From 2810c4f0ced4fabe44757d3ca158945f52d333e6 Mon Sep 17 00:00:00 2001 From: Liam O'Connor Date: Tue, 1 Jul 2025 22:33:59 +1000 Subject: [PATCH] add gregorian chant rendering --- exsurge.min.js | 7 +++++++ exsurge.min.js.map | 1 + gabc.css | 10 ++++++++++ gabc.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ tree.xsl | 5 +++++ 5 files changed, 67 insertions(+) create mode 100644 exsurge.min.js create mode 100644 exsurge.min.js.map create mode 100644 gabc.css create mode 100644 gabc.js diff --git a/exsurge.min.js b/exsurge.min.js new file mode 100644 index 0000000..2b7861e --- /dev/null +++ b/exsurge.min.js @@ -0,0 +1,7 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("exsurge",[],e):"object"==typeof exports?exports.exsurge=e():t.exsurge=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var A=i[n]={exports:{},id:n,loaded:!1};return t[n].call(A.exports,A,A.exports,e),A.loaded=!0,A.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1);Object.keys(n).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var A=i(2);Object.keys(A).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return A[t]}})});var s=i(3);Object.keys(s).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})});var o=i(4);Object.keys(o).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})});var a=i(6);Object.keys(a).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}})});var r=i(9);Object.keys(r).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})});var u=i(8);Object.keys(u).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return u[t]}})});var h=i(11);Object.keys(h).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return h[t]}})});var l=i(10);if(Object.keys(l).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return l[t]}})}),"undefined"!=typeof document){var c=Object.create(HTMLElement.prototype);c.createdCallback=function(){var t=new o.ChantContext;t.lyricTextFont="'Crimson Text', serif",t.lyricTextSize*=1.2,t.dropCapTextFont=t.lyricTextFont,t.annotationTextFont=t.lyricTextFont;var e=!0,i=this.getAttribute("use-drop-cap");"false"===i&&(e=!1);var n=l.Gabc.loadChantScore(t,this.innerText,e),A=this.getAttribute("annotation");A&&(n.annotation=new o.Annotation(t,A));var s=this,a=0,r=function(){var e=s.parentElement.clientWidth;a!==e&&(a=e,n.performLayout(t,function(){n.layoutChantLines(t,a,function(){s.innerHTML=n.createSvgFragment(t)})}))};r(),window.addEventListener?window.addEventListener("resize",r,!1):window.attachEvent&&window.attachEvent("onresize",r)},c.attachedCallback=function(){},document.registerElement=document.registerElement||function(){};document.registerElement("chant-visual",{prototype:c})}},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t){return t}function A(t){return c.ToDeviceIndependent(t,c.Centimeters)}function s(t){return c.ToDeviceIndependent(t,c.Millimeters)}function o(t){return c.ToDeviceIndependent(t,c.Inches)}function a(t){return c.FromDeviceIndependent(t,c.Centimeters)}function r(t){return c.FromDeviceIndependent(t,c.Millimeters)}function u(t){return c.FromDeviceIndependent(t,c.Inches)}function h(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var i=0;i=this.x&&t.x<=this.x+this.width&&t.y>=this.y&&t.y<=this.y+this.height:this.x<=t.x&&this.x+this.width>=t.x+t.width&&this.y<=t.y&&this.y+this.height>=t.y+t.height}},{key:"union",value:function(t){var e=Math.max(this.x+this.width,t.x+t.width),i=Math.max(this.y+this.height,t.y+t.height);this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=e-this.x,this.height=i-this.y}}]),t}(),e.Margins=function(){function t(e,n,A,s){i(this,t),this.left="undefined"!=typeof e?e:0,this.top="undefined"!=typeof n?n:0,this.right="undefined"!=typeof A?A:0,this.bottom="undefined"!=typeof s?s:0}return l(t,[{key:"clone",value:function(){return new t(this.left,this.top,this.right,this.bottom)}},{key:"equals",value:function(t){return this.left===t.left&&this.top===t.top&&this.right===t.right&&this.bottom===t.bottom}}]),t}(),e.Size=function(){function t(e,n){i(this,t),this.width="undefined"!=typeof e?e:0,this.height="undefined"!=typeof n?n:0}return l(t,[{key:"clone",value:function(){return new t(this.width,this.height)}},{key:"equals",value:function(t){return this.width===t.width&&this.height===t.height}}]),t}(),e.Step={Do:0,Du:1,Re:2,Me:3,Mi:4,Fa:5,Fu:6,So:7,La:9,Te:10,Ti:11}),f=[0,0,1,1,2,3,3,4,4,5,6,6],d=[p.Do,p.Re,p.Mi,p.Fa,p.So,p.La,p.Ti];e.Pitch=function(){function t(e,n){i(this,t),this.step=e,this.octave=n}return l(t,[{key:"toInt",value:function(){return 12*this.octave+this.step}},{key:"isHigherThan",value:function(t){return this.toInt()>t.toInt()}},{key:"isLowerThan",value:function(t){return this.toInt()t;)t=d.length+t;return d[t%d.length]}}]),t}()},function(t,e,n){"use strict";function A(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Spanish=e.Latin=e.Language=void 0;var r=function(){function t(t,e){for(var i=0;i"}return r(t,[{key:"syllabify",value:function(t){var e=[];if("undefined"==typeof t||""===t)return e;for(var i=t.split(/[\s]+/),n=0,A=i.length;A>n;n++)e.push(this.syllabifyWord(i[n]));return e}}]),t}());e.Latin=function(t){function e(){a(this,e);var t=s(this,Object.getPrototypeOf(e).call(this,"Latin"));t.diphthongs=["ae","au","oe","aé","áu","oé"],t.possibleDiphthongs=t.diphthongs.concat(["ei","eu","ui","éi","éu","úi"]);var i=new Object;return i.huius=["hui","us"],i.cuius=["cui","us"],i.huic=["huic"],i.cui=["cui"],i.hui=["hui"],i.euge=["eu","ge"],i.seu=["seu"],t.vowels=["a","e","i","o","u","á","é","í","ó","ú","æ","œ","ǽ","y"],t.vowelsThatMightBeConsonants=["i","u"],t.muteConsonantsAndF=["b","c","d","g","p","t","f"],t.liquidConsonants=["l","r"],t}return o(e,t),r(e,[{key:"isVowel",value:function(t){for(var e=0,i=this.vowels.length;i>e;e++)if(this.vowels[e]===t)return!0;return!1}},{key:"isVowelThatMightBeConsonant",value:function(t){for(var e=0,i=this.vowelsThatMightBeConsonants.length;i>e;e++)if(this.vowelsThatMightBeConsonants[e]===t)return!0;return!1}},{key:"isVowelActingAsConsonant",value:function(t){return this.isVowelThatMightBeConsonant(t[0])&&this.isVowel(t[1])}},{key:"isMuteConsonantOrF",value:function(t){for(var e=0,i=this.muteConsonantsAndF.length;i>e;e++)if(this.muteConsonantsAndF[e]===t)return!0;return!1}},{key:"isLiquidConsonant",value:function(t){for(var e=0,i=this.liquidConsonants.length;i>e;e++)if(this.liquidConsonants[e]===t)return!0;return!1}},{key:"isDiphthong",value:function(t){for(var e=0,i=this.diphthongs.length;i>e;e++)if(this.diphthongs[e]===t)return!0;return!1}},{key:"isPossibleDiphthong",value:function(t){for(var e=0,i=this.possibleDiphthongs.length;i>e;e++)if(this.possibleDiphthongs[e]===t)return!0;return!1}},{key:"syllabifyWord",value:function(t){for(var e,i,n,A=[],s=!1,o=!1,a=t.toLowerCase(),r=0,u=function(e){s&&(A.push(t.substr(r,e)),r+=e),s=!1},h=0,l=a.length;l>h;h++){e=a[h],i="*",n=l>h+1,n&&(i=a[h+1]);var c=this.isVowel(e);"i"===e&&(0===h&&n&&this.isVowel(i)?c=!1:o&&n&&this.isVowel(i)&&(c=!1)),"-"===e?(s=!0,o=!1,u(h-r),r++):c?(s=!0,o&&!this.isDiphthong(a[h-1]+""+e)&&(u(h-r),s=!0),o=!0):n&&("q"===e&&"u"===i||"h"===i&&("c"===e||"p"===e||"t"===e)?(u(h-r),h++):o&&this.isVowel(i)?u(h-r):this.isMuteConsonantOrF(e)&&this.isLiquidConsonant(i)?u(h-r):s&&u(h+1-r),o=!1)}return s?A.push(t.substr(r)):r>0&&(A[A.length-1]+=t.substr(r)),A}},{key:"findVowelSegment",value:function(t,e){var i,n,A,s=t.toLowerCase();for(i=0,n=this.possibleDiphthongs.length;n>i;i++){var o=this.possibleDiphthongs[i];if(A=s.indexOf(o,e),A>=0)return{found:!0,startIndex:A,length:o.length}}for(i=0,n=this.vowels.length;n>i;i++)if(A=s.indexOf(this.vowels[i],e),A>=0)return this.isVowelActingAsConsonant(s.substr(A,2))&&++A,{found:!0,startIndex:A,length:1};return{found:!1,startIndex:-1,length:-1}}}]),e}(h),e.Spanish=function(t){function e(){a(this,e);var t=s(this,Object.getPrototypeOf(e).call(this,"Spanish"));return t.vowels=["a","e","i","o","u","y","á","é","í","ó","ú","ü"],t.weakVowels=["i","u","ü","y"],t.strongVowels=["a","e","o","á","é","í","ó","ú"],t.diphthongs=["ai","ei","oi","ui","ia","ie","io","iu","au","eu","ou","ua","ue","uo","ái","éi","ói","úi","iá","ié","ió","iú","áu","éu","óu","uá","ué","uó","üe","üi"],t.uDiphthongExceptions=["gue","gui","qua","que","qui","quo"],t}return o(e,t),r(e,[{key:"isVowel",value:function(t){for(var e=0,i=this.vowels.length;i>e;e++)if(this.vowels[e]===t)return!0;return!1}},{key:"isWeakVowel",value:function(t){for(var e=0,i=this.weakVowels.length;i>e;e++)if(this.weakVowels[e]===t)return!0;return!1}},{key:"isStrongVowel",value:function(t){for(var e=0,i=this.strongVowels.length;i>e;e++)if(this.strongVowels[e]===t)return!0;return!1}},{key:"isDiphthong",value:function(t){for(var e=0,i=this.diphthongs.length;i>e;e++)if(this.diphthongs[e]===t)return!0;return!1}},{key:"createSyllable",value:function(t){return t}},{key:"syllabifyWord",value:function(t){var e=[],n=!1,A=!1,s=!1,o=0;for(i=0;i0?e[e.length-1]+=t.substr(o):0===e.length&&e.push(this.createSyllable(t)),e}},{key:"findVowelSegment",value:function(t,e){var i,n,A,s=t.toLowerCase();for(i=0,n=this.diphthongs.length;n>i;i++){var o=this.diphthongs[i];if(A=s.indexOf(o,e),A>=0){if("u"===o[0]&&A>0){var a=t.substr(A-1,3).toLowerCase();for(j=0,endj=this.uDiphthongExceptions.length;ii;i++)if(A=s.indexOf(this.vowels[i],e),A>=0)return{found:!0,startIndex:A,length:1};return{found:!1,startIndex:-1,length:-1}}}]),e}(h)},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Glyphs={None:{svgSrc:"",paths:[{type:"positive",data:""}],bounds:{x:0,y:0,width:0,height:0},origin:{x:0,y:0},align:"left"},AcuteAccent:{svgSrc:'',paths:[{type:"positive",data:"M4 0C-.614.52-.614.52-.803-3.182l60.768-108.422c4.52-7.182 10.543-13.67 18.075-13.67 5.27 0 14.31 1.264 23.346 7.793 7.53 5.223 8.803 11.752 8.803 16.975 0 3.917-.52 11.1-8.05 17.628L4 0z"}],bounds:{x:0,y:0,width:110.99200439453125,height:125.79399108886719},origin:{x:.8030000329017639,y:125.27399444580078},align:"left"},Stropha:{svgSrc:'',paths:[{type:"positive",data:"M1.22-73.438c4.165 13.02 12.238 27.084 24.217 42.188L49.657 0 34.812 27.344C18.666 55.47-.084 72.396-21.438 78.124c4.687-3.645 7.03-8.593 7.03-14.843 0-8.853-4.947-20.572-14.843-35.155L-48 0 1.22-73.438z"}],bounds:{x:0,y:0,width:97.65699768066406,height:151.56201171875},origin:{x:48,y:73.43800354003906},align:"left"},BeginningAscLiquescent:{svgSrc:'',paths:[{type:"positive",data:"M-50 43.688V-61c4.167 7.292 12.76 10.938 25.78 10.938 9.376 0 20.053-1.563 32.032-4.688C31.773-60.48 45.833-71.677 50-88.344v117.97C43.75 42.645 32.812 51.5 17.187 56.186-.52 61.398-15.886 64-28.906 64-42.97 64-50 57.23-50 43.687z"}],bounds:{x:0,y:0,width:100,height:152.343994140625},origin:{x:50,y:88.34400177001953},align:"left"},BeginningDesLiquescent:{svgSrc:'',paths:[{type:"positive",data:"M-50-56.03c0-13.022 7.03-19.532 21.094-19.532 13.02 0 28.385 2.604 46.093 7.812C32.813-63.583 43.75-54.73 50-41.187V76C45.833 59.854 31.77 48.656 7.812 42.406c-11.98-3.125-22.656-4.687-32.03-4.687-13.022 0-21.615 3.905-25.782 11.718v-105.47z"}],bounds:{x:0,y:0,width:100,height:151.56199645996094},origin:{x:50,y:75.56199645996094},align:"left"},CustosDescLong:{svgSrc:'',paths:[{type:"positive",data:"M39.063 273.472c5.73.52 7.29-6.25 4.687-20.312V-65.59c-13.542 2.083-24.22 5.468-32.03 10.156C3.905-50.226 0-43.714 0-35.904V71.91c5.73-5.21 10.677-8.594 14.844-10.157 5.73-1.562 12.24-2.343 19.53-2.343v196.875c0 11.458 1.563 17.187 4.688 17.187"}],bounds:{x:0,y:0,width:46.35300064086914,height:339.58197021484375},origin:{x:0,y:65.58999633789062},align:"left"},CustosDescShort:{svgSrc:'',paths:[{type:"positive",data:"M34.375 191.923c0 8.333 1.563 12.24 4.688 11.72 3.125-.522 4.687-7.033 4.687-19.533v-250c-13.542 2.084-24.22 5.47-32.03 10.157C3.905-50.525 0-44.015 0-36.203V71.61c5.73-5.208 10.677-8.593 14.844-10.156 5.73-1.562 12.24-2.344 19.53-2.344v132.813z"}],bounds:{x:0,y:0,width:43.75,height:270.0530090332031},origin:{x:0,y:65.88999938964844},align:"left"},CustosLong:{svgSrc:'',paths:[{type:"positive",data:"M39.063-269.562c5.73-.52 7.29 6.25 4.687 20.312V69.5c-13.542-2.083-24.22-5.47-32.03-10.156C3.905 54.134 0 47.624 0 39.812V-68c5.73 5.208 10.677 8.594 14.844 10.156 5.73 1.563 12.24 2.344 19.53 2.344v-196.875c0-11.458 1.563-17.187 4.688-17.187z"}],bounds:{x:0,y:0,width:46.35300064086914,height:339.5820007324219},origin:{x:0,y:270.0820007324219},align:"left"},CustosShort:{svgSrc:'',paths:[{type:"positive",data:"M34.375-188.125c0-8.333 1.563-12.24 4.688-11.72 3.125.522 4.687 7.033 4.687 19.532v250c-13.542-2.083-24.22-5.468-32.03-10.156C3.905 54.324 0 47.813 0 40V-67.813c5.73 5.21 10.677 8.594 14.844 10.157 5.73 1.562 12.24 2.344 19.53 2.343v-132.812z"}],bounds:{x:0,y:0,width:43.75,height:270.052001953125},origin:{x:0,y:200.36500549316406},align:"left"},DoClef:{svgSrc:'',paths:[{type:"positive",data:"M0 98.406V-97.688C0-118 5.99-134.275 17.97-146.516c11.978-12.24 27.603-18.36 46.874-18.36 10.937 0 19.53 3.126 25.78 9.376s9.376 14.583 9.376 25v107.813l-6.25-5.47c-4.167-3.645-10.287-7.42-18.36-11.327-8.072-3.907-16.796-5.86-26.17-5.86-11.46 0-21.486 4.427-30.08 13.282-8.593 8.854-12.89 19.53-12.89 32.03s4.297 23.308 12.89 32.423c8.594 9.115 18.62 13.672 30.08 13.672 9.374 0 18.098-1.822 26.17-5.468 8.073-3.646 14.193-7.292 18.36-10.938l6.25-6.25V132c0 9.896-3.125 18.1-9.375 24.61-6.25 6.51-14.844 9.765-25.78 9.765-19.272 0-34.897-6.25-46.876-18.75C5.99 135.125 0 118.72 0 98.405z"}],bounds:{x:0,y:0,width:100,height:331.2510070800781},origin:{x:0,y:164.87600708007812},align:"left"},FaClef:{svgSrc:'',paths:[{type:"positive",data:"M85.156-32v193.75c0 9.375-1.562 14.323-4.687 14.844-1.564 0-2.605-.52-3.126-1.563-.52-1.04-.782-2.603-.78-4.686V56.28c-8.335-8.332-19.793-12.5-34.376-12.5-17.71 0-31.77 3.907-42.188 11.72V-32c0-18.23 14.193-27.344 42.578-27.344 28.385 0 42.578 9.115 42.578 27.344zM98.438 93V-92.156c0-19.27 5.73-34.896 17.187-46.875 11.458-11.98 26.562-17.97 45.313-17.97 10.937 0 19.14 2.865 24.61 8.594 5.467 5.73 8.202 13.542 8.202 23.437v103.126l-5.47-4.687c-3.645-3.647-9.374-7.293-17.186-10.94-7.813-3.645-15.886-5.467-24.22-5.468-11.978 0-22.004 4.167-30.077 12.5-8.073 8.334-12.11 18.36-12.11 30.08 0 11.717 4.037 22.004 12.11 30.858s18.1 13.28 30.078 13.28c8.333 0 16.406-1.822 24.22-5.468 7.81-3.645 13.54-7.03 17.186-10.156l5.47-5.468V125.81c0 9.896-2.865 17.84-8.594 23.83-5.73 5.988-13.802 8.983-24.22 8.983-18.75 0-33.853-6.12-45.31-18.36-11.46-12.24-17.19-27.994-17.19-47.265z"}],bounds:{x:0,y:0,width:193.75201416015625,height:333.5950012207031},origin:{x:.001003265380859375,y:157.00100708007812},align:"left"},Flat:{svgSrc:'',paths:[{type:"positive",data:"M7.813-204.406c4.166 0 6.25 5.208 6.25 15.625L12.5-10.657C33.854 13.302 54.167 25.28 73.438 25.28c9.374 0 14.062-4.686 14.062-14.06 0-6.25-1.042-11.72-3.125-16.407-2.083-4.688-7.03-9.766-14.844-15.235-7.81-5.47-13.02-8.984-15.624-10.547L27.344-45.81V-80.97c17.187 0 33.073 4.82 47.656 14.454C89.583-56.88 96.875-47.376 96.875-38c0 67.708-.26 101.562-.78 101.563-38.543 0-69.532-12.24-92.97-36.72C0-52.322-1.042-123.936 0-188c0-10.937 2.604-16.406 7.813-16.406z"}],bounds:{x:0,y:0,width:97.91699981689453,height:267.968994140625},origin:{x:1.0420000553131104,y:204.406005859375},align:"left"},Mora:{svgSrc:'',paths:[{type:"positive",data:"M47.478-24c6.957 0 12.793 2.288 17.49 6.883C69.662-12.52 72-6.904 72-.267c0 6.64-2.337 12.352-7.033 17.118C60.27 21.618 54.435 24 47.477 24c-6.26 0-11.748-2.383-16.444-7.15C26.337 12.086 24 6.374 24-.265c0-6.638 2.337-12.255 7.033-16.85C35.73-21.713 41.217-24 47.478-24z"}],bounds:{x:0,y:0,width:48,height:48},origin:{x:-24,y:24},align:"left"},Natural:{svgSrc:'',paths:[{type:"positive",data:"M7.906-166.563c-2.864 0-5.614.52-8.218 1.563v13.28l.78 56.25.782 78.907v85.157c.52 3.646 2.604 5.73 6.25 6.25l23.438-3.906 23.437-3.907v29.69c0 42.186-.26 63.54-.78 64.06l6.25 2.345c1.04.52 2.082.78 3.124.78 2.603 0 4.947-1.3 7.03-3.905L67.656-71.25c-.52-2.604-2.083-3.906-4.687-3.906-7.814 0-17.19 1.04-28.126 3.125l-19.53 3.124.78-38.28V-165c-2.604-1.042-5.323-1.562-8.188-1.563zM55.938-40v71.875l-41.407 7.03c0-48.436.262-72.655.783-72.655L55.938-40z"}],bounds:{x:0,y:0,width:70.31100463867188,height:330.468994140625},origin:{x:.3120002746582031,y:166.56300354003906},align:"left"},OriscusAsc:{svgSrc:'',paths:[{type:"positive",data:"M50 30.25c0 12.5-3.125 21.354-9.375 26.562-3.125 2.605-7.813 3.907-14.063 3.907-3.125 0-5.99-.522-8.593-1.564-2.605-1.04-5.6-2.474-8.986-4.297C5.6 53.035 2.734 51.603.39 50.56c-2.343-1.04-5.338-2.474-8.984-4.296-3.646-1.823-6.77-3.256-9.375-4.297-2.603-1.043-5.468-1.564-8.593-1.564-6.25 0-10.937 1.563-14.062 4.688C-46.875 50.824-50 59.677-50 71.656v-106.25c0-13.02 3.125-21.875 9.375-26.562 3.125-2.604 7.813-3.906 14.063-3.907 3.125 0 5.99.52 8.593 1.563 2.605 1.042 5.73 2.474 9.376 4.297 3.646 1.823 6.51 2.995 8.594 3.516l10.938 5.468c6.25 3.126 11.458 4.69 15.624 4.69 6.25 0 10.938-1.564 14.063-4.69C46.875-55.426 50-64.02 50-76V30.25z"}],bounds:{x:0,y:0,width:100,height:147.656005859375},origin:{x:50,y:76},align:"left"},OriscusDes:{svgSrc:'',paths:[{type:"positive",data:"M-50 30.844v-106.25c0 11.458 3.125 20.052 9.375 25.78 3.125 3.126 7.813 4.69 14.063 4.688 4.687 0 13.41-3.255 26.17-9.765 12.762-6.51 21.746-9.766 26.954-9.766 6.25 0 10.938 1.303 14.063 3.907C46.875-55.874 50-47.02 50-34V72.25c0-11.98-3.125-20.833-9.375-26.563C37.5 42.563 32.812 41 26.562 41 21.875 41 13.023 44.385 0 51.156c-4.167 2.604-8.594 4.948-13.28 7.032-4.69 2.083-9.116 3.124-13.283 3.124-6.25 0-10.937-1.302-14.062-3.906C-46.875 52.198-50 43.344-50 30.844z"}],bounds:{x:0,y:0,width:100,height:147.656005859375},origin:{x:50,y:75.40599822998047},align:"left"},OriscusLiquescent:{svgSrc:'',paths:[{type:"positive",data:"M 19.05539,78.886528 C 20.242277,78.486807 21.532179,77.890297 22.925106,77.09701 24.317891,76.303653 26.700882,74.417241 30.074091,71.437777 33.447144,68.45824 36.523539,64.985185 39.303286,61.018598 42.082855,57.051975 44.562739,51.395765 46.742952,44.049969 48.922975,36.704172 50.01304,28.671032 50.013135,19.950525 L 50.013135,-34.225545 C 50.01304,-54.464261 42.07377,-64.583661 26.195289,-64.583768 20.248326,-64.583661 11.518758,-61.410372 0.00656131,-55.06389 -11.505742,-48.717218 -20.23531,-45.543929 -26.182179,-45.544024 -34.515109,-45.543929 -40.567968,-48.520405 -44.340791,-54.473441 -48.113613,-60.426286 -50.000025,-67.369373 -50.000025,-75.302702 L -50.000025,30.069925 C -50.000025,49.909039 -42.060754,59.828603 -26.182179,59.828615 -21.022584,59.828603 -12.38991,56.455465 -0.28412107,49.709203 11.821549,42.96294 20.648023,39.589803 26.195289,39.589803 29.368506,40.776762 30.361665,44.249817 29.17479,50.00897 27.987759,55.768122 26.00143,62.020829 23.215789,68.767116 z"}],bounds:{x:0,y:0,width:100,height:147.656005859375},origin:{x:50,y:75.40599822998047},align:"left"},PodatusLower:{svgSrc:'',paths:[{type:"positive",data:"M-4.688-30.28c22.396 0 34.636-.262 36.72-.782 5.728-1.563 8.593-5.21 8.593-10.938H50v97.656c0 2.604-1.302 4.167-3.906 4.688-5.21.52-21.355.78-48.438.78-23.958 0-38.54-.26-43.75-.78-2.604 0-3.906-1.302-3.906-3.906v-82.032c0-3.646 1.302-5.468 3.906-5.468h2.344c2.604.52 15.625.78 39.063.78z"}],bounds:{x:0,y:0,width:100,height:103.12399291992188},origin:{x:50,y:42},align:"left"},PodatusUpper:{svgSrc:'',paths:[{type:"positive",data:"M-46.094-63.78c13.542 0 24.61 2.473 33.203 7.42C-4.298-51.41 0-43.99 0-34.093V62h-9.375c0-10.938-2.604-19.14-7.812-24.61-5.21-5.468-14.844-8.203-28.907-8.202-18.23 0-33.333 4.166-45.312 12.5v-75.782c0-19.79 15.104-29.687 45.312-29.687z"}],bounds:{x:0,y:0,width:91.406005859375,height:125.78099822998047},origin:{x:91.406005859375,y:63.78099822998047},align:"right"},Porrectus1:{svgSrc:'',paths:[{type:"positive",data:"M233.594 162.875c-58.855 0-107.032-6.25-144.53-18.75C34.895 125.895-11.46 99.855-50 66V-52.75C-21.354-24.625 26.302 6.885 92.97 41.78 123.697 57.928 163.54 66 212.5 66c21.354 0 34.635-9.896 39.844-29.688V151.94c0 7.29-6.25 10.937-18.75 10.937z"}],bounds:{ +x:0,y:0,width:302.343994140625,height:215.6269989013672},origin:{x:50,y:52.75},align:"left"},Porrectus2:{svgSrc:'',paths:[{type:"positive",data:"M309.375 259.375c-50.52 0-110.938-22.396-181.25-67.188C48.437 141.667-10.938 94.272-50 50V-68.75C0-3.125 60.417 52.083 131.25 96.875c58.333 36.98 110.677 58.854 157.03 65.625h7.033c16.145 0 26.822-9.896 32.03-29.688v114.844c0 7.812-5.99 11.72-17.968 11.72z"}],bounds:{x:0,y:0,width:377.3429870605469,height:328.1260070800781},origin:{x:50,y:68.75},align:"left"},Porrectus3:{svgSrc:'',paths:[{type:"positive",data:"M309.375 355.78c-48.96-16.666-109.115-55.468-180.47-116.405C79.428 198.23 19.793 134.687-50 48.75V-70C20 40 94.104 103.79 135.25 148.063 190 200 230 230 288.28 258.906c4.168 2.083 8.334 3.125 12.5 3.125 12.5 0 21.355-10.937 26.564-32.81v114.06c0 9.376-3.386 14.063-10.156 14.064-2.084 0-4.688-.522-7.813-1.563z"}],bounds:{x:0,y:0,width:377.343994140625,height:427.3450012207031},origin:{x:50,y:70},align:"left"},Porrectus4:{svgSrc:'',paths:[{type:"positive",data:"M350 453.438c-52.754-22.397-120-77.345-201.74-164.844C90.87 227.656 24.784 147.708-50 48.75V-70C-8.84-1.25 58.406 86.51 151.74 193.28c60.868 69.793 119.13 124.22 174.782 163.282 5.797 3.646 11.014 5.47 15.652 5.47 12.173 0 21.45-11.72 27.826-35.157V441.72c0 9.373-3.19 14.06-9.565 14.06-2.9 0-6.377-.78-10.435-2.342z"}],bounds:{x:0,y:0,width:420,height:525.780029296875},origin:{x:50,y:70},align:"left"},PunctumCavum:{svgSrc:'',paths:[{type:"positive",data:"M0-60.906c33.333 0 50 9.635 50 28.906v94.53C39.062 51.595 22.396 46.126 0 46.126s-39.063 5.47-50 16.406V-32c0-19.27 16.667-28.906 50-28.906z"},{type:"negative",data:"M.08-42.56c9.585.206 20.126.53 27.954 6.822 4.96 3.9 4.71 10.792 4.574 16.482v51.278C22.09 27.066 7.283 26.072.168 26.01c-7.72.23-21.895.935-32.616 4.674.04-19.197-.083-38.395.064-57.59.567-7.5 7.834-12.33 14.62-13.774 5.818-1.498 11.857-1.86 17.844-1.88z"}],bounds:{x:0,y:0,width:100,height:123.43799591064453},origin:{x:50,y:60.90599822998047},align:"left"},PunctumQuadratum:{svgSrc:'',paths:[{type:"positive",data:"M0-60.906c33.333 0 50 9.635 50 28.906v94.53C39.062 51.595 22.396 46.126 0 46.126s-39.063 5.47-50 16.406V-32c0-19.27 16.667-28.906 50-28.906z"}],bounds:{x:0,y:0,width:100,height:123.43799591064453},origin:{x:50,y:60.90599822998047},align:"left"},PunctumQuadratumAscLiquescent:{svgSrc:'',paths:[{type:"positive",data:"M-50 43.688V-61c4.167 7.292 12.76 10.938 25.78 10.938 9.376 0 20.053-1.563 32.032-4.688C31.773-60.48 45.833-71.677 50-88.344v117.97C43.75 42.645 32.812 51.5 17.187 56.186-.52 61.398-15.886 64-28.906 64-42.97 64-50 57.23-50 43.687z"}],bounds:{x:0,y:0,width:100,height:152.343994140625},origin:{x:50,y:88.34400177001953},align:"left"},PunctumQuadratumDesLiquescent:{svgSrc:'',paths:[{type:"positive",data:"M-50-56.03c0-13.022 7.03-19.532 21.094-19.532 13.02 0 28.385 2.604 46.093 7.812C32.813-63.583 43.75-54.73 50-41.187V76C45.833 59.854 31.77 48.656 7.812 42.406c-11.98-3.125-22.656-4.687-32.03-4.687-13.022 0-21.615 3.905-25.782 11.718v-105.47z"}],bounds:{x:0,y:0,width:100,height:151.56199645996094},origin:{x:50,y:75.56199645996094},align:"left"},PunctumInclinatum:{svgSrc:'',paths:[{type:"positive",data:"M0-75.78L50 0 0 75-50 0 0-75.78z"}],bounds:{x:0,y:0,width:100,height:150.77999877929688},origin:{x:50,y:75.77999877929688},align:"left"},PunctumInclinatumLiquescent:{svgSrc:'',paths:[{type:"positive",data:"M 0,-53.164062 35,-0.1171875 0,52.382812 -35,-0.1171875 0,-53.164062 z"}],bounds:{x:0,y:0,width:70,height:105.546},origin:{x:35,y:53.164062},align:"left"},Quilisma:{svgSrc:'',paths:[{type:"positive",data:"M-50 34.938V-51c5.73 20.833 13.02 31.25 21.875 31.25 7.813 0 12.5-15.625 14.063-46.875 3.645 12.5 6.9 21.224 9.765 26.172s6.9 7.422 12.11 7.422c5.208 0 9.374-14.324 12.5-42.97 5.73 22.917 10.677 34.375 14.843 34.375 5.73 0 10.677-15.885 14.844-47.656v100c0 17.707-3.125 26.56-9.375 26.56-4.688 0-9.115-5.988-13.28-17.968-2.085 21.875-8.074 32.813-17.97 32.813-7.813 0-16.146-7.292-25-21.875-4.688 20.312-10.677 30.47-17.97 30.47-5.207 0-9.244-2.605-12.108-7.814C-48.568 47.698-50 41.708-50 34.938z"}],bounds:{x:0,y:0,width:100,height:150},origin:{x:50,y:89.28199768066406},align:"left"},TerminatingAscLiquescent:{svgSrc:'',paths:[{type:"positive",data:"M-9.375 40.22c0-11.98-4.948-17.97-14.844-17.97-10.936 0-19.53 3.646-25.78 10.938v-53.126c0-6.77 2.604-12.76 7.813-17.968 5.208-5.21 10.677-8.594 16.406-10.157 2.603-.52 5.207-.78 7.81-.78 3.647 0 7.032.78 10.157 2.343C-2.603-43.896 0-39.73 0-34V73.03h-9.375V40.22z"}],bounds:{x:0,y:0,width:49.999000549316406,height:121.87299346923828},origin:{x:49.999000549316406,y:48.842994689941406},align:"right"},TerminatingDesLiquescent:{svgSrc:'',paths:[{type:"positive",data:"M-9.375-48.156V-80.97H0V26.845c0 5.73-2.604 9.896-7.813 12.5-3.125 1.562-6.51 2.343-10.156 2.343-2.603 0-5.207-.26-7.81-.78-5.73-1.563-11.2-4.95-16.407-10.157C-47.398 25.542-50 19.292-50 12v-52.344c6.25 7.292 14.844 10.938 25.78 10.938 9.897 0 14.845-6.25 14.845-18.75z"}],bounds:{x:0,y:0,width:50,height:122.65800476074219},origin:{x:50,y:80.97000122070312},align:"right"},VerticalEpisemaAbove:{svgSrc:'',paths:[{type:"positive",data:"M-8-80H8L4 0h-8l-4-80z"}],bounds:{x:0,y:0,width:16,height:80},origin:{x:8,y:80},align:"left"},VerticalEpisemaBelow:{svgSrc:'',paths:[{type:"positive",data:"M-8 80H8L4 0h-8l-4 80z"}],bounds:{x:0,y:0,width:16,height:80},origin:{x:8,y:0},align:"left"},VirgaLong:{svgSrc:'',paths:[{type:"positive",data:"M50-38v285.156c0 6.77-2.344 10.937-7.03 12.5-1.564 0-2.605-.78-3.126-2.344-.52-1.562-.782-10.156-.782-25.78V54.186C29.168 45.334 16.146 40.907 0 40.907c-22.917 0-39.583 5.208-50 15.624V-38c0-19.27 16.667-28.906 50-28.906S50-57.27 50-38z"}],bounds:{x:0,y:0,width:100,height:326.56201171875},origin:{x:50,y:66.90599822998047},align:"left"},VirgaShort:{svgSrc:'',paths:[{type:"positive",data:"M50-38v211.72c0 7.29-2.344 11.457-7.03 12.5-1.564 0-2.606-.783-3.126-2.345-.52-1.563-.782-10.156-.782-25.78V54.187C29.167 45.332 16.146 40.906 0 40.906c-22.917 0-39.583 5.21-50 15.625V-38c0-19.27 16.667-28.906 50-28.906S50-57.27 50-38z"}],bounds:{x:0,y:0,width:100,height:253.12600708007812},origin:{x:50,y:66.90599822998047},align:"left"},Virgula:{svgSrc:'',paths:[{type:"positive",data:"M8.178-55.66c0-22.137 12.092-33.2 36.287-33.2 11.835 0 23.53 5.66 35.108 16.98C91.15-60.547 96.94-41.766 96.94-15.534c0 53.515-31.646 87.487-94.937 101.895-2.048-2.06-3.077-5.146-3.077-9.273 0-1.03.247-1.8.76-2.316 42.71-19.027 64.075-41.678 64.075-67.92 0-11.322-2.325-20.326-6.945-27.016-4.62-6.69-9.52-11.052-14.676-13.11-5.147-2.048-11.836-3.85-20.07-5.403C12.81-39.707 8.18-45.37 8.18-55.66z"}],bounds:{x:0,y:0,width:98.01399993896484,height:175.2209930419922},origin:{x:1.0739939212799072,y:88.86000061035156},align:"left"}}},function(t,e,i){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function A(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,i){this.symbol=t,this.startIndex=e,this.properties=i}Object.defineProperty(e,"__esModule",{value:!0}),e.ChantNotationElement=e.Annotation=e.DropCap=e.Lyric=e.LyricType=e.TextElement=e.CurlyBraceVisualizer=e.RoundBraceVisualizer=e.GlyphVisualizer=e.VirgaLineVisualizer=e.NeumeLineVisualizer=e.DividerLineVisualizer=e.ChantLayoutElement=e.ChantContext=e.TextMeasuringStrategy=e.QuickSvg=e.GlyphCode=void 0;var a=function k(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var A=Object.getPrototypeOf(t);return null===A?void 0:k(A,e,i)}if("value"in n)return n.value;var s=n.get;if(void 0!==s)return s.call(i)},r=function(){function t(t,e){for(var i=0;i"},parseFragment:function(t){var e=document.createElement("svg");if(t){var i=this.g();e.innerHTML=""+t.replace(/\n/,"").replace(/<(\w+)([^<]+?)\/>/g,"<$1$2>")+"";for(var n=0,A=e.firstChild.childNodes.length;A>n;n++)i.appendChild(e.firstChild.firstChild);return i}},translate:function(t,e,i){return t.setAttribute("transform","translate("+e+","+i+")"),t},scale:function(t,e,i){return t.setAttribute("transform","scale("+e+","+i+")"),t}},f=e.TextMeasuringStrategy={Svg:0,Canvas:1},d=(e.ChantContext=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?f.Svg:arguments[0];s(this,t),this.textMeasuringStrategy=e,this.defs={},this.lyricTextSize=16,this.lyricTextFont="'Palatino Linotype', 'Book Antiqua', Palatino, serif",this.lyricTextColor="#000",this.dropCapTextSize=64,this.dropCapTextFont=this.lyricTextFont,this.dropCapTextColor=this.lyricTextColor,this.annotationTextSize=13,this.annotationTextFont=this.lyricTextFont,this.annotationTextColor=this.lyricTextColor,this.glyphPunctumWidth=h.Glyphs.PunctumQuadratum.bounds.width,this.glyphPunctumHeight=h.Glyphs.PunctumQuadratum.bounds.height,this.glyphScaling=1/16,this.staffInterval=this.glyphPunctumWidth*this.glyphScaling,this.staffLineWeight=Math.round(this.glyphPunctumWidth*this.glyphScaling/8),this.neumeLineWeight=this.staffLineWeight,this.dividerLineWeight=this.neumeLineWeight,this.episemaLineWeight=this.neumeLineWeight,this.activeClef=null,this.neumeLineColor="#000",this.staffLineColor="#000",this.dividerLineColor="#000",this.defaultLanguage=new l.Latin,this.canvas=document.createElement("canvas"),this.canvasCtxt=this.canvas.getContext("2d");var i=window.devicePixelRatio||1,n=this.canvasCtxt.webkitBackingStorePixelRatio||this.canvasCtxt.mozBackingStorePixelRatio||this.canvasCtxt.msBackingStorePixelRatio||this.canvasCtxt.oBackingStorePixelRatio||this.canvasCtxt.backingStorePixelRatio||1;this.pixelRatio=i/n,this.canvasCtxt.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),e===f.Svg&&(this.svgTextMeasurer=p.svg(1,1),this.svgTextMeasurer.setAttribute("id","TextMeasurer"),document.querySelector("body").appendChild(this.svgTextMeasurer));var A=new I(this,"-",Q.SingleSyllable);this.hyphenWidth=A.bounds.width,this.minLyricWordSpacing=this.hyphenWidth,this.intraNeumeSpacing=this.staffInterval/2,this.syllableConnector="-",this.drawGuides=!1,this.drawDebuggingBounds=!0,this.activeNotations=null,this.currNotationIndex=-1,this.condensingTolerance=.9,this.autoColor=!0,this.insertFontsInDoc()}return r(t,[{key:"calculateHeightFromStaffPosition",value:function(t){return-t*this.staffInterval}},{key:"insertFontsInDoc",value:function(){var t=document.getElementById("exsurge-fonts");null===t&&(t=document.createElement("style"),t.id="exsurge-fonts",t.appendChild(document.createTextNode("@font-face{font-family: 'Exsurge Characters';font-weight: normal;font-style: normal;src: url("+c+") format('opentype');}")),document.head.appendChild(t))}},{key:"findNextNeume",value:function(){if("undefined"==typeof this.currNotationIndex)throw"findNextNeume() called without a valid currNotationIndex set";for(var t=this.currNotationIndex+1;tr){var u=a;a=r,r=u}return o.bounds.x=0,o.bounds.y=a,o.bounds.width=t.dividerLineWeight,o.bounds.height=r-a,o.origin.x=o.bounds.width/2,o.origin.y=a,o}return A(e,t),r(e,[{key:"draw",value:function(t){var e=t.canvasCtxt;e.lineWidth=this.bounds.width,e.strokeStyle=t.dividerLineColor,e.beginPath(),e.moveTo(this.bounds.x-this.origin.x,this.bounds.y),e.lineTo(this.bounds.x-this.origin.x,this.bounds.y+this.bounds.height),e.stroke()}},{key:"createSvgFragment",value:function(t){return p.createFragment("rect",{x:this.bounds.x,y:this.bounds.y,width:t.dividerLineWeight,height:this.bounds.height,fill:t.dividerLineColor,"class":"dividerLine"})}}]),e}(d),e.NeumeLineVisualizer=function(t){function e(t,i,A,o){s(this,e);var a=n(this,Object.getPrototypeOf(e).call(this)),r=i.staffPosition,u=A.staffPosition;if(u>r){var h=r;r=u,u=h}var l=t.calculateHeightFromStaffPosition(r),c=0;return o&&(r-u===1&&Math.abs(r)%2===1&&u>-3&&u--,c+=t.glyphPunctumHeight*t.glyphScaling/2.2),c+=t.calculateHeightFromStaffPosition(u),a.bounds.x=0,a.bounds.y=l,a.bounds.width=t.neumeLineWeight,a.bounds.height=c-l,a.origin.x=0,a.origin.y=0,a}return A(e,t),r(e,[{key:"draw",value:function(t){var e=t.canvasCtxt;e.lineWidth=this.bounds.width,e.strokeStyle=t.neumeLineColor,e.beginPath();var i=this.bounds.x+this.bounds.width/2;e.moveTo(i,this.bounds.y),e.lineTo(i,this.bounds.y+this.bounds.height),e.stroke()}},{key:"createSvgFragment",value:function(t){return p.createFragment("rect",{x:this.bounds.x,y:this.bounds.y,width:t.neumeLineWeight,height:this.bounds.height,fill:t.neumeLineColor,"class":"neumeLine"})}}]),e}(d),e.VirgaLineVisualizer=function(t){function e(t,i){s(this,e);var A,o=n(this,Object.getPrototypeOf(e).call(this)),a=i.staffPosition,r=t.calculateHeightFromStaffPosition(a);return A=0===Math.abs(a%2)?r+1.8*t.staffInterval:r+2.7*t.staffInterval,o.bounds.x=0,o.bounds.y=r,o.bounds.width=t.neumeLineWeight,o.bounds.height=A-r,o.origin.x=0,o.origin.y=0,o}return A(e,t),r(e,[{key:"draw",value:function(t){var e=t.canvasCtxt;e.lineWidth=this.bounds.width,e.strokeStyle=t.neumeLineColor,e.beginPath(),e.moveTo(this.bounds.x,this.bounds.y),e.lineTo(this.bounds.x,this.bounds.y+this.bounds.height),e.stroke()}},{key:"createSvgFragment",value:function(t){return p.createFragment("rect",{x:this.bounds.x,y:this.bounds.y,width:t.neumeLineWeight,height:this.bounds.height,fill:t.neumeLineColor,"class":"neumeLine"})}}]),e}(d),e.GlyphVisualizer=function(t){function e(t,i){s(this,e);var A=n(this,Object.getPrototypeOf(e).call(this));return A.glyph=null,A.setGlyph(t,i),A}return A(e,t),r(e,[{key:"setGlyph",value:function(t,e){if(this.glyphCode!==e){if("undefined"==typeof e||null===e||""===e?this.glyphCode=g.None:this.glyphCode=e,this.glyph=h.Glyphs[this.glyphCode],!t.defs.hasOwnProperty(this.glyphCode)){var i=this.glyph.svgSrc;t.defs[this.glyphCode]=p.createFragment("g",{id:this.glyphCode,"class":"glyph",transform:"scale("+t.glyphScaling+")"},i)}this.align=this.glyph.align,this.origin.x=this.glyph.origin.x*t.glyphScaling,this.origin.y=this.glyph.origin.y*t.glyphScaling,this.bounds.x=0,this.bounds.y=-this.origin.y,this.bounds.width=this.glyph.bounds.width*t.glyphScaling,this.bounds.height=this.glyph.bounds.height*t.glyphScaling}}},{key:"setStaffPosition",value:function(t,e){this.bounds.y+=t.calculateHeightFromStaffPosition(e)}},{key:"draw",value:function(t){var e=t.canvasCtxt,i=this.bounds.x+this.origin.x,n=this.bounds.y+this.origin.y;e.translate(i,n),e.scale(t.glyphScaling,t.glyphScaling);for(var A=0;AA){var h=i;i=A,A=h}return r.isAbove=a,r.braceHeight=t.staffInterval/2,r.bounds=new u.Rect(i,o,A-i,r.braceHeight),r.origin.x=0,r.origin.y=0,r}return A(e,t),r(e,[{key:"createSvgFragment",value:function(t){var e=p.createFragment("path",{d:this.generatePathString(),stroke:t.neumeLineColor,"stroke-width":t.staffLineWeight+"px",fill:"none","class":"brace"});return this.acuteAccent?(e+=this.acuteAccent.createSvgFragment(t),p.createFragment("g",{"class":"accentedBrace"},e)):e}},{key:"generatePathString",value:function(){var t,e,i,n=this.bounds.x,A=this.bounds.right(),s=this.bounds.width;this.isAbove?(t=this.bounds.bottom(),e=s/6,i=-s/6):(t=this.bounds.y,e=s/6,i=s/6);var o=n+e,a=t+i,r=A-e,u=2;return"M "+n.toFixed(u)+" "+t.toFixed(u)+" C "+o.toFixed(u)+" "+a.toFixed(u)+" "+r.toFixed(u)+" "+a.toFixed(u)+" "+A.toFixed(u)+" "+t.toFixed(u)}}]),e}(d),e.CurlyBraceVisualizer=function(t){function e(t,i,A,o){var a=arguments.length<=4||void 0===arguments[4]?!0:arguments[4],r=arguments.length<=5||void 0===arguments[5]?!1:arguments[5];s(this,e);var h=n(this,Object.getPrototypeOf(e).call(this));if(i>A){var l=i;i=A,A=l}h.isAbove=a,h.braceHeight=t.staffInterval/2,a&&(o-=h.braceHeight);var c=new u.Rect(i,o,A-i,h.braceHeight);return r&&a&&(h.acuteAccent=new y(t,g.AcuteAccent),h.acuteAccent.bounds.x+=c.x+(A-i)/2,h.acuteAccent.bounds.y+=c.y-t.staffInterval/4,c.union(h.acuteAccent.bounds)),h.bounds=c,h.origin.x=0,h.origin.y=0,h}return A(e,t),r(e,[{key:"createSvgFragment",value:function(t){var e=p.createFragment("path",{d:this.generatePathString(),stroke:t.neumeLineColor,"stroke-width":t.staffLineWeight+"px",fill:"none","class":"brace"});return this.acuteAccent?(e+=this.acuteAccent.createSvgFragment(t),p.createFragment("g",{"class":"accentedBrace"},e)):e}},{key:"generatePathString",value:function(){var t,e,i=.6,n=this.bounds.x,A=this.bounds.right(),s=this.bounds.width;this.isAbove?(t=this.bounds.bottom(),e=-this.braceHeight):(t=this.bounds.y,e=this.braceHeight);var o=t+i*e,a=n+.25*s,r=t+(1-i)*e,u=n+.5*s,h=t+e,l=t+i*e,c=n+.75*s,g=t+(1-i)*e,p=2;return"M "+n.toFixed(p)+" "+t.toFixed(p)+" Q "+n.toFixed(p)+" "+o.toFixed(p)+" "+a.toFixed(p)+" "+r.toFixed(p)+" T "+u.toFixed(p)+" "+h.toFixed(p)+" M "+A.toFixed(p)+" "+t.toFixed(p)+" Q "+A.toFixed(p)+" "+l.toFixed(p)+" "+c.toFixed(p)+" "+g.toFixed(p)+" T "+u.toFixed(p)+" "+h.toFixed(p)}}]),e}(d),function(t,e){"undefined"!=typeof e&&null!==e||(e=""),this.text=t,this.properties=e}),v="*",b="_",m="^",C="%";o.createStackFrame=function(t,e){var i="";switch(t){case v:i="font-weight:bold;";break;case b:i="font-style:italic;";break;case m:i="fill:#f00;";break;case C:i="font-variant:small-caps;font-feature-settings:'smcp';-webkit-font-feature-settings:'smcp';"}return new o(t,e,i)};var G={"&":"&","<":"<",">":">"},w=e.TextElement=function(t){function e(t,i,A,o,a){s(this,e);var r=n(this,Object.getPrototypeOf(e).call(this));return r.bounds.x=0,r.bounds.y=0,r.bounds.width=0,r.bounds.height=0,r.origin.x=0,r.origin.y=0,r.fontFamily=A,r.fontSize=o,r.textAnchor=a,r.dominantBaseline="baseline",r.generateSpansFromText(t,i),r.recalculateMetrics(t),r}return A(e,t),r(e,[{key:"generateSpansFromText",value:function(t,e){if(this.text="",this.spans=[],"*"===e||"†"===e)return void this.spans.push(new B(e));for(var i=[],n=0,A=function(t,e){return t.Symbol===e},s=this,a=function(t,e){if(""!==t){s.text+=t;for(var n="",A=0;A0){n=i[i.length-1].startIndex,i.pop();continue}a(e.substring(n,u.index)),i.push(o.createStackFrame(h,u.index))}n=u.index+h.length}n=0&&(a+="italic "),r.properties.indexOf("font-variant:small-caps;")>=0&&(a+="small-caps "),r.properties.indexOf("font-weight:bold;")>=0&&(a+="bold "),a+=n,i.font=a;var h=i.measureText(u,this.bounds.x,this.bounds.y);if(A+=h.width,s+=u.length,s===e)break}return A}},{key:"recalculateMetrics",value:function(t){if(this.bounds.x=0,this.bounds.y=0,this.bounds.x=0,this.bounds.y=0,this.origin.x=0,t.textMeasuringStrategy===f.Svg){for(var e=''+this.createSvgFragment(t)+"",i=(new DOMParser).parseFromString(e,"application/xml");t.svgTextMeasurer.firstChild;)t.svgTextMeasurer.firstChild.remove();t.svgTextMeasurer.appendChild(t.svgTextMeasurer.ownerDocument.importNode(i.documentElement,!0).firstChild);var n=t.svgTextMeasurer.firstChild.getBBox();this.bounds.width=n.width,this.bounds.height=n.height,this.origin.y=-n.y}else t.textMeasuringStrategy===f.Canvas&&(this.bounds.width=this.measureSubstring(t),this.bounds.height=1.2*this.fontSize,this.origin.y=this.fontSize)}},{key:"getCssClasses",value:function(){return""}},{key:"getExtraStyleProperties",value:function(t){return""}},{key:"draw",value:function(t){var e=t.canvasCtxt;"middle"===this.textAnchor?e.textAlign="center":e.textAlign="start",e.font=this.fontSize+"px "+this.fontFamily;for(var i=0;i]/g,function(t){return G[t]})}}]),e}(d),Q=e.LyricType={SingleSyllable:0,BeginningSyllable:1,MiddleSyllable:2,EndingSyllable:3,Directive:4},I=e.Lyric=function(t){function e(t,i,A){s(this,e);var o=n(this,Object.getPrototypeOf(e).call(this,t,i,t.lyricTextFont,t.lyricTextSize,"start"));return o.originalText=i,"undefined"==typeof A||null===A||""===A?o.lyricType=Q.SingleSyllable:o.lyricType=A,o.centerStartIndex=-1,o.centerLength=i.length,o.needsConnector=!1,o.language=null,o}return A(e,t),r(e,[{key:"allowsConnector",value:function(){return this.lyricType===Q.BeginningSyllable||this.lyricType===Q.MiddleSyllable}},{key:"setNeedsConnector",value:function(t){t===!0?(this.needsConnector=!0,this.bounds.width=this.widthWithConnector,this.spans.length>0&&(this.spans[this.spans.length-1].text=this.lastSpanTextWithConnector)):(this.needsConnector=!1,this.bounds.width=this.widthWithoutConnector,this.spans.length>0&&(this.spans[this.spans.length-1].text=this.lastSpanText))}},{key:"generateSpansFromText",value:function(t,i){a(Object.getPrototypeOf(e.prototype),"generateSpansFromText",this).call(this,t,i),this.spans.length>0?(this.lastSpanText=this.spans[this.spans.length-1].text,this.lastSpanTextWithConnector=this.lastSpanText+t.syllableConnector):(this.lastSpanText="",this.lastSpanTextWithConnector="")}},{key:"recalculateMetrics",value:function(t){a(Object.getPrototypeOf(e.prototype),"recalculateMetrics",this).call(this,t),this.widthWithoutConnector=this.bounds.width,this.textWithConnector=this.text+t.syllableConnector,this.widthWithConnector=this.bounds.width+t.hyphenWidth;var i,n,A=this.language||t.defaultLanguage,s=this.widthWithoutConnector/2;if(this.centerStartIndex>=0&&(this.centerStartIndex>=this.text.length||this.centerLength<0||this.centerStartIndex+this.centerLength>this.text.length)&&(this.centerStartIndex=-1),0===this.text.length);else if(this.centerStartIndex>=0)t.textMeasuringStrategy===f.Svg?(i=t.svgTextMeasurer.firstChild.getSubStringLength(0,this.centerStartIndex),n=t.svgTextMeasurer.firstChild.getSubStringLength(0,this.centerStartIndex+this.centerLength)):t.textMeasuringStrategy===f.Canvas&&(i=this.measureSubstring(t,this.centerStartIndex),n=this.measureSubstring(t,this.centerStartIndex+this.centerLength)),s=i+(n-i)/2;else if(this.lyricType!==Q.Directive){var o=A.findVowelSegment(this.text,0);o.found===!0&&(t.textMeasuringStrategy===f.Svg?(i=t.svgTextMeasurer.firstChild.getSubStringLength(0,o.startIndex),n=t.svgTextMeasurer.firstChild.getSubStringLength(0,o.startIndex+o.length)):t.textMeasuringStrategy===f.Canvas&&(i=this.measureSubstring(t,o.startIndex),n=this.measureSubstring(t,o.startIndex+o.length)),s=i+(n-i)/2)}this.bounds.x=-s,this.bounds.y=0,this.origin.x=s,this.bounds.width=this.widthWithoutConnector, +this.bounds.height=t.lyricTextSize}},{key:"generateDropCap",value:function(t){var e=new S(t,this.originalText.substring(0,1));return 1===this.originalText.length?(this.generateSpansFromText(t,t.syllableConnector),this.centerStartIndex=-1,this.lyricType=Q.SingleSyllable):(this.generateSpansFromText(t,this.originalText.substring(1)),this.centerStartIndex--),e}},{key:"getCssClasses",value:function(){var t="lyric ";return this.lyricType===Q.Directive&&(t+="directive "),t+a(Object.getPrototypeOf(e.prototype),"getCssClasses",this).call(this)}},{key:"getExtraStyleProperties",value:function(t){var i=a(Object.getPrototypeOf(e.prototype),"getExtraStyleProperties",this).call(this);return this.lyricType===Q.Directive&&t.autoColor===!0&&(i+="fill:#f00;"),i}},{key:"createSvgFragment",value:function(t){return this.spans.length>0&&(this.needsConnector?this.spans[this.spans.length-1].text=this.lastSpanTextWithConnector:this.spans[this.spans.length-1].text=this.lastSpanText),a(Object.getPrototypeOf(e.prototype),"createSvgFragment",this).call(this,t)}}]),e}(w),S=e.DropCap=function(t){function e(t,i){s(this,e);var A=n(this,Object.getPrototypeOf(e).call(this,t,i,t.dropCapTextFont,t.dropCapTextSize,"middle"));return A.padding=2*t.staffInterval,A}return A(e,t),r(e,[{key:"getCssClasses",value:function(){return"dropCap "+a(Object.getPrototypeOf(e.prototype),"getCssClasses",this).call(this)}}]),e}(w);e.Annotation=function(t){function e(t,i){s(this,e);var A=n(this,Object.getPrototypeOf(e).call(this,t,i,t.annotationTextFont,t.annotationTextSize,"middle"));return A.padding=t.staffInterval,A.dominantBaseline="hanging",A}return A(e,t),r(e,[{key:"getCssClasses",value:function(){return"annotation "+a(Object.getPrototypeOf(e.prototype),"getCssClasses",this).call(this)}}]),e}(w),e.ChantNotationElement=function(t){function e(){s(this,e);var t=n(this,Object.getPrototypeOf(e).call(this));return t.leadingSpace=0,t.trailingSpace=-1,t.keepWithNext=!1,t.needsLayout=!0,t.lyrics=[],t.score=null,t.line=null,t.visualizers=[],t}return A(e,t),r(e,[{key:"hasLyrics",value:function(){return 0!==this.lyrics.length}},{key:"getLyricLeft",value:function(t){return this.bounds.x+this.lyrics[t].bounds.x}},{key:"getAllLyricsLeft",value:function(){if(0===this.lyrics.length)return this.bounds.right();for(var t=Number.MAX_VALUE,e=0;e=this.notations.length)return this.needsLayout=!1,void(i&&setTimeout(function(){return i()},0));0===e&&(t.activeClef=this.startingClef);var A=(new Date).getTime()+50;do{var s=this.notations[e];s.needsLayout&&(t.currNotationIndex=e,s.performLayout(t)),e++}while(ee;e++)for(A=i[e],this.notationBounds.union(A.bounds),o=0;oe;e++){A=i[e];for(var s=this.notationBounds.y+this.notationBounds.height,o=0;o0?this.notationBounds.y+this.notationBounds.height+this.lyricLineBaselines[0]:this.notationBounds.y+this.notationBounds.height,this.score.dropCap.bounds.x=this.staffLeft/2,this.score.dropCap.bounds.y=u}null!==this.score.annotation&&(this.score.annotation.bounds.x=this.staffLeft/2,this.score.annotation.bounds.y=3*-t.staffInterval)}this.notationBounds.height+=t.lyricTextSize,this.bounds.x=0,this.bounds.y=this.notationBounds.y,this.bounds.width=this.notationBounds.right(),this.bounds.height=a,this.origin=new r.Point(this.staffLeft,-this.notationBounds.y)}},{key:"draw",value:function(t){var e=t.canvasCtxt;e.translate(this.bounds.x,this.bounds.y);var i,n,A=this.staffLeft,s=this.staffRight;for(e.lineWidth=Math.round(t.staffLineWeight),e.strokeStyle=t.staffLineWeight,i=-3;3>=i;i+=2)n=Math.round(t.staffInterval*i)+.5,e.beginPath(),e.moveTo(A,n),e.lineTo(s,n),e.stroke();for(i=0;ii;i++)a[i].draw(t);this.startingClef.draw(t),this.custos&&this.custos.draw(t),e.translate(-this.bounds.x,-this.bounds.y)}},{key:"createSvgFragment",value:function(t){var e,i="",n=this.staffLeft,A=this.staffRight;for(e=-3;3>=e;e+=2)i+=u.QuickSvg.createFragment("line",{x1:n,y1:t.staffInterval*e,x2:A,y2:t.staffInterval*e,stroke:t.staffLineColor,"stroke-width":t.staffLineWeight,"class":"staffLine"});for(e=0;ee;e++)i+=a[e].createSvgFragment(t);return this.custos&&(i+=this.custos.createSvgFragment(t)),u.QuickSvg.createFragment("g",{"class":"chantLine",transform:"translate("+this.bounds.x+","+this.bounds.y+")"},i)}},{key:"generateCurlyBraceDrawable",value:function(t,e,i,n,A){var s;s=A?-t.staffInterval/2:t.staffInterval/2;var o=.6,a=i-e,r=e,h=n+o*s,l=e+.25*a,c=n+(1-o)*s,g=e+.5*a,p=n+s,f=i,d=n+o*s,y=e+.75*a,B=n+(1-o)*s,v="M "+e+" "+n+" Q "+r+" "+h+" "+l+" "+c+" T "+g+" "+p+" M "+i+" "+n+" Q "+f+" "+d+" "+y+" "+B+" T "+g+" "+p;return u.QuickSvg.createFragment("path",{d:v,stroke:t.neumeLineColor,"stroke-width":t.neumeLineWeight+"px",fill:"none"})}},{key:"buildFromChantNotationIndex",value:function(t,e,i){var n=this.score.notations;if(this.notationsStartIndex=e,this.numNotationsOnLine=0,this.staffLeft=0,i>0?this.staffRight=i:this.staffRight=99999999,0===this.notationsStartIndex){var A=0;null!==this.score.dropCap&&(A=this.score.dropCap.bounds.width+2*this.score.dropCap.padding),null!==this.score.annotation&&(A=Math.max(A,this.score.annotation.bounds.width+4*this.score.annotation.padding)),this.staffLeft+=A}n[e].isClef&&(t.activeClef=n[e].clone(),e++,this.notationsStartIndex++),this.startingClef=t.activeClef.clone(),this.startingClef.performLayout(t),this.startingClef.bounds.x=this.staffLeft;var s,o,a=this.startingClef,r=null,u=null,g=this.staffRight-l.Glyphs.CustosLong.bounds.width*t.glyphScaling-4*t.intraNeumeSpacing,p=n.length-1;for(s=e;p>=s;s++){a.hasLyrics()&&(u=a),r=a,a=n[s];var f;f=s===p?this.staffRight:s===p-1?Math.max(g,this.staffRight-n[p].bounds.width):g;var d=this.positionNotationElement(t,u,r,a,f);if(d===!1){var y=a.notes&&a.notes.reduce(function(t,e,i){return t||e.braceEnd&&i+1||0},0),B=a.notes&&a.notes.reduce(function(t,e,i){return t||e.braceStart&&i+1||0},0);if(y&&(!B||B>y)){var v=n.slice(this.notationsStartIndex,s).reduceRight(function(t,e,i){if(-1===t&&e.notes){var n=e.notes.filter(function(t){return t.braceStart}).length,A=e.notes.filter(function(t){return t.braceEnd}).length;if(A)return-2;if(n)return i}return t},-1);v>0&&(this.numNotationsOnLine=v,s=v+this.notationsStartIndex)}for(o=s-1;o>this.notationsStartIndex;o--){var b=n[o];if(!(b.keepWithNext===!0||o===s-1&&a.isDivider))break;this.numNotationsOnLine--}break}if(a.chantLine=this,this.numNotationsOnLine++,a.isClef&&(t.activeClef=a),a.constructor===h.ChantLineBreak&&i>0){this.justify=a.justify;break}}for(s=this.notationsStartIndex+this.numNotationsOnLine;s=i?(this.staffRight=C.bounds.right(),this.justify=!1):this.notationsStartIndex+this.numNotationsOnLine===n.length&&(this.justify=!0,this.justify=C.isDivider&&(this.staffRight-C.bounds.right())/this.staffRight<.1),this.justify===!0&&this.justifyElements(),this.finishLayout(t)}},{key:"justifyElements",value:function(){var t,e=[],i=this.score.notations,n=this.notationsStartIndex+this.numNotationsOnLine,A=0;if(this.numNotationsOnLine>0){var s=i[n-1],o=null;for(t=n-1;t>=this.notationsStartIndex;t--)if(i[t].hasLyrics()){o=i[t];break}A=o?this.staffRight-Math.max(o.getAllLyricsRight(),s.bounds.right()+s.trailingSpace):this.staffRight-(s.bounds.right()+s.trailingSpace)}if(this.custos&&(A-=this.custos.bounds.width+this.custos.leadingSpace),!(0>=A)){var a=null,r=null,u=null;for(t=this.notationsStartIndex;n>t;t++)null!==r&&r.hasLyrics()&&(u=r),a=r,r=i[t],null!==a&&a.keepWithNext===!0||null!==u&&u.lyrics[0].allowsConnector()&&!u.lyrics[0].needsConnector||r.constructor!==h.ChantLineBreak&&e.push(r);if(0!==e.length){var l=0,c=A/e.length,g=0;for(t=this.notationsStartIndex;n>t;t++)r=i[t],g=5||-5>=A){var s=n+i.bounds.x-t.intraNeumeSpacing,o=n+i.bounds.x+i.bounds.width+t.intraNeumeSpacing;A-=A>0?(A-1)%2:(A+1)%2;var a=5*t.staffInterval;if(e.ledgerLines.length>0&&e.ledgerLines[e.ledgerLines.length-1].x2+a>=s){var r=(s-e.ledgerLines[e.ledgerLines.length-1].x2)/2;e.ledgerLines[e.ledgerLines.length-1].x2+=r,s-=r}o>e.staffRight&&(o=e.staffRight),e.ledgerLines.push({x1:s,x2:o,staffPosition:A})}},s=[],o=null,a=0,r=Number.MAX_VALUE,h=Number.MIN_VALUE,l=this.notationsStartIndex;n>l;l++)if(r=Math.min(r,i[l].bounds.y),h=Math.max(h,i[l].bounds.bottom()),i[l].constructor!==c.Custos){if(i[l].isNeume)for(var p=i[l],f=0;f0&&(v=p.bounds.x+B.bounds.x-(s[s.length-1].note.neume.bounds.x+s[s.length-1].bounds.right())),0===s.length||s[s.length-1].positionHint!==B.positionHint||s[s.length-1].terminating===!0||s[s.length-1].alignment===g.HorizontalEpisemaAlignment.Left||B.alignment===g.HorizontalEpisemaAlignment.Right||v>2*t.intraNeumeSpacing)s=[],s.push(B);else{var b;if(b=B.positionHint===g.MarkingPositionHint.Below?Math.max(B.bounds.y,s[s.length-1].bounds.y):Math.min(B.bounds.y,s[s.length-1].bounds.y),B.bounds.y!==b)B.bounds.y=b;else for(var m=0;m=d;d++)G=Math.min(G,i[d].bounds.y-w);else for(G=t.calculateHeightFromStaffPosition(-4),d=a;l>=d;d++)G=Math.max(G,i[d].bounds.y+w);var Q=!1;o.shape===g.BraceShape.RoundBrace?this.braces.push(new u.RoundBraceVisualizer(t,o.getAttachmentX(),y.braceEnd.getAttachmentX(),G,o.isAbove)):(o.shape===g.BraceShape.AccentedCurlyBrace&&(Q=!0),this.braces.push(new u.CurlyBraceVisualizer(t,o.getAttachmentX(),y.braceEnd.getAttachmentX(),G,o.isAbove,Q)))}}y.braceStart&&(o=y.braceStart,a=l),null!==o&&(o.isAbove?o.bounds.y=Math.min(o.bounds.y,y.bounds.y):o.bounds.y=Math.max(o.bounds.y,y.bounds.bottom()))}}else A(i[l]);null!==o&&(o=o),this.custos&&A(this.custos)}},{key:"positionNotationElement",value:function(t,e,i,n,A){var s;if(n.bounds.x=i.bounds.right()+i.trailingSpace,null===e){var o=n.bounds.right()+n.trailingSpace;for(s=0;sA)}if(n.hasLyrics()===!1){for(s=0;s1){var r=Number.MIN_VALUE,u=Number.MAX_VALUE,h=Number.MIN_VALUE;for(s=0;a>s;s++){if(su&&(n.bounds.x+=r-u,h+=r-u),n.bounds.right()c&&(n.bounds.x+=g+t.minLyricWordSpacing-c):g>c?n.bounds.x+=g-c:(e.lyrics[0].setNeedsConnector(!0),g=e.getLyricRight(0),g>c&&(n.bounds.x+=g-c)),n.bounds.right()+n.trailingSpace=t?Math.abs(t)%2===1?h.GlyphCode.CustosLong:h.GlyphCode.CustosShort:Math.abs(t)%2===1?h.GlyphCode.CustosDescLong:h.GlyphCode.CustosDescShort}}]),e}(h.ChantNotationElement),e.Divider=function(t){function e(){A(this,e);var t=s(this,Object.getPrototypeOf(e).call(this));return t.isDivider=!0,t.resetsAccidentals=!0,t}return o(e,t),e}(h.ChantNotationElement)),c=(e.QuarterBar=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),a(e,[{key:"performLayout",value:function(t){r(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(new h.DividerLineVisualizer(t,2,4)),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(l),e.HalfBar=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),a(e,[{key:"performLayout",value:function(t){r(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(new h.DividerLineVisualizer(t,-2,2)),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(l),e.FullBar=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),a(e,[{key:"performLayout",value:function(t){r(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(new h.DividerLineVisualizer(t,-3,3)),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(l),e.DoubleBar=function(t){function e(){return A(this,e),s(this,Object.getPrototypeOf(e).apply(this,arguments))}return o(e,t),a(e,[{key:"performLayout",value:function(t){r(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=new h.DividerLineVisualizer(t,-3,3);i.bounds.x=0,this.addVisualizer(i);var n=new h.DividerLineVisualizer(t,-3,3);n.bounds.x=2*t.intraNeumeSpacing,this.addVisualizer(n),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(l),e.AccidentalType={Flat:-1,Natural:0,Sharp:1});e.Accidental=function(t){function e(t,i){A(this,e);var n=s(this,Object.getPrototypeOf(e).call(this));return n.isAccidental=!0,n.keepWithNext=!0,n.staffPosition=t,n.accidentalType=i,n}return o(e,t),a(e,[{key:"performLayout",value:function(t){r(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.addVisualizer(this.createGlyphVisualizer(t)),this.finishLayout(t)}},{key:"createGlyphVisualizer",value:function(t){var e=h.GlyphCode.Flat;switch(this.accidentalType){case c.Natural:e=h.GlyphCode.Natural;break;case c.Sharp:e=h.GlyphCode.Sharp;break;default:e=h.GlyphCode.Flat}var i=new h.GlyphVisualizer(t,e);return i.setStaffPosition(t,this.staffPosition),i}},{key:"adjustStep",value:function(t){switch(this.accidentalType){case c.Flat:if(t===Step.Ti)return Step.Te;if(t===Step.Mi)return Step.Me;break;case c.Sharp:if(t===Step.Do)return Step.Du;if(t===Step.Fa)return Step.Fu;break;case c.Natural:if(t===Step.Te)return Step.Ti;if(t===Step.Me)return Step.Mi;if(t===Step.Du)return Step.Do;if(t===Step.Fu)return Step.Fa}return t}},{key:"applyToPitch",value:function(t){this.octave===t.octave&&(t.step=this.adjustStep(t.step))}}]),e}(h.ChantNotationElement),e.Virgula=function(t){function e(){A(this,e);var t=s(this,Object.getPrototypeOf(e).call(this));return t.resetsAccidentals=!1,t.staffPosition=3,t}return o(e,t),a(e,[{key:"performLayout",value:function(t){r(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i=new h.GlyphVisualizer(t,h.GlyphCode.Virgula);i.setStaffPosition(t,this.staffPosition),this.addVisualizer(i),this.origin.x=this.bounds.width/2,this.finishLayout(t)}}]),e}(l)},function(t,e,i){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.BracePoint=e.BraceAttachment=e.BraceShape=e.Mora=e.Ictus=e.HorizontalEpisema=e.HorizontalEpisemaAlignment=e.AcuteAccent=e.MarkingPositionHint=void 0;var a=function(){function t(t,e){for(var i=0;i<_\.'012345]*(?:\[[^\]]*\]?)*/g,y=/([ou])(b|cb|cba):([01])(?:([{}])|;(\d*(?:\.\d+)?)mm)/; +e.Gabc=function(){function t(){A(this,t)}return s(t,null,[{key:"createMappingsFromSource",value:function(t,e){var i=this.splitWords(e);t.activeClef=r.Clef["default"]();var n=this.createMappingsFromWords(t,i,function(e){return t.activeClef=e});return n.length>0&&n[n.length-1].notations.length>0&&(n[n.length-1].notations[n[n.length-1].notations.length-1].trailingSpace=0),n}},{key:"diffDescriptorsAndNewWords",value:function(t,e){var i,n={};for(i=0;io&&(o=u[h],A=h-o+1,s=a-o+1)}r=u}if(0===o){var l=[];return t.length&&l.push(["-",t]),e.length&&l.push(["+",e]),l}return[].concat(this.diffDescriptorsAndNewWords(t.slice(0,A),e.slice(0,s)),[["=",e.slice(s,s+o)]],this.diffDescriptorsAndNewWords(t.slice(A+o),e.slice(s+o)))}},{key:"updateMappingsFromSource",value:function(t,e,i){e.pop();var n,A,s=this.splitWords(i),o=this.diffDescriptorsAndNewWords(e,s),a=0;t.activeClef=r.Clef["default"]();for(var u=0;u0&&e[e.length-1].notations.length>0&&(e[e.length-1].notations[e[e.length-1].notations.length-1].trailingSpace=0)}},{key:"createMappingsFromWords",value:function(t,e){for(var i=[],n=0;n=0){var u=o.indexOf("}");u>=0&&u>a?(r=u-a-1,o=o.substring(0,a)+o.substring(a+1,u)+o.substring(u+1,o.length)):a=-1}var h=this.makeLyric(t,o,i);a>=0&&(h.centerStartIndex=a,h.centerLength=r),n.push(h)}return n}},{key:"makeLyric",value:function(t,e,i){e.length>1&&"-"===e[e.length-1]&&(i===a.LyricType.EndingSyllable?i=a.LyricType.MiddleSyllable:i===a.LyricType.SingleSyllable&&(i=a.LyricType.BeginningSyllable),e=e.substring(0,e.length-1));var n=!1;e.length>1&&"_"===e[e.length-1]&&(n=!0,e=e.substring(0,e.length-1)),"*"!==e&&"†"!==e||(i=a.LyricType.Directive);var A=new a.Lyric(t,e,i);return A.elidesToNext=n,A}},{key:"parseNotations",value:function(t,e){var i=this;if(!e)return[new r.TextOnly];var n=[],A=[],s=-1,o=function(e){if(A.length>0){for(var o=i.createNeumesFromNotes(t,A,s),a=0;a1&&"+"===h[1]){var l=new c.Custos;l.staffPosition=this.gabcHeightToExsurgeHeight(e[0]),o(l)}else if(h.length>1&&("x"===h[1]||"y"===h[1]||"#"===h[1])){var g;switch(h[1]){case"y":g=c.AccidentalType.Natural;break;case"#":g=c.AccidentalType.Sharp;break;default:g=c.AccidentalType.Flat}var p=[];this.createNoteFromData(t,t.activeClef,h,p);var f=new c.Accidental(p[0].staffPosition,g);f.trailingSpace=2*t.intraNeumeSpacing,t.activeClef.activeAccidental=f,o(f)}else this.createNoteFromData(t,t.activeClef,h,A)}}return o(null),n}},{key:"createNeumesFromNotes",value:function(t,e,i){for(var n=[],A=0,s=0,o=function(i,o){var r,u=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(r=o?s:u?s-1:s-2,!(0>r)){for(;r>=A;)i.addNote(e[A++]);return n.push(i),o===!1&&(s--,u===!1&&s--,i.keepWithNext=!0,i.trailingSpace=t.intraNeumeSpacing),a}},a={neume:function(){return new p.Punctum},handle:function(t,e){return t.shape===r.NoteShape.Virga?C:t.shape===r.NoteShape.Stropha?w:t.shape===r.NoteShape.Oriscus?l:t.shape===r.NoteShape.Inclinatum?h:t.shapeModifiers&r.NoteShapeModifiers.Cavum?o(new p.Punctum,!0):u}},u={neume:function(){return new p.Punctum},handle:function(t,e){return t.staffPosition>e.staffPosition?c:t.staffPositione.staffPosition?(e.shapeModifiers|=r.NoteShapeModifiers.Ascending,o(new p.PesQuassus,!0)):t.staffPositione.staffPosition?e.shape===r.NoteShape.Oriscus?B:b:t.staffPositione.staffPosition?d:o(new p.Clivis,!1)}},f={neume:function(){return new p.Climacus},handle:function(t,e){return t.shape!==r.NoteShape.Inclinatum?o(new p.Climacus,!1):H}},d={neume:function(){return new p.Porrectus},handle:function(t,e){return t.shape===r.NoteShape.Default&&t.staffPositione.staffPosition?k:o(new p.Torculus,!1)}},k={neume:function(){return new p.TorculusResupinus},handle:function(t,e){return t.shape===r.NoteShape.Default&&t.staffPosition0?e[s-1]:null,M=e[s];H=H.handle(M,L),s===e.length-1&&H!==a&&o(H.neume(),!0),s++}return n.length>0&&i>=0&&(n[n.length-1].trailingSpace=i,i>t.intraNeumeSpacing?n[n.length-1].keepWithNext=!1:n[n.length-1].keepWithNext=!0),n}},{key:"createNoteFromData",value:function(t,e,i,n){var A=new r.Note;if(i.length<1)throw"Invalid note data: "+i;if("-"===i[0]&&(A.liquescent=r.LiquescentType.InitioDebilis,i=i.substring(1)),i.length<1)throw"Invalid note data: "+i;var s=this.gabcHeightToExsurgePitch(e,i[0]);i[0]===i[0].toUpperCase()&&(A.shape=r.NoteShape.Inclinatum),A.staffPosition=this.gabcHeightToExsurgeHeight(i[0]),A.pitch=s;for(var a,u=n.length,l=A,c=1;c0&&(f=!0,p=Math.abs(A.staffPosition)%2===0?"1":"0"),a=new h.Mora(t,A),f&&"1"===p?a.positionHint=h.MarkingPositionHint.Above:f&&"0"===p&&(a.positionHint=h.MarkingPositionHint.Below),A.morae.push(a);break;case"_":var d=!1;for(a=new h.HorizontalEpisema(l);f;){if("0"===p)a.positionHint=h.MarkingPositionHint.Below;else if("1"===p)a.positionHint=h.MarkingPositionHint.Above;else if("2"===p)a.terminating=!0;else if("3"===p)a.alignment=h.HorizontalEpisemaAlignment.Left;else if("4"===p)a.alignment=h.HorizontalEpisemaAlignment.Center;else{if("5"!==p)break;a.alignment=h.HorizontalEpisemaAlignment.Right}a.alignment!==h.HorizontalEpisemaAlignment.Default&&a.positionHint!==h.MarkingPositionHint.Below&&(d=!0),c++,f=c+1=0&&n.length>0&&(l=n[--u]);break;case"'":a=new h.Ictus(t,A),f&&"1"===p?a.positionHint=h.MarkingPositionHint.Above:f&&"0"===p&&(a.positionHint=h.MarkingPositionHint.Below),A.ictus=a;break;case"r":f&&"1"===p?(A.acuteAccent=new h.AcuteAccent(t,A),c++):A.shapeModifiers|=r.NoteShapeModifiers.Cavum;break;case"s":A.shape===r.NoteShape.Stropha&&(n.push(A),A=new r.Note,u++),A.shape=r.NoteShape.Stropha;break;case"v":A.shape===r.NoteShape.Virga&&(n.push(A),A=new r.Note,u++),A.shape=r.NoteShape.Virga;break;case"w":A.shape=r.NoteShape.Quilisma;break;case"o":A.shape=r.NoteShape.Oriscus,f&&"<"===p?(A.shapeModifiers|=r.NoteShapeModifiers.Ascending,c++):f&&">"===p&&(A.shapeModifiers|=r.NoteShapeModifiers.Descending,c++);break;case"O":A.shape=r.NoteShape.Oriscus,f&&"<"===p?(A.shapeModifiers|=r.NoteShapeModifiers.Ascending|r.NoteShapeModifiers.Stemmed,c++):f&&">"===p?(A.shapeModifiers|=r.NoteShapeModifiers.Descending|r.NoteShapeModifiers.Stemmed,c++):A.shapeModifiers|=r.NoteShapeModifiers.Stemmed;break;case"~":A.shape===r.NoteShape.Inclinatum?A.liquescent|=r.LiquescentType.Small:A.shape===r.NoteShape.Oriscus?A.liquescent|=r.LiquescentType.Large:A.liquescent|=r.LiquescentType.Small;break;case"<":A.liquescent|=r.LiquescentType.Ascending;break;case">":A.liquescent|=r.LiquescentType.Descending;break;case"x":A.pitch.step===o.Step.Mi?A.pitch.step=o.Step.Me:A.pitch.step===o.Step.Ti&&(A.pitch.step=o.Step.Te);break;case"y":A.pitch.step===o.Step.Te?A.pitch.step=o.Step.Ti:A.pitch.step===o.Step.Me?A.pitch.step=o.Step.Mi:A.pitch.step===o.Step.Du?A.pitch.step=o.Step.Do:A.pitch.step===o.Step.Fu&&(A.pitch.step=o.Step.Fa);break;case"#":A.pitch.step===o.Step.Do?A.pitch.step=o.Step.Du:A.pitch.step===o.Step.Fa&&(A.pitch.step=o.Step.Fu);break;case"[":for(var y=++c;c1);if(A){var s=new h.NeumeLineVisualizer(this.ctxt,this.lastNote,t,this.lineIsHanging);this.neume.addVisualizer(s),s.bounds.x=Math.max(0,this.x-s.bounds.width),n||(this.x=s.bounds.x)}return n&&this.lastNote?t.bounds.x=this.x-t.bounds.width:(t.bounds.x=this.x,this.x+=t.bounds.width),this.neume.addVisualizer(t),this.lastNote=t,this.lineIsHanging=!1,this}},{key:"virgaAt",value:function(t){arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.noteAt(t,h.GlyphCode.PunctumQuadratum);var e=new h.VirgaLineVisualizer(this.ctxt,t);return this.x-=e.bounds.width,e.bounds.x=this.x,this.neume.addVisualizer(e),this.lastNote=t,this.lineIsHanging=!1,this}},{key:"advanceBy",value:function(t){return this.lastNote=null,this.lineIsHanging=!1,this.x+=t,this}},{key:"withLineEndingAt",value:function(t){if(null!==this.lastNote){var e=new h.NeumeLineVisualizer(this.ctxt,this.lastNote,t,!0);return this.neume.addVisualizer(e),this.x-=e.bounds.width,e.bounds.x=this.x,this.neume.addVisualizer(e),this.lastNote=t,this}}},{key:"withPodatus",value:function(t,e){var i,n;return t.liquescent===l.LiquescentType.InitioDebilis?(i=e.liquescent===l.LiquescentType.None?h.GlyphCode.PunctumQuadratum:h.GlyphCode.PunctumQuadratumDesLiquescent,n=h.GlyphCode.TerminatingDesLiquescent):e.liquescent&l.LiquescentType.Small?(n=h.GlyphCode.BeginningAscLiquescent,i=h.GlyphCode.TerminatingAscLiquescent):e.liquescent&l.LiquescentType.Ascending?(n=h.GlyphCode.PunctumQuadratum,i=h.GlyphCode.PunctumQuadratumAscLiquescent):e.liquescent&l.LiquescentType.Descending?(n=h.GlyphCode.PunctumQuadratum,i=h.GlyphCode.PunctumQuadratumDesLiquescent):(n=h.GlyphCode.PodatusLower,i=h.GlyphCode.PodatusUpper),t.shape===l.NoteShape.Quilisma&&(n=h.GlyphCode.Quilisma),this.noteAt(t,n).noteAt(e,i),this.lastNote=null,this}},{key:"withClivis",value:function(t,e){var i;return t.shape===l.NoteShape.Oriscus?this.noteAt(t,h.GlyphCode.OriscusDes,!1):this.lineFrom(e).noteAt(t,h.GlyphCode.PunctumQuadratum),i=e.liquescent&l.LiquescentType.Small?h.GlyphCode.TerminatingDesLiquescent:e.liquescent===l.LiquescentType.Ascending?h.GlyphCode.PunctumQuadratumAscLiquescent:e.liquescent===l.LiquescentType.Descending?h.GlyphCode.PunctumQuadratumDesLiquescent:h.GlyphCode.PunctumQuadratum,this.noteAt(e,i),this.lastNote=null,this}},{key:"withInclinati",value:function(t){for(var e=t[0].staffPosition,i=t[0].staffPosition,n=g.Glyphs.PunctumInclinatum.bounds.width*this.ctxt.glyphScaling,A=0;A0&&(this.x+=n*o),s.bounds.x=this.x,this.neume.addVisualizer(s)}return this}},{key:"withPorrectusSwash",value:function(t,e){var i=null!==this.lastNote&&(this.lineIsHanging||"right"===this.lastNote.glyphVisualizer.align||Math.abs(this.lastNote.staffPosition-t.staffPosition)>1);if(i){var n=new h.NeumeLineVisualizer(this.ctxt,this.lastNote,t,this.lineIsHanging);this.x=Math.max(0,this.x-n.bounds.width),n.bounds.x=this.x,this.neume.addVisualizer(n)}var A;switch(t.staffPosition-e.staffPosition){case 1:A=h.GlyphCode.Porrectus1;break;case 2:A=h.GlyphCode.Porrectus2;break;case 3:A=h.GlyphCode.Porrectus3;break;case 4:A=h.GlyphCode.Porrectus4;break;default:A=h.GlyphCode.None}return t.setGlyph(this.ctxt,A),t.bounds.x=this.x,e.setGlyph(this.ctxt,h.GlyphCode.None),this.x=t.bounds.right(),e.bounds.x=this.x-e.bounds.width,this.neume.addVisualizer(t),this.neume.addVisualizer(e),this.lastNote=e,this.lineIsHanging=!1,this}}]),t}(),f=e.Neume=function(t){function e(){var t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];o(this,e);var i=A(this,Object.getPrototypeOf(e).call(this));i.isNeume=!0,i.notes=t;for(var n=0;nn.staffPosition&&(i=h.GlyphCode.OriscusAsc)}}this.build(t).noteAt(n,i),this.finishLayout(t)}},{key:"resetDependencies",value:function(){this.notes[0].shapeModifiers&l.NoteShapeModifiers.Ascending||this.notes[0].shapeModifiers&l.NoteShapeModifiers.Descending||(this.needsLayout=!0)}}]),e}(f),e.PesQuassus=function(t){function e(){return o(this,e),A(this,Object.getPrototypeOf(e).apply(this,arguments))}return s(e,t),r(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t);var i,n=this.notes[0],A=this.notes[1],s=n.staffPosition,o=A.staffPosition;i=n.shape===l.NoteShape.Oriscus?h.GlyphCode.OriscusAsc:h.GlyphCode.PunctumQuadratum;var r=this.build(t).noteAt(n,i);o-s===1?r.virgaAt(A):A.liquescent===l.LiquescentType.LargeDescending?r.noteAt(A,h.GlyphCode.PunctumQuadratumDesLiquescent).withLineEndingAt(n):r.noteAt(A,h.GlyphCode.PunctumQuadratum).withLineEndingAt(n),this.finishLayout(t)}}]),e}(f),e.PesSubpunctis=function(t){function e(){return o(this,e),A(this,Object.getPrototypeOf(e).apply(this,arguments))}return s(e,t),r(e,[{key:"performLayout",value:function(t){a(Object.getPrototypeOf(e.prototype),"performLayout",this).call(this,t),this.build(t).withPodatus(this.notes[0],this.notes[1]).advanceBy(t.intraNeumeSpacing/2).withInclinati(this.notes.slice(2)),this.finishLayout(t)}}]),e}(f),e.Podatus=function(t){function e(){return o(this,e),A(this,Object.getPrototypeOf(e).apply(this,arguments))}return s(e,t),r(e,[{key:"positionMarkings",value:function(){var t,e;for(e=0;e","_ChantLayoutElement7","fontFamily","fontSize","textAnchor","_this7","dominantBaseline","generateSpansFromText","recalculateMetrics","spans","markupStack","spanStartIndex","filterFrames","frame","Symbol","that","closeSpan","spanText","extraProperties","markupRegex","match","exec","markupSymbol","pop","filter","baseFont","subStringLength","font","span","myText","slice","metrics","measureText","xml","doc","DOMParser","parseFromString","remove","ownerDocument","importNode","documentElement","bbox","getBBox","measureSubstring","textAlign","fillText","options","escapeForTspan","styleProperties","getExtraStyleProperties","getCssClasses","trim","text-anchor","dominant-baseline","string","String","BeginningSyllable","MiddleSyllable","EndingSyllable","Directive","_TextElement","lyricType","_this8","originalText","centerStartIndex","centerLength","needsConnector","language","needs","widthWithConnector","lastSpanTextWithConnector","widthWithoutConnector","lastSpanText","textWithConnector","activeLanguage","getSubStringLength","result","dropCap","classes","_TextElement2","_this9","padding","_TextElement3","_this10","_ChantLayoutElement8","_this11","leadingSpace","trailingSpace","keepWithNext","needsLayout","lyrics","visualizers","Number","MAX_VALUE","MIN_VALUE","chantLayoutElement","isEmpty","clone","unshift","draw","inner","ChantDocument","ChantScore","ChantMapping","ChantLineBreak","TextOnly","Clef","Note","NoteShapeModifiers","NoteShape","LiquescentType","Large","Small","Ascending","Descending","InitioDebilis","LargeAscending","LargeDescending","SmallAscending","SmallDescending","Default","Virga","Inclinatum","Oriscus","Cavum","Stemmed","glyphVisualizer","liquescent","shape","shapeModifiers","neume","epismata","morae","setStaffPosition","shapeModifier","_ChantNotationElement","defaultAccidental","isClef","activeAccidental","accidentalGlyph","createGlyphVisualizer","addVisualizer","__defaultDoClef","_Clef","stepToStaffOffset","octaveOffset","staffOffsetToStep","accidentalType","finishLayout","_Clef2","AccidentalType","_ChantNotationElement2","_ChantNotationElement3","justify","lb","source","mappings","lines","notes","startingClef","compiled","autoColoring","updateNotations","defaultClef","splice","recreateDropCap","hasLyrics","generateDropCap","finishedCallback","setTimeout","layoutElementsAsync","timeout","Date","getTime","currIndex","ChantLine","buildFromChantNotationIndex","notationsStartIndex","numNotationsOnLine","lastLine","clearRect","def","version","xmlns:xlink","createDropCap","parseChantNotations","unsanitizedText","defaults","layout","default-font","font-family","font-size","page","margin-left","margin-top","margin-right","margin-bottom","scores","copyLayout","to","from","unserializeFromJson","serializeToJson","notationBounds","staffLeft","staffRight","custos","ledgerLines","braces","nextLine","previousLine","lyricLineHeights","lyricLineBaselines","spaceAfterNotations","spaceBetweenTextTracks","lastIndex","totalHeight","dropCapY","ledgerLine","len","qx1","qx3","newElementStart","curr","prev","prevWithLyrics","rightNotationBoundary","lastNotationIndex","actualRightBoundary","fitsOnLine","positionNotationElement","braceEndIndex","reduce","braceEnd","braceStartIndex","braceStart","reduceRight","accum","cne","isDivider","chantLine","Custos","last","justifyElements","toJustify","extraSpace","lastWithLyrics","getAllLyricsRight","allowsConnector","increment","toJustifyIndex","processElementForLedgerLine","element","offsetX","minLedgerSeperation","half","startBrace","startBraceNotationIndex","minY","maxY","k","episema","spaceBetweenEpismata","positionHint","terminating","alignment","HorizontalEpisemaAlignment","Left","Right","newY","MarkingPositionHint","Below","l","BraceShape","RoundBrace","getAttachmentX","AccentedCurlyBrace","maxRight","setNeedsConnector","getLyricLeft","getLyricRight","lyricCount","prevLyricRightMax","currLyricLeftMin","currLyricRightMax","currLyricLeft","prevLyricRight","Accidental","DoubleBar","FullBar","HalfBar","QuarterBar","Divider","auto","findNextNeume","pitchToStaffPosition","getGlyphCode","resetsAccidentals","_Divider","apply","_Divider2","_Divider3","_Divider4","line0","line1","Sharp","isAccidental","adjustStep","_Divider5","BracePoint","BraceAttachment","Ictus","HorizontalEpisema","Above","_GlyphVisualizer","Center","minDistanceAway","ceil","_GlyphVisualizer2","horizontalOffset","verticalOffset","_GlyphVisualizer3","CurlyBrace","attachment","Markings","Signs","Neumes","__syllablesRegex","__notationsRegex","__braceSpecRegex","gabcSource","splitWords","createMappingsFromWords","clef","before","after","oldIndexMap","startOld","startNew","subLength","inew","overlap","_overlap","iold","diffDescriptorsAndNewWords","newGabcSource","newWords","results","resultCode","resultValues","resetDependencies","mapping","createMappingFromWord","matches","currSyllable","lyricText","notationData","items","parseNotations","notationWithLyrics","proposedLyricType","resetAccidentals","createSyllableLyrics","lyricTexts","indexClosingBracket","lyric","makeLyric","elides","elidesToNext","addNotation","neumes","createNeumesFromNotes","atoms","atom","gabcHeightToExsurgeHeight","noteArray","createNoteFromData","accidental","finalTrailingSpace","firstNoteIndex","currNoteIndex","createNeume","includeCurrNote","lastNoteIndex","includePrevNote","addNote","unknownState","Punctum","handle","currNote","prevNote","virgaState","apostrophaState","oriscusState","punctaInclinataState","punctumState","podatusState","climacusState","clivisState","distrophaState","PunctaInclinata","PesQuassus","Clivis","Podatus","salicusState","scandicusState","pesSubpunctisState","torculusState","porrectusState","Climacus","state","Porrectus","PorrectusFlexus","PesSubpunctis","Salicus","salicusFlexusState","SalicusFlexus","Scandicus","scandicusFlexusState","ScandicusFlexus","bivirgaState","Bivirga","Trivirga","Apostropha","Distropha","tristrophaState","Tristropha","Torculus","torculusResupinusState","TorculusResupinus","TorculusResupinusFlexus","gabcHeightToExsurgePitch","toUpperCase","mark","episemaNoteIndex","episemaNote","episemaHadModifier","ictus","processInstructionForNote","instruction","above","attachmentPoint","gabcNotations","parseWords","gabcWords","parseWord","gabcWord","gabcHeight","charCodeAt","exsurgeHeight","staffPositionToPitch","applyToPitch","Neume","NeumeBuilder","startingX","lastNote","lineIsHanging","withLineTo","noteAlignsRight","needsLine","noteAt","lowerNote","upperNote","upperGlyph","lowerGlyph","upper","lower","lineFrom","prevStaffPosition","advanceWidth","multiple","start","positionMarkings","_Neume","build","getNoteGlyphCode","_Neume2","virgaAt","advanceBy","_Neume3","_Neume4","withInclinati","_Neume5","hasLowerMora","withClivis","_Neume6","_Neume7","nextNoteStaffPosition","_Neume8","lowerStaffPos","upperStaffPos","builder","withLineEndingAt","_Neume9","withPodatus","_Neume10","marking","_Neume11","thirdGlyph","first","second","third","withPorrectusSwash","_Neume12","fourthGlyph","fourth","_Neume13","_Neume14","_Neume15","_Neume16","_Neume17","_Neume18","_Neume19","hasMiddleEpisema","glyph1","glyph3","note2","note3","_Neume20","firstGlyph","_Neume21","fifthGlyph","fifth","_Neume22","_Neume23"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,aAAAH,GACA,gBAAAC,SACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASL,EAAQD,EAASM,GE7BhC,YF0DCS,QAAOC,eAAehB,EAAS,cAC7BiB,OAAO,GAGT,IAAIC,GAAWZ,EAAoB,EEEpCS,QAAAI,KAAAD,GAAAE,QAAA,SAAAC,GFCe,YAARA,GACJN,OAAOC,eAAehB,EAASqB,GAC7BC,YAAY,EACZC,IAAK,WACH,MAAOL,GAASG,OAKtB,IAAIG,GAAYlB,EAAoB,EETrCS,QAAAI,KAAAK,GAAAJ,QAAA,SAAAC,GFYe,YAARA,GACJN,OAAOC,eAAehB,EAASqB,GAC7BC,YAAY,EACZC,IAAK,WACH,MAAOC,GAAUH,OAKvB,IAAII,GAAYnB,EAAoB,EEpBrCS,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packUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"exsurge\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"exsurge\"] = factory();\n\telse\n\t\troot[\"exsurge\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"exsurge\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"exsurge\"] = factory();\n\telse\n\t\troot[\"exsurge\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t//\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tObject.keys(_Exsurge).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Exsurge[key];\n\t }\n\t });\n\t});\n\t\n\tvar _Exsurge2 = __webpack_require__(2);\n\t\n\tObject.keys(_Exsurge2).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Exsurge2[key];\n\t }\n\t });\n\t});\n\t\n\tvar _Exsurge3 = __webpack_require__(3);\n\t\n\tObject.keys(_Exsurge3).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Exsurge3[key];\n\t }\n\t });\n\t});\n\t\n\tvar _Exsurge4 = __webpack_require__(4);\n\t\n\tObject.keys(_Exsurge4).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Exsurge4[key];\n\t }\n\t });\n\t});\n\t\n\tvar _Exsurge5 = __webpack_require__(6);\n\t\n\tObject.keys(_Exsurge5).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Exsurge5[key];\n\t }\n\t });\n\t});\n\t\n\tvar _ExsurgeChant = __webpack_require__(9);\n\t\n\tObject.keys(_ExsurgeChant).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _ExsurgeChant[key];\n\t }\n\t });\n\t});\n\t\n\tvar _ExsurgeChant2 = __webpack_require__(8);\n\t\n\tObject.keys(_ExsurgeChant2).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _ExsurgeChant2[key];\n\t }\n\t });\n\t});\n\t\n\tvar _ExsurgeChant3 = __webpack_require__(11);\n\t\n\tObject.keys(_ExsurgeChant3).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _ExsurgeChant3[key];\n\t }\n\t });\n\t});\n\t\n\tvar _Exsurge6 = __webpack_require__(10);\n\t\n\tObject.keys(_Exsurge6).forEach(function (key) {\n\t if (key === \"default\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Exsurge6[key];\n\t }\n\t });\n\t});\n\t\n\t\n\t// client side support\n\t\n\tif (typeof document !== 'undefined') {\n\t var ChantVisualElementPrototype = Object.create(HTMLElement.prototype);\n\t\n\t ChantVisualElementPrototype.createdCallback = function () {\n\t var ctxt = new _Exsurge4.ChantContext();\n\t\n\t ctxt.lyricTextFont = \"'Crimson Text', serif\";\n\t ctxt.lyricTextSize *= 1.2;\n\t ctxt.dropCapTextFont = ctxt.lyricTextFont;\n\t ctxt.annotationTextFont = ctxt.lyricTextFont;\n\t\n\t var useDropCap = true;\n\t var useDropCapAttr = this.getAttribute(\"use-drop-cap\");\n\t if (useDropCapAttr === 'false') useDropCap = false;\n\t\n\t var score = _Exsurge6.Gabc.loadChantScore(ctxt, this.innerText, useDropCap);\n\t\n\t var annotationAttr = this.getAttribute(\"annotation\");\n\t if (annotationAttr) {\n\t // add an annotation\n\t score.annotation = new _Exsurge4.Annotation(ctxt, annotationAttr);\n\t }\n\t\n\t var _element = this;\n\t\n\t var width = 0;\n\t var doLayout = function doLayout() {\n\t var newWidth = _element.parentElement.clientWidth;\n\t if (width === newWidth) return;\n\t width = newWidth;\n\t // perform layout on the chant\n\t score.performLayout(ctxt, function () {\n\t score.layoutChantLines(ctxt, width, function () {\n\t // render the score to svg code\n\t _element.innerHTML = score.createSvgFragment(ctxt);\n\t });\n\t });\n\t };\n\t doLayout();\n\t if (window.addEventListener) window.addEventListener('resize', doLayout, false);else if (window.attachEvent) window.attachEvent('onresize', doLayout);\n\t };\n\t\n\t ChantVisualElementPrototype.attachedCallback = function () {};\n\t\n\t document.registerElement = document.registerElement || function () {};\n\t // register the custom element\n\t var ChantVisualElement = document.registerElement('chant-visual', {\n\t prototype: ChantVisualElementPrototype\n\t });\n\t}\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\texports.DeviceIndependent = DeviceIndependent;\n\texports.Centimeters = Centimeters;\n\texports.Millimeters = Millimeters;\n\texports.Inches = Inches;\n\texports.ToCentimeters = ToCentimeters;\n\texports.ToMillimeters = ToMillimeters;\n\texports.ToInches = ToInches;\n\texports.generateRandomGuid = generateRandomGuid;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t//\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\tvar Units = exports.Units = {\n\t // enums\n\t DeviceIndepenedent: 0, // device independent units: 96/inch\n\t Centimeters: 1,\n\t Millimeters: 2,\n\t Inches: 3,\n\t\n\t // constants for device independent units (diu)\n\t DIU_PER_INCH: 96,\n\t DIU_PER_CENTIMETER: 96 / 2.54,\n\t\n\t ToDeviceIndependent: function ToDeviceIndependent(n, inputUnits) {\n\t switch (inputUnits) {\n\t case Centimeters:\n\t return n * DIU_PER_CENTIMETER;\n\t case Millimeters:\n\t return n * DIU_PER_CENTIMETER / 10;\n\t case Inches:\n\t return n * DIU_PER_INCH;\n\t default:\n\t return n;\n\t }\n\t },\n\t\n\t FromDeviceIndependent: function FromDeviceIndependent(n, outputUnits) {\n\t switch (outputUnits) {\n\t case Centimeters:\n\t return n / DIU_PER_CENTIMETER;\n\t case Millimeters:\n\t return n / DIU_PER_CENTIMETER * 10;\n\t case Inches:\n\t return n / DIU_PER_INCH;\n\t default:\n\t return n;\n\t }\n\t },\n\t\n\t StringToUnitsType: function StringToUnitsType(s) {\n\t switch (s.ToLower()) {\n\t case \"in\":\n\t case \"inches\":\n\t return Inches;\n\t\n\t case \"cm\":\n\t case \"centimeters\":\n\t return Centimeters;\n\t\n\t case \"mm\":\n\t case \"millimeters\":\n\t return Millimeters;\n\t\n\t case \"di\":\n\t case \"device-independent\":\n\t return DeviceIndepenedent;\n\t\n\t default:\n\t return DeviceIndepenedent;\n\t }\n\t },\n\t\n\t UnitsTypeToString: function UnitsTypeToString(units) {\n\t switch (units) {\n\t case Inches:\n\t return \"in\";\n\t case Centimeters:\n\t return \"cm\";\n\t case Millimeters:\n\t return \"mm\";\n\t case DeviceIndepenedent:\n\t return \"device-independent\";\n\t default:\n\t return \"device-independent\";\n\t }\n\t }\n\t};\n\t\n\tfunction DeviceIndependent(n) {\n\t return n;\n\t}\n\t\n\tfunction Centimeters(n) {\n\t return Units.ToDeviceIndependent(n, Units.Centimeters);\n\t}\n\t\n\tfunction Millimeters(n) {\n\t return Units.ToDeviceIndependent(n, Units.Millimeters);\n\t}\n\t\n\tfunction Inches(n) {\n\t return Units.ToDeviceIndependent(n, Units.Inches);\n\t}\n\t\n\tfunction ToCentimeters(n) {\n\t return Units.FromDeviceIndependent(n, Units.Centimeters);\n\t}\n\t\n\tfunction ToMillimeters(n) {\n\t return Units.FromDeviceIndependent(n, Units.Millimeters);\n\t}\n\t\n\tfunction ToInches(n) {\n\t return Units.FromDeviceIndependent(n, Units.Inches);\n\t}\n\t\n\t/*\n\t * Point\n\t */\n\t\n\tvar Point = exports.Point = function () {\n\t function Point(x, y) {\n\t _classCallCheck(this, Point);\n\t\n\t this.x = typeof x !== 'undefined' ? x : 0;\n\t this.y = typeof y !== 'undefined' ? y : 0;\n\t }\n\t\n\t _createClass(Point, [{\n\t key: \"clone\",\n\t value: function clone() {\n\t return new Point(this.x, this.y);\n\t }\n\t }, {\n\t key: \"equals\",\n\t value: function equals(point) {\n\t return this.x === point.x && this.y === point.y;\n\t }\n\t }]);\n\t\n\t return Point;\n\t}();\n\t\n\t/*\n\t * Rect\n\t */\n\t\n\t\n\tvar Rect = exports.Rect = function () {\n\t function Rect(x, y, width, height) {\n\t _classCallCheck(this, Rect);\n\t\n\t this.x = typeof x !== 'undefined' ? x : Infinity;\n\t this.y = typeof y !== 'undefined' ? y : Infinity;\n\t this.width = typeof width !== 'undefined' ? width : -Infinity;\n\t this.height = typeof height !== 'undefined' ? height : -Infinity;\n\t }\n\t\n\t _createClass(Rect, [{\n\t key: \"clone\",\n\t value: function clone() {\n\t return new Rect(this.x, this.y, this.width, this.height);\n\t }\n\t }, {\n\t key: \"isEmpty\",\n\t value: function isEmpty() {\n\t return this.x === Infinity && this.y === Infinity && this.width === -Infinity && this.height === -Infinity;\n\t }\n\t\n\t // convenience method\n\t\n\t }, {\n\t key: \"right\",\n\t value: function right() {\n\t return this.x + this.width;\n\t }\n\t }, {\n\t key: \"bottom\",\n\t value: function bottom() {\n\t return this.y + this.height;\n\t }\n\t }, {\n\t key: \"equals\",\n\t value: function equals(rect) {\n\t return this.x === rect.x && this.y === rect.y && this.width === rect.width && this.height === rect.height;\n\t }\n\t\n\t // other can be a Point or a Rect\n\t\n\t }, {\n\t key: \"contains\",\n\t value: function contains(other) {\n\t if (other instanceof Point) {\n\t return other.x >= this.x && other.x <= this.x + this.width && other.y >= this.y && other.y <= this.y + this.height;\n\t } else {\n\t // better be instance of Rect\n\t return this.x <= other.x && this.x + this.width >= other.x + other.width && this.y <= other.y && this.y + this.height >= other.y + other.height;\n\t }\n\t }\n\t }, {\n\t key: \"union\",\n\t value: function union(rect) {\n\t\n\t var right = Math.max(this.x + this.width, rect.x + rect.width);\n\t var bottom = Math.max(this.y + this.height, rect.y + rect.height);\n\t\n\t this.x = Math.min(this.x, rect.x);\n\t this.y = Math.min(this.y, rect.y);\n\t\n\t this.width = right - this.x;\n\t this.height = bottom - this.y;\n\t }\n\t }]);\n\t\n\t return Rect;\n\t}();\n\t\n\t/**\n\t * Margins\n\t *\n\t * @class\n\t */\n\t\n\t\n\tvar Margins = exports.Margins = function () {\n\t function Margins(left, top, right, bottom) {\n\t _classCallCheck(this, Margins);\n\t\n\t this.left = typeof left !== 'undefined' ? left : 0;\n\t this.top = typeof top !== 'undefined' ? top : 0;\n\t this.right = typeof right !== 'undefined' ? right : 0;\n\t this.bottom = typeof bottom !== 'undefined' ? bottom : 0;\n\t }\n\t\n\t _createClass(Margins, [{\n\t key: \"clone\",\n\t value: function clone() {\n\t return new Margins(this.left, this.top, this.right, this.bottom);\n\t }\n\t }, {\n\t key: \"equals\",\n\t value: function equals(margins) {\n\t return this.left === margins.left && this.top === margins.top && this.right === margins.right && this.bottom === margins.bottom;\n\t }\n\t }]);\n\t\n\t return Margins;\n\t}();\n\t\n\t/**\n\t * Size\n\t *\n\t * @class\n\t */\n\t\n\t\n\tvar Size = exports.Size = function () {\n\t function Size(width, height) {\n\t _classCallCheck(this, Size);\n\t\n\t this.width = typeof width !== 'undefined' ? width : 0;\n\t this.height = typeof height !== 'undefined' ? height : 0;\n\t }\n\t\n\t _createClass(Size, [{\n\t key: \"clone\",\n\t value: function clone() {\n\t return new Size(this.width, this.height);\n\t }\n\t }, {\n\t key: \"equals\",\n\t value: function equals(size) {\n\t return this.width === size.width && this.height === size.height;\n\t }\n\t }]);\n\t\n\t return Size;\n\t}();\n\t\n\t/*\n\t * Pitches, notes\n\t */\n\t\n\t\n\tvar Step = exports.Step = {\n\t Do: 0,\n\t Du: 1,\n\t Re: 2,\n\t Me: 3,\n\t Mi: 4,\n\t Fa: 5,\n\t Fu: 6,\n\t So: 7,\n\t La: 9,\n\t Te: 10,\n\t Ti: 11\n\t};\n\t\n\t// this little array helps map step values to staff positions. The numeric values of steps\n\t// correspond to whole step increments (2) or half step increments (1). This gives us the ability\n\t// to compare pitches precisely, but makes it challenging to place steps on the staff. this little\n\t// array maps the steps to an incremental position the steps take on the staff line. This works\n\t// so simply because chant only uses do and fa clefs, and only has a flatted ti (te), making\n\t// for relatively easy mapping to staff line locations.\n\t// Do Du Re Me Mi Fa Fu So La Te Ti\n\tvar __StepToStaffPosition = [0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6];\n\tvar __StaffOffsetToStep = [Step.Do, Step.Re, Step.Mi, Step.Fa, Step.So, Step.La, Step.Ti]; // no accidentals in this one\n\t\n\tvar Pitch = exports.Pitch = function () {\n\t function Pitch(step, octave) {\n\t _classCallCheck(this, Pitch);\n\t\n\t this.step = step;\n\t this.octave = octave;\n\t }\n\t\n\t _createClass(Pitch, [{\n\t key: \"toInt\",\n\t value: function toInt() {\n\t return this.octave * 12 + this.step;\n\t }\n\t }, {\n\t key: \"isHigherThan\",\n\t value: function isHigherThan(pitch) {\n\t return this.toInt() > pitch.toInt();\n\t }\n\t }, {\n\t key: \"isLowerThan\",\n\t value: function isLowerThan(pitch) {\n\t return this.toInt() < pitch.toInt();\n\t }\n\t }, {\n\t key: \"equals\",\n\t value: function equals(pitch) {\n\t return this.toInt() === pitch.toInt();\n\t }\n\t }], [{\n\t key: \"stepToStaffOffset\",\n\t value: function stepToStaffOffset(step) {\n\t return __StepToStaffPosition[step];\n\t }\n\t }, {\n\t key: \"staffOffsetToStep\",\n\t value: function staffOffsetToStep(offset) {\n\t while (offset < 0) {\n\t offset = __StaffOffsetToStep.length + offset;\n\t }return __StaffOffsetToStep[offset % __StaffOffsetToStep.length];\n\t }\n\t }]);\n\t\n\t return Pitch;\n\t}();\n\t\n\tfunction generateRandomGuid() {\n\t function s4() {\n\t return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t }\n\t return s4() + s4();\n\t}\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Spanish = exports.Latin = exports.Language = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); //\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tvar Exsurge = _interopRequireWildcard(_Exsurge);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @class\n\t */\n\t\n\tvar Language = exports.Language = function () {\n\t function Language(name) {\n\t _classCallCheck(this, Language);\n\t\n\t this.name = typeof name !== 'undefined' ? name : \"\";\n\t }\n\t\n\t /**\n\t * @param {String} text The string to parsed into words.\n\t * @return {Word[]} the resulting parsed words from syllabification\n\t */\n\t\n\t\n\t _createClass(Language, [{\n\t key: 'syllabify',\n\t value: function syllabify(text) {\n\t\n\t var parsedWords = [];\n\t\n\t if (typeof text === 'undefined' || text === \"\") return parsedWords;\n\t\n\t // Divide the text into words separated by whitespace\n\t var words = text.split(/[\\s]+/);\n\t\n\t for (var i = 0, end = words.length; i < end; i++) {\n\t parsedWords.push(this.syllabifyWord(words[i]));\n\t }return parsedWords;\n\t }\n\t }]);\n\t\n\t return Language;\n\t}();\n\t\n\t/**\n\t * @class\n\t */\n\t\n\t\n\tvar Latin = exports.Latin = function (_Language) {\n\t _inherits(Latin, _Language);\n\t\n\t /**\n\t * @constructs\n\t */\n\t\n\t function Latin() {\n\t _classCallCheck(this, Latin);\n\t\n\t // fixme: ui is only diphthong in the exceptional cases below (according to Wheelock's Latin)\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Latin).call(this, \"Latin\"));\n\t\n\t _this.diphthongs = [\"ae\", \"au\", \"oe\", \"aé\", \"áu\", \"oé\"];\n\t // for centering over the vowel, we will need to know any combinations that might be diphthongs:\n\t _this.possibleDiphthongs = _this.diphthongs.concat([\"ei\", \"eu\", \"ui\", \"éi\", \"éu\", \"úi\"]);\n\t\n\t // some words that are simply exceptions to standard syllabification rules!\n\t var wordExceptions = new Object();\n\t\n\t // ui combos pronounced as diphthongs\n\t wordExceptions[\"huius\"] = [\"hui\", \"us\"];\n\t wordExceptions[\"cuius\"] = [\"cui\", \"us\"];\n\t wordExceptions[\"huic\"] = [\"huic\"];\n\t wordExceptions[\"cui\"] = [\"cui\"];\n\t wordExceptions[\"hui\"] = [\"hui\"];\n\t\n\t // eu combos pronounced as diphthongs\n\t wordExceptions[\"euge\"] = [\"eu\", \"ge\"];\n\t wordExceptions[\"seu\"] = [\"seu\"];\n\t\n\t _this.vowels = ['a', 'e', 'i', 'o', 'u', 'á', 'é', 'í', 'ó', 'ú', 'æ', 'œ', 'ǽ', // no accented œ in unicode?\n\t 'y']; // y is treated as a vowel; not native to Latin but useful for words borrowed from Greek\n\t\n\t _this.vowelsThatMightBeConsonants = ['i', 'u'];\n\t\n\t _this.muteConsonantsAndF = ['b', 'c', 'd', 'g', 'p', 't', 'f'];\n\t\n\t _this.liquidConsonants = ['l', 'r'];\n\t return _this;\n\t }\n\t\n\t // c must be lowercase!\n\t\n\t\n\t _createClass(Latin, [{\n\t key: 'isVowel',\n\t value: function isVowel(c) {\n\t for (var i = 0, end = this.vowels.length; i < end; i++) {\n\t if (this.vowels[i] === c) return true;\n\t }return false;\n\t }\n\t }, {\n\t key: 'isVowelThatMightBeConsonant',\n\t value: function isVowelThatMightBeConsonant(c) {\n\t for (var i = 0, end = this.vowelsThatMightBeConsonants.length; i < end; i++) {\n\t if (this.vowelsThatMightBeConsonants[i] === c) return true;\n\t }return false;\n\t }\n\t\n\t // substring should be a vowel and the character following\n\t\n\t }, {\n\t key: 'isVowelActingAsConsonant',\n\t value: function isVowelActingAsConsonant(substring) {\n\t return this.isVowelThatMightBeConsonant(substring[0]) && this.isVowel(substring[1]);\n\t }\n\t\n\t /**\n\t * f is not a mute consonant, but we lump it together for syllabification\n\t * since it is syntactically treated the same way\n\t *\n\t * @param {String} c The character to test; must be lowercase\n\t * @return {boolean} true if c is an f or a mute consonant\n\t */\n\t\n\t }, {\n\t key: 'isMuteConsonantOrF',\n\t value: function isMuteConsonantOrF(c) {\n\t for (var i = 0, end = this.muteConsonantsAndF.length; i < end; i++) {\n\t if (this.muteConsonantsAndF[i] === c) return true;\n\t }return false;\n\t }\n\t\n\t /**\n\t *\n\t * @param {String} c The character to test; must be lowercase\n\t * @return {boolean} true if c is a liquid consonant\n\t */\n\t\n\t }, {\n\t key: 'isLiquidConsonant',\n\t value: function isLiquidConsonant(c) {\n\t for (var i = 0, end = this.liquidConsonants.length; i < end; i++) {\n\t if (this.liquidConsonants[i] === c) return true;\n\t }return false;\n\t }\n\t\n\t /**\n\t *\n\t * @param {String} s The string to test; must be lowercase\n\t * @return {boolean} true if s is a diphthong\n\t */\n\t\n\t }, {\n\t key: 'isDiphthong',\n\t value: function isDiphthong(s) {\n\t for (var i = 0, end = this.diphthongs.length; i < end; i++) {\n\t if (this.diphthongs[i] === s) return true;\n\t }return false;\n\t }\n\t\n\t /**\n\t *\n\t * @param {String} s The string to test; must be lowercase\n\t * @return {boolean} true if s is a diphthong\n\t */\n\t\n\t }, {\n\t key: 'isPossibleDiphthong',\n\t value: function isPossibleDiphthong(s) {\n\t for (var i = 0, end = this.possibleDiphthongs.length; i < end; i++) {\n\t if (this.possibleDiphthongs[i] === s) return true;\n\t }return false;\n\t }\n\t\n\t /**\n\t * Rules for Latin syllabification (from Collins, \"A Primer on Ecclesiastical Latin\")\n\t *\n\t * Divisions occur when:\n\t * 1. After open vowels (those not followed by a consonant) (e.g., \"pi-us\" and \"De-us\")\n\t * 2. After vowels followed by a single consonant (e.g., \"vi-ta\" and \"ho-ra\")\n\t * 3. After the first consonant when two or more consonants follow a vowel\n\t * (e.g., \"mis-sa\", \"minis-ter\", and \"san-ctus\").\n\t *\n\t * Exceptions:\n\t * 1. In compound words the consonants stay together (e.g., \"de-scribo\").\n\t * 2. A mute consonant (b, c, d, g, p, t) or f followed by a liquid consonant (l, r)\n\t * go with the succeeding vowel: \"la-crima\", \"pa-tris\"\n\t *\n\t * In addition to these rules, Wheelock's Latin provides this sound exception:\n\t * - Also counted as single consonants are qu and the aspirates ch, ph,\n\t * th, which should never be separated in syllabification:\n\t * architectus, ar-chi-tec-tus; loquacem, lo-qua-cem.\n\t *\n\t */\n\t\n\t }, {\n\t key: 'syllabifyWord',\n\t value: function syllabifyWord(word) {\n\t var syllables = [];\n\t var haveCompleteSyllable = false;\n\t var previousWasVowel = false;\n\t var workingString = word.toLowerCase();\n\t var startSyllable = 0;\n\t\n\t var c, lookahead, haveLookahead;\n\t\n\t // a helper function to create syllables\n\t var makeSyllable = function makeSyllable(length) {\n\t if (haveCompleteSyllable) {\n\t syllables.push(word.substr(startSyllable, length));\n\t startSyllable += length;\n\t }\n\t\n\t haveCompleteSyllable = false;\n\t };\n\t\n\t for (var i = 0, wordLength = workingString.length; i < wordLength; i++) {\n\t\n\t c = workingString[i];\n\t\n\t // get our lookahead in case we need them...\n\t lookahead = '*';\n\t haveLookahead = i + 1 < wordLength;\n\t\n\t if (haveLookahead) lookahead = workingString[i + 1];\n\t\n\t var cIsVowel = this.isVowel(c);\n\t\n\t // i is a special case for a vowel. when i is at the beginning\n\t // of the word (Iesu) or i is between vowels (alleluia),\n\t // then the i is treated as a consonant (y)\n\t if (c === 'i') {\n\t if (i === 0 && haveLookahead && this.isVowel(lookahead)) cIsVowel = false;else if (previousWasVowel && haveLookahead && this.isVowel(lookahead)) {\n\t cIsVowel = false;\n\t }\n\t }\n\t\n\t if (c === '-') {\n\t\n\t // a hyphen forces a syllable break, which effectively resets\n\t // the logic...\n\t\n\t haveCompleteSyllable = true;\n\t previousWasVowel = false;\n\t makeSyllable(i - startSyllable);\n\t startSyllable++;\n\t } else if (cIsVowel) {\n\t\n\t // once we get a vowel, we have a complete syllable\n\t haveCompleteSyllable = true;\n\t\n\t if (previousWasVowel && !this.isDiphthong(workingString[i - 1] + \"\" + c)) {\n\t makeSyllable(i - startSyllable);\n\t haveCompleteSyllable = true;\n\t }\n\t\n\t previousWasVowel = true;\n\t } else if (haveLookahead) {\n\t\n\t if (c === 'q' && lookahead === 'u' || lookahead === 'h' && (c === 'c' || c === 'p' || c === 't')) {\n\t // handle wheelock's exceptions for qu, ch, ph and th\n\t makeSyllable(i - startSyllable);\n\t i++; // skip over the 'h' or 'u'\n\t } else if (previousWasVowel && this.isVowel(lookahead)) {\n\t // handle division rule 2\n\t makeSyllable(i - startSyllable);\n\t } else if (this.isMuteConsonantOrF(c) && this.isLiquidConsonant(lookahead)) {\n\t // handle exception 2\n\t makeSyllable(i - startSyllable);\n\t } else if (haveCompleteSyllable) {\n\t // handle division rule 3\n\t makeSyllable(i + 1 - startSyllable);\n\t }\n\t\n\t previousWasVowel = false;\n\t }\n\t }\n\t\n\t // if we have a complete syllable, we can add it as a new one. Otherwise\n\t // we tack the remaining characters onto the last syllable.\n\t if (haveCompleteSyllable) syllables.push(word.substr(startSyllable));else if (startSyllable > 0) syllables[syllables.length - 1] += word.substr(startSyllable);\n\t\n\t return syllables;\n\t }\n\t\n\t /**\n\t * @param {String} s the string to search\n\t * @param {Number} startIndex The index at which to start searching for a vowel in the string\n\t * @retuns a custom class with three properties: {found: (true/false) startIndex: (start index in s of vowel segment) length ()}\n\t */\n\t\n\t }, {\n\t key: 'findVowelSegment',\n\t value: function findVowelSegment(s, startIndex) {\n\t\n\t var i, end, index;\n\t var workingString = s.toLowerCase();\n\t\n\t // do we have a diphthong?\n\t for (i = 0, end = this.possibleDiphthongs.length; i < end; i++) {\n\t var d = this.possibleDiphthongs[i];\n\t index = workingString.indexOf(d, startIndex);\n\t\n\t if (index >= 0) return { found: true, startIndex: index, length: d.length };\n\t }\n\t\n\t // no diphthongs. Let's look for single vowels then...\n\t for (i = 0, end = this.vowels.length; i < end; i++) {\n\t index = workingString.indexOf(this.vowels[i], startIndex);\n\t\n\t if (index >= 0) {\n\t // if the first vowel found might also be a consonant (U or I), and it is immediately followed by another vowel, (e.g., sanguis, quis), the first u counts as a consonant:\n\t // (in practice, this only affects words such as equus that contain a uu, since the alphabetically earlier vowel would be found before the U)\n\t if (this.isVowelActingAsConsonant(workingString.substr(index, 2))) {\n\t ++index;\n\t }\n\t return { found: true, startIndex: index, length: 1 };\n\t }\n\t }\n\t\n\t // no vowels sets found after startIndex!\n\t return { found: false, startIndex: -1, length: -1 };\n\t }\n\t }]);\n\t\n\t return Latin;\n\t}(Language);\n\t\n\t/**\n\t * @class\n\t */\n\t\n\t\n\tvar Spanish = exports.Spanish = function (_Language2) {\n\t _inherits(Spanish, _Language2);\n\t\n\t function Spanish() {\n\t _classCallCheck(this, Spanish);\n\t\n\t var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(Spanish).call(this, \"Spanish\"));\n\t\n\t _this2.vowels = ['a', 'e', 'i', 'o', 'u', 'y', 'á', 'é', 'í', 'ó', 'ú', 'ü'];\n\t\n\t _this2.weakVowels = ['i', 'u', 'ü', 'y'];\n\t\n\t _this2.strongVowels = ['a', 'e', 'o', 'á', 'é', 'í', 'ó', 'ú'];\n\t\n\t _this2.diphthongs = [\"ai\", \"ei\", \"oi\", \"ui\", \"ia\", \"ie\", \"io\", \"iu\", \"au\", \"eu\", \"ou\", \"ua\", \"ue\", \"uo\", \"ái\", \"éi\", \"ói\", \"úi\", \"iá\", \"ié\", \"ió\", \"iú\", \"áu\", \"éu\", \"óu\", \"uá\", \"ué\", \"uó\", \"üe\", \"üi\"];\n\t\n\t _this2.uDiphthongExceptions = [\"gue\", \"gui\", \"qua\", \"que\", \"qui\", \"quo\"];\n\t return _this2;\n\t }\n\t\n\t // c must be lowercase!\n\t\n\t\n\t _createClass(Spanish, [{\n\t key: 'isVowel',\n\t value: function isVowel(c) {\n\t for (var i = 0, end = this.vowels.length; i < end; i++) {\n\t if (this.vowels[i] === c) return true;\n\t }return false;\n\t }\n\t\n\t /**\n\t * @param {String} c The character to test; must be lowercase\n\t * @return {boolean} true if c is an f or a mute consonant\n\t */\n\t\n\t }, {\n\t key: 'isWeakVowel',\n\t value: function isWeakVowel(c) {\n\t for (var i = 0, end = this.weakVowels.length; i < end; i++) {\n\t if (this.weakVowels[i] === c) return true;\n\t }return false;\n\t }\n\t\n\t /**\n\t * @param {String} c The character to test; must be lowercase\n\t * @return {boolean} true if c is an f or a mute consonant\n\t */\n\t\n\t }, {\n\t key: 'isStrongVowel',\n\t value: function isStrongVowel(c) {\n\t for (var i = 0, end = this.strongVowels.length; i < end; i++) {\n\t if (this.strongVowels[i] === c) return true;\n\t }return false;\n\t }\n\t\n\t /**\n\t *\n\t * @param {String} s The string to test; must be lowercase\n\t * @return {boolean} true if s is a diphthong\n\t */\n\t\n\t }, {\n\t key: 'isDiphthong',\n\t value: function isDiphthong(s) {\n\t for (var i = 0, end = this.diphthongs.length; i < end; i++) {\n\t if (this.diphthongs[i] === s) return true;\n\t }return false;\n\t }\n\t }, {\n\t key: 'createSyllable',\n\t value: function createSyllable(text) {\n\t\n\t /*\n\t var accented = false;\n\t var ellidesToNext = false;\n\t \n\t if (text.length > 0) {\n\t \n\t if (text[0] == '`') {\n\t accented = true;\n\t text = text.substr(1);\n\t }\n\t \n\t if (text[text.length - 1] == '_') {\n\t ellidesToNext = true;\n\t text = text.substr(0, text.length - 1);\n\t }\n\t }\n\t \n\t var s = new Syllable(text);\n\t \n\t s.isMusicalAccent = accented;\n\t s.elidesToNext = ellidesToNext;*/\n\t\n\t return text;\n\t }\n\t\n\t /**\n\t */\n\t\n\t }, {\n\t key: 'syllabifyWord',\n\t value: function syllabifyWord(word) {\n\t\n\t var syllables = [];\n\t\n\t var haveCompleteSyllable = false;\n\t var previousIsVowel = false;\n\t var previousIsStrongVowel = false; // only valid if previousIsVowel == true\n\t var startSyllable = 0;\n\t\n\t // fixme: first check for prefixes\n\t\n\t for (i = 0; i < word.length; i++) {\n\t\n\t var c = word[i].toLowerCase();\n\t\n\t if (this.isVowel(c)) {\n\t\n\t // we have a complete syllable as soon as we have a vowel\n\t haveCompleteSyllable = true;\n\t\n\t var cIsStrongVowel = this.isStrongVowel(c);\n\t\n\t if (previousIsVowel) {\n\t // if we're at a strong vowel, then we finish out the last syllable\n\t if (cIsStrongVowel) {\n\t if (previousIsStrongVowel) {\n\t syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n\t startSyllable = i;\n\t }\n\t }\n\t }\n\t\n\t previousIsVowel = true;\n\t previousIsStrongVowel = cIsStrongVowel;\n\t } else {\n\t if (!haveCompleteSyllable) {\n\t // do nothing since we don't have a complete syllable yet...\n\t } else {\n\t\n\t // handle explicit syllable breaks\n\t if (word[i] === '-') {\n\t // start new syllable\n\t syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n\t startSyllable = ++i;\n\t } else {\n\t\n\t var numberOfConsonants = 1,\n\t consonant2;\n\t\n\t // count how many more consonants there are\n\t for (j = i + 1; j < word.length; j++) {\n\t if (this.isVowel(word[j])) break;\n\t numberOfConsonants++;\n\t }\n\t\n\t if (numberOfConsonants === 1) {\n\t // start new syllable\n\t syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n\t startSyllable = i;\n\t } else if (numberOfConsonants === 2) {\n\t consonant2 = word[i + 1].toLowerCase();\n\t if (consonant2 === 'l' || consonant2 === 'r' || c === 'c' && consonant2 === 'h') {\n\t // split before the consonant pair\n\t syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n\t startSyllable = i++;\n\t } else {\n\t //split the consonants\n\t syllables.push(this.createSyllable(word.substr(startSyllable, ++i - startSyllable)));\n\t startSyllable = i;\n\t }\n\t } else if (numberOfConsonants === 3) {\n\t consonant2 = word[i + 1].toLowerCase();\n\t\n\t // if second consonant is s, divide cc-c, otherwise divide c-cc\n\t if (consonant2 === 's') {\n\t i += 2;\n\t syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n\t } else syllables.push(this.createSyllable(word.substr(startSyllable, ++i - startSyllable)));\n\t\n\t startSyllable = i;\n\t } else if (numberOfConsonants === 4) {\n\t // four always get split cc-cc\n\t syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable + 2)));\n\t startSyllable = i + 2;\n\t i += 3;\n\t }\n\t }\n\t\n\t haveCompleteSyllable = false;\n\t }\n\t\n\t previousIsVowel = false;\n\t }\n\t }\n\t\n\t // if we have a complete syllable, we can add it as a new one. Otherwise\n\t // we tack the remaining characters onto the last syllable.\n\t if (haveCompleteSyllable) syllables.push(word.substr(startSyllable));else if (startSyllable > 0) syllables[syllables.length - 1] += word.substr(startSyllable);else if (syllables.length === 0) syllables.push(this.createSyllable(word));\n\t\n\t return syllables;\n\t }\n\t\n\t /**\n\t * @param {String} s the string to search\n\t * @param {Number} startIndex The index at which to start searching for a vowel in the string\n\t * @retuns a custom class with three properties: {found: (true/false) startIndex: (start index in s of vowel segment) length ()}\n\t */\n\t\n\t }, {\n\t key: 'findVowelSegment',\n\t value: function findVowelSegment(s, startIndex) {\n\t\n\t var i, end, index;\n\t var workingString = s.toLowerCase();\n\t\n\t // do we have a diphthongs?\n\t for (i = 0, end = this.diphthongs.length; i < end; i++) {\n\t var d = this.diphthongs[i];\n\t index = workingString.indexOf(d, startIndex);\n\t\n\t if (index >= 0) {\n\t\n\t // check the exceptions...\n\t if (d[0] === 'u' && index > 0) {\n\t var tripthong = s.substr(index - 1, 3).toLowerCase();\n\t\n\t for (j = 0, endj = this.uDiphthongExceptions.length; i < endj; j++) {\n\t if (tripthong === this.uDiphthongExceptions[j]) {\n\t // search from after the u...\n\t return this.findVowelSegment(s, index + 1);\n\t }\n\t }\n\t }\n\t\n\t return { found: true, startIndex: index, length: d.length };\n\t }\n\t }\n\t\n\t // no diphthongs. Let's look for single vowels then...\n\t for (i = 0, end = this.vowels.length; i < end; i++) {\n\t index = workingString.indexOf(this.vowels[i], startIndex);\n\t\n\t if (index >= 0) return { found: true, startIndex: index, length: 1 };\n\t }\n\t\n\t // no vowels sets found after startIndex!\n\t return { found: false, startIndex: -1, length: -1 };\n\t }\n\t }]);\n\t\n\t return Spanish;\n\t}(Language);\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t//\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\t// generated based on the svg data\n\tvar Glyphs = exports.Glyphs = {\n\t \"None\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 0,\n\t \"height\": 0\n\t },\n\t \"origin\": {\n\t \"x\": 0,\n\t \"y\": 0\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"AcuteAccent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M4 0C-.614.52-.614.52-.803-3.182l60.768-108.422c4.52-7.182 10.543-13.67 18.075-13.67 5.27 0 14.31 1.264 23.346 7.793 7.53 5.223 8.803 11.752 8.803 16.975 0 3.917-.52 11.1-8.05 17.628L4 0z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 110.99200439453125,\n\t \"height\": 125.79399108886719\n\t },\n\t \"origin\": {\n\t \"x\": 0.8030000329017639,\n\t \"y\": 125.27399444580078\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Stropha\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M1.22-73.438c4.165 13.02 12.238 27.084 24.217 42.188L49.657 0 34.812 27.344C18.666 55.47-.084 72.396-21.438 78.124c4.687-3.645 7.03-8.593 7.03-14.843 0-8.853-4.947-20.572-14.843-35.155L-48 0 1.22-73.438z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 97.65699768066406,\n\t \"height\": 151.56201171875\n\t },\n\t \"origin\": {\n\t \"x\": 48,\n\t \"y\": 73.43800354003906\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"BeginningAscLiquescent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-50 43.688V-61c4.167 7.292 12.76 10.938 25.78 10.938 9.376 0 20.053-1.563 32.032-4.688C31.773-60.48 45.833-71.677 50-88.344v117.97C43.75 42.645 32.812 51.5 17.187 56.186-.52 61.398-15.886 64-28.906 64-42.97 64-50 57.23-50 43.687z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 152.343994140625\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 88.34400177001953\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"BeginningDesLiquescent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-50-56.03c0-13.022 7.03-19.532 21.094-19.532 13.02 0 28.385 2.604 46.093 7.812C32.813-63.583 43.75-54.73 50-41.187V76C45.833 59.854 31.77 48.656 7.812 42.406c-11.98-3.125-22.656-4.687-32.03-4.687-13.022 0-21.615 3.905-25.782 11.718v-105.47z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 151.56199645996094\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 75.56199645996094\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"CustosDescLong\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M39.063 273.472c5.73.52 7.29-6.25 4.687-20.312V-65.59c-13.542 2.083-24.22 5.468-32.03 10.156C3.905-50.226 0-43.714 0-35.904V71.91c5.73-5.21 10.677-8.594 14.844-10.157 5.73-1.562 12.24-2.343 19.53-2.343v196.875c0 11.458 1.563 17.187 4.688 17.187\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 46.35300064086914,\n\t \"height\": 339.58197021484375\n\t },\n\t \"origin\": {\n\t \"x\": 0,\n\t \"y\": 65.58999633789062\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"CustosDescShort\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M34.375 191.923c0 8.333 1.563 12.24 4.688 11.72 3.125-.522 4.687-7.033 4.687-19.533v-250c-13.542 2.084-24.22 5.47-32.03 10.157C3.905-50.525 0-44.015 0-36.203V71.61c5.73-5.208 10.677-8.593 14.844-10.156 5.73-1.562 12.24-2.344 19.53-2.344v132.813z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 43.75,\n\t \"height\": 270.0530090332031\n\t },\n\t \"origin\": {\n\t \"x\": 0,\n\t \"y\": 65.88999938964844\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"CustosLong\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M39.063-269.562c5.73-.52 7.29 6.25 4.687 20.312V69.5c-13.542-2.083-24.22-5.47-32.03-10.156C3.905 54.134 0 47.624 0 39.812V-68c5.73 5.208 10.677 8.594 14.844 10.156 5.73 1.563 12.24 2.344 19.53 2.344v-196.875c0-11.458 1.563-17.187 4.688-17.187z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 46.35300064086914,\n\t \"height\": 339.5820007324219\n\t },\n\t \"origin\": {\n\t \"x\": 0,\n\t \"y\": 270.0820007324219\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"CustosShort\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M34.375-188.125c0-8.333 1.563-12.24 4.688-11.72 3.125.522 4.687 7.033 4.687 19.532v250c-13.542-2.083-24.22-5.468-32.03-10.156C3.905 54.324 0 47.813 0 40V-67.813c5.73 5.21 10.677 8.594 14.844 10.157 5.73 1.562 12.24 2.344 19.53 2.343v-132.812z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 43.75,\n\t \"height\": 270.052001953125\n\t },\n\t \"origin\": {\n\t \"x\": 0,\n\t \"y\": 200.36500549316406\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"DoClef\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M0 98.406V-97.688C0-118 5.99-134.275 17.97-146.516c11.978-12.24 27.603-18.36 46.874-18.36 10.937 0 19.53 3.126 25.78 9.376s9.376 14.583 9.376 25v107.813l-6.25-5.47c-4.167-3.645-10.287-7.42-18.36-11.327-8.072-3.907-16.796-5.86-26.17-5.86-11.46 0-21.486 4.427-30.08 13.282-8.593 8.854-12.89 19.53-12.89 32.03s4.297 23.308 12.89 32.423c8.594 9.115 18.62 13.672 30.08 13.672 9.374 0 18.098-1.822 26.17-5.468 8.073-3.646 14.193-7.292 18.36-10.938l6.25-6.25V132c0 9.896-3.125 18.1-9.375 24.61-6.25 6.51-14.844 9.765-25.78 9.765-19.272 0-34.897-6.25-46.876-18.75C5.99 135.125 0 118.72 0 98.405z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 331.2510070800781\n\t },\n\t \"origin\": {\n\t \"x\": 0,\n\t \"y\": 164.87600708007812\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"FaClef\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M85.156-32v193.75c0 9.375-1.562 14.323-4.687 14.844-1.564 0-2.605-.52-3.126-1.563-.52-1.04-.782-2.603-.78-4.686V56.28c-8.335-8.332-19.793-12.5-34.376-12.5-17.71 0-31.77 3.907-42.188 11.72V-32c0-18.23 14.193-27.344 42.578-27.344 28.385 0 42.578 9.115 42.578 27.344zM98.438 93V-92.156c0-19.27 5.73-34.896 17.187-46.875 11.458-11.98 26.562-17.97 45.313-17.97 10.937 0 19.14 2.865 24.61 8.594 5.467 5.73 8.202 13.542 8.202 23.437v103.126l-5.47-4.687c-3.645-3.647-9.374-7.293-17.186-10.94-7.813-3.645-15.886-5.467-24.22-5.468-11.978 0-22.004 4.167-30.077 12.5-8.073 8.334-12.11 18.36-12.11 30.08 0 11.717 4.037 22.004 12.11 30.858s18.1 13.28 30.078 13.28c8.333 0 16.406-1.822 24.22-5.468 7.81-3.645 13.54-7.03 17.186-10.156l5.47-5.468V125.81c0 9.896-2.865 17.84-8.594 23.83-5.73 5.988-13.802 8.983-24.22 8.983-18.75 0-33.853-6.12-45.31-18.36-11.46-12.24-17.19-27.994-17.19-47.265z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 193.75201416015625,\n\t \"height\": 333.5950012207031\n\t },\n\t \"origin\": {\n\t \"x\": 0.001003265380859375,\n\t \"y\": 157.00100708007812\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Flat\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M7.813-204.406c4.166 0 6.25 5.208 6.25 15.625L12.5-10.657C33.854 13.302 54.167 25.28 73.438 25.28c9.374 0 14.062-4.686 14.062-14.06 0-6.25-1.042-11.72-3.125-16.407-2.083-4.688-7.03-9.766-14.844-15.235-7.81-5.47-13.02-8.984-15.624-10.547L27.344-45.81V-80.97c17.187 0 33.073 4.82 47.656 14.454C89.583-56.88 96.875-47.376 96.875-38c0 67.708-.26 101.562-.78 101.563-38.543 0-69.532-12.24-92.97-36.72C0-52.322-1.042-123.936 0-188c0-10.937 2.604-16.406 7.813-16.406z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 97.91699981689453,\n\t \"height\": 267.968994140625\n\t },\n\t \"origin\": {\n\t \"x\": 1.0420000553131104,\n\t \"y\": 204.406005859375\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Mora\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M47.478-24c6.957 0 12.793 2.288 17.49 6.883C69.662-12.52 72-6.904 72-.267c0 6.64-2.337 12.352-7.033 17.118C60.27 21.618 54.435 24 47.477 24c-6.26 0-11.748-2.383-16.444-7.15C26.337 12.086 24 6.374 24-.265c0-6.638 2.337-12.255 7.033-16.85C35.73-21.713 41.217-24 47.478-24z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 48,\n\t \"height\": 48\n\t },\n\t \"origin\": {\n\t \"x\": -24,\n\t \"y\": 24\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Natural\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M7.906-166.563c-2.864 0-5.614.52-8.218 1.563v13.28l.78 56.25.782 78.907v85.157c.52 3.646 2.604 5.73 6.25 6.25l23.438-3.906 23.437-3.907v29.69c0 42.186-.26 63.54-.78 64.06l6.25 2.345c1.04.52 2.082.78 3.124.78 2.603 0 4.947-1.3 7.03-3.905L67.656-71.25c-.52-2.604-2.083-3.906-4.687-3.906-7.814 0-17.19 1.04-28.126 3.125l-19.53 3.124.78-38.28V-165c-2.604-1.042-5.323-1.562-8.188-1.563zM55.938-40v71.875l-41.407 7.03c0-48.436.262-72.655.783-72.655L55.938-40z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 70.31100463867188,\n\t \"height\": 330.468994140625\n\t },\n\t \"origin\": {\n\t \"x\": 0.3120002746582031,\n\t \"y\": 166.56300354003906\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"OriscusAsc\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M50 30.25c0 12.5-3.125 21.354-9.375 26.562-3.125 2.605-7.813 3.907-14.063 3.907-3.125 0-5.99-.522-8.593-1.564-2.605-1.04-5.6-2.474-8.986-4.297C5.6 53.035 2.734 51.603.39 50.56c-2.343-1.04-5.338-2.474-8.984-4.296-3.646-1.823-6.77-3.256-9.375-4.297-2.603-1.043-5.468-1.564-8.593-1.564-6.25 0-10.937 1.563-14.062 4.688C-46.875 50.824-50 59.677-50 71.656v-106.25c0-13.02 3.125-21.875 9.375-26.562 3.125-2.604 7.813-3.906 14.063-3.907 3.125 0 5.99.52 8.593 1.563 2.605 1.042 5.73 2.474 9.376 4.297 3.646 1.823 6.51 2.995 8.594 3.516l10.938 5.468c6.25 3.126 11.458 4.69 15.624 4.69 6.25 0 10.938-1.564 14.063-4.69C46.875-55.426 50-64.02 50-76V30.25z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 147.656005859375\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 76\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"OriscusDes\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-50 30.844v-106.25c0 11.458 3.125 20.052 9.375 25.78 3.125 3.126 7.813 4.69 14.063 4.688 4.687 0 13.41-3.255 26.17-9.765 12.762-6.51 21.746-9.766 26.954-9.766 6.25 0 10.938 1.303 14.063 3.907C46.875-55.874 50-47.02 50-34V72.25c0-11.98-3.125-20.833-9.375-26.563C37.5 42.563 32.812 41 26.562 41 21.875 41 13.023 44.385 0 51.156c-4.167 2.604-8.594 4.948-13.28 7.032-4.69 2.083-9.116 3.124-13.283 3.124-6.25 0-10.937-1.302-14.062-3.906C-46.875 52.198-50 43.344-50 30.844z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 147.656005859375\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 75.40599822998047\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"OriscusLiquescent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M 19.05539,78.886528 C 20.242277,78.486807 21.532179,77.890297 22.925106,77.09701 24.317891,76.303653 26.700882,74.417241 30.074091,71.437777 33.447144,68.45824 36.523539,64.985185 39.303286,61.018598 42.082855,57.051975 44.562739,51.395765 46.742952,44.049969 48.922975,36.704172 50.01304,28.671032 50.013135,19.950525 L 50.013135,-34.225545 C 50.01304,-54.464261 42.07377,-64.583661 26.195289,-64.583768 20.248326,-64.583661 11.518758,-61.410372 0.00656131,-55.06389 -11.505742,-48.717218 -20.23531,-45.543929 -26.182179,-45.544024 -34.515109,-45.543929 -40.567968,-48.520405 -44.340791,-54.473441 -48.113613,-60.426286 -50.000025,-67.369373 -50.000025,-75.302702 L -50.000025,30.069925 C -50.000025,49.909039 -42.060754,59.828603 -26.182179,59.828615 -21.022584,59.828603 -12.38991,56.455465 -0.28412107,49.709203 11.821549,42.96294 20.648023,39.589803 26.195289,39.589803 29.368506,40.776762 30.361665,44.249817 29.17479,50.00897 27.987759,55.768122 26.00143,62.020829 23.215789,68.767116 z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 147.656005859375\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 75.40599822998047\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"PodatusLower\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-4.688-30.28c22.396 0 34.636-.262 36.72-.782 5.728-1.563 8.593-5.21 8.593-10.938H50v97.656c0 2.604-1.302 4.167-3.906 4.688-5.21.52-21.355.78-48.438.78-23.958 0-38.54-.26-43.75-.78-2.604 0-3.906-1.302-3.906-3.906v-82.032c0-3.646 1.302-5.468 3.906-5.468h2.344c2.604.52 15.625.78 39.063.78z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 103.12399291992188\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 42\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"PodatusUpper\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-46.094-63.78c13.542 0 24.61 2.473 33.203 7.42C-4.298-51.41 0-43.99 0-34.093V62h-9.375c0-10.938-2.604-19.14-7.812-24.61-5.21-5.468-14.844-8.203-28.907-8.202-18.23 0-33.333 4.166-45.312 12.5v-75.782c0-19.79 15.104-29.687 45.312-29.687z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 91.406005859375,\n\t \"height\": 125.78099822998047\n\t },\n\t \"origin\": {\n\t \"x\": 91.406005859375,\n\t \"y\": 63.78099822998047\n\t },\n\t \"align\": \"right\"\n\t },\n\t \"Porrectus1\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M233.594 162.875c-58.855 0-107.032-6.25-144.53-18.75C34.895 125.895-11.46 99.855-50 66V-52.75C-21.354-24.625 26.302 6.885 92.97 41.78 123.697 57.928 163.54 66 212.5 66c21.354 0 34.635-9.896 39.844-29.688V151.94c0 7.29-6.25 10.937-18.75 10.937z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 302.343994140625,\n\t \"height\": 215.6269989013672\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 52.75\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Porrectus2\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M309.375 259.375c-50.52 0-110.938-22.396-181.25-67.188C48.437 141.667-10.938 94.272-50 50V-68.75C0-3.125 60.417 52.083 131.25 96.875c58.333 36.98 110.677 58.854 157.03 65.625h7.033c16.145 0 26.822-9.896 32.03-29.688v114.844c0 7.812-5.99 11.72-17.968 11.72z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 377.3429870605469,\n\t \"height\": 328.1260070800781\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 68.75\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Porrectus3\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M309.375 355.78c-48.96-16.666-109.115-55.468-180.47-116.405C79.428 198.23 19.793 134.687-50 48.75V-70C20 40 94.104 103.79 135.25 148.063 190 200 230 230 288.28 258.906c4.168 2.083 8.334 3.125 12.5 3.125 12.5 0 21.355-10.937 26.564-32.81v114.06c0 9.376-3.386 14.063-10.156 14.064-2.084 0-4.688-.522-7.813-1.563z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 377.343994140625,\n\t \"height\": 427.3450012207031\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 70\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Porrectus4\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M350 453.438c-52.754-22.397-120-77.345-201.74-164.844C90.87 227.656 24.784 147.708-50 48.75V-70C-8.84-1.25 58.406 86.51 151.74 193.28c60.868 69.793 119.13 124.22 174.782 163.282 5.797 3.646 11.014 5.47 15.652 5.47 12.173 0 21.45-11.72 27.826-35.157V441.72c0 9.373-3.19 14.06-9.565 14.06-2.9 0-6.377-.78-10.435-2.342z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 420,\n\t \"height\": 525.780029296875\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 70\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"PunctumCavum\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M0-60.906c33.333 0 50 9.635 50 28.906v94.53C39.062 51.595 22.396 46.126 0 46.126s-39.063 5.47-50 16.406V-32c0-19.27 16.667-28.906 50-28.906z\"\n\t }, {\n\t \"type\": \"negative\",\n\t \"data\": \"M.08-42.56c9.585.206 20.126.53 27.954 6.822 4.96 3.9 4.71 10.792 4.574 16.482v51.278C22.09 27.066 7.283 26.072.168 26.01c-7.72.23-21.895.935-32.616 4.674.04-19.197-.083-38.395.064-57.59.567-7.5 7.834-12.33 14.62-13.774 5.818-1.498 11.857-1.86 17.844-1.88z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 123.43799591064453\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 60.90599822998047\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"PunctumQuadratum\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M0-60.906c33.333 0 50 9.635 50 28.906v94.53C39.062 51.595 22.396 46.126 0 46.126s-39.063 5.47-50 16.406V-32c0-19.27 16.667-28.906 50-28.906z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 123.43799591064453\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 60.90599822998047\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"PunctumQuadratumAscLiquescent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-50 43.688V-61c4.167 7.292 12.76 10.938 25.78 10.938 9.376 0 20.053-1.563 32.032-4.688C31.773-60.48 45.833-71.677 50-88.344v117.97C43.75 42.645 32.812 51.5 17.187 56.186-.52 61.398-15.886 64-28.906 64-42.97 64-50 57.23-50 43.687z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 152.343994140625\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 88.34400177001953\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"PunctumQuadratumDesLiquescent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-50-56.03c0-13.022 7.03-19.532 21.094-19.532 13.02 0 28.385 2.604 46.093 7.812C32.813-63.583 43.75-54.73 50-41.187V76C45.833 59.854 31.77 48.656 7.812 42.406c-11.98-3.125-22.656-4.687-32.03-4.687-13.022 0-21.615 3.905-25.782 11.718v-105.47z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 151.56199645996094\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 75.56199645996094\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"PunctumInclinatum\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M0-75.78L50 0 0 75-50 0 0-75.78z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 150.77999877929688\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 75.77999877929688\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"PunctumInclinatumLiquescent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M 0,-53.164062 35,-0.1171875 0,52.382812 -35,-0.1171875 0,-53.164062 z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 70,\n\t \"height\": 105.546\n\t },\n\t \"origin\": {\n\t \"x\": 35,\n\t \"y\": 53.164062\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Quilisma\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-50 34.938V-51c5.73 20.833 13.02 31.25 21.875 31.25 7.813 0 12.5-15.625 14.063-46.875 3.645 12.5 6.9 21.224 9.765 26.172s6.9 7.422 12.11 7.422c5.208 0 9.374-14.324 12.5-42.97 5.73 22.917 10.677 34.375 14.843 34.375 5.73 0 10.677-15.885 14.844-47.656v100c0 17.707-3.125 26.56-9.375 26.56-4.688 0-9.115-5.988-13.28-17.968-2.085 21.875-8.074 32.813-17.97 32.813-7.813 0-16.146-7.292-25-21.875-4.688 20.312-10.677 30.47-17.97 30.47-5.207 0-9.244-2.605-12.108-7.814C-48.568 47.698-50 41.708-50 34.938z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 150\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 89.28199768066406\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"TerminatingAscLiquescent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-9.375 40.22c0-11.98-4.948-17.97-14.844-17.97-10.936 0-19.53 3.646-25.78 10.938v-53.126c0-6.77 2.604-12.76 7.813-17.968 5.208-5.21 10.677-8.594 16.406-10.157 2.603-.52 5.207-.78 7.81-.78 3.647 0 7.032.78 10.157 2.343C-2.603-43.896 0-39.73 0-34V73.03h-9.375V40.22z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 49.999000549316406,\n\t \"height\": 121.87299346923828\n\t },\n\t \"origin\": {\n\t \"x\": 49.999000549316406,\n\t \"y\": 48.842994689941406\n\t },\n\t \"align\": \"right\"\n\t },\n\t \"TerminatingDesLiquescent\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-9.375-48.156V-80.97H0V26.845c0 5.73-2.604 9.896-7.813 12.5-3.125 1.562-6.51 2.343-10.156 2.343-2.603 0-5.207-.26-7.81-.78-5.73-1.563-11.2-4.95-16.407-10.157C-47.398 25.542-50 19.292-50 12v-52.344c6.25 7.292 14.844 10.938 25.78 10.938 9.897 0 14.845-6.25 14.845-18.75z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 50,\n\t \"height\": 122.65800476074219\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 80.97000122070312\n\t },\n\t \"align\": \"right\"\n\t },\n\t \"VerticalEpisemaAbove\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-8-80H8L4 0h-8l-4-80z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 16,\n\t \"height\": 80\n\t },\n\t \"origin\": {\n\t \"x\": 8,\n\t \"y\": 80\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"VerticalEpisemaBelow\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M-8 80H8L4 0h-8l-4 80z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 16,\n\t \"height\": 80\n\t },\n\t \"origin\": {\n\t \"x\": 8,\n\t \"y\": 0\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"VirgaLong\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M50-38v285.156c0 6.77-2.344 10.937-7.03 12.5-1.564 0-2.605-.78-3.126-2.344-.52-1.562-.782-10.156-.782-25.78V54.186C29.168 45.334 16.146 40.907 0 40.907c-22.917 0-39.583 5.208-50 15.624V-38c0-19.27 16.667-28.906 50-28.906S50-57.27 50-38z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 326.56201171875\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 66.90599822998047\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"VirgaShort\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M50-38v211.72c0 7.29-2.344 11.457-7.03 12.5-1.564 0-2.606-.783-3.126-2.345-.52-1.563-.782-10.156-.782-25.78V54.187C29.167 45.332 16.146 40.906 0 40.906c-22.917 0-39.583 5.21-50 15.625V-38c0-19.27 16.667-28.906 50-28.906S50-57.27 50-38z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 100,\n\t \"height\": 253.12600708007812\n\t },\n\t \"origin\": {\n\t \"x\": 50,\n\t \"y\": 66.90599822998047\n\t },\n\t \"align\": \"left\"\n\t },\n\t \"Virgula\": {\n\t \"svgSrc\": \"\",\n\t \"paths\": [{\n\t \"type\": \"positive\",\n\t \"data\": \"M8.178-55.66c0-22.137 12.092-33.2 36.287-33.2 11.835 0 23.53 5.66 35.108 16.98C91.15-60.547 96.94-41.766 96.94-15.534c0 53.515-31.646 87.487-94.937 101.895-2.048-2.06-3.077-5.146-3.077-9.273 0-1.03.247-1.8.76-2.316 42.71-19.027 64.075-41.678 64.075-67.92 0-11.322-2.325-20.326-6.945-27.016-4.62-6.69-9.52-11.052-14.676-13.11-5.147-2.048-11.836-3.85-20.07-5.403C12.81-39.707 8.18-45.37 8.18-55.66z\"\n\t }],\n\t \"bounds\": {\n\t \"x\": 0,\n\t \"y\": 0,\n\t \"width\": 98.01399993896484,\n\t \"height\": 175.2209930419922\n\t },\n\t \"origin\": {\n\t \"x\": 1.0739939212799072,\n\t \"y\": 88.86000061035156\n\t },\n\t \"align\": \"left\"\n\t }\n\t};\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.ChantNotationElement = exports.Annotation = exports.DropCap = exports.Lyric = exports.LyricType = exports.TextElement = exports.CurlyBraceVisualizer = exports.RoundBraceVisualizer = exports.GlyphVisualizer = exports.VirgaLineVisualizer = exports.NeumeLineVisualizer = exports.DividerLineVisualizer = exports.ChantLayoutElement = exports.ChantContext = exports.TextMeasuringStrategy = exports.QuickSvg = exports.GlyphCode = undefined;\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); //\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tvar _Exsurge2 = __webpack_require__(3);\n\t\n\tvar _Exsurge3 = __webpack_require__(2);\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// load in the web font for special chant characters here:\n\tvar __exsurgeCharactersFont = __webpack_require__(5);\n\t\n\tvar GlyphCode = exports.GlyphCode = {\n\t\n\t None: \"None\",\n\t\n\t AcuteAccent: \"AcuteAccent\",\n\t Stropha: \"Stropha\",\n\t StrophaLiquescent: \"StrophaLiquescent\",\n\t\n\t BeginningAscLiquescent: \"BeginningAscLiquescent\",\n\t BeginningDesLiquescent: \"BeginningDesLiquescent\",\n\t\n\t CustosDescLong: \"CustosDescLong\",\n\t CustosDescShort: \"CustosDescShort\",\n\t CustosLong: \"CustosLong\",\n\t CustosShort: \"CustosShort\",\n\t\n\t // clefs and other markings\n\t DoClef: \"DoClef\",\n\t FaClef: \"FaClef\",\n\t Flat: \"Flat\",\n\t Mora: \"Mora\",\n\t Natural: \"Natural\",\n\t OriscusAsc: \"OriscusAsc\",\n\t OriscusDes: \"OriscusDes\",\n\t OriscusLiquescent: \"OriscusLiquescent\",\n\t\n\t PodatusLower: \"PodatusLower\",\n\t PodatusUpper: \"PodatusUpper\",\n\t\n\t Porrectus1: \"Porrectus1\", // 1 staff line difference,\n\t Porrectus2: \"Porrectus2\", // 2 lines difference, etc...\n\t Porrectus3: \"Porrectus3\",\n\t Porrectus4: \"Porrectus4\",\n\t\n\t PunctumCavum: \"PunctumCavum\",\n\t PunctumQuadratum: \"PunctumQuadratum\",\n\t PunctumQuadratumAscLiquescent: \"PunctumQuadratumAscLiquescent\",\n\t PunctumQuadratumDesLiquescent: \"PunctumQuadratumDesLiquescent\",\n\t PunctumInclinatum: \"PunctumInclinatum\",\n\t PunctumInclinatumLiquescent: \"PunctumInclinatumLiquescent\",\n\t Quilisma: \"Quilisma\",\n\t\n\t TerminatingAscLiquescent: \"TerminatingAscLiquescent\",\n\t TerminatingDesLiquescent: \"TerminatingDesLiquescent\",\n\t VerticalEpisemaAbove: \"VerticalEpisemaAbove\",\n\t VerticalEpisemaBelow: \"VerticalEpisemaBelow\",\n\t VirgaLong: \"VirgaLong\",\n\t VirgaShort: \"VirgaShort\",\n\t Virgula: \"Virgula\",\n\t\n\t UpperBrace: \"UpperBrace\"\n\t}; // GlyphCode\n\t\n\tvar QuickSvg = exports.QuickSvg = {\n\t\n\t // namespaces \n\t ns: 'http://www.w3.org/2000/svg',\n\t xmlns: 'http://www.w3.org/2000/xmlns/',\n\t xlink: 'http://www.w3.org/1999/xlink',\n\t\n\t // create the root level svg object\n\t svg: function svg(width, height) {\n\t var node = document.createElementNS(this.ns, 'svg');\n\t\n\t node.setAttribute('xmlns', this.ns);\n\t node.setAttribute('version', '1.1');\n\t node.setAttributeNS(this.xmlns, 'xmlns:xlink', this.xlink);\n\t\n\t node.setAttribute('width', width);\n\t node.setAttribute('height', height);\n\t\n\t // create the defs element\n\t var defs = document.createElementNS(this.ns, 'defs');\n\t node.appendChild(defs);\n\t\n\t node.defs = defs;\n\t\n\t node.clearNotations = function () {\n\t // clear out all children except defs\n\t node.removeChild(defs);\n\t\n\t while (node.hasChildNodes()) {\n\t node.removeChild(node.lastChild);\n\t }node.appendChild(defs);\n\t };\n\t\n\t return node;\n\t },\n\t\n\t rect: function rect(width, height) {\n\t var node = document.createElementNS(this.ns, 'rect');\n\t\n\t node.setAttribute('width', width);\n\t node.setAttribute('height', height);\n\t\n\t return node;\n\t },\n\t\n\t line: function line(x1, y1, x2, y2) {\n\t var node = document.createElementNS(this.ns, 'line');\n\t\n\t node.setAttribute('x1', x1);\n\t node.setAttribute('y1', y1);\n\t node.setAttribute('x2', x2);\n\t node.setAttribute('y2', y2);\n\t\n\t return node;\n\t },\n\t\n\t g: function g() {\n\t var node = document.createElementNS(this.ns, 'g');\n\t\n\t return node;\n\t },\n\t\n\t text: function text() {\n\t var node = document.createElementNS(this.ns, 'text');\n\t\n\t return node;\n\t },\n\t\n\t tspan: function tspan(str) {\n\t var node = document.createElementNS(this.ns, 'tspan');\n\t node.textContent = str;\n\t\n\t return node;\n\t },\n\t\n\t // nodeRef should be the id of the object in defs (without the #)\n\t use: function use(nodeRef) {\n\t var node = document.createElementNS(this.ns, 'use');\n\t node.setAttributeNS(this.xlink, \"xlink:href\", '#' + nodeRef);\n\t\n\t return node;\n\t },\n\t\n\t createFragment: function createFragment(name, attributes, child) {\n\t if (child === undefined || child === null) child = '';\n\t\n\t var fragment = '<' + name + ' ';\n\t\n\t for (var attr in attributes) {\n\t if (attributes.hasOwnProperty(attr)) fragment += attr + '=\"' + attributes[attr] + '\" ';\n\t }\n\t\n\t fragment += '>' + child + '';\n\t\n\t return fragment;\n\t },\n\t\n\t parseFragment: function parseFragment(fragment) {\n\t\n\t // create temporary holder\n\t var well = document.createElement('svg');\n\t\n\t // act as a setter if svg is given\n\t if (fragment) {\n\t\n\t var container = this.g();\n\t\n\t // dump raw svg\n\t // do this to allow the browser to automatically create svg nodes?\n\t well.innerHTML = '' + fragment.replace(/\\n/, '').replace(/<(\\w+)([^<]+?)\\/>/g, '<$1$2>') + '';\n\t\n\t // transplant nodes\n\t for (var i = 0, il = well.firstChild.childNodes.length; i < il; i++) {\n\t container.appendChild(well.firstChild.firstChild);\n\t }return container;\n\t }\n\t },\n\t\n\t translate: function translate(node, x, y) {\n\t node.setAttribute('transform', 'translate(' + x + ',' + y + ')');\n\t return node;\n\t },\n\t\n\t scale: function scale(node, sx, sy) {\n\t node.setAttribute('transform', 'scale(' + sx + ',' + sy + ')');\n\t return node;\n\t }\n\t};\n\t\n\tvar TextMeasuringStrategy = exports.TextMeasuringStrategy = {\n\t // shapes\n\t Svg: 0,\n\t Canvas: 1\n\t};\n\t\n\t/*\n\t * ChantContext\n\t */\n\t\n\tvar ChantContext = exports.ChantContext = function () {\n\t function ChantContext() {\n\t var textMeasuringStrategy = arguments.length <= 0 || arguments[0] === undefined ? TextMeasuringStrategy.Svg : arguments[0];\n\t\n\t _classCallCheck(this, ChantContext);\n\t\n\t this.textMeasuringStrategy = textMeasuringStrategy;\n\t this.defs = {};\n\t\n\t // font styles\n\t this.lyricTextSize = 16; // in points?\n\t this.lyricTextFont = \"'Palatino Linotype', 'Book Antiqua', Palatino, serif\";\n\t this.lyricTextColor = \"#000\";\n\t\n\t this.dropCapTextSize = 64;\n\t this.dropCapTextFont = this.lyricTextFont;\n\t this.dropCapTextColor = this.lyricTextColor;\n\t\n\t this.annotationTextSize = 13;\n\t this.annotationTextFont = this.lyricTextFont;\n\t this.annotationTextColor = this.lyricTextColor;\n\t\n\t // everything depends on the scale of the punctum\n\t this.glyphPunctumWidth = _Exsurge2.Glyphs.PunctumQuadratum.bounds.width;\n\t this.glyphPunctumHeight = _Exsurge2.Glyphs.PunctumQuadratum.bounds.height;\n\t\n\t // fixme: for now, we just set these using the glyph scales as noted above, presuming a\n\t // staff line size of 0.5 in. Really what we should do is scale the punctum size based\n\t // on the text metrics, right? 1 punctum ~ x height size?\n\t this.glyphScaling = 1.0 / 16.0;\n\t\n\t this.staffInterval = this.glyphPunctumWidth * this.glyphScaling;\n\t\n\t // setup the line weights for the various elements.\n\t // we\n\t this.staffLineWeight = Math.round(this.glyphPunctumWidth * this.glyphScaling / 8);\n\t this.neumeLineWeight = this.staffLineWeight; // the weight of connecting lines in the glyphs.\n\t this.dividerLineWeight = this.neumeLineWeight; // of quarter bar, half bar, etc.\n\t this.episemaLineWeight = this.neumeLineWeight; // of horizontal episemae\n\t\n\t // for keeping track of the clef\n\t this.activeClef = null;\n\t\n\t this.neumeLineColor = \"#000\";\n\t this.staffLineColor = \"#000\";\n\t this.dividerLineColor = \"#000\";\n\t\n\t this.defaultLanguage = new _Exsurge3.Latin();\n\t\n\t this.canvas = document.createElement(\"canvas\");\n\t this.canvasCtxt = this.canvas.getContext(\"2d\");\n\t\n\t // calculate the pixel ratio for drawing to a canvas\n\t var dpr = window.devicePixelRatio || 1.0;\n\t var bsr = this.canvasCtxt.webkitBackingStorePixelRatio || this.canvasCtxt.mozBackingStorePixelRatio || this.canvasCtxt.msBackingStorePixelRatio || this.canvasCtxt.oBackingStorePixelRatio || this.canvasCtxt.backingStorePixelRatio || 1.0;\n\t\n\t this.pixelRatio = dpr / bsr;\n\t\n\t this.canvasCtxt.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\t\n\t if (textMeasuringStrategy === TextMeasuringStrategy.Svg) {\n\t this.svgTextMeasurer = QuickSvg.svg(1, 1);\n\t this.svgTextMeasurer.setAttribute('id', \"TextMeasurer\");\n\t document.querySelector('body').appendChild(this.svgTextMeasurer);\n\t }\n\t\n\t // measure the size of a hyphen for the lyrics\n\t var hyphen = new Lyric(this, \"-\", LyricType.SingleSyllable);\n\t this.hyphenWidth = hyphen.bounds.width;\n\t\n\t this.minLyricWordSpacing = this.hyphenWidth;\n\t\n\t this.intraNeumeSpacing = this.staffInterval / 2.0;\n\t\n\t // for connecting neume syllables...\n\t this.syllableConnector = '-';\n\t\n\t this.drawGuides = false;\n\t this.drawDebuggingBounds = true;\n\t\n\t // we keep track of where we are in processing notations, so that\n\t // we can maintain the context for notations to know about.\n\t //\n\t // these are only gauranteed to be valid during the performLayout phase!\n\t this.activeNotations = null;\n\t this.currNotationIndex = -1;\n\t\n\t // chant notation elements are normally separated by a minimum fixed amount of space\n\t // on the staff line. It can happen, however, that two text elements are almost close\n\t // enough to merge, only to be separated much more by the required hyphen (or other\n\t // connecting string).\n\t //\n\t // This tolerance value allows a little bit of flexibility to merge two close lyrical\n\t // elements, thus bringing the chant notation elements a bit closer than otherwise\n\t // would be normally allowed.\n\t //\n\t // condensing tolerance is a percentage value (0.0-1.0, inclusive) that indicates\n\t // how much the default spacing can shrink. E.g., a value of 0.80 allows the layout\n\t // engine to separate two glyphs by only 80% of the normal inter-neume spacing value.\n\t //\n\t // fixme: condensing tolerance is not implemented yet!\n\t this.condensingTolerance = 0.9;\n\t\n\t // if auto color is true, then exsurge tries to automatically colorize\n\t // some elements of the chant (directives become rubric color, etc.)\n\t this.autoColor = true;\n\t\n\t this.insertFontsInDoc();\n\t }\n\t\n\t _createClass(ChantContext, [{\n\t key: 'calculateHeightFromStaffPosition',\n\t value: function calculateHeightFromStaffPosition(staffPosition) {\n\t return -staffPosition * this.staffInterval;\n\t }\n\t }, {\n\t key: 'insertFontsInDoc',\n\t value: function insertFontsInDoc() {\n\t\n\t var styleElement = document.getElementById('exsurge-fonts');\n\t\n\t if (styleElement === null) {\n\t // create it since it doesn't exist yet.\n\t styleElement = document.createElement('style');\n\t styleElement.id = 'exsurge-fonts';\n\t\n\t styleElement.appendChild(document.createTextNode(\"@font-face{font-family: 'Exsurge Characters';font-weight: normal;font-style: normal;src: url(\" + __exsurgeCharactersFont + \") format('opentype');}\"));\n\t\n\t document.head.appendChild(styleElement);\n\t }\n\t }\n\t\n\t // returns the next neume starting at this.currNotationIndex, or null\n\t // if there isn't a neume after this one...\n\t\n\t }, {\n\t key: 'findNextNeume',\n\t value: function findNextNeume() {\n\t\n\t if (typeof this.currNotationIndex === 'undefined') throw \"findNextNeume() called without a valid currNotationIndex set\";\n\t\n\t for (var i = this.currNotationIndex + 1; i < this.notations.length; i++) {\n\t var notation = this.notations[i];\n\t\n\t if (notation.isNeume) return notation;\n\t }\n\t\n\t return null;\n\t }\n\t }, {\n\t key: 'setCanvasSize',\n\t value: function setCanvasSize(width, height) {\n\t this.canvas.width = width * this.pixelRatio;\n\t this.canvas.height = height * this.pixelRatio;\n\t this.canvas.style.width = width + \"px\";\n\t this.canvas.style.height = height + \"px\";\n\t\n\t this.canvasCtxt.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\t }\n\t }]);\n\t\n\t return ChantContext;\n\t}();\n\t\n\t/*\n\t * ChantLayoutElement\n\t */\n\t\n\t\n\tvar ChantLayoutElement = exports.ChantLayoutElement = function () {\n\t function ChantLayoutElement() {\n\t _classCallCheck(this, ChantLayoutElement);\n\t\n\t this.bounds = new _Exsurge.Rect();\n\t this.origin = new _Exsurge.Point(0, 0);\n\t\n\t this.selected = false;\n\t this.highlighted = false;\n\t }\n\t\n\t // draws the element on an html5 canvas\n\t\n\t\n\t _createClass(ChantLayoutElement, [{\n\t key: 'draw',\n\t value: function draw(ctxt) {}\n\t\n\t // returns svg code for the element, used for printing support\n\t\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t throw \"ChantLayout Elements must implement createSvgFragment(ctxt)\";\n\t }\n\t }]);\n\t\n\t return ChantLayoutElement;\n\t}();\n\t\n\tvar DividerLineVisualizer = exports.DividerLineVisualizer = function (_ChantLayoutElement) {\n\t _inherits(DividerLineVisualizer, _ChantLayoutElement);\n\t\n\t function DividerLineVisualizer(ctxt, staffPosition0, staffPosition1) {\n\t _classCallCheck(this, DividerLineVisualizer);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DividerLineVisualizer).call(this));\n\t\n\t var y0 = ctxt.calculateHeightFromStaffPosition(staffPosition0);\n\t var y1 = ctxt.calculateHeightFromStaffPosition(staffPosition1);\n\t\n\t if (y0 > y1) {\n\t var temp = y0;\n\t y0 = y1;\n\t y1 = temp;\n\t }\n\t\n\t _this.bounds.x = 0;\n\t _this.bounds.y = y0;\n\t _this.bounds.width = ctxt.dividerLineWeight;\n\t _this.bounds.height = y1 - y0;\n\t\n\t _this.origin.x = _this.bounds.width / 2;\n\t _this.origin.y = y0;\n\t return _this;\n\t }\n\t\n\t _createClass(DividerLineVisualizer, [{\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t\n\t canvasCtxt.lineWidth = this.bounds.width;\n\t canvasCtxt.strokeStyle = ctxt.dividerLineColor;\n\t\n\t canvasCtxt.beginPath();\n\t canvasCtxt.moveTo(this.bounds.x - this.origin.x, this.bounds.y);\n\t canvasCtxt.lineTo(this.bounds.x - this.origin.x, this.bounds.y + this.bounds.height);\n\t canvasCtxt.stroke();\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t\n\t return QuickSvg.createFragment('rect', {\n\t 'x': this.bounds.x,\n\t 'y': this.bounds.y,\n\t 'width': ctxt.dividerLineWeight,\n\t 'height': this.bounds.height,\n\t 'fill': ctxt.dividerLineColor,\n\t 'class': 'dividerLine'\n\t });\n\t }\n\t }]);\n\t\n\t return DividerLineVisualizer;\n\t}(ChantLayoutElement);\n\t\n\tvar NeumeLineVisualizer = exports.NeumeLineVisualizer = function (_ChantLayoutElement2) {\n\t _inherits(NeumeLineVisualizer, _ChantLayoutElement2);\n\t\n\t function NeumeLineVisualizer(ctxt, note0, note1, hanging) {\n\t _classCallCheck(this, NeumeLineVisualizer);\n\t\n\t var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(NeumeLineVisualizer).call(this));\n\t\n\t var staffPosition0 = note0.staffPosition;\n\t var staffPosition1 = note1.staffPosition;\n\t\n\t // note0 should be the upper one for our calculations here\n\t if (staffPosition0 < staffPosition1) {\n\t var temp = staffPosition0;\n\t staffPosition0 = staffPosition1;\n\t staffPosition1 = temp;\n\t }\n\t\n\t var y0 = ctxt.calculateHeightFromStaffPosition(staffPosition0);\n\t var y1 = 0;\n\t\n\t if (hanging) {\n\t\n\t // if the difference between the notes is only one, and the upper\n\t // note is on a line, and the lower note is within the four staff lines,\n\t // then our hanging line goes past the lower note by a whole\n\t // staff interval\n\t if (staffPosition0 - staffPosition1 === 1 && Math.abs(staffPosition0) % 2 === 1 && staffPosition1 > -3) staffPosition1--;\n\t\n\t y1 += ctxt.glyphPunctumHeight * ctxt.glyphScaling / 2.2;\n\t }\n\t\n\t y1 += ctxt.calculateHeightFromStaffPosition(staffPosition1);\n\t\n\t _this2.bounds.x = 0;\n\t _this2.bounds.y = y0;\n\t _this2.bounds.width = ctxt.neumeLineWeight;\n\t _this2.bounds.height = y1 - y0;\n\t\n\t _this2.origin.x = 0;\n\t _this2.origin.y = 0;\n\t return _this2;\n\t }\n\t\n\t _createClass(NeumeLineVisualizer, [{\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t\n\t canvasCtxt.lineWidth = this.bounds.width;\n\t canvasCtxt.strokeStyle = ctxt.neumeLineColor;\n\t\n\t canvasCtxt.beginPath();\n\t\n\t // since the canvas context draws strokes centered on the path\n\t // and neume lines are supposed to be draw left aligned,\n\t // we need to offset the line by half the line width.\n\t var x = this.bounds.x + this.bounds.width / 2;\n\t\n\t canvasCtxt.moveTo(x, this.bounds.y);\n\t canvasCtxt.lineTo(x, this.bounds.y + this.bounds.height);\n\t canvasCtxt.stroke();\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t\n\t return QuickSvg.createFragment('rect', {\n\t 'x': this.bounds.x,\n\t 'y': this.bounds.y,\n\t 'width': ctxt.neumeLineWeight,\n\t 'height': this.bounds.height,\n\t 'fill': ctxt.neumeLineColor,\n\t 'class': 'neumeLine'\n\t });\n\t }\n\t }]);\n\t\n\t return NeumeLineVisualizer;\n\t}(ChantLayoutElement);\n\t\n\tvar VirgaLineVisualizer = exports.VirgaLineVisualizer = function (_ChantLayoutElement3) {\n\t _inherits(VirgaLineVisualizer, _ChantLayoutElement3);\n\t\n\t function VirgaLineVisualizer(ctxt, note) {\n\t _classCallCheck(this, VirgaLineVisualizer);\n\t\n\t var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(VirgaLineVisualizer).call(this));\n\t\n\t var staffPosition = note.staffPosition;\n\t\n\t var y0 = ctxt.calculateHeightFromStaffPosition(staffPosition);\n\t var y1;\n\t\n\t if (Math.abs(staffPosition % 2) === 0) y1 = y0 + ctxt.staffInterval * 1.8;else y1 = y0 + ctxt.staffInterval * 2.7;\n\t\n\t _this3.bounds.x = 0;\n\t _this3.bounds.y = y0;\n\t _this3.bounds.width = ctxt.neumeLineWeight;\n\t _this3.bounds.height = y1 - y0;\n\t\n\t _this3.origin.x = 0;\n\t _this3.origin.y = 0;\n\t return _this3;\n\t }\n\t\n\t _createClass(VirgaLineVisualizer, [{\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t\n\t canvasCtxt.lineWidth = this.bounds.width;\n\t canvasCtxt.strokeStyle = ctxt.neumeLineColor;\n\t\n\t canvasCtxt.beginPath();\n\t canvasCtxt.moveTo(this.bounds.x, this.bounds.y);\n\t canvasCtxt.lineTo(this.bounds.x, this.bounds.y + this.bounds.height);\n\t canvasCtxt.stroke();\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t\n\t return QuickSvg.createFragment('rect', {\n\t 'x': this.bounds.x,\n\t 'y': this.bounds.y,\n\t 'width': ctxt.neumeLineWeight,\n\t 'height': this.bounds.height,\n\t 'fill': ctxt.neumeLineColor,\n\t 'class': 'neumeLine'\n\t });\n\t }\n\t }]);\n\t\n\t return VirgaLineVisualizer;\n\t}(ChantLayoutElement);\n\t\n\tvar GlyphVisualizer = exports.GlyphVisualizer = function (_ChantLayoutElement4) {\n\t _inherits(GlyphVisualizer, _ChantLayoutElement4);\n\t\n\t function GlyphVisualizer(ctxt, glyphCode) {\n\t _classCallCheck(this, GlyphVisualizer);\n\t\n\t var _this4 = _possibleConstructorReturn(this, Object.getPrototypeOf(GlyphVisualizer).call(this));\n\t\n\t _this4.glyph = null;\n\t\n\t _this4.setGlyph(ctxt, glyphCode);\n\t return _this4;\n\t }\n\t\n\t _createClass(GlyphVisualizer, [{\n\t key: 'setGlyph',\n\t value: function setGlyph(ctxt, glyphCode) {\n\t\n\t if (this.glyphCode === glyphCode) return;\n\t\n\t if (typeof glyphCode === 'undefined' || glyphCode === null || glyphCode === \"\") this.glyphCode = GlyphCode.None;else this.glyphCode = glyphCode;\n\t\n\t this.glyph = _Exsurge2.Glyphs[this.glyphCode];\n\t\n\t // if this glyph hasn't been used yet, then load it up in the defs section for sharing\n\t if (!ctxt.defs.hasOwnProperty(this.glyphCode)) {\n\t var glyphSrc = this.glyph.svgSrc;\n\t\n\t // create the ref\n\t ctxt.defs[this.glyphCode] = QuickSvg.createFragment('g', {\n\t id: this.glyphCode,\n\t 'class': 'glyph',\n\t transform: 'scale(' + ctxt.glyphScaling + ')'\n\t }, glyphSrc);\n\t }\n\t\n\t this.align = this.glyph.align;\n\t\n\t this.origin.x = this.glyph.origin.x * ctxt.glyphScaling;\n\t this.origin.y = this.glyph.origin.y * ctxt.glyphScaling;\n\t\n\t this.bounds.x = 0;\n\t this.bounds.y = -this.origin.y;\n\t this.bounds.width = this.glyph.bounds.width * ctxt.glyphScaling;\n\t this.bounds.height = this.glyph.bounds.height * ctxt.glyphScaling;\n\t }\n\t }, {\n\t key: 'setStaffPosition',\n\t value: function setStaffPosition(ctxt, staffPosition) {\n\t this.bounds.y += ctxt.calculateHeightFromStaffPosition(staffPosition);\n\t }\n\t }, {\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t\n\t var x = this.bounds.x + this.origin.x;\n\t var y = this.bounds.y + this.origin.y;\n\t canvasCtxt.translate(x, y);\n\t canvasCtxt.scale(ctxt.glyphScaling, ctxt.glyphScaling);\n\t\n\t for (var i = 0; i < this.glyph.paths.length; i++) {\n\t var path = this.glyph.paths[i];\n\t canvasCtxt.fillStyle = ctxt.neumeLineColor;\n\t canvasCtxt.fill(new Path2D(path.data));\n\t }\n\t\n\t canvasCtxt.scale(1.0 / ctxt.glyphScaling, 1.0 / ctxt.glyphScaling);\n\t canvasCtxt.translate(-x, -y);\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t\n\t return QuickSvg.createFragment('use', {\n\t 'xlink:href': '#' + this.glyphCode,\n\t x: this.bounds.x + this.origin.x,\n\t y: this.bounds.y + this.origin.y\n\t });\n\t }\n\t }]);\n\t\n\t return GlyphVisualizer;\n\t}(ChantLayoutElement);\n\t\n\tvar RoundBraceVisualizer = exports.RoundBraceVisualizer = function (_ChantLayoutElement5) {\n\t _inherits(RoundBraceVisualizer, _ChantLayoutElement5);\n\t\n\t function RoundBraceVisualizer(ctxt, x1, x2, y, isAbove) {\n\t _classCallCheck(this, RoundBraceVisualizer);\n\t\n\t var _this5 = _possibleConstructorReturn(this, Object.getPrototypeOf(RoundBraceVisualizer).call(this));\n\t\n\t if (x1 > x2) {\n\t // swap the xs\n\t var temp = x1;\n\t x1 = x2;\n\t x2 = temp;\n\t }\n\t\n\t _this5.isAbove = isAbove;\n\t _this5.braceHeight = ctxt.staffInterval / 2;\n\t\n\t _this5.bounds = new _Exsurge.Rect(x1, y, x2 - x1, _this5.braceHeight);\n\t\n\t _this5.origin.x = 0;\n\t _this5.origin.y = 0;\n\t return _this5;\n\t }\n\t\n\t _createClass(RoundBraceVisualizer, [{\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t var fragment = QuickSvg.createFragment('path', {\n\t 'd': this.generatePathString(),\n\t 'stroke': ctxt.neumeLineColor,\n\t 'stroke-width': ctxt.staffLineWeight + 'px',\n\t 'fill': 'none',\n\t 'class': 'brace'\n\t });\n\t\n\t if (this.acuteAccent) {\n\t\n\t fragment += this.acuteAccent.createSvgFragment(ctxt);\n\t\n\t return QuickSvg.createFragment('g', {\n\t 'class': 'accentedBrace'\n\t }, fragment);\n\t } else return fragment;\n\t }\n\t\n\t // returns svg path d string\n\t\n\t }, {\n\t key: 'generatePathString',\n\t value: function generatePathString() {\n\t\n\t var x1 = this.bounds.x;\n\t var x2 = this.bounds.right();\n\t var width = this.bounds.width;\n\t var y, dx, dy;\n\t\n\t if (this.isAbove) {\n\t y = this.bounds.bottom();\n\t dx = width / 6;\n\t dy = -width / 6;\n\t } else {\n\t y = this.bounds.y;\n\t dx = width / 6;\n\t dy = width / 6;\n\t }\n\t\n\t //Calculate Control Points of path,\n\t var cx1 = x1 + dx;\n\t var cy = y + dy;\n\t var cx2 = x2 - dx;\n\t\n\t // two decimal points should be enough, but if we need more precision, we can\n\t // up it here.\n\t var dp = 2;\n\t return \"M \" + x1.toFixed(dp) + \" \" + y.toFixed(dp) + \" C \" + cx1.toFixed(dp) + \" \" + cy.toFixed(dp) + \" \" + cx2.toFixed(dp) + \" \" + cy.toFixed(dp) + \" \" + x2.toFixed(dp) + \" \" + y.toFixed(dp);\n\t }\n\t }]);\n\t\n\t return RoundBraceVisualizer;\n\t}(ChantLayoutElement);\n\t\n\tvar CurlyBraceVisualizer = exports.CurlyBraceVisualizer = function (_ChantLayoutElement6) {\n\t _inherits(CurlyBraceVisualizer, _ChantLayoutElement6);\n\t\n\t function CurlyBraceVisualizer(ctxt, x1, x2, y) {\n\t var isAbove = arguments.length <= 4 || arguments[4] === undefined ? true : arguments[4];\n\t var addAcuteAccent = arguments.length <= 5 || arguments[5] === undefined ? false : arguments[5];\n\t\n\t _classCallCheck(this, CurlyBraceVisualizer);\n\t\n\t var _this6 = _possibleConstructorReturn(this, Object.getPrototypeOf(CurlyBraceVisualizer).call(this));\n\t\n\t if (x1 > x2) {\n\t // swap the xs\n\t var temp = x1;\n\t x1 = x2;\n\t x2 = temp;\n\t }\n\t\n\t _this6.isAbove = isAbove;\n\t _this6.braceHeight = ctxt.staffInterval / 2;\n\t\n\t // y is the actual vertical start of the brace (left hand side)\n\t // thus for a brace over notes, bounds.y is the bottom of brace,\n\t // but for a brace under the notes, y is simply the y passed in.\n\t if (isAbove) y -= _this6.braceHeight;\n\t\n\t var bounds = new _Exsurge.Rect(x1, y, x2 - x1, _this6.braceHeight);\n\t\n\t if (addAcuteAccent && isAbove) {\n\t\n\t _this6.acuteAccent = new GlyphVisualizer(ctxt, GlyphCode.AcuteAccent);\n\t _this6.acuteAccent.bounds.x += bounds.x + (x2 - x1) / 2;\n\t _this6.acuteAccent.bounds.y += bounds.y - ctxt.staffInterval / 4;\n\t\n\t bounds.union(_this6.acuteAccent.bounds);\n\t }\n\t\n\t _this6.bounds = bounds;\n\t\n\t _this6.origin.x = 0;\n\t _this6.origin.y = 0;\n\t return _this6;\n\t }\n\t\n\t _createClass(CurlyBraceVisualizer, [{\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t var fragment = QuickSvg.createFragment('path', {\n\t 'd': this.generatePathString(),\n\t 'stroke': ctxt.neumeLineColor,\n\t 'stroke-width': ctxt.staffLineWeight + 'px',\n\t 'fill': 'none',\n\t 'class': 'brace'\n\t });\n\t\n\t if (this.acuteAccent) {\n\t\n\t fragment += this.acuteAccent.createSvgFragment(ctxt);\n\t\n\t return QuickSvg.createFragment('g', {\n\t 'class': 'accentedBrace'\n\t }, fragment);\n\t } else return fragment;\n\t }\n\t\n\t // code below inspired by: https://gist.github.com/alexhornbake\n\t // optimized for braces that are only drawn horizontally.\n\t // returns svg path d string\n\t\n\t }, {\n\t key: 'generatePathString',\n\t value: function generatePathString() {\n\t\n\t var q = 0.6; // .5 is normal, higher q = more expressive bracket\n\t\n\t var x1 = this.bounds.x;\n\t var x2 = this.bounds.right();\n\t var width = this.bounds.width;\n\t var y, h;\n\t\n\t if (this.isAbove) {\n\t y = this.bounds.bottom();\n\t h = -this.braceHeight;\n\t } else {\n\t y = this.bounds.y;\n\t h = this.braceHeight;\n\t }\n\t\n\t // calculate Control Points of path\n\t var qy1 = y + q * h;\n\t var qx2 = x1 + .25 * width;\n\t var qy2 = y + (1 - q) * h;\n\t var tx1 = x1 + .5 * width;\n\t var ty1 = y + h;\n\t var qy3 = y + q * h;\n\t var qx4 = x1 + .75 * width;\n\t var qy4 = y + (1 - q) * h;\n\t\n\t // two decimal points should be enough, but if we need more precision, we can\n\t // up it here.\n\t var dp = 2;\n\t return \"M \" + x1.toFixed(dp) + \" \" + y.toFixed(dp) + \" Q \" + x1.toFixed(dp) + \" \" + qy1.toFixed(dp) + \" \" + qx2.toFixed(dp) + \" \" + qy2.toFixed(dp) + \" T \" + tx1.toFixed(dp) + \" \" + ty1.toFixed(dp) + \" M \" + x2.toFixed(dp) + \" \" + y.toFixed(dp) + \" Q \" + x2.toFixed(dp) + \" \" + qy3.toFixed(dp) + \" \" + qx4.toFixed(dp) + \" \" + qy4.toFixed(dp) + \" T \" + tx1.toFixed(dp) + \" \" + ty1.toFixed(dp);\n\t }\n\t }]);\n\t\n\t return CurlyBraceVisualizer;\n\t}(ChantLayoutElement);\n\t\n\tvar TextSpan = function TextSpan(text, properties) {\n\t if (typeof properties === 'undefined' || properties === null) properties = \"\";\n\t\n\t this.text = text;\n\t this.properties = properties;\n\t};\n\t\n\tvar boldMarkup = \"*\";\n\tvar italicMarkup = \"_\";\n\tvar redMarkup = \"^\";\n\tvar smallCapsMarkup = \"%\";\n\t\n\tfunction MarkupStackFrame(symbol, startIndex, properties) {\n\t this.symbol = symbol;\n\t this.startIndex = startIndex;\n\t this.properties = properties;\n\t}\n\t\n\tMarkupStackFrame.createStackFrame = function (symbol, startIndex) {\n\t\n\t var properties = \"\";\n\t\n\t switch (symbol) {\n\t case boldMarkup:\n\t properties = 'font-weight:bold;';\n\t break;\n\t case italicMarkup:\n\t properties = 'font-style:italic;';\n\t break;\n\t case redMarkup:\n\t properties = 'fill:#f00;'; // SVG text color is set by the fill property\n\t break;\n\t case smallCapsMarkup:\n\t properties = \"font-variant:small-caps;font-feature-settings:'smcp';-webkit-font-feature-settings:'smcp';\";\n\t break;\n\t }\n\t\n\t return new MarkupStackFrame(symbol, startIndex, properties);\n\t};\n\t\n\t// for escaping html strings before they go into the svgs\n\t// adapted from http://stackoverflow.com/a/12034334/5720160\n\tvar __subsForTspans = {\n\t \"&\": \"&\",\n\t \"<\": \"<\",\n\t \">\": \">\"\n\t};\n\t\n\tvar TextElement = exports.TextElement = function (_ChantLayoutElement7) {\n\t _inherits(TextElement, _ChantLayoutElement7);\n\t\n\t function TextElement(ctxt, text, fontFamily, fontSize, textAnchor) {\n\t _classCallCheck(this, TextElement);\n\t\n\t // set these to some sane values for now...\n\t\n\t var _this7 = _possibleConstructorReturn(this, Object.getPrototypeOf(TextElement).call(this));\n\t\n\t _this7.bounds.x = 0;\n\t _this7.bounds.y = 0;\n\t _this7.bounds.width = 0;\n\t _this7.bounds.height = 0;\n\t _this7.origin.x = 0;\n\t _this7.origin.y = 0;\n\t\n\t _this7.fontFamily = fontFamily;\n\t _this7.fontSize = fontSize;\n\t _this7.textAnchor = textAnchor;\n\t _this7.dominantBaseline = 'baseline'; // default placement\n\t\n\t _this7.generateSpansFromText(ctxt, text);\n\t\n\t _this7.recalculateMetrics(ctxt);\n\t return _this7;\n\t }\n\t\n\t _createClass(TextElement, [{\n\t key: 'generateSpansFromText',\n\t value: function generateSpansFromText(ctxt, text) {\n\t\n\t this.text = \"\";\n\t this.spans = [];\n\t\n\t // save ourselves a lot of grief for a very common text:\n\t if (text === \"*\" || text === \"†\") {\n\t this.spans.push(new TextSpan(text));\n\t return;\n\t }\n\t\n\t var markupStack = [];\n\t var spanStartIndex = 0;\n\t\n\t var filterFrames = function filterFrames(frame, symbol) {\n\t return frame.Symbol === symbol;\n\t };\n\t\n\t var that = this;\n\t var closeSpan = function closeSpan(spanText, extraProperties) {\n\t if (spanText === \"\") return;\n\t\n\t that.text += spanText;\n\t\n\t var properties = \"\";\n\t for (var i = 0; i < markupStack.length; i++) {\n\t properties += markupStack[i].properties;\n\t }if (extraProperties) properties = properties + extraProperties;\n\t\n\t that.spans.push(new TextSpan(spanText, properties));\n\t };\n\t\n\t var markupRegex = /(\\*|_|\\^|%|[ARVarv]\\/\\.)/g;\n\t\n\t var match = null;\n\t while (match = markupRegex.exec(text)) {\n\t\n\t var markupSymbol = match[0];\n\t\n\t // non-matching symbols first\n\t if (markupSymbol === \"A/.\" || markupSymbol === \"R/.\" || markupSymbol === \"V/.\" || markupSymbol === \"a/.\" || markupSymbol === \"r/.\" || markupSymbol === \"v/.\") {\n\t closeSpan(text[match.index] + \".\", \"font-family:'Exsurge Characters';fill:#f00;\");\n\t } else if (markupStack.length === 0) {\n\t // otherwise we're dealing with matching markup delimeters\n\t // if this is our first markup frame, then just create an inline for preceding text and push the stack frame\n\t closeSpan(text.substring(spanStartIndex, match.index));\n\t markupStack.push(MarkupStackFrame.createStackFrame(markupSymbol, match.index));\n\t } else {\n\t\n\t if (markupStack[markupStack.length - 1].symbol === markupSymbol) {\n\t // group close\n\t closeSpan(text.substring(spanStartIndex, match.index));\n\t markupStack.pop();\n\t } else if (markupStack.filter(filterFrames).length > 0) {\n\t // trying to open a recursive group (or forgot to close a previous group)\n\t // in either case, we just unwind to the previous stack frame\n\t spanStartIndex = markupStack[markupStack.length - 1].startIndex;\n\t markupStack.pop();\n\t continue;\n\t } else {\n\t // group open\n\t closeSpan(text.substring(spanStartIndex, match.index));\n\t markupStack.push(MarkupStackFrame.createStackFrame(markupSymbol, match.index));\n\t }\n\t }\n\t\n\t // advance the start index past the current markup\n\t spanStartIndex = match.index + markupSymbol.length;\n\t }\n\t\n\t // if we finished matches, and there is still some text left, create one final run\n\t if (spanStartIndex < text.length) closeSpan(text.substring(spanStartIndex, text.length));\n\t\n\t // if after all of that we still didn't create any runs, then just add the entire text\n\t // string itself as a run\n\t if (this.spans.length === 0) closeSpan(text);\n\t }\n\t }, {\n\t key: 'measureSubstring',\n\t value: function measureSubstring(ctxt, length) {\n\t if (length === 0) return 0;\n\t if (!length) length = Infinity;\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t var baseFont = this.fontSize + \"px \" + this.fontFamily;\n\t var width = 0;\n\t var subStringLength = 0;\n\t for (var i = 0; i < this.spans.length; i++) {\n\t var font = '',\n\t span = this.spans[i],\n\t myText = span.text.slice(0, length - subStringLength);\n\t if (span.properties.indexOf('font-style:italic;') >= 0) font += 'italic ';\n\t if (span.properties.indexOf(\"font-variant:small-caps;\") >= 0) font += 'small-caps ';\n\t if (span.properties.indexOf('font-weight:bold;') >= 0) font += 'bold ';\n\t font += baseFont;\n\t canvasCtxt.font = font;\n\t var metrics = canvasCtxt.measureText(myText, this.bounds.x, this.bounds.y);\n\t width += metrics.width;\n\t subStringLength += myText.length;\n\t if (subStringLength === length) break;\n\t }\n\t return width;\n\t }\n\t }, {\n\t key: 'recalculateMetrics',\n\t value: function recalculateMetrics(ctxt) {\n\t\n\t this.bounds.x = 0;\n\t this.bounds.y = 0;\n\t\n\t this.bounds.x = 0;\n\t this.bounds.y = 0;\n\t\n\t this.origin.x = 0;\n\t\n\t if (ctxt.textMeasuringStrategy === TextMeasuringStrategy.Svg) {\n\t var xml = '' + this.createSvgFragment(ctxt) + '';\n\t var doc = new DOMParser().parseFromString(xml, 'application/xml');\n\t\n\t while (ctxt.svgTextMeasurer.firstChild) {\n\t ctxt.svgTextMeasurer.firstChild.remove();\n\t }ctxt.svgTextMeasurer.appendChild(ctxt.svgTextMeasurer.ownerDocument.importNode(doc.documentElement, true).firstChild);\n\t\n\t var bbox = ctxt.svgTextMeasurer.firstChild.getBBox();\n\t this.bounds.width = bbox.width;\n\t this.bounds.height = bbox.height;\n\t this.origin.y = -bbox.y; // offset to baseline from top\n\t } else if (ctxt.textMeasuringStrategy === TextMeasuringStrategy.Canvas) {\n\t this.bounds.width = this.measureSubstring(ctxt);\n\t this.bounds.height = this.fontSize * 1.2;\n\t this.origin.y = this.fontSize;\n\t }\n\t }\n\t }, {\n\t key: 'getCssClasses',\n\t value: function getCssClasses() {\n\t return \"\";\n\t }\n\t }, {\n\t key: 'getExtraStyleProperties',\n\t value: function getExtraStyleProperties(ctxt) {\n\t return \"\";\n\t }\n\t }, {\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t\n\t if (this.textAnchor === 'middle') canvasCtxt.textAlign = 'center';else canvasCtxt.textAlign = 'start';\n\t\n\t canvasCtxt.font = this.fontSize + \"px \" + this.fontFamily;\n\t\n\t for (var i = 0; i < this.spans.length; i++) {\n\t canvasCtxt.fillText(this.spans[i].text, this.bounds.x, this.bounds.y);\n\t }\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t\n\t var spans = \"\";\n\t\n\t for (var i = 0; i < this.spans.length; i++) {\n\t var options = {};\n\t\n\t if (this.spans[i].properties) options['style'] = this.spans[i].properties;\n\t\n\t spans += QuickSvg.createFragment('tspan', options, TextElement.escapeForTspan(this.spans[i].text));\n\t }\n\t\n\t var styleProperties = \"font-family:\" + this.fontFamily + \";font-size:\" + this.fontSize + \"px\" + \";font-kerning:normal;\" + this.getExtraStyleProperties(ctxt);\n\t\n\t return QuickSvg.createFragment('text', {\n\t 'x': this.bounds.x,\n\t 'y': this.bounds.y,\n\t 'class': this.getCssClasses().trim(),\n\t 'text-anchor': this.textAnchor,\n\t 'dominant-baseline': this.dominantBaseline,\n\t 'style': styleProperties\n\t }, spans);\n\t }\n\t }], [{\n\t key: 'escapeForTspan',\n\t value: function escapeForTspan(string) {\n\t return String(string).replace(/[&<>]/g, function (s) {\n\t return __subsForTspans[s];\n\t });\n\t }\n\t }]);\n\t\n\t return TextElement;\n\t}(ChantLayoutElement);\n\t\n\tvar LyricType = exports.LyricType = {\n\t SingleSyllable: 0,\n\t BeginningSyllable: 1,\n\t MiddleSyllable: 2,\n\t EndingSyllable: 3,\n\t\n\t Directive: 4 // for asterisks, \"ij.\" elements, or other performance notes.\n\t};\n\t\n\tvar Lyric = exports.Lyric = function (_TextElement) {\n\t _inherits(Lyric, _TextElement);\n\t\n\t function Lyric(ctxt, text, lyricType) {\n\t _classCallCheck(this, Lyric);\n\t\n\t // save the original text in case we need to later use the lyric\n\t // in a dropcap...\n\t\n\t var _this8 = _possibleConstructorReturn(this, Object.getPrototypeOf(Lyric).call(this, ctxt, text, ctxt.lyricTextFont, ctxt.lyricTextSize, 'start'));\n\t\n\t _this8.originalText = text;\n\t\n\t if (typeof lyricType === 'undefined' || lyricType === null || lyricType === \"\") _this8.lyricType = LyricType.SingleSyllable;else _this8.lyricType = lyricType;\n\t\n\t // Lyrics keep track of how to center them on notation elements.\n\t // centerTextIndex is the index in this.text where the centering starts,\n\t // centerLength is how many characters comprise the center point.\n\t // performLayout will do the processing\n\t _this8.centerStartIndex = -1;\n\t _this8.centerLength = text.length;\n\t\n\t _this8.needsConnector = false;\n\t\n\t // Lyrics can have their own language defined, which affects the alignment\n\t // of the text with the notation element\n\t _this8.language = null;\n\t return _this8;\n\t }\n\t\n\t _createClass(Lyric, [{\n\t key: 'allowsConnector',\n\t value: function allowsConnector() {\n\t return this.lyricType === LyricType.BeginningSyllable || this.lyricType === LyricType.MiddleSyllable;\n\t }\n\t }, {\n\t key: 'setNeedsConnector',\n\t value: function setNeedsConnector(needs) {\n\t if (needs === true) {\n\t this.needsConnector = true;\n\t this.bounds.width = this.widthWithConnector;\n\t\n\t if (this.spans.length > 0) this.spans[this.spans.length - 1].text = this.lastSpanTextWithConnector;\n\t } else {\n\t this.needsConnector = false;\n\t this.bounds.width = this.widthWithoutConnector;\n\t\n\t if (this.spans.length > 0) this.spans[this.spans.length - 1].text = this.lastSpanText;\n\t }\n\t }\n\t }, {\n\t key: 'generateSpansFromText',\n\t value: function generateSpansFromText(ctxt, text) {\n\t _get(Object.getPrototypeOf(Lyric.prototype), 'generateSpansFromText', this).call(this, ctxt, text);\n\t\n\t if (this.spans.length > 0) {\n\t this.lastSpanText = this.spans[this.spans.length - 1].text;\n\t this.lastSpanTextWithConnector = this.lastSpanText + ctxt.syllableConnector;\n\t } else {\n\t this.lastSpanText = \"\";\n\t this.lastSpanTextWithConnector = \"\";\n\t }\n\t }\n\t }, {\n\t key: 'recalculateMetrics',\n\t value: function recalculateMetrics(ctxt) {\n\t _get(Object.getPrototypeOf(Lyric.prototype), 'recalculateMetrics', this).call(this, ctxt);\n\t\n\t this.widthWithoutConnector = this.bounds.width;\n\t this.textWithConnector = this.text + ctxt.syllableConnector;\n\t\n\t this.widthWithConnector = this.bounds.width + ctxt.hyphenWidth;\n\t\n\t var activeLanguage = this.language || ctxt.defaultLanguage;\n\t\n\t // calculate the point where the text lines up to the staff notation\n\t // and offset the rect that much. By default we just center the text,\n\t // but the logic below allows for smarter lyric alignment based\n\t // on manual override or language control.\n\t var offset = this.widthWithoutConnector / 2,\n\t x1,\n\t x2;\n\t\n\t // some simple checks for sanity, and disable manual centering if the numbers are bad\n\t if (this.centerStartIndex >= 0 && (this.centerStartIndex >= this.text.length || this.centerLength < 0 || this.centerStartIndex + this.centerLength > this.text.length)) this.centerStartIndex = -1;\n\t\n\t if (this.text.length === 0) {\n\t // if we have no text to work with, then there's nothing to do!\n\t } else if (this.centerStartIndex >= 0) {\n\t // if we have manually overriden the centering logic for this lyric,\n\t // then always use that.\n\t if (ctxt.textMeasuringStrategy === TextMeasuringStrategy.Svg) {\n\t // svgTextMeasurer still has the current lyric in it...\n\t x1 = ctxt.svgTextMeasurer.firstChild.getSubStringLength(0, this.centerStartIndex);\n\t x2 = ctxt.svgTextMeasurer.firstChild.getSubStringLength(0, this.centerStartIndex + this.centerLength);\n\t } else if (ctxt.textMeasuringStrategy === TextMeasuringStrategy.Canvas) {\n\t x1 = this.measureSubstring(ctxt, this.centerStartIndex);\n\t x2 = this.measureSubstring(ctxt, this.centerStartIndex + this.centerLength);\n\t }\n\t offset = x1 + (x2 - x1) / 2;\n\t } else {\n\t\n\t // if it's a directive with no manual centering override, then\n\t // just center the text.\n\t if (this.lyricType !== LyricType.Directive) {\n\t\n\t // Non-directive elements are lined up to the chant notation based on vowel segments,\n\t var result = activeLanguage.findVowelSegment(this.text, 0);\n\t\n\t if (result.found === true) {\n\t if (ctxt.textMeasuringStrategy === TextMeasuringStrategy.Svg) {\n\t // svgTextMeasurer still has the current lyric in it...\n\t x1 = ctxt.svgTextMeasurer.firstChild.getSubStringLength(0, result.startIndex);\n\t x2 = ctxt.svgTextMeasurer.firstChild.getSubStringLength(0, result.startIndex + result.length);\n\t } else if (ctxt.textMeasuringStrategy === TextMeasuringStrategy.Canvas) {\n\t x1 = this.measureSubstring(ctxt, result.startIndex);\n\t x2 = this.measureSubstring(ctxt, result.startIndex + result.length);\n\t }\n\t offset = x1 + (x2 - x1) / 2;\n\t }\n\t }\n\t }\n\t\n\t this.bounds.x = -offset;\n\t this.bounds.y = 0;\n\t\n\t this.origin.x = offset;\n\t\n\t this.bounds.width = this.widthWithoutConnector;\n\t this.bounds.height = ctxt.lyricTextSize;\n\t }\n\t }, {\n\t key: 'generateDropCap',\n\t value: function generateDropCap(ctxt) {\n\t\n\t var dropCap = new DropCap(ctxt, this.originalText.substring(0, 1));\n\t\n\t // if the dropcap is a single character syllable (vowel) that is the\n\t // beginning of the word, then we use a hyphen in place of the lyric text\n\t // and treat it as a single syllable.\n\t if (this.originalText.length === 1) {\n\t this.generateSpansFromText(ctxt, ctxt.syllableConnector);\n\t this.centerStartIndex = -1;\n\t this.lyricType = LyricType.SingleSyllable;\n\t } else {\n\t this.generateSpansFromText(ctxt, this.originalText.substring(1));\n\t this.centerStartIndex--; // lost a letter, so adjust centering accordingly\n\t }\n\t\n\t return dropCap;\n\t }\n\t }, {\n\t key: 'getCssClasses',\n\t value: function getCssClasses() {\n\t\n\t var classes = \"lyric \";\n\t\n\t if (this.lyricType === LyricType.Directive) classes += \"directive \";\n\t\n\t return classes + _get(Object.getPrototypeOf(Lyric.prototype), 'getCssClasses', this).call(this);\n\t }\n\t }, {\n\t key: 'getExtraStyleProperties',\n\t value: function getExtraStyleProperties(ctxt) {\n\t var props = _get(Object.getPrototypeOf(Lyric.prototype), 'getExtraStyleProperties', this).call(this);\n\t\n\t if (this.lyricType === LyricType.Directive && ctxt.autoColor === true) props += \"fill:#f00;\";\n\t\n\t return props;\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t if (this.spans.length > 0) {\n\t if (this.needsConnector) this.spans[this.spans.length - 1].text = this.lastSpanTextWithConnector;else this.spans[this.spans.length - 1].text = this.lastSpanText;\n\t }\n\t\n\t return _get(Object.getPrototypeOf(Lyric.prototype), 'createSvgFragment', this).call(this, ctxt);\n\t }\n\t }]);\n\t\n\t return Lyric;\n\t}(TextElement);\n\t\n\tvar DropCap = exports.DropCap = function (_TextElement2) {\n\t _inherits(DropCap, _TextElement2);\n\t\n\t /**\n\t * @param {String} text\n\t */\n\t\n\t function DropCap(ctxt, text) {\n\t _classCallCheck(this, DropCap);\n\t\n\t var _this9 = _possibleConstructorReturn(this, Object.getPrototypeOf(DropCap).call(this, ctxt, text, ctxt.dropCapTextFont, ctxt.dropCapTextSize, 'middle'));\n\t\n\t _this9.padding = ctxt.staffInterval * 2;\n\t return _this9;\n\t }\n\t\n\t _createClass(DropCap, [{\n\t key: 'getCssClasses',\n\t value: function getCssClasses() {\n\t return \"dropCap \" + _get(Object.getPrototypeOf(DropCap.prototype), 'getCssClasses', this).call(this);\n\t }\n\t }]);\n\t\n\t return DropCap;\n\t}(TextElement);\n\t\n\tvar Annotation = exports.Annotation = function (_TextElement3) {\n\t _inherits(Annotation, _TextElement3);\n\t\n\t /**\n\t * @param {String} text\n\t */\n\t\n\t function Annotation(ctxt, text) {\n\t _classCallCheck(this, Annotation);\n\t\n\t var _this10 = _possibleConstructorReturn(this, Object.getPrototypeOf(Annotation).call(this, ctxt, text, ctxt.annotationTextFont, ctxt.annotationTextSize, 'middle'));\n\t\n\t _this10.padding = ctxt.staffInterval;\n\t _this10.dominantBaseline = 'hanging'; // so that annotations can be aligned at the top.\n\t return _this10;\n\t }\n\t\n\t _createClass(Annotation, [{\n\t key: 'getCssClasses',\n\t value: function getCssClasses() {\n\t return \"annotation \" + _get(Object.getPrototypeOf(Annotation.prototype), 'getCssClasses', this).call(this);\n\t }\n\t }]);\n\t\n\t return Annotation;\n\t}(TextElement);\n\t\n\tvar ChantNotationElement = exports.ChantNotationElement = function (_ChantLayoutElement8) {\n\t _inherits(ChantNotationElement, _ChantLayoutElement8);\n\t\n\t function ChantNotationElement() {\n\t _classCallCheck(this, ChantNotationElement);\n\t\n\t //double\n\t\n\t var _this11 = _possibleConstructorReturn(this, Object.getPrototypeOf(ChantNotationElement).call(this));\n\t\n\t _this11.leadingSpace = 0.0;\n\t _this11.trailingSpace = -1; // if less than zero, this is automatically calculated at layout time\n\t _this11.keepWithNext = false;\n\t _this11.needsLayout = true;\n\t\n\t _this11.lyrics = [];\n\t\n\t _this11.score = null; // the ChantScore\n\t _this11.line = null; // the ChantLine\n\t\n\t _this11.visualizers = [];\n\t return _this11;\n\t }\n\t\n\t _createClass(ChantNotationElement, [{\n\t key: 'hasLyrics',\n\t value: function hasLyrics() {\n\t if (this.lyrics.length !== 0) return true;else return false;\n\t }\n\t }, {\n\t key: 'getLyricLeft',\n\t value: function getLyricLeft(index) {\n\t // warning: no error checking on index or on whether lyric[index] is valid\n\t return this.bounds.x + this.lyrics[index].bounds.x;\n\t }\n\t }, {\n\t key: 'getAllLyricsLeft',\n\t value: function getAllLyricsLeft() {\n\t if (this.lyrics.length === 0) return this.bounds.right();\n\t\n\t var x = Number.MAX_VALUE;\n\t for (var i = 0; i < this.lyrics.length; i++) {\n\t if (this.lyrics[i]) x = Math.min(x, this.lyrics[i].bounds.x);\n\t }\n\t\n\t return this.bounds.x + x;\n\t }\n\t }, {\n\t key: 'getLyricRight',\n\t value: function getLyricRight(index) {\n\t // warning: no error checking on index or on whether lyric[index] is valid\n\t return this.bounds.x + this.lyrics[index].bounds.x + this.lyrics[index].bounds.width;\n\t }\n\t }, {\n\t key: 'getAllLyricsRight',\n\t value: function getAllLyricsRight() {\n\t if (this.lyrics.length === 0) return this.bounds.x;\n\t\n\t var x = Number.MIN_VALUE;\n\t for (var i = 0; i < this.lyrics.length; i++) {\n\t if (this.lyrics[i]) x = Math.max(x, this.lyrics[i].bounds.x + this.lyrics[i].bounds.width);\n\t }\n\t\n\t return this.bounds.x + x;\n\t }\n\t\n\t // used by subclasses while building up the chant notations.\n\t\n\t }, {\n\t key: 'addVisualizer',\n\t value: function addVisualizer(chantLayoutElement) {\n\t if (this.bounds.isEmpty()) this.bounds = chantLayoutElement.bounds.clone();else this.bounds.union(chantLayoutElement.bounds);\n\t\n\t this.visualizers.push(chantLayoutElement);\n\t }\n\t\n\t // same as addVisualizer, except the element is unshifted to the front\n\t // of the visualizer array rather than the end. This way, some\n\t // visualizers can be placed behind the others...ledger lines for example.\n\t\n\t }, {\n\t key: 'prependVisualizer',\n\t value: function prependVisualizer(chantLayoutElement) {\n\t if (this.bounds.isEmpty()) this.bounds = chantLayoutElement.bounds.clone();else this.bounds.union(chantLayoutElement.bounds);\n\t\n\t this.visualizers.unshift(chantLayoutElement);\n\t }\n\t\n\t // chant notation elements are given an opportunity to perform their layout via this function.\n\t // subclasses should call this function first in overrides of this function.\n\t // on completion, exsurge presumes that the bounds, the origin, and the fragment objects are\n\t // all valid and prepared for higher level layout.\n\t\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t if (this.trailingSpace < 0) this.trailingSpace = ctxt.intraNeumeSpacing * 4;\n\t\n\t // reset the bounds and the staff notations before doing a layout\n\t this.visualizers = [];\n\t this.bounds = new _Exsurge.Rect(Infinity, Infinity, -Infinity, -Infinity);\n\t\n\t for (var i = 0; i < this.lyrics.length; i++) {\n\t this.lyrics[i].recalculateMetrics(ctxt);\n\t }\n\t }\n\t\n\t // some subclasses have internal dependencies on other notations (for example,\n\t // a custos can depend on a later neume which it uses to set its height).\n\t // subclasses can override this function so that when the notations are\n\t // altered, the subclass can correctly invalidate (and later restore) its own\n\t // depedencies\n\t\n\t }, {\n\t key: 'resetDependencies',\n\t value: function resetDependencies() {}\n\t\n\t // a helper function for subclasses to call after they are done performing layout...\n\t\n\t }, {\n\t key: 'finishLayout',\n\t value: function finishLayout(ctxt) {\n\t\n\t this.bounds.x = 0;\n\t\n\t for (var i = 0; i < this.lyrics.length; i++) {\n\t this.lyrics[i].bounds.x = this.origin.x - this.lyrics[i].origin.x;\n\t }this.needsLayout = false;\n\t }\n\t }, {\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t canvasCtxt.translate(this.bounds.x, 0);\n\t\n\t for (var i = 0; i < this.visualizers.length; i++) {\n\t this.visualizers[i].draw(ctxt);\n\t }for (i = 0; i < this.lyrics.length; i++) {\n\t this.lyrics[i].draw(ctxt);\n\t }canvasCtxt.translate(-this.bounds.x, 0);\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t var inner = \"\";\n\t\n\t for (var i = 0; i < this.visualizers.length; i++) {\n\t inner += this.visualizers[i].createSvgFragment(ctxt);\n\t }for (i = 0; i < this.lyrics.length; i++) {\n\t inner += this.lyrics[i].createSvgFragment(ctxt);\n\t }return QuickSvg.createFragment('g', {\n\t // this.constructor.name will not be the same after being mangled by UglifyJS\n\t 'class': 'ChantNotationElement ' + this.constructor.name,\n\t 'transform': 'translate(' + this.bounds.x + ',' + 0 + ')'\n\t }, inner);\n\t }\n\t }]);\n\t\n\t return ChantNotationElement;\n\t}(ChantLayoutElement);\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"data:font/opentype;base64,AAEAAAATAQAABAAwRFNJRwAAAAEAAENkAAAACEdERUYAbgADAABDbAAAABhHUE9TTxtiswAAQ4QAAAE8R1NVQjtgWB4AAETAAAAAlk9TLzJKLTibAAABuAAAAGBjbWFwCRIK1gAAA4gAAAEEY3Z0IAGGB0cAAAZ0AAAAGmZwZ20GWZw3AAAEjAAAAXNnYXNwABcACAAAQ1QAAAAQZ2x5ZhRQNO4AAAdQAAAEzGhlYWQKMl2QAAABPAAAADZoaGVhDC0CmQAAAXQAAAAkaG10eB67AO4AAAIYAAABbmtlcm4E1wS9AAAMHAAAAMZsb2NhLQ4u0gAABpAAAADAbWF4cAJtAJoAAAGYAAAAIG5hbWUmgJC3AAAM5AAANY5wb3N0CJUJxAAAQnQAAADgcHJlcNTHuIYAAAYAAAAAcgABAAAAAQAArr24P18PPPUAGwgAAAAAANLrfC8AAAAA0uuXUgAA/vAFLAYhAAAACQACAAAAAAAAAAEAAAb+/bwAAAUzAAD/UQUsAAEAAAAAAAAAAAAAAAAAAABYAAEAAABfAE4AAwAAAAAAAQAAAAAACgAAAgAASwAAAAAAAwNBAZAABQAAA1gDWAAABLADWANYAAAEsABkAfQAAAIABQMGAAACAAQAAAABAAAAAAAAAAAAAAAAICAgIABAACEAfgb+/bwAAAb+AkQAAAABAAAAAAOiBOwAAAAgAAIDMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAA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AFMAIABPAFIAIABJAE0AUABMAEkARQBEACwAIABJAE4AQwBMAFUARABJAE4ARwAgAEIAVQBUACAATgBPAFQAIABMAEkATQBJAFQARQBEACAAVABPACAAQQBOAFkAIABXAEEAUgBSAEEATgBUAEkARQBTACAATwBGACAATQBFAFIAQwBIAEEATgBUAEEAQgBJAEwASQBUAFkALAAgAEYASQBUAE4ARQBTAFMAIABGAE8AUgAgAEEAIABQAEEAUgBUAEkAQwBVAEwAQQBSACAAUABVAFIAUABPAFMARQAgAEEATgBEACAATgBPAE4ASQBOAEYAUgBJAE4ARwBFAE0ARQBOAFQAIABPAEYAIABDAE8AUABZAFIASQBHAEgAVAAsACAAUABBAFQARQBOAFQALAAgAFQAUgBBAEQARQBNAEEAUgBLACwAIABPAFIAIABPAFQASABFAFIAIABSAEkARwBIAFQALgAgAEkATgAgAE4ATwAgAEUAVgBFAE4AVAAgAFMASABBAEwATAAgAFQASABFACAAQwBPAFAAWQBSAEkARwBIAFQAIABIAE8ATABEAEUAUgAgAEIARQAgAEwASQBBAEIATABFACAARgBPAFIAIABBAE4AWQAgAEMATABBAEkATQAsACAARABBAE0AQQBHAEUAUwAgAE8AUgAgAE8AVABIAEUAUgAgAEwASQBBAEIASQBMAEkAVABZACwAIABJAE4AQwBMAFUARABJAE4ARwAgAEEATgBZACAARwBFAE4ARQBSAEEATAAsACAAUwBQAEUAQwBJAEEATAAsACAASQBOAEQASQBSAEUAQwBUACwAIABJAE4AQwBJAEQARQBOAFQAQQBMACwAIABPAFIAIABDAE8ATgBTAEUAUQBVAEUATgBUAEkAQQBMACAARABBAE0AQQBHAEUAUwAsACAAVwBIAEUAVABIAEUAUgAgAEkATgAgAEEATgAgAEEAQwBUAEkATwBOACAATwBGACAAQwBPAE4AVABSAEEAQwBUACwAIABUAE8AUgBUACAATwBSACAATwBUAEgARQBSAFcASQBTAEUALAAgAEEAUgBJAFMASQBOAEcAIABGAFIATwBNACwAIABPAFUAVAAgAE8ARgAgAFQASABFACAAVQBTAEUAIABPAFIAIABJAE4AQQBCAEkATABJAFQAWQAgAFQATwAgAFUAUwBFACAAVABIAEUAIABGAE8ATgBUACAAUwBPAEYAVABXAEEAUgBFACAATwBSACAARgBSAE8ATQAgAE8AVABIAEUAUgAgAEQARQBBAEwASQBOAEcAUwAgAEkATgAgAFQASABFACAARgBPAE4AVAAgAFMATwBGAFQAVwBBAFIARQAuAAAAAgAAAAAAAP8GAGQAAAAAAAAAAAAAAAAAAAAAAAAAAABfAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQAAAAMACAACABAAAf//AAIAAAABAAAAAAABAAAADgAAAAAAAAAAAAIAAQAAAF4AAQABAAAACgBKAGQAAmN5cmwADmxhdG4AGAAEAAAAAP//AAAAEAACSVBBIAAaVklUIAAiAAD//wACAAEAAAAA//8AAQABAAD//wAAAAJrZXJuAA5tYXJrABQAAAABAAEAAAABAAAAAgAGAA4ABAAEAAEAEAACAAAAAQAsAAEADAAQAAAAIAAiAAIAAAABAAYAIQAyADYAQQBSAFYAAAAGAAEAjgAEAAAABgAWADAASgBkAHIAgAAGAA7/nAAhADYAQQA2ADIADQA2//IAUgAXAAYADv+cACEAWABBAFgAMgChADYAvQBSAE8ABgAO/nAAIf6TAEH+kwAy//kANgAOAFL/YQADAA7/nABSABcAVv/VAAMADv+cAFIANgBWAEwAAwAO/nAAUgAJAFYAGQABAAYAIQAyADYAQQBSAFYAAQAAAAoATgBoAAJjeXJsAA5sYXRuABoABAAAAAD//wABAAAAEAACSVBBIAAaVklUIAAiAAD//wACAAAAAQAA//8AAQAAAAD//wABAAAAAmFhbHQADnNtY3AAFAAAAAEAAAAAAAEAAAABAAQAAwAAAAEACAABABgAAwAMABAAFAABAEEAAQBSAAEAVgABAAMAIQAyADYAAA==\"\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.ChantDocument = exports.ChantScore = exports.ChantMapping = exports.ChantLineBreak = exports.TextOnly = exports.FaClef = exports.DoClef = exports.Clef = exports.Note = exports.NoteShapeModifiers = exports.NoteShape = exports.LiquescentType = undefined;\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tvar Exsurge = _interopRequireWildcard(_Exsurge);\n\t\n\tvar _Exsurge2 = __webpack_require__(4);\n\t\n\tvar _ExsurgeChant = __webpack_require__(7);\n\t\n\tvar _ExsurgeChant2 = __webpack_require__(8);\n\t\n\tvar _ExsurgeChant3 = __webpack_require__(9);\n\t\n\tvar _Exsurge3 = __webpack_require__(10);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } //\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\tvar LiquescentType = exports.LiquescentType = {\n\t None: 0,\n\t\n\t // flags that can be combined, though of course it\n\t // it doesn't make sense to combine some!\n\t Large: 1 << 0,\n\t Small: 1 << 1,\n\t Ascending: 1 << 2,\n\t Descending: 1 << 3,\n\t InitioDebilis: 1 << 4,\n\t\n\t // handy liquescent types\n\t LargeAscending: 1 << 0 | 1 << 2,\n\t LargeDescending: 1 << 0 | 1 << 3,\n\t SmallAscending: 1 << 1 | 1 << 2,\n\t SmallDescending: 1 << 1 | 1 << 3\n\t};\n\t\n\tvar NoteShape = exports.NoteShape = {\n\t // shapes\n\t Default: 0,\n\t Virga: 1,\n\t Inclinatum: 2,\n\t Quilisma: 3,\n\t Stropha: 4,\n\t Oriscus: 5\n\t};\n\t\n\tvar NoteShapeModifiers = exports.NoteShapeModifiers = {\n\t\n\t // flags which modify the shape\n\t // not all of them apply to every shape of course\n\t None: 0,\n\t Ascending: 1 << 0,\n\t Descending: 1 << 1,\n\t Cavum: 1 << 2,\n\t Stemmed: 1 << 3\n\t};\n\t\n\t/**\n\t * @class\n\t */\n\t\n\tvar Note = exports.Note = function (_ChantLayoutElement) {\n\t _inherits(Note, _ChantLayoutElement);\n\t\n\t /**\n\t * @para {Pitch} pitch\n\t */\n\t\n\t function Note(pitch) {\n\t _classCallCheck(this, Note);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Note).call(this));\n\t\n\t if (typeof pitch !== 'undefined') _this.pitch = pitch;else _this.pitch = null;\n\t\n\t _this.glyphVisualizer = null;\n\t\n\t // The staffPosition on a note is an integer that indicates the vertical position on the staff.\n\t // 0 is the center space on the staff (equivalent to gabc 'g'). Positive numbers go up\n\t // the staff, and negative numbers go down, i.e., 1 is gabc 'h', 2 is gabc 'i', -1 is gabc 'f', etc.\n\t _this.staffPosition = 0;\n\t _this.liquescent = LiquescentType.None;\n\t _this.shape = NoteShape.Default;\n\t _this.shapeModifiers = NoteShapeModifiers.None;\n\t\n\t // notes keep track of the neume they belong to in order to facilitate layout\n\t // this.neume gets set when a note is added to a neume via Neume.addNote()\n\t _this.neume = null;\n\t\n\t // various markings that can exist on a note, organized by type\n\t // for faster access and simpler code logic\n\t _this.epismata = [];\n\t _this.morae = []; // silly to have an array of these, but gabc allows multiple morae per note!\n\t\n\t // these are set on the note when they are needed, otherwise, they're undefined\n\t // this.ictus\n\t // this.accuteAccent\n\t // this.braceStart\n\t // this.braceEnd\n\t return _this;\n\t }\n\t\n\t _createClass(Note, [{\n\t key: 'setGlyph',\n\t value: function setGlyph(ctxt, glyphCode) {\n\t if (this.glyphVisualizer) this.glyphVisualizer.setGlyph(ctxt, glyphCode);else this.glyphVisualizer = new _Exsurge2.GlyphVisualizer(ctxt, glyphCode);\n\t\n\t this.glyphVisualizer.setStaffPosition(ctxt, this.staffPosition);\n\t\n\t // assign glyphvisualizer metrics to this note\n\t this.bounds.x = this.glyphVisualizer.bounds.x;\n\t this.bounds.y = this.glyphVisualizer.bounds.y;\n\t this.bounds.width = this.glyphVisualizer.bounds.width;\n\t this.bounds.height = this.glyphVisualizer.bounds.height;\n\t\n\t this.origin.x = this.glyphVisualizer.origin.x;\n\t this.origin.y = this.glyphVisualizer.origin.y;\n\t }\n\t\n\t // a utility function for modifiers\n\t\n\t }, {\n\t key: 'shapeModifierMatches',\n\t value: function shapeModifierMatches(shapeModifier) {\n\t if (shapeModifier === NoteShapeModifiers.None) return this.shapeModifier === NoteShapeModifiers.None;else return this.shapeModifier & shapeModifier !== 0;\n\t }\n\t }, {\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t\n\t this.glyphVisualizer.bounds.x = this.bounds.x;\n\t this.glyphVisualizer.bounds.y = this.bounds.y;\n\t\n\t this.glyphVisualizer.draw(ctxt);\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t\n\t this.glyphVisualizer.bounds.x = this.bounds.x;\n\t this.glyphVisualizer.bounds.y = this.bounds.y;\n\t return this.glyphVisualizer.createSvgFragment(ctxt);\n\t }\n\t }]);\n\t\n\t return Note;\n\t}(_Exsurge2.ChantLayoutElement);\n\t\n\tvar Clef = exports.Clef = function (_ChantNotationElement) {\n\t _inherits(Clef, _ChantNotationElement);\n\t\n\t function Clef(staffPosition, octave) {\n\t var defaultAccidental = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];\n\t\n\t _classCallCheck(this, Clef);\n\t\n\t var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(Clef).call(this));\n\t\n\t _this2.isClef = true;\n\t _this2.staffPosition = staffPosition;\n\t _this2.octave = octave;\n\t _this2.defaultAccidental = defaultAccidental;\n\t _this2.activeAccidental = defaultAccidental;\n\t return _this2;\n\t }\n\t\n\t _createClass(Clef, [{\n\t key: 'resetAccidentals',\n\t value: function resetAccidentals() {\n\t this.activeAccidental = this.defaultAccidental;\n\t }\n\t }, {\n\t key: 'pitchToStaffPosition',\n\t value: function pitchToStaffPosition(pitch) {}\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t ctxt.activeClef = this;\n\t\n\t if (this.defaultAccidental) this.defaultAccidental.performLayout(ctxt);\n\t\n\t _get(Object.getPrototypeOf(Clef.prototype), 'performLayout', this).call(this, ctxt);\n\t }\n\t }, {\n\t key: 'finishLayout',\n\t value: function finishLayout(ctxt) {\n\t\n\t // if we have a default accidental, then add a glyph for it now\n\t if (this.defaultAccidental) {\n\t var accidentalGlyph = this.defaultAccidental.createGlyphVisualizer(ctxt);\n\t accidentalGlyph.bounds.x += this.visualizers[0].bounds.right() + ctxt.intraNeumeSpacing;\n\t this.addVisualizer(accidentalGlyph);\n\t }\n\t\n\t _get(Object.getPrototypeOf(Clef.prototype), 'finishLayout', this).call(this, ctxt);\n\t }\n\t }], [{\n\t key: 'default',\n\t value: function _default() {\n\t return __defaultDoClef;\n\t }\n\t }]);\n\t\n\t return Clef;\n\t}(_Exsurge2.ChantNotationElement);\n\t\n\tvar DoClef = exports.DoClef = function (_Clef) {\n\t _inherits(DoClef, _Clef);\n\t\n\t function DoClef(staffPosition, octave) {\n\t var defaultAccidental = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];\n\t\n\t _classCallCheck(this, DoClef);\n\t\n\t var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(DoClef).call(this, staffPosition, octave, defaultAccidental));\n\t\n\t _this3.leadingSpace = 0.0;\n\t return _this3;\n\t }\n\t\n\t _createClass(DoClef, [{\n\t key: 'pitchToStaffPosition',\n\t value: function pitchToStaffPosition(pitch) {\n\t return (pitch.octave - this.octave) * 7 + this.staffPosition + _Exsurge.Pitch.stepToStaffOffset(pitch.step) - _Exsurge.Pitch.stepToStaffOffset(_Exsurge.Step.Do);\n\t }\n\t }, {\n\t key: 'staffPositionToPitch',\n\t value: function staffPositionToPitch(staffPosition) {\n\t var offset = staffPosition - this.staffPosition;\n\t var octaveOffset = Math.floor(offset / 7);\n\t\n\t var step = _Exsurge.Pitch.staffOffsetToStep(offset);\n\t\n\t if (this.defaultAccidental !== null && step === this.defaultAccidental.step) step += this.defaultAccidental.accidentalType;\n\t\n\t return new _Exsurge.Pitch(step, this.octave + octaveOffset);\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(DoClef.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var glyph = new _Exsurge2.GlyphVisualizer(ctxt, _Exsurge2.GlyphCode.DoClef);\n\t glyph.setStaffPosition(ctxt, this.staffPosition);\n\t this.addVisualizer(glyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }, {\n\t key: 'clone',\n\t value: function clone() {\n\t return new DoClef(this.staffPosition, this.octave, this.defaultAccidental);\n\t }\n\t }]);\n\t\n\t return DoClef;\n\t}(Clef);\n\t\n\tvar __defaultDoClef = new DoClef(1, 2);\n\t\n\tvar FaClef = exports.FaClef = function (_Clef2) {\n\t _inherits(FaClef, _Clef2);\n\t\n\t function FaClef(staffPosition, octave) {\n\t var defaultAccidental = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];\n\t\n\t _classCallCheck(this, FaClef);\n\t\n\t var _this4 = _possibleConstructorReturn(this, Object.getPrototypeOf(FaClef).call(this, staffPosition, octave, defaultAccidental));\n\t\n\t _this4.octave = octave;\n\t\n\t _this4.leadingSpace = 0;\n\t return _this4;\n\t }\n\t\n\t _createClass(FaClef, [{\n\t key: 'pitchToStaffPosition',\n\t value: function pitchToStaffPosition(pitch) {\n\t return (pitch.octave - this.octave) * 7 + this.staffPosition + _Exsurge.Pitch.stepToStaffOffset(pitch.step) - _Exsurge.Pitch.stepToStaffOffset(_Exsurge.Step.Fa);\n\t }\n\t }, {\n\t key: 'staffPositionToPitch',\n\t value: function staffPositionToPitch(staffPosition) {\n\t var offset = staffPosition - this.staffPosition + 3; // + 3 because it's a fa clef (3 == offset from Do)\n\t var octaveOffset = Math.floor(offset / 7);\n\t\n\t var step = _Exsurge.Pitch.staffOffsetToStep(offset);\n\t\n\t if (step === _Exsurge.Step.Ti && this.defaultAccidental === _ExsurgeChant2.AccidentalType.Flat) step = _Exsurge.Step.Te;\n\t\n\t return new _Exsurge.Pitch(step, this.octave + octaveOffset);\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(FaClef.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var glyph = new _Exsurge2.GlyphVisualizer(ctxt, _Exsurge2.GlyphCode.FaClef);\n\t glyph.setStaffPosition(ctxt, this.staffPosition);\n\t this.addVisualizer(glyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }, {\n\t key: 'clone',\n\t value: function clone() {\n\t return new FaClef(this.staffPosition, this.octave, this.defaultAccidental);\n\t }\n\t }]);\n\t\n\t return FaClef;\n\t}(Clef);\n\t\n\t/*\n\t * TextOnly\n\t */\n\t\n\t\n\tvar TextOnly = exports.TextOnly = function (_ChantNotationElement2) {\n\t _inherits(TextOnly, _ChantNotationElement2);\n\t\n\t function TextOnly() {\n\t _classCallCheck(this, TextOnly);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(TextOnly).call(this));\n\t }\n\t\n\t _createClass(TextOnly, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(TextOnly.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t // add an empty glyph as a placeholder\n\t this.addVisualizer(new _Exsurge2.GlyphVisualizer(ctxt, _Exsurge2.GlyphCode.None));\n\t\n\t this.origin.x = 0;\n\t this.origin.y = 0;\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return TextOnly;\n\t}(_Exsurge2.ChantNotationElement);\n\t\n\tvar ChantLineBreak = exports.ChantLineBreak = function (_ChantNotationElement3) {\n\t _inherits(ChantLineBreak, _ChantNotationElement3);\n\t\n\t function ChantLineBreak(justify) {\n\t _classCallCheck(this, ChantLineBreak);\n\t\n\t var _this6 = _possibleConstructorReturn(this, Object.getPrototypeOf(ChantLineBreak).call(this));\n\t\n\t _this6.justify = justify;\n\t return _this6;\n\t }\n\t\n\t _createClass(ChantLineBreak, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t // reset the bounds before doing a layout\n\t this.bounds = new _Exsurge.Rect(0, 0, 0, 0);\n\t }\n\t }, {\n\t key: 'clone',\n\t value: function clone() {\n\t var lb = new ChantLineBreak();\n\t lb.justify = this.justify;\n\t\n\t return lb;\n\t }\n\t }]);\n\t\n\t return ChantLineBreak;\n\t}(_Exsurge2.ChantNotationElement);\n\t\n\t// a chant mapping is a lightweight format independent way of\n\t// tracking how a chant language (e.g., gabc) has been\n\t// mapped to exsurge notations.\n\t\n\t\n\tvar ChantMapping =\n\t\n\t// source can be any object type. in the case of gabc, source is a text\n\t// string that maps to a gabc word (e.g.: \"no(g)bis(fg)\").\n\t// notations is an array of ChantNotationElements\n\texports.ChantMapping = function ChantMapping(source, notations) {\n\t _classCallCheck(this, ChantMapping);\n\t\n\t this.source = source;\n\t this.notations = notations;\n\t};\n\t\n\t/*\n\t * Score, document\n\t */\n\t\n\t\n\tvar ChantScore = exports.ChantScore = function () {\n\t\n\t // mappings is an array of ChantMappings.\n\t\n\t function ChantScore(ctxt) {\n\t var mappings = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];\n\t var useDropCap = arguments[2];\n\t\n\t _classCallCheck(this, ChantScore);\n\t\n\t this.mappings = mappings;\n\t\n\t this.lines = [];\n\t this.notes = [];\n\t\n\t this.startingClef = null;\n\t\n\t this.useDropCap = useDropCap;\n\t this.dropCap = null;\n\t\n\t this.annotation = null;\n\t\n\t this.compiled = false;\n\t\n\t this.autoColoring = true;\n\t this.needsLayout = true;\n\t\n\t // valid after chant lines are created...\n\t this.bounds = new _Exsurge.Rect();\n\t\n\t this.updateNotations(ctxt);\n\t }\n\t\n\t _createClass(ChantScore, [{\n\t key: 'updateNotations',\n\t value: function updateNotations(ctxt) {\n\t\n\t var i;\n\t\n\t // flatten all mappings into one array for N(0) access to notations\n\t this.notations = [];\n\t for (i = 0; i < this.mappings.length; i++) {\n\t this.notations = this.notations.concat(this.mappings[i].notations);\n\t } // find the starting clef...\n\t // start with a default clef in case the notations don't provide one.\n\t this.startingClef = null;\n\t var defaultClef = new DoClef(1, 2);\n\t\n\t for (i = 0; i < this.notations.length; i++) {\n\t\n\t // if there are neumes before the clef, then we just keep the default clef above\n\t if (this.notations[i].isNeume) {\n\t this.startingClef = defaultClef;\n\t break;\n\t }\n\t\n\t // otherwise, if we find a clef, before neumes then we use that as our default\n\t if (this.notations[i].isClef) {\n\t this.startingClef = this.notations[i];\n\t\n\t // the clef is taken out of the notations...\n\t this.notations.splice(i, 1); // remove a single notation\n\t\n\t break;\n\t }\n\t }\n\t\n\t // if we've reached this far and we *still* don't have a clef, then there aren't even\n\t // any neumes in the score. still, set the default clef just for good measure\n\t if (!this.startingClef) this.startingClef = defaultClef;\n\t\n\t // update drop cap\n\t if (this.useDropCap) this.recreateDropCap(ctxt);\n\t\n\t this.needsLayout = true;\n\t }\n\t }, {\n\t key: 'recreateDropCap',\n\t value: function recreateDropCap(ctxt) {\n\t\n\t // find the first notation with lyrics to use\n\t for (var i = 0; i < this.notations.length; i++) {\n\t if (this.notations[i].hasLyrics() && this.notations[i].lyrics[0] !== null) {\n\t this.dropCap = this.notations[i].lyrics[0].generateDropCap(ctxt);\n\t return;\n\t }\n\t }\n\t }\n\t\n\t // this is the the synchronous version of performLayout that\n\t // process everything without yielding to any other workers/threads.\n\t // good for server side processing or very small chant pieces.\n\t\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t if (this.needsLayout === false) return; // nothing to do here!\n\t\n\t // setup the context\n\t ctxt.activeClef = this.startingClef;\n\t ctxt.notations = this.notations;\n\t ctxt.currNotationIndex = 0;\n\t\n\t if (this.dropCap) this.dropCap.recalculateMetrics(ctxt);\n\t\n\t if (this.annotation) this.annotation.recalculateMetrics(ctxt);\n\t\n\t for (var i = 0; i < this.notations.length; i++) {\n\t this.notations[i].performLayout(ctxt);\n\t ctxt.currNotationIndex++;\n\t }\n\t\n\t this.needsLayout = false;\n\t }\n\t\n\t // for web applications, probably performLayoutAsync would be more\n\t // apppropriate that the above performLayout, since it will process\n\t // the notations without locking up the UI thread.\n\t\n\t }, {\n\t key: 'performLayoutAsync',\n\t value: function performLayoutAsync(ctxt, finishedCallback) {\n\t var _this7 = this;\n\t\n\t if (this.needsLayout === false) {\n\t if (finishedCallback) setTimeout(function () {\n\t return finishedCallback();\n\t }, 0);\n\t\n\t return; // nothing to do here!\n\t }\n\t\n\t // setup the context\n\t ctxt.activeClef = this.startingClef;\n\t ctxt.notations = this.notations;\n\t ctxt.currNotationIndex = 0;\n\t\n\t if (this.dropCap) this.dropCap.recalculateMetrics(ctxt);\n\t\n\t if (this.annotation) this.annotation.recalculateMetrics(ctxt);\n\t\n\t setTimeout(function () {\n\t return _this7.layoutElementsAsync(ctxt, 0, finishedCallback);\n\t }, 0);\n\t }\n\t }, {\n\t key: 'layoutElementsAsync',\n\t value: function layoutElementsAsync(ctxt, index, finishedCallback) {\n\t var _this8 = this;\n\t\n\t if (index >= this.notations.length) {\n\t this.needsLayout = false;\n\t\n\t if (finishedCallback) setTimeout(function () {\n\t return finishedCallback();\n\t }, 0);\n\t\n\t return;\n\t }\n\t\n\t if (index === 0) ctxt.activeClef = this.startingClef;\n\t\n\t var timeout = new Date().getTime() + 50; // process for fifty milliseconds\n\t do {\n\t var notation = this.notations[index];\n\t if (notation.needsLayout) {\n\t ctxt.currNotationIndex = index;\n\t notation.performLayout(ctxt);\n\t }\n\t\n\t index++;\n\t } while (index < this.notations.length && new Date().getTime() < timeout);\n\t\n\t // schedule the next block of processing\n\t setTimeout(function () {\n\t return _this8.layoutElementsAsync(ctxt, index, finishedCallback);\n\t }, 0);\n\t }\n\t }, {\n\t key: 'layoutChantLines',\n\t value: function layoutChantLines(ctxt, width, finishedCallback) {\n\t\n\t this.lines = [];\n\t\n\t var y = 0;\n\t var currIndex = 0;\n\t\n\t ctxt.activeClef = this.startingClef;\n\t\n\t do {\n\t\n\t var line = new _ExsurgeChant.ChantLine(this);\n\t\n\t line.buildFromChantNotationIndex(ctxt, currIndex, width);\n\t currIndex = line.notationsStartIndex + line.numNotationsOnLine;\n\t line.performLayout(ctxt);\n\t this.lines.push(line);\n\t\n\t line.bounds.y = -line.bounds.y + y;\n\t y += line.bounds.height + ctxt.staffInterval * 1.5;\n\t } while (currIndex < this.notations.length);\n\t\n\t var lastLine = this.lines[this.lines.length - 1];\n\t\n\t this.bounds.x = 0;\n\t this.bounds.y = 0;\n\t this.bounds.width = lastLine.bounds.width;\n\t this.bounds.height = y;\n\t\n\t if (finishedCallback) finishedCallback(this);\n\t }\n\t }, {\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t\n\t canvasCtxt.clearRect(0, 0, ctxt.canvas.width, ctxt.canvas.height);\n\t\n\t canvasCtxt.translate(this.bounds.x, this.bounds.y);\n\t\n\t for (var i = 0; i < this.lines.length; i++) {\n\t this.lines[i].draw(ctxt);\n\t }canvasCtxt.translate(-this.bounds.x, -this.bounds.y);\n\t }\n\t }, {\n\t key: 'createSvg',\n\t value: function createSvg(ctxt) {\n\t\n\t var fragment = \"\";\n\t\n\t // create defs section\n\t for (var def in ctxt.defs) {\n\t if (ctxt.defs.hasOwnProperty(def)) fragment += ctxt.defs[def];\n\t }fragment = _Exsurge2.QuickSvg.createFragment('defs', {}, fragment);\n\t\n\t for (var i = 0; i < this.lines.length; i++) {\n\t fragment += this.lines[i].createSvgFragment(ctxt);\n\t }fragment = _Exsurge2.QuickSvg.createFragment('g', {}, fragment);\n\t\n\t fragment = _Exsurge2.QuickSvg.createFragment('svg', {\n\t 'xmlns': 'http://www.w3.org/2000/svg',\n\t 'version': '1.1',\n\t 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n\t 'class': 'ChantScore',\n\t 'width': this.bounds.width,\n\t 'height': this.bounds.height\n\t }, fragment);\n\t\n\t return fragment;\n\t }\n\t }, {\n\t key: 'unserializeFromJson',\n\t value: function unserializeFromJson(data) {\n\t this.autoColoring = data['auto-coloring'];\n\t\n\t if (data.annotation !== null && data.annotation !== \"\") {\n\t // create the annotation\n\t this.annotation = new _Exsurge2.Annotation(ctxt, data.annotation);\n\t } else this.annotation = null;\n\t\n\t var createDropCap = data['drop-cap'] === 'auto' ? true : false;\n\t\n\t _Exsurge3.Gabc.parseChantNotations(data.notations, this, createDropCap);\n\t }\n\t }, {\n\t key: 'serializeToJson',\n\t value: function serializeToJson() {\n\t var data = {};\n\t\n\t data['type'] = \"score\";\n\t data['auto-coloring'] = true;\n\t\n\t if (this.annotation !== null) data.annotation = this.annotation.unsanitizedText;else data.annotation = \"\";\n\t\n\t return data;\n\t }\n\t }]);\n\t\n\t return ChantScore;\n\t}();\n\t\n\tvar ChantDocument = exports.ChantDocument = function () {\n\t function ChantDocument() {\n\t _classCallCheck(this, ChantDocument);\n\t\n\t var defaults = {\n\t layout: {\n\t units: \"mm\",\n\t 'default-font': {\n\t 'font-family': \"Crimson\",\n\t 'font-size': 14\n\t },\n\t page: {\n\t width: 8.5,\n\t height: 11,\n\t 'margin-left': 0,\n\t 'margin-top': 0,\n\t 'margin-right': 0,\n\t 'margin-bottom': 0\n\t }\n\t },\n\t scores: []\n\t };\n\t\n\t // default layout\n\t this.copyLayout(this, defaults);\n\t\n\t this.scores = defaults.scores;\n\t }\n\t\n\t _createClass(ChantDocument, [{\n\t key: 'copyLayout',\n\t value: function copyLayout(to, from) {\n\t\n\t to.layout = {\n\t units: from.layout.units,\n\t 'default-font': {\n\t 'font-family': from.layout['default-font']['font-family'],\n\t 'font-size': from.layout['default-font']['font-size']\n\t },\n\t page: {\n\t width: from.layout.page.width,\n\t height: from.layout.page.height,\n\t 'margin-left': from.layout.page['margin-left'],\n\t 'margin-top': from.layout.page['margin-top'],\n\t 'margin-right': from.layout.page['margin-right'],\n\t 'margin-bottom': from.layout.page['margin-bottom']\n\t }\n\t };\n\t }\n\t }, {\n\t key: 'unserializeFromJson',\n\t value: function unserializeFromJson(data) {\n\t\n\t this.copyLayout(this, data);\n\t\n\t this.scores = [];\n\t\n\t // read in the scores\n\t for (var i = 0; i < data.scores.length; i++) {\n\t var score = new ChantScore();\n\t\n\t score.unserializeFromJson(data.scores[i]);\n\t this.scores.push(score);\n\t }\n\t }\n\t }, {\n\t key: 'serializeToJson',\n\t value: function serializeToJson() {\n\t var data = {};\n\t\n\t this.copyLayout(data, this);\n\t\n\t data.scores = [];\n\t\n\t // save scores...\n\t for (var i = 0; i < this.scores.length; i++) {\n\t data.scores.push(this.scores[i].serializeToJson());\n\t }return data;\n\t }\n\t }]);\n\t\n\t return ChantDocument;\n\t}();\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.ChantLine = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tvar Exsurge = _interopRequireWildcard(_Exsurge);\n\t\n\tvar _Exsurge2 = __webpack_require__(4);\n\t\n\tvar _Exsurge3 = __webpack_require__(6);\n\t\n\tvar _Exsurge4 = __webpack_require__(3);\n\t\n\tvar _ExsurgeChant = __webpack_require__(8);\n\t\n\tvar _ExsurgeChant2 = __webpack_require__(9);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } //\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\t// a chant line represents one staff line on the page. ChantLines are created by the score\n\t// and laid out by the page\n\t\n\tvar ChantLine = exports.ChantLine = function (_ChantLayoutElement) {\n\t _inherits(ChantLine, _ChantLayoutElement);\n\t\n\t function ChantLine(score) {\n\t _classCallCheck(this, ChantLine);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ChantLine).call(this));\n\t\n\t _this.score = score;\n\t\n\t _this.notationsStartIndex = 0;\n\t _this.numNotationsOnLine = 0;\n\t _this.notationBounds = null; // Rect\n\t\n\t _this.staffLeft = 0;\n\t _this.staffRight = 0;\n\t\n\t _this.startingClef = null; // necessary for the layout process\n\t _this.custos = null;\n\t\n\t _this.justify = true;\n\t\n\t // these are markings that exist at the chant line level rather than at the neume level.\n\t _this.ledgerLines = [];\n\t _this.braces = [];\n\t\n\t _this.nextLine = null;\n\t _this.previousLine = null; // for layout assistance\n\t\n\t _this.lyricLineHeights = []; // height of each text line\n\t _this.lyricLineBaselines = []; // offsets from the top of the text line to the baseline\n\t\n\t // fixme: make these configurable values from the score\n\t _this.spaceAfterNotations = 0; // the space between the notation bounds and the first text track\n\t _this.spaceBetweenTextTracks = 0; // spacing between each text track\n\t return _this;\n\t }\n\t\n\t _createClass(ChantLine, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t // start off with a rectangle that holds at least the four staff lines\n\t // we fudge the 3 to 3.1 so that the svg doesn't crop off the upper/lower staff lines...\n\t this.notationBounds = new _Exsurge.Rect(this.staffLeft, -3.1 * ctxt.staffInterval, this.staffRight - this.staffLeft, 6.2 * ctxt.staffInterval);\n\t\n\t // run through all the elements of the line and calculate the bounds of the notations,\n\t // as well as the bounds of each text track we will use\n\t var i;\n\t var notations = this.score.notations;\n\t var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\t var notation = null;\n\t\n\t this.notationBounds.union(this.startingClef.bounds);\n\t\n\t // reset the lyric line offsets before we [re]calculate them now\n\t this.lyricLineHeights = [];\n\t this.lyricLineBaselines = [];\n\t\n\t for (i = this.notationsStartIndex; i < lastIndex; i++) {\n\t notation = notations[i];\n\t\n\t this.notationBounds.union(notation.bounds);\n\t\n\t // keep track of lyric line offsets\n\t for (j = 0; j < notation.lyrics.length; j++) {\n\t if (this.lyricLineHeights.length < j + 1) {\n\t this.lyricLineHeights.push(0);\n\t this.lyricLineBaselines.push(0);\n\t }\n\t\n\t this.lyricLineHeights[j] = Math.max(this.lyricLineHeights[j], notation.lyrics[j].bounds.height);\n\t this.lyricLineBaselines[j] = Math.max(this.lyricLineBaselines[j], notation.lyrics[j].origin.y);\n\t }\n\t }\n\t\n\t if (this.custos) this.notationBounds.union(this.custos.bounds);\n\t\n\t // finalize the lyrics placement\n\t for (i = this.notationsStartIndex; i < lastIndex; i++) {\n\t notation = notations[i];\n\t\n\t var offset = this.notationBounds.y + this.notationBounds.height;\n\t\n\t for (var j = 0; j < notation.lyrics.length; j++) {\n\t notation.lyrics[j].bounds.y = offset + this.lyricLineBaselines[j];\n\t offset += this.lyricLineHeights[j];\n\t }\n\t }\n\t\n\t // add any braces to the notationBounds as well\n\t for (i = 0; i < this.braces.length; i++) {\n\t this.notationBounds.union(this.braces[i].bounds);\n\t }var totalHeight = this.notationBounds.height;\n\t\n\t // add up the lyric line heights to get the total height of the chant line\n\t for (i = 0; i < this.lyricLineHeights.length; i++) {\n\t totalHeight += this.lyricLineHeights[i];\n\t } // dropCap and the annotations\n\t if (this.notationsStartIndex === 0) {\n\t\n\t if (this.score.dropCap !== null) {\n\t\n\t var dropCapY;\n\t if (this.lyricLineHeights.length > 0) {\n\t dropCapY = this.notationBounds.y + this.notationBounds.height + this.lyricLineBaselines[0];\n\t } else dropCapY = this.notationBounds.y + this.notationBounds.height;\n\t\n\t // drop caps and annotations are drawn from their center, so aligning them\n\t // horizontally is as easy as this.staffLeft / 2\n\t this.score.dropCap.bounds.x = this.staffLeft / 2;\n\t this.score.dropCap.bounds.y = dropCapY;\n\t }\n\t\n\t if (this.score.annotation !== null) {\n\t // annotations use dominant-baseline to align text to the top\n\t this.score.annotation.bounds.x = this.staffLeft / 2;\n\t this.score.annotation.bounds.y = -ctxt.staffInterval * 3;\n\t }\n\t }\n\t\n\t this.notationBounds.height += ctxt.lyricTextSize;\n\t\n\t this.bounds.x = 0;\n\t this.bounds.y = this.notationBounds.y;\n\t this.bounds.width = this.notationBounds.right();\n\t this.bounds.height = totalHeight;\n\t\n\t // the origin of the chant line's coordinate space is at the center line of the left extremity of the staff\n\t this.origin = new _Exsurge.Point(this.staffLeft, -this.notationBounds.y);\n\t }\n\t }, {\n\t key: 'draw',\n\t value: function draw(ctxt) {\n\t\n\t var canvasCtxt = ctxt.canvasCtxt;\n\t\n\t canvasCtxt.translate(this.bounds.x, this.bounds.y);\n\t\n\t // draw the chant lines\n\t var i,\n\t x1 = this.staffLeft,\n\t x2 = this.staffRight,\n\t y;\n\t\n\t canvasCtxt.lineWidth = Math.round(ctxt.staffLineWeight);\n\t canvasCtxt.strokeStyle = ctxt.staffLineWeight;\n\t\n\t for (i = -3; i <= 3; i += 2) {\n\t\n\t y = Math.round(ctxt.staffInterval * i) + 0.5;\n\t\n\t canvasCtxt.beginPath();\n\t canvasCtxt.moveTo(x1, y);\n\t canvasCtxt.lineTo(x2, y);\n\t canvasCtxt.stroke();\n\t }\n\t\n\t // draw the ledger lines\n\t for (i = 0; i < this.ledgerLines.length; i++) {\n\t\n\t var ledgerLine = this.ledgerLines[i];\n\t y = ctxt.calculateHeightFromStaffPosition(ledgerLine.staffPosition);\n\t\n\t canvasCtxt.beginPath();\n\t canvasCtxt.moveTo(ledgerLine.x1, y);\n\t canvasCtxt.lineTo(ledgerLine.x2, y);\n\t canvasCtxt.stroke();\n\t }\n\t\n\t // fixme: draw the braces\n\t\n\t // draw the dropCap and the annotations\n\t if (this.notationsStartIndex === 0) {\n\t\n\t if (this.score.dropCap !== null) this.score.dropCap.draw(ctxt);\n\t\n\t if (this.score.annotation !== null) this.score.annotation.draw(ctxt);\n\t }\n\t\n\t // draw the notations\n\t var notations = this.score.notations;\n\t var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\t\n\t for (i = this.notationsStartIndex; i < lastIndex; i++) {\n\t notations[i].draw(ctxt);\n\t }this.startingClef.draw(ctxt);\n\t\n\t if (this.custos) this.custos.draw(ctxt);\n\t\n\t canvasCtxt.translate(-this.bounds.x, -this.bounds.y);\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t var inner = \"\";\n\t\n\t // add the chant lines\n\t var i,\n\t x1 = this.staffLeft,\n\t x2 = this.staffRight;\n\t\n\t // create the staff lines\n\t for (i = -3; i <= 3; i += 2) {\n\t\n\t inner += _Exsurge2.QuickSvg.createFragment('line', {\n\t 'x1': x1,\n\t 'y1': ctxt.staffInterval * i,\n\t 'x2': x2,\n\t 'y2': ctxt.staffInterval * i,\n\t 'stroke': ctxt.staffLineColor,\n\t 'stroke-width': ctxt.staffLineWeight,\n\t 'class': 'staffLine'\n\t });\n\t }\n\t\n\t // create the ledger lines\n\t for (i = 0; i < this.ledgerLines.length; i++) {\n\t\n\t var ledgerLine = this.ledgerLines[i];\n\t var y = ctxt.calculateHeightFromStaffPosition(ledgerLine.staffPosition);\n\t\n\t inner += _Exsurge2.QuickSvg.createFragment('line', {\n\t 'x1': ledgerLine.x1,\n\t 'y1': y,\n\t 'x2': ledgerLine.x2,\n\t 'y2': y,\n\t 'stroke': ctxt.staffLineColor,\n\t 'stroke-width': ctxt.staffLineWeight,\n\t 'class': 'ledgerLine'\n\t });\n\t }\n\t\n\t // add any braces\n\t for (i = 0; i < this.braces.length; i++) {\n\t inner += this.braces[i].createSvgFragment(ctxt);\n\t } // dropCap and the annotations\n\t if (this.notationsStartIndex === 0) {\n\t\n\t if (this.score.dropCap !== null) inner += this.score.dropCap.createSvgFragment(ctxt);\n\t\n\t if (this.score.annotation !== null) inner += this.score.annotation.createSvgFragment(ctxt);\n\t }\n\t\n\t inner += this.startingClef.createSvgFragment(ctxt);\n\t\n\t var notations = this.score.notations;\n\t var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\t\n\t // add all of the notations\n\t for (i = this.notationsStartIndex; i < lastIndex; i++) {\n\t inner += notations[i].createSvgFragment(ctxt);\n\t }if (this.custos) inner += this.custos.createSvgFragment(ctxt);\n\t\n\t return _Exsurge2.QuickSvg.createFragment('g', {\n\t 'class': 'chantLine',\n\t 'transform': 'translate(' + this.bounds.x + ',' + this.bounds.y + ')'\n\t }, inner);\n\t }\n\t\n\t // code below based on code by: https://gist.github.com/alexhornbake\n\t //\n\t // optimized for braces that are only drawn horizontally.\n\t // returns svg path string ready to insert into svg doc\n\t\n\t }, {\n\t key: 'generateCurlyBraceDrawable',\n\t value: function generateCurlyBraceDrawable(ctxt, x1, x2, y, isAbove) {\n\t\n\t var h;\n\t\n\t if (isAbove) h = -ctxt.staffInterval / 2;else h = ctxt.staffInterval / 2;\n\t\n\t // and q factor, .5 is normal, higher q = more expressive bracket\n\t var q = 0.6;\n\t\n\t var dx = -1;\n\t var len = x2 - x1;\n\t\n\t //Calculate Control Points of path,\n\t var qx1 = x1;\n\t var qy1 = y + q * h;\n\t var qx2 = x1 + .25 * len;\n\t var qy2 = y + (1 - q) * h;\n\t var tx1 = x1 + .5 * len;\n\t var ty1 = y + h;\n\t var qx3 = x2;\n\t var qy3 = y + q * h;\n\t var qx4 = x1 + .75 * len;\n\t var qy4 = y + (1 - q) * h;\n\t var d = \"M \" + x1 + \" \" + y + \" Q \" + qx1 + \" \" + qy1 + \" \" + qx2 + \" \" + qy2 + \" T \" + tx1 + \" \" + ty1 + \" M \" + x2 + \" \" + y + \" Q \" + qx3 + \" \" + qy3 + \" \" + qx4 + \" \" + qy4 + \" T \" + tx1 + \" \" + ty1;\n\t\n\t return _Exsurge2.QuickSvg.createFragment('path', {\n\t 'd': d,\n\t 'stroke': ctxt.neumeLineColor,\n\t 'stroke-width': ctxt.neumeLineWeight + 'px',\n\t 'fill': 'none'\n\t });\n\t }\n\t }, {\n\t key: 'buildFromChantNotationIndex',\n\t value: function buildFromChantNotationIndex(ctxt, newElementStart, width) {\n\t\n\t // todo: reset / clear the children we have in case they have data\n\t var notations = this.score.notations;\n\t this.notationsStartIndex = newElementStart;\n\t this.numNotationsOnLine = 0;\n\t\n\t this.staffLeft = 0;\n\t\n\t if (width > 0) this.staffRight = width;else this.staffRight = 99999999; // no limit to staff size\n\t\n\t // If this is the first chant line, then we have to make room for a\n\t // drop cap and/or annotation, if present\n\t if (this.notationsStartIndex === 0) {\n\t\n\t var padding = 0;\n\t\n\t if (this.score.dropCap !== null) padding = this.score.dropCap.bounds.width + this.score.dropCap.padding * 2;\n\t\n\t if (this.score.annotation !== null) padding = Math.max(padding, this.score.annotation.bounds.width + this.score.annotation.padding * 4);\n\t\n\t this.staffLeft += padding;\n\t }\n\t\n\t // set up the clef...\n\t // if the first notation on the line is a starting clef, then we treat it a little differently...\n\t // the clef becomes this line's starting clef and we skip over the clef in the notations array\n\t if (notations[newElementStart].isClef) {\n\t ctxt.activeClef = notations[newElementStart].clone();\n\t newElementStart++;\n\t this.notationsStartIndex++;\n\t }\n\t\n\t // make a copy for this line to use at the beginning\n\t this.startingClef = ctxt.activeClef.clone();\n\t this.startingClef.performLayout(ctxt);\n\t this.startingClef.bounds.x = this.staffLeft;\n\t\n\t var curr = this.startingClef,\n\t prev = null,\n\t prevWithLyrics = null;\n\t\n\t // estimate how much space we have available to us\n\t var rightNotationBoundary = this.staffRight - _Exsurge4.Glyphs.CustosLong.bounds.width * ctxt.glyphScaling - ctxt.intraNeumeSpacing * 4; // possible custos on the line\n\t\n\t // iterate through the notations, fittng what we can on this line\n\t var i,\n\t j,\n\t lastNotationIndex = notations.length - 1;\n\t\n\t for (i = newElementStart; i <= lastNotationIndex; i++) {\n\t\n\t if (curr.hasLyrics()) prevWithLyrics = curr;\n\t\n\t prev = curr;\n\t curr = notations[i];\n\t\n\t var actualRightBoundary;\n\t if (i === lastNotationIndex) {\n\t // on the last notation of the score, we don't need a custos or trailing space, so we use staffRight as the\n\t // right boundary.\n\t actualRightBoundary = this.staffRight;\n\t } else if (i === lastNotationIndex - 1) {\n\t // on the penultimate notation, make sure there is at least enough room for whichever takes up less space,\n\t // between the final notation and a custos:\n\t actualRightBoundary = Math.max(rightNotationBoundary, this.staffRight - notations[lastNotationIndex].bounds.width);\n\t } else {\n\t // Otherwise, we use rightNotationBoundary, which leaves room for a custos...\n\t actualRightBoundary = rightNotationBoundary;\n\t }\n\t\n\t // try to fit the curr element on this line.\n\t // if it doesn't fit, we finish up here.\n\t var fitsOnLine = this.positionNotationElement(ctxt, prevWithLyrics, prev, curr, actualRightBoundary);\n\t if (fitsOnLine === false) {\n\t\n\t // check for an end brace in the curr element\n\t var braceEndIndex = curr.notes && curr.notes.reduce(function (result, n, i) {\n\t return result || n.braceEnd && i + 1 || 0;\n\t }, 0);\n\t var braceStartIndex = curr.notes && curr.notes.reduce(function (result, n, i) {\n\t return result || n.braceStart && i + 1 || 0;\n\t }, 0);\n\t // if there is not a start brace earlier in the element than the end brace, we need to find the earlier start brace\n\t // to keep the entire brace together on the next line\n\t if (braceEndIndex && (!braceStartIndex || braceStartIndex > braceEndIndex)) {\n\t // find last index of start brace\n\t var index = notations.slice(this.notationsStartIndex, i).reduceRight(function (accum, cne, index) {\n\t if (accum === -1 && cne.notes) {\n\t var braceStart = cne.notes.filter(function (n) {\n\t return n.braceStart;\n\t }).length;\n\t var braceEnd = cne.notes.filter(function (n) {\n\t return n.braceEnd;\n\t }).length;\n\t // if we see another end brace before we get to a start brace, short circuit\n\t if (braceEnd) return -2;\n\t if (braceStart) return index;\n\t }\n\t return accum;\n\t }, -1);\n\t // if the start brace was found, this line needs to end just before it:\n\t if (index > 0) {\n\t this.numNotationsOnLine = index;\n\t i = index + this.notationsStartIndex;\n\t }\n\t }\n\t\n\t // check if the prev elements want to be kept with this one\n\t for (j = i - 1; j > this.notationsStartIndex; j--) {\n\t var cne = notations[j];\n\t\n\t if (cne.keepWithNext === true || j === i - 1 && curr.isDivider) this.numNotationsOnLine--;else break;\n\t }\n\t\n\t // we are at the end of the line!\n\t break;\n\t }\n\t\n\t curr.chantLine = this;\n\t this.numNotationsOnLine++;\n\t\n\t if (curr.isClef) ctxt.activeClef = curr;\n\t\n\t // line breaks are a special case indicating to stop processing here\n\t if (curr.constructor === _Exsurge3.ChantLineBreak && width > 0) {\n\t this.justify = curr.justify;\n\t break;\n\t }\n\t }\n\t\n\t // create the automatic custos at the end of the line if there are neumes left in the notations\n\t for (i = this.notationsStartIndex + this.numNotationsOnLine; i < notations.length; i++) {\n\t var notation = notations[i];\n\t\n\t if (notation.isNeume) {\n\t\n\t this.custos = new _ExsurgeChant.Custos(true);\n\t ctxt.currNotationIndex = i - 1; // make sure the context knows where the custos is\n\t this.custos.performLayout(ctxt);\n\t\n\t // Put the custos at the very end of the line\n\t this.custos.bounds.x = this.staffRight - this.custos.bounds.width - this.custos.leadingSpace;\n\t\n\t // nothing more to see here...\n\t break;\n\t }\n\t }\n\t\n\t // if the provided width is less than zero, then set the width of the line\n\t // based on the last notation\n\t var last = notations[this.notationsStartIndex + this.numNotationsOnLine - 1];\n\t if (width <= 0) {\n\t this.staffRight = last.bounds.right();\n\t this.justify = false;\n\t } else if (this.notationsStartIndex + this.numNotationsOnLine === notations.length) {\n\t // this is the last chant line.\n\t this.justify = true;\n\t this.justify = last.isDivider && (this.staffRight - last.bounds.right()) / this.staffRight < .1;\n\t }\n\t\n\t // Justify the line if we need to\n\t if (this.justify === true) this.justifyElements();\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }, {\n\t key: 'justifyElements',\n\t value: function justifyElements() {\n\t\n\t var i;\n\t var toJustify = [];\n\t var notations = this.score.notations;\n\t var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\t\n\t // first step of justification is to determine how much space we have to use up\n\t var extraSpace = 0;\n\t\n\t if (this.numNotationsOnLine > 0) {\n\t var last = notations[lastIndex - 1],\n\t lastWithLyrics = null;\n\t\n\t for (i = lastIndex - 1; i >= this.notationsStartIndex; i--) {\n\t if (notations[i].hasLyrics()) {\n\t lastWithLyrics = notations[i];\n\t break;\n\t }\n\t }\n\t\n\t if (lastWithLyrics) extraSpace = this.staffRight - Math.max(lastWithLyrics.getAllLyricsRight(), last.bounds.right() + last.trailingSpace);else extraSpace = this.staffRight - (last.bounds.right() + last.trailingSpace);\n\t }\n\t\n\t if (this.custos) extraSpace -= this.custos.bounds.width + this.custos.leadingSpace;\n\t\n\t if (extraSpace <= 0) return;\n\t\n\t var prev = null,\n\t curr = null,\n\t prevWithLyrics = null;\n\t\n\t // first pass: determine the neumes we can space apart\n\t for (i = this.notationsStartIndex; i < lastIndex; i++) {\n\t\n\t if (curr !== null && curr.hasLyrics()) prevWithLyrics = curr;\n\t\n\t prev = curr;\n\t curr = notations[i];\n\t\n\t if (prev !== null && prev.keepWithNext === true) continue;\n\t\n\t if (prevWithLyrics !== null && prevWithLyrics.lyrics[0].allowsConnector() && !prevWithLyrics.lyrics[0].needsConnector) continue;\n\t\n\t if (curr.constructor === _Exsurge3.ChantLineBreak) continue;\n\t\n\t // otherwise, we can add space before this element\n\t toJustify.push(curr);\n\t }\n\t\n\t if (toJustify.length === 0) return;\n\t\n\t var offset = 0;\n\t var increment = extraSpace / toJustify.length;\n\t var toJustifyIndex = 0;\n\t for (i = this.notationsStartIndex; i < lastIndex; i++) {\n\t\n\t curr = notations[i];\n\t\n\t if (toJustifyIndex < toJustify.length && toJustify[toJustifyIndex] === curr) {\n\t offset += increment;\n\t toJustifyIndex++;\n\t }\n\t\n\t curr.bounds.x += offset;\n\t }\n\t }\n\t }, {\n\t key: 'finishLayout',\n\t value: function finishLayout(ctxt) {\n\t var _this2 = this;\n\t\n\t this.ledgerLines = []; // clear any existing ledger lines\n\t\n\t var notations = this.score.notations;\n\t var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\t\n\t // an element needs to have a staffPosition property, as well as the standard\n\t // bounds property. so it could be a note, or it could be a custos\n\t // offsetX and offsetY can be used to add to the position info for the element,\n\t // useful in the case of notes.\n\t var processElementForLedgerLine = function processElementForLedgerLine(element) {\n\t var offsetX = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];\n\t var offsetY = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];\n\t\n\t\n\t // do we need a ledger line for this note?\n\t var staffPosition = element.staffPosition;\n\t\n\t if (staffPosition >= 5 || staffPosition <= -5) {\n\t\n\t var x1 = offsetX + element.bounds.x - ctxt.intraNeumeSpacing;\n\t var x2 = offsetX + element.bounds.x + element.bounds.width + ctxt.intraNeumeSpacing;\n\t\n\t // round the staffPosition to the nearest line\n\t if (staffPosition > 0) staffPosition = staffPosition - (staffPosition - 1) % 2;else staffPosition = staffPosition - (staffPosition + 1) % 2;\n\t\n\t // if we have a ledger line close by, then average out the distance between the two\n\t var minLedgerSeperation = ctxt.staffInterval * 5;\n\t\n\t if (_this2.ledgerLines.length > 0 && _this2.ledgerLines[_this2.ledgerLines.length - 1].x2 + minLedgerSeperation >= x1) {\n\t\n\t // average out the distance\n\t var half = (x1 - _this2.ledgerLines[_this2.ledgerLines.length - 1].x2) / 2;\n\t _this2.ledgerLines[_this2.ledgerLines.length - 1].x2 += half;\n\t x1 -= half;\n\t }\n\t\n\t // never let a ledger line extend past the staff width\n\t if (x2 > _this2.staffRight) x2 = _this2.staffRight;\n\t\n\t // finally, add the ledger line\n\t _this2.ledgerLines.push({\n\t x1: x1,\n\t x2: x2,\n\t staffPosition: staffPosition\n\t });\n\t }\n\t };\n\t\n\t var epismata = []; // keep track of epismata in case we can connect some\n\t var startBrace = null,\n\t startBraceNotationIndex = 0;\n\t var minY = Number.MAX_VALUE,\n\t maxY = Number.MIN_VALUE; // for braces\n\t\n\t // make a final pass over all of the notes to add any necessary\n\t // ledger lines and to smooth out epismata\n\t for (var i = this.notationsStartIndex; i < lastIndex; i++) {\n\t\n\t minY = Math.min(minY, notations[i].bounds.y);\n\t maxY = Math.max(maxY, notations[i].bounds.bottom());\n\t\n\t if (notations[i].constructor === _ExsurgeChant.Custos) {\n\t processElementForLedgerLine(notations[i]);\n\t continue;\n\t }\n\t\n\t // if it's not a neume then just skip here\n\t if (!notations[i].isNeume) continue;\n\t\n\t var neume = notations[i];\n\t\n\t for (var j = 0; j < neume.notes.length; j++) {\n\t var k,\n\t note = neume.notes[j];\n\t\n\t processElementForLedgerLine(note, neume.bounds.x, neume.bounds.y);\n\t\n\t // blend epismata as we're able\n\t for (k = 0; k < note.epismata.length; k++) {\n\t\n\t var episema = note.epismata[k];\n\t\n\t var spaceBetweenEpismata = 0;\n\t\n\t // calculate the distance between the last epismata and this one...\n\t // lots of code for a simple: currEpismata.left - prevEpismata.right\n\t if (epismata.length > 0) spaceBetweenEpismata = neume.bounds.x + episema.bounds.x - (epismata[epismata.length - 1].note.neume.bounds.x + epismata[epismata.length - 1].bounds.right());\n\t\n\t // we try to blend the episema if we're able.\n\t if (epismata.length === 0 || epismata[epismata.length - 1].positionHint !== episema.positionHint || epismata[epismata.length - 1].terminating === true || epismata[epismata.length - 1].alignment === _ExsurgeChant2.HorizontalEpisemaAlignment.Left || episema.alignment === _ExsurgeChant2.HorizontalEpisemaAlignment.Right || spaceBetweenEpismata > ctxt.intraNeumeSpacing * 2) {\n\t\n\t // start a new set of epismata to potentially blend\n\t epismata = [];\n\t epismata.push(episema);\n\t } else {\n\t // blend all previous with this one\n\t var newY;\n\t\n\t if (episema.positionHint === _ExsurgeChant2.MarkingPositionHint.Below) newY = Math.max(episema.bounds.y, epismata[epismata.length - 1].bounds.y);else newY = Math.min(episema.bounds.y, epismata[epismata.length - 1].bounds.y);\n\t\n\t if (episema.bounds.y !== newY) episema.bounds.y = newY;else {\n\t for (var l = 0; l < epismata.length; l++) {\n\t epismata[l].bounds.y = newY;\n\t }\n\t }\n\t\n\t // extend the last episema to meet the new one\n\t var newWidth = neume.bounds.x + episema.bounds.x - (epismata[epismata.length - 1].note.neume.bounds.x + epismata[epismata.length - 1].bounds.x);\n\t epismata[epismata.length - 1].bounds.width = newWidth;\n\t\n\t epismata.push(episema);\n\t }\n\t }\n\t\n\t if (note.braceEnd) {\n\t\n\t // calculate the y value of the brace by iterating over all notations\n\t // under/over the brace.\n\t var y;\n\t var dy = ctxt.intraNeumeSpacing / 2; // some safe space between brace and notes.\n\t if (startBrace === null) {\n\t // fixme: this brace must have started on the previous line...what to do here, draw half a brace?\n\t } else {\n\t if (startBrace.isAbove) {\n\t y = ctxt.calculateHeightFromStaffPosition(4);\n\t for (k = startBraceNotationIndex; k <= i; k++) {\n\t y = Math.min(y, notations[k].bounds.y - dy);\n\t }\n\t } else {\n\t y = ctxt.calculateHeightFromStaffPosition(-4);\n\t for (k = startBraceNotationIndex; k <= i; k++) {\n\t y = Math.max(y, notations[k].bounds.y + dy);\n\t }\n\t }\n\t\n\t var addAcuteAccent = false;\n\t\n\t if (startBrace.shape === _ExsurgeChant2.BraceShape.RoundBrace) {\n\t\n\t this.braces.push(new _Exsurge2.RoundBraceVisualizer(ctxt, startBrace.getAttachmentX(), note.braceEnd.getAttachmentX(), y, startBrace.isAbove));\n\t } else {\n\t\n\t if (startBrace.shape === _ExsurgeChant2.BraceShape.AccentedCurlyBrace) addAcuteAccent = true;\n\t\n\t this.braces.push(new _Exsurge2.CurlyBraceVisualizer(ctxt, startBrace.getAttachmentX(), note.braceEnd.getAttachmentX(), y, startBrace.isAbove, addAcuteAccent));\n\t }\n\t }\n\t }\n\t\n\t if (note.braceStart) {\n\t startBrace = note.braceStart;\n\t startBraceNotationIndex = i;\n\t }\n\t\n\t // update the active brace y position if there is one\n\t if (startBrace !== null) {\n\t if (startBrace.isAbove) startBrace.bounds.y = Math.min(startBrace.bounds.y, note.bounds.y);else startBrace.bounds.y = Math.max(startBrace.bounds.y, note.bounds.bottom());\n\t }\n\t }\n\t }\n\t\n\t // if we still have an active brace, that means it spands two chant lines!\n\t if (startBrace !== null) {\n\t startBrace = startBrace;\n\t }\n\t\n\t // don't forget to also include the final custos, which may need a ledger line too\n\t if (this.custos) processElementForLedgerLine(this.custos);\n\t }\n\t\n\t // this is where the real core of positioning neumes takes place\n\t // returns true if positioning was able to fit the neume before rightNotationBoundary.\n\t // returns false if cannot fit before given right margin.\n\t // fixme: if this returns false, shouldn't we set the connectors on prev to be activated?!\n\t\n\t }, {\n\t key: 'positionNotationElement',\n\t value: function positionNotationElement(ctxt, prevWithLyrics, prev, curr, rightNotationBoundary) {\n\t\n\t var i;\n\t\n\t // To begin we just place the current notation right after the previous,\n\t // irrespective of lyrics.\n\t curr.bounds.x = prev.bounds.right() + prev.trailingSpace;\n\t\n\t // if the previous notation has no lyrics, then we simply make sure the\n\t // current notation with lyrics is in the bounds of the line\n\t if (prevWithLyrics === null) {\n\t\n\t var maxRight = curr.bounds.right() + curr.trailingSpace;\n\t\n\t // if the lyric left is negative, then offset the neume appropriately\n\t for (i = 0; i < curr.lyrics.length; i++) {\n\t\n\t curr.lyrics[i].setNeedsConnector(false); // we hope for the best!\n\t\n\t if (curr.getLyricLeft(i) < 0) curr.bounds.x += -curr.getLyricLeft(i);\n\t\n\t maxRight = Math.max(maxRight, curr.getLyricRight(i));\n\t }\n\t\n\t if (maxRight > rightNotationBoundary) return false;else return true;\n\t }\n\t\n\t // if the curr notation has no lyrics, then we force the prev notation\n\t // with lyrics to have syllable connectors.\n\t if (curr.hasLyrics() === false) {\n\t\n\t for (i = 0; i < prevWithLyrics.lyrics.length; i++) {\n\t\n\t if (prevWithLyrics.lyrics[i] !== null && prevWithLyrics.lyrics[i].allowsConnector()) prevWithLyrics.lyrics[i].setNeedsConnector(true);\n\t }\n\t\n\t if (curr.bounds.right() + curr.trailingSpace < rightNotationBoundary) return true;else return false;\n\t }\n\t\n\t // if we have multiple lyrics on the current or the previous notation,\n\t // then we simplify the process. We don't try to eliminate syllable\n\t // connectors but we require them on every syllable in the previous\n\t // notation that permits a connector.\n\t //\n\t // A nice (but probably tricky) enhancement would be to combine lyrics\n\t // when possible, taking into consideration hyphenation of each syllable!\n\t var lyricCount = Math.max(prevWithLyrics.lyrics.length, curr.lyrics.length);\n\t\n\t if (lyricCount > 1) {\n\t\n\t var prevLyricRightMax = Number.MIN_VALUE;\n\t var currLyricLeftMin = Number.MAX_VALUE;\n\t var currLyricRightMax = Number.MIN_VALUE;\n\t\n\t for (i = 0; i < lyricCount; i++) {\n\t\n\t if (i < prevWithLyrics.lyrics.length && prevWithLyrics.lyrics[i] !== null) {\n\t\n\t var right = prevWithLyrics.getLyricRight(i);\n\t\n\t if (prevWithLyrics.lyrics[i].allowsConnector()) {\n\t prevWithLyrics.lyrics[i].setNeedsConnector(true);\n\t right += prevWithLyrics.lyrics[i].widthWithConnector - prevWithLyrics.lyrics[i].widthWithoutConnector;\n\t } else right += ctxt.minLyricWordSpacing;\n\t\n\t prevLyricRightMax = Math.max(prevLyricRightMax, right);\n\t }\n\t\n\t if (i < curr.lyrics.length && curr.lyrics[i] !== null) {\n\t currLyricLeftMin = Math.min(currLyricLeftMin, curr.getLyricLeft(i));\n\t currLyricRightMax = Math.max(currLyricRightMax, curr.getLyricRight(i));\n\t }\n\t }\n\t\n\t // if the lyrics overlap, then we need to shift over the current element a bit\n\t if (prevLyricRightMax > currLyricLeftMin) {\n\t curr.bounds.x += prevLyricRightMax - currLyricLeftMin;\n\t currLyricRightMax += prevLyricRightMax - currLyricLeftMin;\n\t }\n\t\n\t if (curr.bounds.right() < rightNotationBoundary && currLyricRightMax <= this.staffRight) return true;else {\n\t curr.bounds.x = 0;\n\t return false;\n\t }\n\t }\n\t\n\t // handling single lyric lines is a little more nuanced, since we carefully\n\t // eliminate syllable connectors when we're able...\n\t curr.lyrics[0].setNeedsConnector(false); // we hope for the best!\n\t\n\t var currLyricLeft = curr.getLyricLeft(0);\n\t var prevLyricRight = prevWithLyrics.getLyricRight(0);\n\t\n\t if (prevWithLyrics.lyrics[0].allowsConnector() === false) {\n\t\n\t // No connector needed, but include space between words if necessary!\n\t if (prevLyricRight + ctxt.minLyricWordSpacing > currLyricLeft) {\n\t // push the current element over a bit.\n\t curr.bounds.x += prevLyricRight + ctxt.minLyricWordSpacing - currLyricLeft;\n\t }\n\t } else {\n\t\n\t // we may need a connector yet...\n\t\n\t if (prevLyricRight > currLyricLeft) {\n\t // in this case, the lyric elements actually overlap.\n\t // so nope, no connector needed. instead, we just place the lyrics together\n\t // fixme: for better text layout, we could actually use the kerning values\n\t // between the prev and curr lyric elements!\n\t curr.bounds.x += prevLyricRight - currLyricLeft;\n\t } else {\n\t\n\t // bummer, looks like we couldn't merge the syllables together. Better add a connector...\n\t prevWithLyrics.lyrics[0].setNeedsConnector(true);\n\t prevLyricRight = prevWithLyrics.getLyricRight(0);\n\t\n\t if (prevLyricRight > currLyricLeft) curr.bounds.x += prevLyricRight - currLyricLeft;\n\t }\n\t }\n\t\n\t if (curr.bounds.right() + curr.trailingSpace < rightNotationBoundary && curr.getLyricRight(0) <= this.staffRight) return true;\n\t\n\t // if we made it this far, then the element won't fit on this line.\n\t // set the position of the current element to the beginning of a chant line,\n\t // and mark the previous lyric as connecting if needed.\n\t // curr.bounds.x = this.startingClef.bounds.right();\n\t\n\t if (prevWithLyrics.hasLyrics() && prevWithLyrics.lyrics[0].allowsConnector()) prevWithLyrics.lyrics[0].setNeedsConnector(true);\n\t\n\t return false;\n\t }\n\t }]);\n\t\n\t return ChantLine;\n\t}(_Exsurge2.ChantLayoutElement);\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Virgula = exports.Accidental = exports.AccidentalType = exports.DoubleBar = exports.FullBar = exports.HalfBar = exports.QuarterBar = exports.Divider = exports.Custos = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tvar Exsurge = _interopRequireWildcard(_Exsurge);\n\t\n\tvar _Exsurge2 = __webpack_require__(4);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } //\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\t/*\n\t *\n\t */\n\t\n\tvar Custos = exports.Custos = function (_ChantNotationElement) {\n\t _inherits(Custos, _ChantNotationElement);\n\t\n\t // if auto is true, then the custos will automatically try to determine it's height based on\n\t // subsequent notations\n\t\n\t function Custos() {\n\t var auto = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];\n\t\n\t _classCallCheck(this, Custos);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Custos).call(this));\n\t\n\t _this.auto = auto;\n\t _this.staffPosition = 0; // default sane value\n\t return _this;\n\t }\n\t\n\t _createClass(Custos, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Custos.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var glyphCode;\n\t\n\t if (this.auto) {\n\t\n\t var neume = ctxt.findNextNeume();\n\t\n\t if (neume) this.staffPosition = ctxt.activeClef.pitchToStaffPosition(neume.notes[0].pitch);\n\t }\n\t\n\t var glyph = new _Exsurge2.GlyphVisualizer(ctxt, Custos.getGlyphCode(this.staffPosition));\n\t glyph.setStaffPosition(ctxt, this.staffPosition);\n\t this.addVisualizer(glyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t\n\t // called when layout has changed and our dependencies are no longer good\n\t\n\t }, {\n\t key: 'resetDependencies',\n\t value: function resetDependencies() {\n\t\n\t // we only need to resolve new dependencies if we're an automatic custos\n\t if (this.auto) this.needsLayout = true;\n\t }\n\t }], [{\n\t key: 'getGlyphCode',\n\t value: function getGlyphCode(staffPosition) {\n\t\n\t if (staffPosition <= 2) {\n\t\n\t // ascending custodes\n\t if (Math.abs(staffPosition) % 2 === 1) return _Exsurge2.GlyphCode.CustosLong;else return _Exsurge2.GlyphCode.CustosShort;\n\t } else {\n\t\n\t // descending custodes\n\t if (Math.abs(staffPosition) % 2 === 1) return _Exsurge2.GlyphCode.CustosDescLong;else return _Exsurge2.GlyphCode.CustosDescShort;\n\t }\n\t }\n\t }]);\n\t\n\t return Custos;\n\t}(_Exsurge2.ChantNotationElement);\n\t\n\t/*\n\t * Divider\n\t */\n\t\n\t\n\tvar Divider = exports.Divider = function (_ChantNotationElement2) {\n\t _inherits(Divider, _ChantNotationElement2);\n\t\n\t function Divider() {\n\t _classCallCheck(this, Divider);\n\t\n\t var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(Divider).call(this));\n\t\n\t _this2.isDivider = true;\n\t _this2.resetsAccidentals = true;\n\t return _this2;\n\t }\n\t\n\t return Divider;\n\t}(_Exsurge2.ChantNotationElement);\n\t\n\t/*\n\t * QuarterBar\n\t */\n\t\n\t\n\tvar QuarterBar = exports.QuarterBar = function (_Divider) {\n\t _inherits(QuarterBar, _Divider);\n\t\n\t function QuarterBar() {\n\t _classCallCheck(this, QuarterBar);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(QuarterBar).apply(this, arguments));\n\t }\n\t\n\t _createClass(QuarterBar, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(QuarterBar.prototype), 'performLayout', this).call(this, ctxt);\n\t this.addVisualizer(new _Exsurge2.DividerLineVisualizer(ctxt, 2, 4));\n\t\n\t this.origin.x = this.bounds.width / 2;\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return QuarterBar;\n\t}(Divider);\n\t\n\t/*\n\t * HalfBar\n\t */\n\t\n\t\n\tvar HalfBar = exports.HalfBar = function (_Divider2) {\n\t _inherits(HalfBar, _Divider2);\n\t\n\t function HalfBar() {\n\t _classCallCheck(this, HalfBar);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(HalfBar).apply(this, arguments));\n\t }\n\t\n\t _createClass(HalfBar, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(HalfBar.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.addVisualizer(new _Exsurge2.DividerLineVisualizer(ctxt, -2, 2));\n\t\n\t this.origin.x = this.bounds.width / 2;\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return HalfBar;\n\t}(Divider);\n\t\n\t/*\n\t * FullBar\n\t */\n\t\n\t\n\tvar FullBar = exports.FullBar = function (_Divider3) {\n\t _inherits(FullBar, _Divider3);\n\t\n\t function FullBar() {\n\t _classCallCheck(this, FullBar);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(FullBar).apply(this, arguments));\n\t }\n\t\n\t _createClass(FullBar, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(FullBar.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.addVisualizer(new _Exsurge2.DividerLineVisualizer(ctxt, -3, 3));\n\t\n\t this.origin.x = this.bounds.width / 2;\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return FullBar;\n\t}(Divider);\n\t\n\t/*\n\t * DoubleBar\n\t */\n\t\n\t\n\tvar DoubleBar = exports.DoubleBar = function (_Divider4) {\n\t _inherits(DoubleBar, _Divider4);\n\t\n\t function DoubleBar() {\n\t _classCallCheck(this, DoubleBar);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(DoubleBar).apply(this, arguments));\n\t }\n\t\n\t _createClass(DoubleBar, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(DoubleBar.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var line0 = new _Exsurge2.DividerLineVisualizer(ctxt, -3, 3);\n\t line0.bounds.x = 0;\n\t this.addVisualizer(line0);\n\t\n\t var line1 = new _Exsurge2.DividerLineVisualizer(ctxt, -3, 3);\n\t line1.bounds.x = ctxt.intraNeumeSpacing * 2;\n\t this.addVisualizer(line1);\n\t\n\t this.origin.x = this.bounds.width / 2;\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return DoubleBar;\n\t}(Divider);\n\t\n\tvar AccidentalType = exports.AccidentalType = {\n\t Flat: -1,\n\t Natural: 0,\n\t Sharp: 1\n\t};\n\t\n\t/*\n\t * Accidental\n\t */\n\t\n\tvar Accidental = exports.Accidental = function (_ChantNotationElement3) {\n\t _inherits(Accidental, _ChantNotationElement3);\n\t\n\t function Accidental(staffPosition, accidentalType) {\n\t _classCallCheck(this, Accidental);\n\t\n\t var _this7 = _possibleConstructorReturn(this, Object.getPrototypeOf(Accidental).call(this));\n\t\n\t _this7.isAccidental = true;\n\t _this7.keepWithNext = true; // accidentals should always stay connected...\n\t\n\t _this7.staffPosition = staffPosition;\n\t _this7.accidentalType = accidentalType;\n\t return _this7;\n\t }\n\t\n\t _createClass(Accidental, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Accidental.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.addVisualizer(this.createGlyphVisualizer(ctxt));\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t\n\t // creation of the glyph visualizer is refactored out or performLayout\n\t // so that clefs can use the same logic for their accidental glyph\n\t\n\t }, {\n\t key: 'createGlyphVisualizer',\n\t value: function createGlyphVisualizer(ctxt) {\n\t\n\t var glyphCode = _Exsurge2.GlyphCode.Flat;\n\t\n\t switch (this.accidentalType) {\n\t case AccidentalType.Natural:\n\t glyphCode = _Exsurge2.GlyphCode.Natural;\n\t break;\n\t case AccidentalType.Sharp:\n\t glyphCode = _Exsurge2.GlyphCode.Sharp;\n\t break;\n\t default:\n\t glyphCode = _Exsurge2.GlyphCode.Flat;\n\t break;\n\t }\n\t\n\t var glyph = new _Exsurge2.GlyphVisualizer(ctxt, glyphCode);\n\t glyph.setStaffPosition(ctxt, this.staffPosition);\n\t\n\t return glyph;\n\t }\n\t }, {\n\t key: 'adjustStep',\n\t value: function adjustStep(step) {\n\t switch (this.accidentalType) {\n\t case AccidentalType.Flat:\n\t if (step === Step.Ti) return Step.Te;\n\t if (step === Step.Mi) return Step.Me;\n\t break;\n\t case AccidentalType.Sharp:\n\t if (step === Step.Do) return Step.Du;\n\t if (step === Step.Fa) return Step.Fu;\n\t break;\n\t case AccidentalType.Natural:\n\t if (step === Step.Te) return Step.Ti;\n\t if (step === Step.Me) return Step.Mi;\n\t if (step === Step.Du) return Step.Do;\n\t if (step === Step.Fu) return Step.Fa;\n\t break;\n\t }\n\t\n\t // no adjustment needed\n\t return step;\n\t }\n\t }, {\n\t key: 'applyToPitch',\n\t value: function applyToPitch(pitch) {\n\t\n\t // fixme: this is broken since we changed to staff positions\n\t\n\t // no adjusment needed\n\t if (this.octave !== pitch.octave) return;\n\t\n\t pitch.step = this.adjustStep(pitch.step);\n\t }\n\t }]);\n\t\n\t return Accidental;\n\t}(_Exsurge2.ChantNotationElement);\n\t\n\t/*\n\t * Virgula\n\t */\n\t\n\t\n\tvar Virgula = exports.Virgula = function (_Divider5) {\n\t _inherits(Virgula, _Divider5);\n\t\n\t function Virgula() {\n\t _classCallCheck(this, Virgula);\n\t\n\t // unlike other dividers a virgula does not reset accidentals\n\t\n\t var _this8 = _possibleConstructorReturn(this, Object.getPrototypeOf(Virgula).call(this));\n\t\n\t _this8.resetsAccidentals = false;\n\t\n\t // the staff position of the virgula is customizable, so that it\n\t // can be placed on different lines (top or bottom) depending on the\n\t // notation tradition of what is being notated (e.g., Benedictine has it\n\t // on top line, Norbertine at the bottom)\n\t _this8.staffPosition = 3;\n\t return _this8;\n\t }\n\t\n\t _createClass(Virgula, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Virgula.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var glyph = new _Exsurge2.GlyphVisualizer(ctxt, _Exsurge2.GlyphCode.Virgula);\n\t glyph.setStaffPosition(ctxt, this.staffPosition);\n\t\n\t this.addVisualizer(glyph);\n\t\n\t this.origin.x = this.bounds.width / 2;\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Virgula;\n\t}(Divider);\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.BracePoint = exports.BraceAttachment = exports.BraceShape = exports.Mora = exports.Ictus = exports.HorizontalEpisema = exports.HorizontalEpisemaAlignment = exports.AcuteAccent = exports.MarkingPositionHint = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tvar Exsurge = _interopRequireWildcard(_Exsurge);\n\t\n\tvar _Exsurge2 = __webpack_require__(4);\n\t\n\tvar _Exsurge3 = __webpack_require__(6);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } //\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\t// for positioning markings on notes\n\tvar MarkingPositionHint = exports.MarkingPositionHint = {\n\t Default: 0,\n\t Above: 1,\n\t Below: 2\n\t};\n\t\n\tvar AcuteAccent = exports.AcuteAccent = function (_GlyphVisualizer) {\n\t _inherits(AcuteAccent, _GlyphVisualizer);\n\t\n\t function AcuteAccent(ctxt, note) {\n\t _classCallCheck(this, AcuteAccent);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AcuteAccent).call(this, ctxt, _Exsurge2.GlyphCode.AcuteAccent));\n\t\n\t _this.note = note;\n\t _this.positionHint = MarkingPositionHint.Above;\n\t return _this;\n\t }\n\t\n\t _createClass(AcuteAccent, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t this.bounds.x += this.bounds.width / 2; // center on the note itself\n\t\n\t // this puts the acute accent either over the staff lines, or over the note if the\n\t // note is above the staff lines\n\t this.setStaffPosition(ctxt, Math.max(this.note.staffPosition + 1, 4));\n\t }\n\t }]);\n\t\n\t return AcuteAccent;\n\t}(_Exsurge2.GlyphVisualizer);\n\t\n\t// for positioning markings on notes\n\t\n\t\n\tvar HorizontalEpisemaAlignment = exports.HorizontalEpisemaAlignment = {\n\t Default: 0,\n\t Left: 1,\n\t Center: 2,\n\t Right: 3\n\t};\n\t\n\t/*\n\t * HorizontalEpisema\n\t *\n\t * A horizontal episema marking is it's own visualizer (that is, it implements createSvgFragment)\n\t */\n\t\n\tvar HorizontalEpisema = exports.HorizontalEpisema = function (_ChantLayoutElement) {\n\t _inherits(HorizontalEpisema, _ChantLayoutElement);\n\t\n\t function HorizontalEpisema(note) {\n\t _classCallCheck(this, HorizontalEpisema);\n\t\n\t var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(HorizontalEpisema).call(this));\n\t\n\t _this2.note = note;\n\t\n\t _this2.positionHint = MarkingPositionHint.Default;\n\t _this2.terminating = false; // indicates if this episema should terminate itself or not\n\t _this2.alignment = HorizontalEpisemaAlignment.Default;\n\t return _this2;\n\t }\n\t\n\t _createClass(HorizontalEpisema, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t // following logic helps to keep the episemae away from staff lines if they get too close\n\t // the placement is based on a review of the Vatican and solesmes editions, which\n\t // seem to always place the epismata centered between staff lines. Probably helps\n\t // for visual layout, rather than letting epismata be at various heights.\n\t\n\t var y = 0,\n\t step;\n\t var minDistanceAway = ctxt.staffInterval * 0.4; // min distance from neume\n\t\n\t if (this.positionHint === MarkingPositionHint.Below) {\n\t y = this.note.bounds.bottom() + minDistanceAway; // the highest the line could be at\n\t step = Math.floor(y / ctxt.staffInterval);\n\t\n\t // if it's an odd step, that means we're on a staff line,\n\t // so we shift to between the staff line\n\t if (Math.abs(step % 2) === 1) step = step + 1;\n\t } else {\n\t y = this.note.bounds.y - minDistanceAway; // the lowest the line could be at\n\t step = Math.ceil(y / ctxt.staffInterval);\n\t\n\t // if it's an odd step, that means we're on a staff line,\n\t // so we shift to between the staff line\n\t if (Math.abs(step % 2) === 1) step = step - 1;\n\t }\n\t\n\t y = step * ctxt.staffInterval;\n\t\n\t var glyphCode = this.note.glyphVisualizer.glyphCode;\n\t var width;\n\t\n\t // The porrectus requires special handling of the note width,\n\t // otherwise the width is just that of the note itself\n\t if (glyphCode === _Exsurge2.GlyphCode.Porrectus1 || glyphCode === _Exsurge2.GlyphCode.Porrectus2 || glyphCode === _Exsurge2.GlyphCode.Porrectus3 || glyphCode === _Exsurge2.GlyphCode.Porrectus4) width = ctxt.staffInterval;else width = this.note.bounds.width;\n\t\n\t var x = this.note.bounds.x;\n\t\n\t // also, the position hint can affect the x/width of the episema\n\t if (this.alignment === HorizontalEpisemaAlignment.Left) {\n\t width *= .80;\n\t } else if (this.alignment === HorizontalEpisemaAlignment.Center) {\n\t x += width * .20;\n\t width *= .60;\n\t } else if (this.alignment === HorizontalEpisemaAlignment.Right) {\n\t x += width * .20;\n\t width *= .80;\n\t }\n\t\n\t this.bounds.x = x;\n\t this.bounds.y = y;\n\t this.bounds.width = width;\n\t this.bounds.height = ctxt.episemaLineWeight;\n\t\n\t this.origin.x = 0;\n\t this.origin.y = 0;\n\t }\n\t }, {\n\t key: 'createSvgFragment',\n\t value: function createSvgFragment(ctxt) {\n\t\n\t return _Exsurge2.QuickSvg.createFragment('rect', {\n\t 'x': this.bounds.x,\n\t 'y': this.bounds.y,\n\t 'width': this.bounds.width,\n\t 'height': this.bounds.height,\n\t 'fill': ctxt.neumeLineColor,\n\t 'class': 'horizontalEpisema'\n\t });\n\t }\n\t }]);\n\t\n\t return HorizontalEpisema;\n\t}(_Exsurge2.ChantLayoutElement);\n\t\n\t/*\n\t * Ictus\n\t */\n\t\n\t\n\tvar Ictus = exports.Ictus = function (_GlyphVisualizer2) {\n\t _inherits(Ictus, _GlyphVisualizer2);\n\t\n\t function Ictus(ctxt, note) {\n\t _classCallCheck(this, Ictus);\n\t\n\t var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(Ictus).call(this, ctxt, _Exsurge2.GlyphCode.VerticalEpisemaAbove));\n\t\n\t _this3.note = note;\n\t _this3.positionHint = MarkingPositionHint.Default;\n\t return _this3;\n\t }\n\t\n\t _createClass(Ictus, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t var glyphCode;\n\t\n\t // fixme: this positioning logic doesn't work for the ictus on a virga apparently...?\n\t\n\t if (this.positionHint === MarkingPositionHint.Above) {\n\t glyphCode = _Exsurge2.GlyphCode.VerticalEpisemaAbove;\n\t } else {\n\t glyphCode = _Exsurge2.GlyphCode.VerticalEpisemaBelow;\n\t }\n\t\n\t var staffPosition = this.note.staffPosition;\n\t\n\t var horizontalOffset = this.note.bounds.width / 2;\n\t var verticalOffset = 0;\n\t\n\t switch (glyphCode) {\n\t case _Exsurge2.GlyphCode.VerticalEpisemaAbove:\n\t if (staffPosition % 2 === 0) verticalOffset -= ctxt.staffInterval * 1.5;else verticalOffset -= ctxt.staffInterval * .9;\n\t break;\n\t\n\t case _Exsurge2.GlyphCode.VerticalEpisemaBelow:\n\t default:\n\t if (staffPosition % 2 === 0) verticalOffset += ctxt.staffInterval * 1.5;else verticalOffset += ctxt.staffInterval * .8;\n\t break;\n\t }\n\t\n\t this.setGlyph(ctxt, glyphCode);\n\t this.setStaffPosition(ctxt, staffPosition);\n\t\n\t this.bounds.x = this.note.bounds.x + horizontalOffset - this.origin.x;\n\t this.bounds.y += verticalOffset;\n\t }\n\t }]);\n\t\n\t return Ictus;\n\t}(_Exsurge2.GlyphVisualizer);\n\t\n\t/*\n\t * Mora\n\t */\n\t\n\t\n\tvar Mora = exports.Mora = function (_GlyphVisualizer3) {\n\t _inherits(Mora, _GlyphVisualizer3);\n\t\n\t function Mora(ctxt, note) {\n\t _classCallCheck(this, Mora);\n\t\n\t var _this4 = _possibleConstructorReturn(this, Object.getPrototypeOf(Mora).call(this, ctxt, _Exsurge2.GlyphCode.Mora));\n\t\n\t _this4.note = note;\n\t _this4.positionHint = MarkingPositionHint.Default;\n\t return _this4;\n\t }\n\t\n\t _createClass(Mora, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t\n\t var staffPosition = this.note.staffPosition;\n\t\n\t this.setStaffPosition(ctxt, staffPosition);\n\t\n\t var verticalOffset = 0;\n\t if (this.positionHint === MarkingPositionHint.Above) {\n\t if (staffPosition % 2 === 0) verticalOffset -= ctxt.staffInterval + ctxt.staffInterval * .75;else verticalOffset -= ctxt.staffInterval * .75;\n\t } else if (this.positionHint === MarkingPositionHint.Below) {\n\t if (staffPosition % 2 === 0) verticalOffset += ctxt.staffInterval + ctxt.staffInterval * .75;else verticalOffset += ctxt.staffInterval * .75;\n\t } else {\n\t if (Math.abs(staffPosition) % 2 === 1) verticalOffset -= ctxt.staffInterval * .75;\n\t }\n\t\n\t this.bounds.x += this.note.bounds.right() + ctxt.staffInterval / 4.0;\n\t this.bounds.y += verticalOffset;\n\t }\n\t }]);\n\t\n\t return Mora;\n\t}(_Exsurge2.GlyphVisualizer);\n\t\n\t// indicates the shape of the brace\n\t\n\t\n\tvar BraceShape = exports.BraceShape = {\n\t RoundBrace: 0,\n\t CurlyBrace: 1,\n\t AccentedCurlyBrace: 2\n\t};\n\t\n\t// indicates how the brace is alignerd to the note to which it's connected\n\tvar BraceAttachment = exports.BraceAttachment = {\n\t Left: 0,\n\t Right: 1\n\t};\n\t\n\tvar BracePoint = exports.BracePoint = function (_ChantLayoutElement2) {\n\t _inherits(BracePoint, _ChantLayoutElement2);\n\t\n\t function BracePoint(note, isAbove, shape, attachment) {\n\t _classCallCheck(this, BracePoint);\n\t\n\t var _this5 = _possibleConstructorReturn(this, Object.getPrototypeOf(BracePoint).call(this));\n\t\n\t _this5.note = note;\n\t _this5.isAbove = isAbove;\n\t _this5.shape = shape;\n\t _this5.attachment = attachment;\n\t return _this5;\n\t }\n\t\n\t _createClass(BracePoint, [{\n\t key: 'getAttachmentX',\n\t value: function getAttachmentX() {\n\t if (this.attachment === BraceAttachment.Left) return this.note.neume.bounds.x + this.note.bounds.x;else return this.note.neume.bounds.x + this.note.bounds.right();\n\t }\n\t }]);\n\t\n\t return BracePoint;\n\t}(_Exsurge2.ChantLayoutElement);\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Gabc = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t//\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tvar _Exsurge2 = __webpack_require__(4);\n\t\n\tvar _Exsurge3 = __webpack_require__(6);\n\t\n\tvar _ExsurgeChant = __webpack_require__(9);\n\t\n\tvar Markings = _interopRequireWildcard(_ExsurgeChant);\n\t\n\tvar _ExsurgeChant2 = __webpack_require__(8);\n\t\n\tvar Signs = _interopRequireWildcard(_ExsurgeChant2);\n\t\n\tvar _ExsurgeChant3 = __webpack_require__(11);\n\t\n\tvar Neumes = _interopRequireWildcard(_ExsurgeChant3);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// reusable reg exps\n\tvar __syllablesRegex = /(?=.)((?:[^(])*)(?:\\(?([^)]*)\\)?)?/g;\n\tvar __notationsRegex = /z0|z|Z|::|:|;|,|`|c1|c2|c3|c4|f3|f4|cb3|cb4|\\/\\/|\\/| |\\!|-?[a-mA-M][oOwWvVrRsxy#~\\+><_\\.'012345]*(?:\\[[^\\]]*\\]?)*/g;\n\t\n\t// for the brace string inside of [ and ] in notation data\n\t// the capturing groups are:\n\t// 1. o or u, to indicate over or under\n\t// 2. b, cb, or cba, to indicate the brace type\n\t// 3. 0 or 1 to indicate the attachment point\n\t// 4. {}( or ) to indicate opening/closing (this group will be null if the metric version is used)\n\t// 5. a float indicating the millimeter length of the brace (not supported yet)\n\tvar __braceSpecRegex = /([ou])(b|cb|cba):([01])(?:([{}])|;(\\d*(?:\\.\\d+)?)mm)/;\n\t\n\tvar Gabc = exports.Gabc = function () {\n\t function Gabc() {\n\t _classCallCheck(this, Gabc);\n\t }\n\t\n\t _createClass(Gabc, null, [{\n\t key: 'createMappingsFromSource',\n\t\n\t\n\t // takes gabc source code (without the header info) and returns an array\n\t // of ChantMappings describing the chant. A chant score can then be created\n\t // fron the chant mappings and later updated via updateMappings() if need\n\t // be...\n\t value: function createMappingsFromSource(ctxt, gabcSource) {\n\t\n\t var words = this.splitWords(gabcSource);\n\t\n\t // set the default clef\n\t ctxt.activeClef = _Exsurge3.Clef.default();\n\t\n\t var mappings = this.createMappingsFromWords(ctxt, words, function (clef) {\n\t return ctxt.activeClef = clef;\n\t });\n\t\n\t // always set the last notation to have a trailingSpace of 0. This makes layout for the last chant line simpler\n\t if (mappings.length > 0 && mappings[mappings.length - 1].notations.length > 0) mappings[mappings.length - 1].notations[mappings[mappings.length - 1].notations.length - 1].trailingSpace = 0;\n\t\n\t return mappings;\n\t }\n\t\n\t // A simple general purpose diff algorithm adapted here for comparing\n\t // an array of existing mappings with an updated list of gabc words.\n\t // note before is an array of mappings, and after is an array of strings\n\t // (gabc words).\n\t //\n\t // This is definitely not the most effecient diff algorithm, but for our\n\t // limited needs and source size it seems to work just fine...\n\t //\n\t // code is adapted from: https://github.com/paulgb/simplediff\n\t //\n\t // Returns:\n\t // A list of pairs, with the first part of the pair being one of three\n\t // strings ('-', '+', '=') and the second part being a list of values from\n\t // the original before and/or after lists. The first part of the pair\n\t // corresponds to whether the list of values is a deletion, insertion, or\n\t // unchanged, respectively.\n\t\n\t }, {\n\t key: 'diffDescriptorsAndNewWords',\n\t value: function diffDescriptorsAndNewWords(before, after) {\n\t\n\t // Create a map from before values to their indices\n\t var oldIndexMap = {},\n\t i;\n\t for (i = 0; i < before.length; i++) {\n\t oldIndexMap[before[i].source] = oldIndexMap[before[i].source] || [];\n\t oldIndexMap[before[i].source].push(i);\n\t }\n\t\n\t var overlap = [],\n\t startOld,\n\t startNew,\n\t subLength,\n\t inew;\n\t\n\t startOld = startNew = subLength = 0;\n\t\n\t for (inew = 0; inew < after.length; inew++) {\n\t var _overlap = [];\n\t oldIndexMap[after[inew]] = oldIndexMap[after[inew]] || [];\n\t for (i = 0; i < oldIndexMap[after[inew]].length; i++) {\n\t var iold = oldIndexMap[after[inew]][i];\n\t // now we are considering all values of val such that\n\t // `before[iold] == after[inew]`\n\t _overlap[iold] = (iold && overlap[iold - 1] || 0) + 1;\n\t if (_overlap[iold] > subLength) {\n\t // this is the largest substring seen so far, so store its indices\n\t subLength = _overlap[iold];\n\t startOld = iold - subLength + 1;\n\t startNew = inew - subLength + 1;\n\t }\n\t }\n\t overlap = _overlap;\n\t }\n\t\n\t if (subLength === 0) {\n\t // If no common substring is found, we return an insert and delete...\n\t var result = [];\n\t\n\t if (before.length) result.push(['-', before]);\n\t\n\t if (after.length) result.push(['+', after]);\n\t\n\t return result;\n\t }\n\t\n\t // ...otherwise, the common substring is unchanged and we recursively\n\t // diff the text before and after that substring\n\t return [].concat(this.diffDescriptorsAndNewWords(before.slice(0, startOld), after.slice(0, startNew)), [['=', after.slice(startNew, startNew + subLength)]], this.diffDescriptorsAndNewWords(before.slice(startOld + subLength), after.slice(startNew + subLength)));\n\t }\n\t\n\t // this function essentially performs and applies a rudimentary diff between a\n\t // previously parsed set of mappings and between a new gabc source text.\n\t // the mappings array passed in is changed in place to be updated from the\n\t // new source\n\t\n\t }, {\n\t key: 'updateMappingsFromSource',\n\t value: function updateMappingsFromSource(ctxt, mappings, newGabcSource) {\n\t\n\t // always remove the last old mapping since it's spacing/trailingSpace is handled specially\n\t mappings.pop();\n\t\n\t var newWords = this.splitWords(newGabcSource);\n\t\n\t var results = this.diffDescriptorsAndNewWords(mappings, newWords);\n\t\n\t var index = 0,\n\t j,\n\t k;\n\t\n\t ctxt.activeClef = _Exsurge3.Clef.default();\n\t\n\t // apply the results to the mappings, marking notations that need to be processed\n\t for (var i = 0; i < results.length; i++) {\n\t\n\t var resultCode = results[i][0];\n\t var resultValues = results[i][1];\n\t\n\t if (resultCode === '=') {\n\t // skip over ones that haven't changed, but updating the clef as we go\n\t for (j = 0; j < resultValues.length; j++, index++) {\n\t for (k = 0; k < mappings[index].notations.length; k++) {\n\t // notify the notation that its dependencies are no longer valid\n\t mappings[index].notations[k].resetDependencies();\n\t\n\t if (mappings[index].notations[k].isClef) ctxt.activeClef = mappings[index].notations[k];\n\t }\n\t }\n\t } else if (resultCode === '-') {\n\t // delete elements that no longer exist, but first notify all\n\t // elements of the change\n\t mappings.splice(index, resultValues.length);\n\t } else if (resultCode === '+') {\n\t // insert new ones\n\t for (j = 0; j < resultValues.length; j++) {\n\t var mapping = this.createMappingFromWord(ctxt, resultValues[j]);\n\t\n\t for (k = 0; k < mapping.notations.length; k++) {\n\t if (mapping.notations[k].isClef) ctxt.activeClef = mapping.notations[k];\n\t }mappings.splice(index++, 0, mapping);\n\t }\n\t }\n\t }\n\t\n\t // always set the last notation to have a trailingSpace of 0. This makes layout for the last chant line simpler\n\t if (mappings.length > 0 && mappings[mappings.length - 1].notations.length > 0) mappings[mappings.length - 1].notations[mappings[mappings.length - 1].notations.length - 1].trailingSpace = 0;\n\t }\n\t\n\t // takes an array of gabc words (like that returned by splitWords below)\n\t // and returns an array of ChantMapping objects, one for each word.\n\t\n\t }, {\n\t key: 'createMappingsFromWords',\n\t value: function createMappingsFromWords(ctxt, words) {\n\t var mappings = [];\n\t\n\t for (var i = 0; i < words.length; i++) {\n\t var word = words[i].trim();\n\t\n\t if (word === '') continue;\n\t\n\t var mapping = this.createMappingFromWord(ctxt, word);\n\t\n\t if (mapping) mappings.push(mapping);\n\t }\n\t\n\t return mappings;\n\t }\n\t\n\t // takes a gabc word (like those returned by splitWords below) and returns\n\t // a ChantMapping object that contains the gabc word source text as well\n\t // as the generated notations.\n\t\n\t }, {\n\t key: 'createMappingFromWord',\n\t value: function createMappingFromWord(ctxt, word) {\n\t\n\t var matches = [];\n\t var notations = [];\n\t var currSyllable = 0;\n\t\n\t while (match = __syllablesRegex.exec(word)) {\n\t matches.push(match);\n\t }for (var j = 0; j < matches.length; j++) {\n\t var match = matches[j];\n\t\n\t var lyricText = match[1].trim();\n\t var notationData = match[2];\n\t\n\t var items = this.parseNotations(ctxt, notationData);\n\t\n\t if (items.length === 0) continue;\n\t\n\t notations = notations.concat(items);\n\t\n\t if (lyricText === '') continue;\n\t\n\t // add the lyrics to the first notation that makes sense...\n\t var notationWithLyrics = null;\n\t for (var i = 0; i < items.length; i++) {\n\t var cne = items[i];\n\t\n\t if (cne.isAccidental || cne.constructor === Signs.Custos) continue;\n\t\n\t notationWithLyrics = cne;\n\t break;\n\t }\n\t\n\t if (notationWithLyrics === null) return notations;\n\t\n\t var proposedLyricType;\n\t\n\t // if it's not a neume or a TextOnly notation, then make the lyrics a directive\n\t if (!cne.isNeume && cne.constructor !== _Exsurge3.TextOnly) proposedLyricType = _Exsurge2.LyricType.Directive;\n\t // otherwise trye to guess the lyricType for the first lyric anyway\n\t else if (currSyllable === 0 && j === matches.length - 1) proposedLyricType = _Exsurge2.LyricType.SingleSyllable;else if (currSyllable === 0 && j < matches.length - 1) proposedLyricType = _Exsurge2.LyricType.BeginningSyllable;else if (j === matches.length - 1) proposedLyricType = _Exsurge2.LyricType.EndingSyllable;else proposedLyricType = _Exsurge2.LyricType.MiddleSyllable;\n\t\n\t currSyllable++;\n\t\n\t // also, new words reset the accidentals, per the Solesmes style (see LU xviij)\n\t if (proposedLyricType === _Exsurge2.LyricType.BeginningSyllable || proposedLyricType === _Exsurge2.LyricType.SingleSyllable) ctxt.activeClef.resetAccidentals();\n\t\n\t var lyrics = this.createSyllableLyrics(ctxt, lyricText, proposedLyricType);\n\t\n\t if (lyrics === null || lyrics.length === 0) continue;\n\t\n\t notationWithLyrics.lyrics = lyrics;\n\t }\n\t\n\t return new _Exsurge3.ChantMapping(word, notations);\n\t }\n\t\n\t // returns an array of lyrics (an array because each syllable can have multiple lyrics)\n\t\n\t }, {\n\t key: 'createSyllableLyrics',\n\t value: function createSyllableLyrics(ctxt, text, proposedLyricType) {\n\t\n\t var lyrics = [];\n\t\n\t // an extension to gabc: multiple lyrics per syllable can be separated by a |\n\t var lyricTexts = text.split('|');\n\t\n\t for (var i = 0; i < lyricTexts.length; i++) {\n\t\n\t var lyricText = lyricTexts[i];\n\t\n\t // gabc allows lyrics to indicate the centering part of the text by\n\t // using braces to indicate how to center the lyric. So a lyric can\n\t // look like \"f{i}re\" or \"{fenced}\" to center on the i or on the entire\n\t // word, respectively. Here we determine if the lyric should be spaced\n\t // manually with this method of using braces.\n\t var centerStartIndex = lyricText.indexOf('{');\n\t var centerLength = 0;\n\t\n\t if (centerStartIndex >= 0) {\n\t var indexClosingBracket = lyricText.indexOf('}');\n\t\n\t if (indexClosingBracket >= 0 && indexClosingBracket > centerStartIndex) {\n\t centerLength = indexClosingBracket - centerStartIndex - 1;\n\t\n\t // strip out the brackets...is this better than string.replace?\n\t lyricText = lyricText.substring(0, centerStartIndex) + lyricText.substring(centerStartIndex + 1, indexClosingBracket) + lyricText.substring(indexClosingBracket + 1, lyricText.length);\n\t } else centerStartIndex = -1; // if there's no closing bracket, don't enable centering\n\t }\n\t\n\t var lyric = this.makeLyric(ctxt, lyricText, proposedLyricType);\n\t\n\t // if we have manual lyric centering, then set it now\n\t if (centerStartIndex >= 0) {\n\t lyric.centerStartIndex = centerStartIndex;\n\t lyric.centerLength = centerLength;\n\t }\n\t\n\t lyrics.push(lyric);\n\t }\n\t\n\t return lyrics;\n\t }\n\t }, {\n\t key: 'makeLyric',\n\t value: function makeLyric(ctxt, text, lyricType) {\n\t\n\t if (text.length > 1 && text[text.length - 1] === '-') {\n\t if (lyricType === _Exsurge2.LyricType.EndingSyllable) lyricType = _Exsurge2.LyricType.MiddleSyllable;else if (lyricType === _Exsurge2.LyricType.SingleSyllable) lyricType = _Exsurge2.LyricType.BeginningSyllable;\n\t\n\t text = text.substring(0, text.length - 1);\n\t }\n\t\n\t var elides = false;\n\t if (text.length > 1 && text[text.length - 1] === '_') {\n\t // must be an elision\n\t elides = true;\n\t text = text.substring(0, text.length - 1);\n\t }\n\t\n\t if (text === \"*\" || text === \"†\") lyricType = _Exsurge2.LyricType.Directive;\n\t\n\t var lyric = new _Exsurge2.Lyric(ctxt, text, lyricType);\n\t lyric.elidesToNext = elides;\n\t\n\t return lyric;\n\t }\n\t\n\t // takes a string of gabc notations and creates exsurge objects out of them.\n\t // returns an array of notations.\n\t\n\t }, {\n\t key: 'parseNotations',\n\t value: function parseNotations(ctxt, data) {\n\t var _this = this;\n\t\n\t // if there is no data, then this must be a text only object\n\t if (!data) return [new _Exsurge3.TextOnly()];\n\t\n\t var notations = [];\n\t var notes = [];\n\t var trailingSpace = -1;\n\t\n\t var addNotation = function addNotation(notation) {\n\t\n\t // first, if we have any notes left over, we create a neume out of them\n\t if (notes.length > 0) {\n\t\n\t // create neume(s)\n\t var neumes = _this.createNeumesFromNotes(ctxt, notes, trailingSpace);\n\t for (var i = 0; i < neumes.length; i++) {\n\t notations.push(neumes[i]);\n\t } // reset the trailing space\n\t trailingSpace = -1;\n\t\n\t notes = [];\n\t }\n\t\n\t // then, if we're passed a notation, let's add it\n\t // also, perform chant logic here\n\t if (notation !== null) {\n\t\n\t if (notation.isClef) {\n\t ctxt.activeClef = notation;\n\t } else if (notation.isAccidental) ctxt.activeClef.activeAccidental = notation;else if (notation.resetsAccidentals) ctxt.activeClef.resetAccidentals();\n\t\n\t notations.push(notation);\n\t }\n\t };\n\t\n\t var atoms = data.match(__notationsRegex);\n\t\n\t if (atoms === null) return notations;\n\t\n\t for (var i = 0; i < atoms.length; i++) {\n\t\n\t var atom = atoms[i];\n\t\n\t // handle the clefs and dividers here\n\t switch (atom) {\n\t case \",\":\n\t addNotation(new Signs.QuarterBar());\n\t break;\n\t case \"`\":\n\t addNotation(new Signs.Virgula());\n\t break;\n\t case \";\":\n\t addNotation(new Signs.HalfBar());\n\t break;\n\t case \":\":\n\t addNotation(new Signs.FullBar());\n\t break;\n\t case \"::\":\n\t addNotation(new Signs.DoubleBar());\n\t break;\n\t // other gregorio dividers are not supported yet\n\t\n\t case \"c1\":\n\t addNotation(ctxt.activeClef = new _Exsurge3.DoClef(-3, 2));\n\t break;\n\t\n\t case \"c2\":\n\t addNotation(ctxt.activeClef = new _Exsurge3.DoClef(-1, 2));\n\t break;\n\t\n\t case \"c3\":\n\t addNotation(ctxt.activeClef = new _Exsurge3.DoClef(1, 2));\n\t break;\n\t\n\t case \"c4\":\n\t addNotation(ctxt.activeClef = new _Exsurge3.DoClef(3, 2));\n\t break;\n\t\n\t case \"f3\":\n\t addNotation(ctxt.activeClef = new _Exsurge3.FaClef(1, 2));\n\t break;\n\t\n\t case \"f4\":\n\t addNotation(ctxt.activeClef = new _Exsurge3.FaClef(3, 2));\n\t break;\n\t\n\t case \"cb3\":\n\t addNotation(ctxt.activeClef = new _Exsurge3.DoClef(1, 2, new Signs.Accidental(0, Signs.AccidentalType.Flat)));\n\t break;\n\t\n\t case \"cb4\":\n\t addNotation(ctxt.activeClef = new _Exsurge3.DoClef(3, 2, new Signs.Accidental(2, Signs.AccidentalType.Flat)));\n\t break;\n\t\n\t case \"z\":\n\t addNotation(new _Exsurge3.ChantLineBreak(true));\n\t break;\n\t case \"Z\":\n\t addNotation(new _Exsurge3.ChantLineBreak(false));\n\t break;\n\t case \"z0\":\n\t addNotation(new Signs.Custos(true));\n\t break;\n\t\n\t // spacing indicators\n\t case \"!\":\n\t trailingSpace = 0;\n\t addNotation(null);\n\t break;\n\t case \"/\":\n\t trailingSpace = ctxt.intraNeumeSpacing;\n\t addNotation(null);\n\t break;\n\t case \"//\":\n\t trailingSpace = ctxt.intraNeumeSpacing * 2;\n\t addNotation(null);\n\t break;\n\t case ' ':\n\t // fixme: is this correct? logically what is the difference in gabc\n\t // between putting a space between notes vs putting '//' between notes?\n\t trailingSpace = ctxt.intraNeumeSpacing * 2;\n\t addNotation(null);\n\t break;\n\t\n\t default:\n\t // might be a custos, might be an accidental, or might be a note\n\t if (atom.length > 1 && atom[1] === '+') {\n\t // custos\n\t var custos = new Signs.Custos();\n\t\n\t custos.staffPosition = this.gabcHeightToExsurgeHeight(data[0]);\n\t\n\t addNotation(custos);\n\t } else if (atom.length > 1 && (atom[1] === 'x' || atom[1] === 'y' || atom[1] === '#')) {\n\t\n\t var accidentalType;\n\t\n\t switch (atom[1]) {\n\t case 'y':\n\t accidentalType = Signs.AccidentalType.Natural;\n\t break;\n\t case '#':\n\t accidentalType = Signs.AccidentalType.Sharp;\n\t break;\n\t default:\n\t accidentalType = Signs.AccidentalType.Flat;\n\t break;\n\t }\n\t\n\t var noteArray = [];\n\t this.createNoteFromData(ctxt, ctxt.activeClef, atom, noteArray);\n\t var accidental = new Signs.Accidental(noteArray[0].staffPosition, accidentalType);\n\t accidental.trailingSpace = ctxt.intraNeumeSpacing * 2;\n\t\n\t ctxt.activeClef.activeAccidental = accidental;\n\t\n\t addNotation(accidental);\n\t } else {\n\t\n\t // looks like it's a note\n\t this.createNoteFromData(ctxt, ctxt.activeClef, atom, notes);\n\t }\n\t break;\n\t }\n\t }\n\t\n\t // finish up any remaining notes we have left\n\t addNotation(null);\n\t\n\t return notations;\n\t }\n\t }, {\n\t key: 'createNeumesFromNotes',\n\t value: function createNeumesFromNotes(ctxt, notes, finalTrailingSpace) {\n\t\n\t var neumes = [];\n\t var firstNoteIndex = 0;\n\t var currNoteIndex = 0;\n\t\n\t // here we use a simple finite state machine to create the neumes from the notes\n\t // createNeume is helper function which returns the next state after a neume is created\n\t // (unknownState). Each state object has a neume() function and a handle() function.\n\t // neume() allows us to create the neume of the state in the event that we run out\n\t // of notes. handle() gives the state an opportunity to examine the currNote and\n\t // determine what to do...either transition to a different neume/state, or\n\t // continue building the neume of that state. handle() returns the next state\n\t\n\t var createNeume = function createNeume(neume, includeCurrNote) {\n\t var includePrevNote = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];\n\t\n\t\n\t // add the notes to the neume\n\t var lastNoteIndex;\n\t if (includeCurrNote) lastNoteIndex = currNoteIndex;else if (includePrevNote) lastNoteIndex = currNoteIndex - 1;else lastNoteIndex = currNoteIndex - 2;\n\t\n\t if (lastNoteIndex < 0) return;\n\t\n\t while (firstNoteIndex <= lastNoteIndex) {\n\t neume.addNote(notes[firstNoteIndex++]);\n\t }neumes.push(neume);\n\t\n\t if (includeCurrNote === false) {\n\t currNoteIndex--;\n\t\n\t if (includePrevNote === false) currNoteIndex--;\n\t\n\t neume.keepWithNext = true;\n\t neume.trailingSpace = ctxt.intraNeumeSpacing;\n\t }\n\t\n\t return unknownState;\n\t };\n\t\n\t var unknownState = {\n\t neume: function neume() {\n\t return new Neumes.Punctum();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.shape === _Exsurge3.NoteShape.Virga) return virgaState;else if (currNote.shape === _Exsurge3.NoteShape.Stropha) return apostrophaState;else if (currNote.shape === _Exsurge3.NoteShape.Oriscus) return oriscusState;else if (currNote.shape === _Exsurge3.NoteShape.Inclinatum) return punctaInclinataState;else if (currNote.shapeModifiers & _Exsurge3.NoteShapeModifiers.Cavum) return createNeume(new Neumes.Punctum(), true);else return punctumState;\n\t }\n\t };\n\t\n\t var punctumState = {\n\t neume: function neume() {\n\t return new Neumes.Punctum();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.staffPosition > prevNote.staffPosition) return podatusState;else if (currNote.staffPosition < prevNote.staffPosition) {\n\t if (currNote.shape === _Exsurge3.NoteShape.Inclinatum) return climacusState;else return clivisState;\n\t } else return distrophaState;\n\t }\n\t };\n\t\n\t var punctaInclinataState = {\n\t neume: function neume() {\n\t return new Neumes.PunctaInclinata();\n\t },\n\t handle: function handle() {\n\t if (currNote.shape !== _Exsurge3.NoteShape.Inclinatum) return createNeume(new Neumes.PunctaInclinata(), false);else return punctaInclinataState;\n\t }\n\t };\n\t\n\t var oriscusState = {\n\t neume: function neume() {\n\t return new Neumes.Oriscus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.shape === _Exsurge3.NoteShape.Default) {\n\t\n\t if (currNote.staffPosition > prevNote.staffPosition) {\n\t prevNote.shapeModifiers |= _Exsurge3.NoteShapeModifiers.Ascending;\n\t return createNeume(new Neumes.PesQuassus(), true);\n\t } else if (currNote.staffPosition < prevNote.staffPosition) {\n\t prevNote.shapeModifiers |= _Exsurge3.NoteShapeModifiers.Descending;\n\t return createNeume(new Neumes.Clivis(), true);\n\t }\n\t } else\n\t // stand alone oriscus\n\t return createNeume(new Neumes.Oriscus(), true);\n\t }\n\t };\n\t\n\t var podatusState = {\n\t neume: function neume() {\n\t return new Neumes.Podatus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.staffPosition > prevNote.staffPosition) {\n\t\n\t if (prevNote.shape === _Exsurge3.NoteShape.Oriscus) return salicusState;else return scandicusState;\n\t } else if (currNote.staffPosition < prevNote.staffPosition) {\n\t if (currNote.shape === _Exsurge3.NoteShape.Inclinatum) return pesSubpunctisState;else return torculusState;\n\t } else return createNeume(new Neumes.Podatus(), false);\n\t }\n\t };\n\t\n\t var clivisState = {\n\t neume: function neume() {\n\t return new Neumes.Clivis();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.shape === _Exsurge3.NoteShape.Default && currNote.staffPosition > prevNote.staffPosition) return porrectusState;else return createNeume(new Neumes.Clivis(), false);\n\t }\n\t };\n\t\n\t var climacusState = {\n\t neume: function neume() {\n\t return new Neumes.Climacus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t if (currNote.shape !== _Exsurge3.NoteShape.Inclinatum) return createNeume(new Neumes.Climacus(), false);else return state;\n\t }\n\t };\n\t\n\t var porrectusState = {\n\t neume: function neume() {\n\t return new Neumes.Porrectus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.shape === _Exsurge3.NoteShape.Default && currNote.staffPosition < prevNote.staffPosition) return createNeume(new Neumes.PorrectusFlexus(), true);else return createNeume(new Neumes.Porrectus(), false);\n\t }\n\t };\n\t\n\t var pesSubpunctisState = {\n\t neume: function neume() {\n\t return new Neumes.PesSubpunctis();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.shape !== _Exsurge3.NoteShape.Inclinatum) return createNeume(new Neumes.PesSubpunctis(), false);else return state;\n\t }\n\t };\n\t\n\t var salicusState = {\n\t neume: function neume() {\n\t return new Neumes.Salicus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.staffPosition < prevNote.staffPosition) return salicusFlexusState;else return createNeume(new Neumes.Salicus(), false);\n\t }\n\t };\n\t\n\t var salicusFlexusState = {\n\t neume: function neume() {\n\t return new Neumes.SalicusFlexus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t return createNeume(new Neumes.SalicusFlexus(), false);\n\t }\n\t };\n\t\n\t var scandicusState = {\n\t neume: function neume() {\n\t return new Neumes.Scandicus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (prevNote.shape === _Exsurge3.NoteShape.Virga && currNote.shape === _Exsurge3.NoteShape.Inclinatum && currNote.staffPosition < prevNote.staffPosition) {\n\t // if we get here, then it seems we have a podatus, now being followed by a climacus\n\t // rather than a scandicus. react accordingly\n\t return createNeume(new Neumes.Podatus(), false, false);\n\t } else if (currNote.shape === _Exsurge3.NoteShape.Default && currNote.staffPosition < prevNote.staffPosition) return scandicusFlexusState;else return createNeume(new Neumes.Scandicus(), false);\n\t }\n\t };\n\t\n\t var scandicusFlexusState = {\n\t neume: function neume() {\n\t return new Neumes.ScandicusFlexus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t return createNeume(new Neumes.ScandicusFlexus(), false);\n\t }\n\t };\n\t\n\t var virgaState = {\n\t neume: function neume() {\n\t return new Neumes.Virga();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.shape === _Exsurge3.NoteShape.Inclinatum && currNote.staffPosition < prevNote.staffPosition) return climacusState;else if (currNote.shape === _Exsurge3.NoteShape.Virga && currNote.staffPosition === prevNote.staffPosition) return bivirgaState;else return createNeume(new Neumes.Virga(), false);\n\t }\n\t };\n\t\n\t var bivirgaState = {\n\t neume: function neume() {\n\t return new Neumes.Bivirga();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t\n\t if (currNote.shape === _Exsurge3.NoteShape.Virga && currNote.staffPosition === prevNote.staffPosition) return createNeume(new Neumes.Trivirga(), true);else return createNeume(new Neumes.Bivirga(), false);\n\t }\n\t };\n\t\n\t var apostrophaState = {\n\t neume: function neume() {\n\t return new Neumes.Apostropha();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t if (currNote.staffPosition === prevNote.staffPosition) return distrophaState;else return createNeume(new Neumes.Apostropha(), false);\n\t }\n\t };\n\t\n\t var distrophaState = {\n\t neume: function neume() {\n\t return new Neumes.Distropha();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t if (currNote.staffPosition === prevNote.staffPosition) return tristrophaState;else return createNeume(new Neumes.Apostropha(), false, false);\n\t }\n\t };\n\t\n\t var tristrophaState = {\n\t neume: function neume() {\n\t return new Neumes.Tristropha();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t // we only create a tristropha when the note run ends after three\n\t // and the neume() function of this state is called. Otherwise\n\t // we always interpret the third note to belong to the next sequence\n\t // of notes.\n\t //\n\t // fixme: gabc allows any number of punctum/stropha in succession...\n\t // is this a valid neume type? Or is it just multiple *stropha neumes\n\t // in succession? Should we simplify the apostropha/distropha/\n\t // tristropha classes to a generic stropha neume that can have 1 or\n\t // more successive notes?\n\t return createNeume(new Neumes.Distropha(), false, false);\n\t }\n\t };\n\t\n\t var torculusState = {\n\t neume: function neume() {\n\t return new Neumes.Torculus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t if (currNote.shape === _Exsurge3.NoteShape.Default && currNote.staffPosition > prevNote.staffPosition) return torculusResupinusState;else return createNeume(new Neumes.Torculus(), false);\n\t }\n\t };\n\t\n\t var torculusResupinusState = {\n\t neume: function neume() {\n\t return new Neumes.TorculusResupinus();\n\t },\n\t handle: function handle(currNote, prevNote) {\n\t if (currNote.shape === _Exsurge3.NoteShape.Default && currNote.staffPosition < prevNote.staffPosition) return createNeume(new Neumes.TorculusResupinusFlexus(), true);else return createNeume(new Neumes.TorculusResupinus(), false);\n\t }\n\t };\n\t\n\t var state = unknownState;\n\t\n\t while (currNoteIndex < notes.length) {\n\t\n\t var prevNote = currNoteIndex > 0 ? notes[currNoteIndex - 1] : null;\n\t var currNote = notes[currNoteIndex];\n\t\n\t state = state.handle(currNote, prevNote);\n\t\n\t // if we are on the last note, then try to create a neume if we need to.\n\t if (currNoteIndex === notes.length - 1 && state !== unknownState) createNeume(state.neume(), true);\n\t\n\t currNoteIndex++;\n\t }\n\t\n\t if (neumes.length > 0) {\n\t if (finalTrailingSpace >= 0) {\n\t neumes[neumes.length - 1].trailingSpace = finalTrailingSpace;\n\t\n\t if (finalTrailingSpace > ctxt.intraNeumeSpacing) neumes[neumes.length - 1].keepWithNext = false;else neumes[neumes.length - 1].keepWithNext = true;\n\t }\n\t }\n\t\n\t return neumes;\n\t }\n\t\n\t // appends any notes created to the notes array argument\n\t\n\t }, {\n\t key: 'createNoteFromData',\n\t value: function createNoteFromData(ctxt, clef, data, notes) {\n\t\n\t var note = new _Exsurge3.Note();\n\t\n\t if (data.length < 1) throw 'Invalid note data: ' + data;\n\t\n\t if (data[0] === '-') {\n\t // liquescent initio debilis\n\t note.liquescent = _Exsurge3.LiquescentType.InitioDebilis;\n\t data = data.substring(1);\n\t }\n\t\n\t if (data.length < 1) throw 'Invalid note data: ' + data;\n\t\n\t // the next char is always the pitch\n\t var pitch = this.gabcHeightToExsurgePitch(clef, data[0]);\n\t\n\t if (data[0] === data[0].toUpperCase()) note.shape = _Exsurge3.NoteShape.Inclinatum;\n\t\n\t note.staffPosition = this.gabcHeightToExsurgeHeight(data[0]);\n\t note.pitch = pitch;\n\t\n\t var mark;\n\t var j;\n\t\n\t var episemaNoteIndex = notes.length;\n\t var episemaNote = note;\n\t\n\t // process the modifiers\n\t for (var i = 1; i < data.length; i++) {\n\t\n\t var c = data[i];\n\t var lookahead = '\\0';\n\t\n\t var haveLookahead = i + 1 < data.length;\n\t if (haveLookahead) lookahead = data[i + 1];\n\t\n\t switch (c) {\n\t\n\t // rhythmic markings\n\t case '.':\n\t\n\t mark = null;\n\t\n\t // gabc supports putting up to two morae on each note, by repeating the\n\t // period. here, we check to see if we've already created a mora for the\n\t // note, and if so, we simply force the second one to have an Above\n\t // position hint. if a user decides to try to put position indicators\n\t // on the double morae (such as 1 or 2), then really the behavior is\n\t // not defined by gabc, so it's on the user to figure it out.\n\t if (note.morae.length > 0) {\n\t // if we already have one mora, then create another but force a\n\t // an alternative positionHint\n\t haveLookahead = true;\n\t if (Math.abs(note.staffPosition) % 2 === 0) lookahead = '1';else lookahead = '0';\n\t }\n\t\n\t mark = new Markings.Mora(ctxt, note);\n\t if (haveLookahead && lookahead === '1') mark.positionHint = Markings.MarkingPositionHint.Above;else if (haveLookahead && lookahead === '0') mark.positionHint = Markings.MarkingPositionHint.Below;\n\t\n\t note.morae.push(mark);\n\t break;\n\t\n\t case '_':\n\t\n\t var episemaHadModifier = false;\n\t\n\t mark = new Markings.HorizontalEpisema(episemaNote);\n\t while (haveLookahead) {\n\t\n\t if (lookahead === '0') mark.positionHint = Markings.MarkingPositionHint.Below;else if (lookahead === '1') mark.positionHint = Markings.MarkingPositionHint.Above;else if (lookahead === '2') mark.terminating = true; // episema terminates\n\t else if (lookahead === '3') mark.alignment = Markings.HorizontalEpisemaAlignment.Left;else if (lookahead === '4') mark.alignment = Markings.HorizontalEpisemaAlignment.Center;else if (lookahead === '5') mark.alignment = Markings.HorizontalEpisemaAlignment.Right;else break;\n\t\n\t // the gabc definition for epismata is so convoluted...\n\t // - double underscores create epismata over multiple notes.\n\t // - unless the _ has a 0, 1, 3, 4, or 5 modifier, which means\n\t // another underscore puts a second epismata on the same note\n\t // - (when there's a 2 lookahead, then this is treated as an\n\t // unmodified underscore, so another underscore would be\n\t // added to previous notes\n\t if (mark.alignment !== Markings.HorizontalEpisemaAlignment.Default && mark.positionHint !== Markings.MarkingPositionHint.Below) episemaHadModifier = true;\n\t\n\t i++;\n\t haveLookahead = i + 1 < data.length;\n\t\n\t if (haveLookahead) lookahead = data[i + 1];\n\t }\n\t\n\t // since gabc allows consecutive underscores which is a shortcut to\n\t // apply the epismata to previous notes, we keep track of that here\n\t // in order to add the new episema to the correct note.\n\t\n\t if (episemaNote) episemaNote.epismata.push(mark);\n\t\n\t if (episemaNote === note && episemaHadModifier) episemaNote = note;else if (episemaNoteIndex >= 0 && notes.length > 0) episemaNote = notes[--episemaNoteIndex];\n\t\n\t break;\n\t\n\t case '\\'':\n\t mark = new Markings.Ictus(ctxt, note);\n\t if (haveLookahead && lookahead === '1') mark.positionHint = Markings.MarkingPositionHint.Above;else if (haveLookahead && lookahead === '0') mark.positionHint = Markings.MarkingPositionHint.Below;\n\t\n\t note.ictus = mark;\n\t break;\n\t\n\t //note shapes\n\t case 'r':\n\t if (haveLookahead && lookahead === '1') {\n\t note.acuteAccent = new Markings.AcuteAccent(ctxt, note);\n\t i++;\n\t } else note.shapeModifiers |= _Exsurge3.NoteShapeModifiers.Cavum;\n\t break;\n\t\n\t case 's':\n\t\n\t if (note.shape === _Exsurge3.NoteShape.Stropha) {\n\t // if we're already a stropha, that means this is gabc's\n\t // quick stropha feature (e.g., gsss). create a new note\n\t notes.push(note);\n\t note = new _Exsurge3.Note();\n\t episemaNoteIndex++; // since a new note was added, increase the index here\n\t }\n\t\n\t note.shape = _Exsurge3.NoteShape.Stropha;\n\t break;\n\t\n\t case 'v':\n\t\n\t if (note.shape === _Exsurge3.NoteShape.Virga) {\n\t // if we're already a stropha, that means this is gabc's\n\t // quick virga feature (e.g., gvvv). create a new note\n\t notes.push(note);\n\t note = new _Exsurge3.Note();\n\t episemaNoteIndex++; // since a new note was added, increase the index here\n\t }\n\t\n\t note.shape = _Exsurge3.NoteShape.Virga;\n\t break;\n\t\n\t case 'w':\n\t note.shape = _Exsurge3.NoteShape.Quilisma;\n\t break;\n\t\n\t case 'o':\n\t note.shape = _Exsurge3.NoteShape.Oriscus;\n\t if (haveLookahead && lookahead === '<') {\n\t note.shapeModifiers |= _Exsurge3.NoteShapeModifiers.Ascending;\n\t i++;\n\t } else if (haveLookahead && lookahead === '>') {\n\t note.shapeModifiers |= _Exsurge3.NoteShapeModifiers.Descending;\n\t i++;\n\t }\n\t break;\n\t\n\t case 'O':\n\t note.shape = _Exsurge3.NoteShape.Oriscus;\n\t if (haveLookahead && lookahead === '<') {\n\t note.shapeModifiers |= _Exsurge3.NoteShapeModifiers.Ascending | _Exsurge3.NoteShapeModifiers.Stemmed;\n\t i++;\n\t } else if (haveLookahead && lookahead === '>') {\n\t note.shapeModifiers |= _Exsurge3.NoteShapeModifiers.Descending | _Exsurge3.NoteShapeModifiers.Stemmed;\n\t i++;\n\t } else note.shapeModifiers |= _Exsurge3.NoteShapeModifiers.Stemmed;\n\t break;\n\t\n\t // liquescents\n\t case '~':\n\t if (note.shape === _Exsurge3.NoteShape.Inclinatum) note.liquescent |= _Exsurge3.LiquescentType.Small;else if (note.shape === _Exsurge3.NoteShape.Oriscus) note.liquescent |= _Exsurge3.LiquescentType.Large;else note.liquescent |= _Exsurge3.LiquescentType.Small;\n\t break;\n\t case '<':\n\t note.liquescent |= _Exsurge3.LiquescentType.Ascending;\n\t break;\n\t case '>':\n\t note.liquescent |= _Exsurge3.LiquescentType.Descending;\n\t break;\n\t\n\t // accidentals\n\t case 'x':\n\t if (note.pitch.step === _Exsurge.Step.Mi) note.pitch.step = _Exsurge.Step.Me;else if (note.pitch.step === _Exsurge.Step.Ti) note.pitch.step = _Exsurge.Step.Te;\n\t break;\n\t case 'y':\n\t if (note.pitch.step === _Exsurge.Step.Te) note.pitch.step = _Exsurge.Step.Ti;else if (note.pitch.step === _Exsurge.Step.Me) note.pitch.step = _Exsurge.Step.Mi;else if (note.pitch.step === _Exsurge.Step.Du) note.pitch.step = _Exsurge.Step.Do;else if (note.pitch.step === _Exsurge.Step.Fu) note.pitch.step = _Exsurge.Step.Fa;\n\t break;\n\t case '#':\n\t if (note.pitch.step === _Exsurge.Step.Do) note.pitch.step = _Exsurge.Step.Du;else if (note.pitch.step === _Exsurge.Step.Fa) note.pitch.step = _Exsurge.Step.Fu;\n\t break;\n\t\n\t // gabc special item groups\n\t case '[':\n\t // read in the whole group and parse it\n\t var startIndex = ++i;\n\t while (i < data.length && data[i] !== ']') {\n\t i++;\n\t }this.processInstructionForNote(ctxt, note, data.substring(startIndex, i));\n\t break;\n\t }\n\t }\n\t\n\t notes.push(note);\n\t }\n\t\n\t // an instruction in this context is referring to a special gabc coding found after\n\t // notes between ['s and ]'s. choral signs and braces fall into this\n\t // category.\n\t //\n\t // currently only brace instructions are supported here!\n\t\n\t }, {\n\t key: 'processInstructionForNote',\n\t value: function processInstructionForNote(ctxt, note, instruction) {\n\t\n\t var results = instruction.match(__braceSpecRegex);\n\t\n\t if (results === null) return;\n\t\n\t // see the comments at the definition of __braceSpecRegex for the\n\t // capturing groups\n\t var above = results[1] === 'o';\n\t var shape = Markings.BraceShape.CurlyBrace; // default\n\t\n\t switch (results[2]) {\n\t case 'b':\n\t shape = Markings.BraceShape.RoundBrace;\n\t break;\n\t case 'cb':\n\t shape = Markings.BraceShape.CurlyBrace;\n\t break;\n\t case 'cba':\n\t shape = Markings.BraceShape.AccentedCurlyBrace;\n\t break;\n\t }\n\t\n\t var attachmentPoint = results[3] === '0' ? Markings.BraceAttachment.Left : Markings.BraceAttachment.Right;\n\t var brace = null;\n\t var type;\n\t\n\t if (results[4] === '{') note.braceStart = new Markings.BracePoint(note, above, shape, attachmentPoint);else note.braceEnd = new Markings.BracePoint(note, above, shape, attachmentPoint);\n\t }\n\t\n\t // takes raw gabc text source and parses it into words. For example, passing\n\t // in a string of \"me(f.) (,) ma(fff)num(d!ewf) tu(fgF'E)am,(f.)\" would return\n\t // an array of four strings: [\"me(f.)\", \"(,)\", \"ma(fff)num(d!ewf)\", \"tu(fgF'E)am,(f.)\"]\n\t\n\t }, {\n\t key: 'splitWords',\n\t value: function splitWords(gabcNotations) {\n\t // split the notations on whitespace boundaries, as long as the space\n\t // immediately follows a set of parentheses. Prior to doing that, we replace\n\t // all whitespace with spaces, which prevents tabs and newlines from ending\n\t // up in the notation data.\n\t gabcNotations = gabcNotations.trim().replace(/\\s/g, ' ').replace(/\\) (?=[^\\)]*(?:\\(|$))/g, ')\\n');\n\t return gabcNotations.split(/\\n/g);\n\t }\n\t }, {\n\t key: 'parseSource',\n\t value: function parseSource(gabcSource) {\n\t return this.parseWords(this.splitWords(gabcSource));\n\t }\n\t\n\t // gabcWords is an array of strings, e.g., the result of splitWords above\n\t\n\t }, {\n\t key: 'parseWords',\n\t value: function parseWords(gabcWords) {\n\t var words = [];\n\t\n\t for (var i = 0; i < gabcWords.length; i++) {\n\t words.push(this.parseWord(gabcWords[i]));\n\t }return words;\n\t }\n\t\n\t // returns an array of objects, each of which has the following properties\n\t // - notations (string)\n\t // - lyrics (array of strings)\n\t\n\t }, {\n\t key: 'parseWord',\n\t value: function parseWord(gabcWord) {\n\t\n\t var syllables = [];\n\t var matches = [];\n\t\n\t while (match = __syllablesRegex.exec(gabcWord)) {\n\t matches.push(match);\n\t }for (var j = 0; j < matches.length; j++) {\n\t var match = matches[j];\n\t\n\t var lyrics = match[1].trim().split('|');\n\t var notations = match[2];\n\t\n\t syllables.push({\n\t notations: notations,\n\t lyrics: lyrics\n\t });\n\t }\n\t\n\t return syllables;\n\t }\n\t\n\t // returns pitch\n\t\n\t }, {\n\t key: 'gabcHeightToExsurgeHeight',\n\t value: function gabcHeightToExsurgeHeight(gabcHeight) {\n\t return gabcHeight.toLowerCase().charCodeAt(0) - 'a'.charCodeAt(0) - 6;\n\t }\n\t\n\t // returns pitch\n\t\n\t }, {\n\t key: 'gabcHeightToExsurgePitch',\n\t value: function gabcHeightToExsurgePitch(clef, gabcHeight) {\n\t var exsurgeHeight = this.gabcHeightToExsurgeHeight(gabcHeight);\n\t\n\t var pitch = clef.staffPositionToPitch(exsurgeHeight);\n\t\n\t if (clef.activeAccidental !== null) clef.activeAccidental.applyToPitch(pitch);\n\t\n\t return pitch;\n\t }\n\t }]);\n\t\n\t return Gabc;\n\t}();\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Virga = exports.Tristropha = exports.TorculusResupinusFlexus = exports.TorculusResupinus = exports.Torculus = exports.ScandicusFlexus = exports.Scandicus = exports.SalicusFlexus = exports.Salicus = exports.Punctum = exports.PunctaInclinata = exports.PorrectusFlexus = exports.Porrectus = exports.Podatus = exports.PesSubpunctis = exports.PesQuassus = exports.Oriscus = exports.Distropha = exports.Clivis = exports.Climacus = exports.Trivirga = exports.Bivirga = exports.Apostropha = exports.Neume = undefined;\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); //\n\t// Author(s):\n\t// Fr. Matthew Spencer, OSJ \n\t//\n\t// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a copy\n\t// of this software and associated documentation files (the \"Software\"), to deal\n\t// in the Software without restriction, including without limitation the rights\n\t// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t// copies of the Software, and to permit persons to whom the Software is\n\t// furnished to do so, subject to the following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included in\n\t// all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t// THE SOFTWARE.\n\t//\n\t\n\tvar _Exsurge = __webpack_require__(1);\n\t\n\tvar Exsurge = _interopRequireWildcard(_Exsurge);\n\t\n\tvar _Exsurge2 = __webpack_require__(4);\n\t\n\tvar _Exsurge3 = __webpack_require__(6);\n\t\n\tvar _ExsurgeChant = __webpack_require__(9);\n\t\n\tvar _Exsurge4 = __webpack_require__(3);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar NeumeBuilder = function () {\n\t function NeumeBuilder(ctxt, neume) {\n\t var startingX = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];\n\t\n\t _classCallCheck(this, NeumeBuilder);\n\t\n\t this.ctxt = ctxt;\n\t this.neume = neume;\n\t this.x = startingX;\n\t this.lastNote = null;\n\t this.lineIsHanging = false;\n\t }\n\t\n\t // used to start a hanging line on the left of the next note\n\t\n\t\n\t _createClass(NeumeBuilder, [{\n\t key: 'lineFrom',\n\t value: function lineFrom(note) {\n\t this.lastNote = note;\n\t this.lineIsHanging = true;\n\t\n\t return this;\n\t }\n\t\n\t // add a note, with a connecting line on the left if we have one\n\t\n\t }, {\n\t key: 'noteAt',\n\t value: function noteAt(note, glyph) {\n\t var withLineTo = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];\n\t\n\t\n\t if (!note) throw \"NeumeBuilder.noteAt: note must be a valid note\";\n\t\n\t if (!glyph) throw \"NeumeBuilder.noteAt: glyph must be a valid glyph code\";\n\t\n\t note.setGlyph(this.ctxt, glyph);\n\t var noteAlignsRight = note.glyphVisualizer.align === \"right\";\n\t\n\t var needsLine = withLineTo && this.lastNote !== null && (this.lineIsHanging || this.lastNote.glyphVisualizer.align === 'right' || Math.abs(this.lastNote.staffPosition - note.staffPosition) > 1);\n\t\n\t if (needsLine) {\n\t var line = new _Exsurge2.NeumeLineVisualizer(this.ctxt, this.lastNote, note, this.lineIsHanging);\n\t this.neume.addVisualizer(line);\n\t line.bounds.x = Math.max(0, this.x - line.bounds.width);\n\t\n\t if (!noteAlignsRight) this.x = line.bounds.x;\n\t }\n\t\n\t // if this is the first note of a right aligned glyph (probably an initio debilis),\n\t // then there's nothing to worry about. but if it's not then first, then this\n\t // subtraction will right align it visually\n\t if (noteAlignsRight && this.lastNote) note.bounds.x = this.x - note.bounds.width;else {\n\t note.bounds.x = this.x;\n\t this.x += note.bounds.width;\n\t }\n\t\n\t this.neume.addVisualizer(note);\n\t\n\t this.lastNote = note;\n\t this.lineIsHanging = false;\n\t\n\t return this;\n\t }\n\t\n\t // a special form of noteAdd that creates a virga\n\t // uses a punctum cuadratum and a line rather than the virga glyphs\n\t\n\t }, {\n\t key: 'virgaAt',\n\t value: function virgaAt(note) {\n\t var withLineTo = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];\n\t\n\t\n\t // add the punctum for the virga\n\t this.noteAt(note, _Exsurge2.GlyphCode.PunctumQuadratum);\n\t\n\t // add a line for the virga\n\t var line = new _Exsurge2.VirgaLineVisualizer(this.ctxt, note);\n\t this.x -= line.bounds.width;\n\t line.bounds.x = this.x;\n\t this.neume.addVisualizer(line);\n\t\n\t this.lastNote = note;\n\t this.lineIsHanging = false;\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'advanceBy',\n\t value: function advanceBy(x) {\n\t this.lastNote = null;\n\t this.lineIsHanging = false;\n\t\n\t this.x += x;\n\t\n\t return this;\n\t }\n\t\n\t // for terminating hanging lines with no lower notes\n\t\n\t }, {\n\t key: 'withLineEndingAt',\n\t value: function withLineEndingAt(note) {\n\t\n\t if (this.lastNote === null) return;\n\t\n\t var line = new _Exsurge2.NeumeLineVisualizer(this.ctxt, this.lastNote, note, true);\n\t this.neume.addVisualizer(line);\n\t this.x -= line.bounds.width;\n\t line.bounds.x = this.x;\n\t\n\t this.neume.addVisualizer(line);\n\t\n\t this.lastNote = note;\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'withPodatus',\n\t value: function withPodatus(lowerNote, upperNote) {\n\t\n\t var upperGlyph;\n\t var lowerGlyph;\n\t\n\t if (lowerNote.liquescent === _Exsurge3.LiquescentType.InitioDebilis) {\n\t\n\t // liquescent upper note or not?\n\t if (upperNote.liquescent === _Exsurge3.LiquescentType.None) upperGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;else upperGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;\n\t\n\t lowerGlyph = _Exsurge2.GlyphCode.TerminatingDesLiquescent;\n\t } else if (upperNote.liquescent & _Exsurge3.LiquescentType.Small) {\n\t lowerGlyph = _Exsurge2.GlyphCode.BeginningAscLiquescent;\n\t upperGlyph = _Exsurge2.GlyphCode.TerminatingAscLiquescent;\n\t } else if (upperNote.liquescent & _Exsurge3.LiquescentType.Ascending) {\n\t lowerGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t upperGlyph = _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent;\n\t } else if (upperNote.liquescent & _Exsurge3.LiquescentType.Descending) {\n\t lowerGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t upperGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;\n\t } else {\n\t // standard shape\n\t lowerGlyph = _Exsurge2.GlyphCode.PodatusLower;\n\t upperGlyph = _Exsurge2.GlyphCode.PodatusUpper;\n\t }\n\t\n\t // allow a quilisma pes\n\t if (lowerNote.shape === _Exsurge3.NoteShape.Quilisma) lowerGlyph = _Exsurge2.GlyphCode.Quilisma;\n\t\n\t this.noteAt(lowerNote, lowerGlyph).noteAt(upperNote, upperGlyph);\n\t\n\t // make sure we don't have lines connected to the podatus\n\t this.lastNote = null;\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'withClivis',\n\t value: function withClivis(upper, lower) {\n\t\n\t var line;\n\t\n\t var upperGlyph;\n\t var lowerGlyph;\n\t\n\t if (upper.shape === _Exsurge3.NoteShape.Oriscus) this.noteAt(upper, _Exsurge2.GlyphCode.OriscusDes, false);else this.lineFrom(lower).noteAt(upper, _Exsurge2.GlyphCode.PunctumQuadratum);\n\t\n\t if (lower.liquescent & _Exsurge3.LiquescentType.Small) {\n\t lowerGlyph = _Exsurge2.GlyphCode.TerminatingDesLiquescent;\n\t } else if (lower.liquescent === _Exsurge3.LiquescentType.Ascending) lowerGlyph = _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent;else if (lower.liquescent === _Exsurge3.LiquescentType.Descending) lowerGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;else lowerGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t this.noteAt(lower, lowerGlyph);\n\t\n\t // make sure we don't have lines connected to the clivis\n\t this.lastNote = null;\n\t\n\t return this;\n\t }\n\t\n\t // lays out a sequence of notes that are inclinati (e.g., climacus, pes subpunctis)\n\t\n\t }, {\n\t key: 'withInclinati',\n\t value: function withInclinati(notes) {\n\t\n\t var staffPosition = notes[0].staffPosition,\n\t prevStaffPosition = notes[0].staffPosition;\n\t\n\t // it is important to advance by the width of the inclinatum glyph itself\n\t // rather than by individual note widths, so that any liquescents are spaced\n\t // the same as non-liquscents\n\t var advanceWidth = _Exsurge4.Glyphs.PunctumInclinatum.bounds.width * this.ctxt.glyphScaling;\n\t\n\t // now add all the punctum inclinati\n\t for (var i = 0; i < notes.length; i++, prevStaffPosition = staffPosition) {\n\t var note = notes[i];\n\t\n\t if (note.liquescent & _Exsurge3.LiquescentType.Small) note.setGlyph(this.ctxt, _Exsurge2.GlyphCode.PunctumInclinatumLiquescent);else if (note.liquescent & _Exsurge3.LiquescentType.Large)\n\t // fixme: is the large inclinatum liquescent the same as the apostropha?\n\t note.setGlyph(this.ctxt, _Exsurge2.GlyphCode.Stropha);else\n\t // fixme: some climaci in the new chant books end with a punctum quadratum\n\t // (see, for example, the antiphon \"Sancta Maria\" for October 7).\n\t note.setGlyph(this.ctxt, _Exsurge2.GlyphCode.PunctumInclinatum);\n\t\n\t staffPosition = note.staffPosition;\n\t\n\t // fixme: how do these calculations look for puncti inclinati based on staff position offsets?\n\t var multiple;\n\t switch (Math.abs(prevStaffPosition - staffPosition)) {\n\t case 0:\n\t multiple = 1.1;\n\t break;\n\t case 1:\n\t multiple = 0.8;\n\t break;\n\t default:\n\t multiple = 1.2;\n\t break;\n\t }\n\t\n\t if (i > 0) this.x += advanceWidth * multiple;\n\t\n\t note.bounds.x = this.x;\n\t\n\t this.neume.addVisualizer(note);\n\t }\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'withPorrectusSwash',\n\t value: function withPorrectusSwash(start, end) {\n\t\n\t var needsLine = this.lastNote !== null && (this.lineIsHanging || this.lastNote.glyphVisualizer.align === 'right' || Math.abs(this.lastNote.staffPosition - start.staffPosition) > 1);\n\t\n\t if (needsLine) {\n\t var line = new _Exsurge2.NeumeLineVisualizer(this.ctxt, this.lastNote, start, this.lineIsHanging);\n\t this.x = Math.max(0, this.x - line.bounds.width);\n\t line.bounds.x = this.x;\n\t this.neume.addVisualizer(line);\n\t }\n\t\n\t var glyph;\n\t\n\t switch (start.staffPosition - end.staffPosition) {\n\t case 1:\n\t glyph = _Exsurge2.GlyphCode.Porrectus1;\n\t break;\n\t case 2:\n\t glyph = _Exsurge2.GlyphCode.Porrectus2;\n\t break;\n\t case 3:\n\t glyph = _Exsurge2.GlyphCode.Porrectus3;\n\t break;\n\t case 4:\n\t glyph = _Exsurge2.GlyphCode.Porrectus4;\n\t break;\n\t default:\n\t // fixme: should we generate an error here?\n\t glyph = _Exsurge2.GlyphCode.None;\n\t break;\n\t }\n\t\n\t start.setGlyph(this.ctxt, glyph);\n\t start.bounds.x = this.x;\n\t\n\t // the second glyph does not draw anything, but it still has logical importance for the editing\n\t // environment...it can respond to changes which will then change the swash glyph of the first.\n\t end.setGlyph(this.ctxt, _Exsurge2.GlyphCode.None);\n\t\n\t this.x = start.bounds.right();\n\t end.bounds.x = this.x - end.bounds.width;\n\t\n\t this.neume.addVisualizer(start);\n\t this.neume.addVisualizer(end);\n\t\n\t this.lastNote = end;\n\t this.lineIsHanging = false;\n\t\n\t return this;\n\t }\n\t }]);\n\t\n\t return NeumeBuilder;\n\t}();\n\t\n\t/*\n\t * Neumes base class\n\t */\n\t\n\t\n\tvar Neume = exports.Neume = function (_ChantNotationElement) {\n\t _inherits(Neume, _ChantNotationElement);\n\t\n\t function Neume() {\n\t var notes = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];\n\t\n\t _classCallCheck(this, Neume);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Neume).call(this));\n\t\n\t _this.isNeume = true; // poor man's reflection\n\t _this.notes = notes;\n\t\n\t for (var i = 0; i < notes.length; i++) {\n\t notes[i].neume = _this;\n\t }return _this;\n\t }\n\t\n\t _createClass(Neume, [{\n\t key: 'addNote',\n\t value: function addNote(note) {\n\t note.neume = this;\n\t this.notes.push(note);\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Neume.prototype), 'performLayout', this).call(this, ctxt);\n\t }\n\t }, {\n\t key: 'finishLayout',\n\t value: function finishLayout(ctxt) {\n\t\n\t // allow subclasses an opportunity to position their own markings...\n\t this.positionMarkings();\n\t\n\t // layout the markings of the notes\n\t for (var i = 0; i < this.notes.length; i++) {\n\t var note = this.notes[i];\n\t var j;\n\t\n\t for (j = 0; j < note.epismata.length; j++) {\n\t note.epismata[j].performLayout(ctxt);\n\t this.addVisualizer(note.epismata[j]);\n\t }\n\t\n\t for (j = 0; j < note.morae.length; j++) {\n\t note.morae[j].performLayout(ctxt);\n\t this.addVisualizer(note.morae[j]);\n\t }\n\t\n\t // if the note has an ictus, then add it here\n\t if (note.ictus) {\n\t note.ictus.performLayout(ctxt);\n\t this.addVisualizer(note.ictus);\n\t }\n\t\n\t if (note.acuteAccent) {\n\t note.acuteAccent.performLayout(ctxt);\n\t this.addVisualizer(note.acuteAccent);\n\t }\n\t\n\t // braces are handled by the chant line, so we don't mess with them here\n\t // this is because brace size depends on chant line logic (neume spacing,\n\t // justification, etc.) so they are considered chant line level\n\t // markings rather than note level markings\n\t }\n\t\n\t this.origin.x = this.notes[0].origin.x;\n\t this.origin.y = this.notes[0].origin.y;\n\t\n\t _get(Object.getPrototypeOf(Neume.prototype), 'finishLayout', this).call(this, ctxt);\n\t }\n\t }, {\n\t key: 'resetDependencies',\n\t value: function resetDependencies() {}\n\t }, {\n\t key: 'build',\n\t value: function build(ctxt) {\n\t return new NeumeBuilder(ctxt, this);\n\t }\n\t\n\t // subclasses can override this in order to correctly place markings in a neume specific way\n\t\n\t }, {\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {}\n\t }]);\n\t\n\t return Neume;\n\t}(_Exsurge2.ChantNotationElement);\n\t\n\t/*\n\t * Apostropha\n\t */\n\t\n\t\n\tvar Apostropha = exports.Apostropha = function (_Neume) {\n\t _inherits(Apostropha, _Neume);\n\t\n\t function Apostropha() {\n\t _classCallCheck(this, Apostropha);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Apostropha).apply(this, arguments));\n\t }\n\t\n\t _createClass(Apostropha, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t\n\t // logic here is this: if first episema is default position, place it above.\n\t // then place the second one (if there is one) opposite of the first.\n\t for (var i = 0; i < this.notes[0].epismata.length; i++) {\n\t if (this.notes[0].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[0].epismata[i].positionHint = positionHint;else positionHint = this.notes[0].epismata[i].positionHint;\n\t\n\t // now place the next one in the opposite position\n\t positionHint = positionHint === _ExsurgeChant.MarkingPositionHint.Above ? _ExsurgeChant.MarkingPositionHint.Below : _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Apostropha.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var y = ctxt.calculateHeightFromStaffPosition(4);\n\t\n\t this.build(ctxt).noteAt(this.notes[0], Apostropha.getNoteGlyphCode(this.notes[0]));\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }], [{\n\t key: 'getNoteGlyphCode',\n\t value: function getNoteGlyphCode(note) {\n\t\n\t if (note.shape === _Exsurge3.NoteShape.Stropha) return _Exsurge2.GlyphCode.Stropha;\n\t\n\t if (note.liquescent !== _Exsurge3.LiquescentType.None) return _Exsurge2.GlyphCode.StrophaLiquescent;\n\t\n\t if (note.shapeModifiers & _Exsurge3.NoteShapeModifiers.Cavum) return _Exsurge2.GlyphCode.PunctumCavum;\n\t\n\t return _Exsurge2.GlyphCode.PunctumQuadratum;\n\t }\n\t }]);\n\t\n\t return Apostropha;\n\t}(Neume);\n\t\n\t/*\n\t * Bivirga\n\t *\n\t * For simplicity in implementation, Bivirga's have two notes in the object\n\t * structure. These technically must be the same pitch though.\n\t */\n\t\n\t\n\tvar Bivirga = exports.Bivirga = function (_Neume2) {\n\t _inherits(Bivirga, _Neume2);\n\t\n\t function Bivirga() {\n\t _classCallCheck(this, Bivirga);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Bivirga).apply(this, arguments));\n\t }\n\t\n\t _createClass(Bivirga, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i, j;\n\t\n\t for (i = 0; i < this.notes.length; i++) {\n\t var positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t\n\t // logic here is this: if first episema is default position, place it above.\n\t // then place the second one (if there is one) opposite of the first.\n\t for (j = 0; j < this.notes[i].epismata.length; j++) {\n\t if (this.notes[i].epismata[j].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[i].epismata[j].positionHint = positionHint;else positionHint = this.notes[i].epismata[j].positionHint;\n\t\n\t // now place the next one in the opposite position\n\t positionHint = positionHint === _ExsurgeChant.MarkingPositionHint.Above ? _ExsurgeChant.MarkingPositionHint.Below : _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Bivirga.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.build(ctxt).virgaAt(this.notes[0]).advanceBy(ctxt.intraNeumeSpacing).virgaAt(this.notes[1]);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Bivirga;\n\t}(Neume);\n\t\n\t/*\n\t * Trivirga\n\t *\n\t * For simplicity in implementation, Trivirga's have three notes in the object\n\t * structure. These technically must be the same pitch though.\n\t */\n\t\n\t\n\tvar Trivirga = exports.Trivirga = function (_Neume3) {\n\t _inherits(Trivirga, _Neume3);\n\t\n\t function Trivirga() {\n\t _classCallCheck(this, Trivirga);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Trivirga).apply(this, arguments));\n\t }\n\t\n\t _createClass(Trivirga, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i, j;\n\t\n\t for (i = 0; i < this.notes.length; i++) {\n\t var positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t\n\t // logic here is this: if first episema is default position, place it above.\n\t // then place the second one (if there is one) opposite of the first.\n\t for (j = 0; j < this.notes[i].epismata.length; j++) {\n\t if (this.notes[i].epismata[j].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[i].epismata[j].positionHint = positionHint;else positionHint = this.notes[i].epismata[j].positionHint;\n\t\n\t // now place the next one in the opposite position\n\t positionHint = positionHint === _ExsurgeChant.MarkingPositionHint.Above ? _ExsurgeChant.MarkingPositionHint.Below : _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Trivirga.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.build(ctxt).virgaAt(this.notes[0]).advanceBy(ctxt.intraNeumeSpacing).virgaAt(this.notes[1]).advanceBy(ctxt.intraNeumeSpacing).virgaAt(this.notes[2]);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Trivirga;\n\t}(Neume);\n\t\n\t/*\n\t * Climacus\n\t */\n\t\n\t\n\tvar Climacus = exports.Climacus = function (_Neume4) {\n\t _inherits(Climacus, _Neume4);\n\t\n\t function Climacus() {\n\t _classCallCheck(this, Climacus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Climacus).apply(this, arguments));\n\t }\n\t\n\t _createClass(Climacus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t\n\t for (var i = 0; i < this.notes.length; i++) {\n\t for (var j = 0; j < this.notes[i].epismata.length; j++) {\n\t var mark = this.notes[i].epismata[j];\n\t\n\t if (mark.positionHint === _ExsurgeChant.MarkingPositionHint.Default) mark.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Climacus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.build(ctxt).virgaAt(this.notes[0]).advanceBy(ctxt.intraNeumeSpacing / 2).withInclinati(this.notes.slice(1));\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Climacus;\n\t}(Neume);\n\t\n\t/*\n\t * Clivis\n\t */\n\t\n\t\n\tvar Clivis = exports.Clivis = function (_Neume5) {\n\t _inherits(Clivis, _Neume5);\n\t\n\t function Clivis() {\n\t _classCallCheck(this, Clivis);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Clivis).apply(this, arguments));\n\t }\n\t\n\t _createClass(Clivis, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t\n\t var hasLowerMora = false;\n\t var mark, i;\n\t\n\t // 1. morae need to be lined up if both notes have morae\n\t // 2. like the podatus, mora on lower note needs to below\n\t // under certain circumstances\n\t for (i = 0; i < this.notes[1].morae.length; i++) {\n\t mark = this.notes[1].morae[i];\n\t\n\t if (this.notes[0].staffPosition - this.notes[1].staffPosition === 1 && Math.abs(this.notes[1].staffPosition % 2) === 1) mark.positionHint = _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t\n\t for (i = 0; i < this.notes[0].morae.length; i++) {\n\t\n\t if (hasLowerMora) {\n\t mark = this.notes[0].morae[i];\n\t mark.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t mark.horizontalOffset += this.notes[1].bounds.right() - this.notes[0].bounds.right();\n\t }\n\t }\n\t\n\t for (i = 0; i < this.notes[0].epismata.length; i++) {\n\t mark = this.notes[0].epismata[i];\n\t\n\t if (mark.positionHint === _ExsurgeChant.MarkingPositionHint.Default) mark.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t\n\t for (i = 0; i < this.notes[1].epismata.length; i++) {\n\t mark = this.notes[1].epismata[i];\n\t\n\t if (mark.positionHint === _ExsurgeChant.MarkingPositionHint.Default) mark.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Clivis.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var upper = this.notes[0];\n\t var lower = this.notes[1];\n\t\n\t this.build(ctxt).withClivis(upper, lower);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Clivis;\n\t}(Neume);\n\t\n\t/*\n\t * Distropha\n\t *\n\t * For simplicity in implementation, Distropha's have two notes in the object\n\t * structure. These technically must be the same pitch though (like Bivirga).\n\t */\n\t\n\t\n\tvar Distropha = exports.Distropha = function (_Neume6) {\n\t _inherits(Distropha, _Neume6);\n\t\n\t function Distropha() {\n\t _classCallCheck(this, Distropha);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Distropha).apply(this, arguments));\n\t }\n\t\n\t _createClass(Distropha, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t\n\t for (var i = 0; i < this.notes.length; i++) {\n\t var positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t\n\t // logic here is this: if first episema is default position, place it above.\n\t // then place the second one (if there is one) opposite of the first.\n\t for (var j = 0; j < this.notes[i].epismata.length; j++) {\n\t if (this.notes[i].epismata[j].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[i].epismata[j].positionHint = positionHint;else positionHint = this.notes[i].epismata[j].positionHint;\n\t\n\t // now place the next one in the opposite position\n\t positionHint = positionHint === _ExsurgeChant.MarkingPositionHint.Above ? _ExsurgeChant.MarkingPositionHint.Below : _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Distropha.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.build(ctxt).noteAt(this.notes[0], Apostropha.getNoteGlyphCode(this.notes[0])).advanceBy(ctxt.intraNeumeSpacing).noteAt(this.notes[1], Apostropha.getNoteGlyphCode(this.notes[1]));\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Distropha;\n\t}(Neume);\n\t\n\t/*\n\t * Oriscus\n\t */\n\t\n\t\n\tvar Oriscus = exports.Oriscus = function (_Neume7) {\n\t _inherits(Oriscus, _Neume7);\n\t\n\t function Oriscus() {\n\t _classCallCheck(this, Oriscus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Oriscus).apply(this, arguments));\n\t }\n\t\n\t _createClass(Oriscus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t\n\t // logic here is this: if first episema is default position, place it above.\n\t // then place the second one (if there is one) opposite of the first.\n\t for (var i = 0; i < this.notes[0].epismata.length; i++) {\n\t if (this.notes[0].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[0].epismata[i].positionHint = positionHint;else positionHint = this.notes[0].epismata[i].positionHint;\n\t\n\t // now place the next one in the opposite position\n\t positionHint = positionHint === _ExsurgeChant.MarkingPositionHint.Above ? _ExsurgeChant.MarkingPositionHint.Below : _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Oriscus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t // determine the glyph to use\n\t var note = this.notes[0];\n\t var glyph;\n\t\n\t if (note.liquescent !== _Exsurge3.LiquescentType.None) {\n\t glyph = _Exsurge2.GlyphCode.OriscusLiquescent;\n\t } else {\n\t if (note.shapeModifiers & _Exsurge3.NoteShapeModifiers.Ascending) glyph = _Exsurge2.GlyphCode.OriscusAsc;else if (note.shapeModifiers & _Exsurge3.NoteShapeModifiers.Descending) glyph = _Exsurge2.GlyphCode.OriscusDes;else {\n\t // by default we take the descending form, unless we can figure out by a lookahead here\n\t glyph = _Exsurge2.GlyphCode.OriscusDes;\n\t\n\t // try to find a neume following this one\n\t var neume = ctxt.findNextNeume();\n\t\n\t if (neume) {\n\t var nextNoteStaffPosition = ctxt.activeClef.pitchToStaffPosition(neume.notes[0].pitch);\n\t\n\t if (nextNoteStaffPosition > note.staffPosition) glyph = _Exsurge2.GlyphCode.OriscusAsc;\n\t }\n\t }\n\t }\n\t\n\t this.build(ctxt).noteAt(note, glyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }, {\n\t key: 'resetDependencies',\n\t value: function resetDependencies() {\n\t\n\t // a single oriscus tries to automatically use the right direction\n\t // based on the following neumes. if we don't have a manually designated\n\t // direction, then we reset our layout so that we can try to guess it\n\t // at next layout phase.\n\t if (this.notes[0].shapeModifiers & _Exsurge3.NoteShapeModifiers.Ascending || this.notes[0].shapeModifiers & _Exsurge3.NoteShapeModifiers.Descending) return;\n\t\n\t this.needsLayout = true;\n\t }\n\t }]);\n\t\n\t return Oriscus;\n\t}(Neume);\n\t\n\t/*\n\t * PesQuassus\n\t */\n\t\n\t\n\tvar PesQuassus = exports.PesQuassus = function (_Neume8) {\n\t _inherits(PesQuassus, _Neume8);\n\t\n\t function PesQuassus() {\n\t _classCallCheck(this, PesQuassus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(PesQuassus).apply(this, arguments));\n\t }\n\t\n\t _createClass(PesQuassus, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(PesQuassus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var lower = this.notes[0];\n\t var upper = this.notes[1];\n\t\n\t var lowerGlyph, upperGlyph;\n\t\n\t var lowerStaffPos = lower.staffPosition;\n\t var upperStaffPos = upper.staffPosition;\n\t\n\t if (lower.shape === _Exsurge3.NoteShape.Oriscus) lowerGlyph = _Exsurge2.GlyphCode.OriscusAsc;else lowerGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t var builder = this.build(ctxt).noteAt(lower, lowerGlyph);\n\t\n\t if (upperStaffPos - lowerStaffPos === 1) // use a virga glyph in this case\n\t builder.virgaAt(upper);else if (upper.liquescent === _Exsurge3.LiquescentType.LargeDescending) builder.noteAt(upper, _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent).withLineEndingAt(lower);else builder.noteAt(upper, _Exsurge2.GlyphCode.PunctumQuadratum).withLineEndingAt(lower);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return PesQuassus;\n\t}(Neume);\n\t\n\t/*\n\t * PesSubpunctis\n\t */\n\t\n\t\n\tvar PesSubpunctis = exports.PesSubpunctis = function (_Neume9) {\n\t _inherits(PesSubpunctis, _Neume9);\n\t\n\t function PesSubpunctis() {\n\t _classCallCheck(this, PesSubpunctis);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(PesSubpunctis).apply(this, arguments));\n\t }\n\t\n\t _createClass(PesSubpunctis, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(PesSubpunctis.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t // podatus followed by inclinati\n\t this.build(ctxt).withPodatus(this.notes[0], this.notes[1]).advanceBy(ctxt.intraNeumeSpacing / 2).withInclinati(this.notes.slice(2));\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return PesSubpunctis;\n\t}(Neume);\n\t\n\t/*\n\t * Podatus\n\t *\n\t * This podatus class handles a few neume types actually, depending on the note\n\t * data: Podatus (including various liquescent types on the upper note),\n\t * Podatus initio debilis, and Quilisma-Pes\n\t */\n\t\n\t\n\tvar Podatus = exports.Podatus = function (_Neume10) {\n\t _inherits(Podatus, _Neume10);\n\t\n\t function Podatus() {\n\t _classCallCheck(this, Podatus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Podatus).apply(this, arguments));\n\t }\n\t\n\t _createClass(Podatus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i;\n\t\n\t // 1. episema on lower note by default be below, upper note above\n\t // 2. morae:\n\t // a. if podatus difference is 1 and lower note is on a line,\n\t // the lower mora should be below\n\t for (i = 0; i < this.notes[0].epismata.length; i++) {\n\t if (this.notes[0].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[0].epismata[i].positionHint = _ExsurgeChant.MarkingPositionHint.Below;\n\t } // if this note has two or more (!?) morae then we just leave them be\n\t // since they have already been assigned position hints.\n\t if (this.notes[0].morae.length < 2) {\n\t for (i = 0; i < this.notes[0].morae.length; i++) {\n\t marking = this.notes[0].morae[i];\n\t\n\t if (this.notes[1].staffPosition - this.notes[0].staffPosition === 1 && Math.abs(this.notes[0].staffPosition % 2) === 1) marking.positionHint = _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t }\n\t\n\t for (i = 0; i < this.notes[1].epismata.length; i++) {\n\t if (this.notes[1].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[1].epismata[i].positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Podatus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.build(ctxt).withPodatus(this.notes[0], this.notes[1]);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Podatus;\n\t}(Neume);\n\t\n\t/*\n\t * Porrectus\n\t */\n\t\n\t\n\tvar Porrectus = exports.Porrectus = function (_Neume11) {\n\t _inherits(Porrectus, _Neume11);\n\t\n\t function Porrectus() {\n\t _classCallCheck(this, Porrectus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Porrectus).apply(this, arguments));\n\t }\n\t\n\t _createClass(Porrectus, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Porrectus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var first = this.notes[0];\n\t var second = this.notes[1];\n\t var third = this.notes[2];\n\t\n\t var thirdGlyph;\n\t\n\t if (third.liquescent & _Exsurge3.LiquescentType.Small) thirdGlyph = _Exsurge2.GlyphCode.TerminatingAscLiquescent;else if (third.liquescent & _Exsurge3.LiquescentType.Descending) thirdGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;else thirdGlyph = _Exsurge2.GlyphCode.PodatusUpper;\n\t\n\t this.build(ctxt).lineFrom(second).withPorrectusSwash(first, second).noteAt(third, thirdGlyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Porrectus;\n\t}(Neume);\n\t\n\t/*\n\t * PorrectusFlexus\n\t */\n\t\n\t\n\tvar PorrectusFlexus = exports.PorrectusFlexus = function (_Neume12) {\n\t _inherits(PorrectusFlexus, _Neume12);\n\t\n\t function PorrectusFlexus() {\n\t _classCallCheck(this, PorrectusFlexus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(PorrectusFlexus).apply(this, arguments));\n\t }\n\t\n\t _createClass(PorrectusFlexus, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(PorrectusFlexus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var first = this.notes[0];\n\t var second = this.notes[1];\n\t var third = this.notes[2];\n\t var fourth = this.notes[3];\n\t\n\t var thirdGlyph = _Exsurge2.GlyphCode.PunctumQuadratum,\n\t fourthGlyph;\n\t\n\t if (fourth.liquescent & _Exsurge3.LiquescentType.Small) {\n\t thirdGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;\n\t fourthGlyph = _Exsurge2.GlyphCode.TerminatingDesLiquescent;\n\t } else if (fourth.liquescent & _Exsurge3.LiquescentType.Ascending) fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent;else if (fourth.liquescent & _Exsurge3.LiquescentType.Descending) fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;else fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t this.build(ctxt).lineFrom(second).withPorrectusSwash(first, second).noteAt(third, thirdGlyph).noteAt(fourth, fourthGlyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return PorrectusFlexus;\n\t}(Neume);\n\t\n\t// this is some type of pseudo nume right? there is no such thing as a neume\n\t// of puncta inclinata, but this will be part of other composite neumes.\n\t\n\t\n\tvar PunctaInclinata = exports.PunctaInclinata = function (_Neume13) {\n\t _inherits(PunctaInclinata, _Neume13);\n\t\n\t function PunctaInclinata() {\n\t _classCallCheck(this, PunctaInclinata);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(PunctaInclinata).apply(this, arguments));\n\t }\n\t\n\t _createClass(PunctaInclinata, [{\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(PunctaInclinata.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.build(ctxt).withInclinati(this.notes);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return PunctaInclinata;\n\t}(Neume);\n\t\n\t/*\n\t * Punctum\n\t */\n\t\n\t\n\tvar Punctum = exports.Punctum = function (_Neume14) {\n\t _inherits(Punctum, _Neume14);\n\t\n\t function Punctum() {\n\t _classCallCheck(this, Punctum);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Punctum).apply(this, arguments));\n\t }\n\t\n\t _createClass(Punctum, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i;\n\t var positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t\n\t // logic here is this: if first episema is default position, place it above.\n\t // then place the second one (if there is one) opposite of the first.\n\t for (i = 0; i < this.notes[0].epismata.length; i++) {\n\t if (this.notes[0].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[0].epismata[i].positionHint = positionHint;else positionHint = this.notes[0].epismata[i].positionHint;\n\t\n\t // now place the next one in the opposite position\n\t positionHint = positionHint === _ExsurgeChant.MarkingPositionHint.Above ? _ExsurgeChant.MarkingPositionHint.Below : _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Punctum.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var note = this.notes[0];\n\t var glyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t // determine the glyph to use\n\t if (note.liquescent !== _Exsurge3.LiquescentType.None) {\n\t if (note.shape === _Exsurge3.NoteShape.Inclinatum) glyph = _Exsurge2.GlyphCode.PunctumInclinatumLiquescent;else if (note.shape === _Exsurge3.NoteShape.Oriscus) glyph = _Exsurge2.GlyphCode.OriscusLiquescent;else if (note.liquescent & _Exsurge3.LiquescentType.Ascending) glyph = _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent;else if (note.liquescent & _Exsurge3.LiquescentType.Descending) glyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;\n\t } else {\n\t\n\t if (note.shapeModifiers & _Exsurge3.NoteShapeModifiers.Cavum) glyph = _Exsurge2.GlyphCode.PunctumCavum;else if (note.shape === _Exsurge3.NoteShape.Inclinatum) glyph = _Exsurge2.GlyphCode.PunctumInclinatum;else if (note.shape === _Exsurge3.NoteShape.Quilisma) glyph = _Exsurge2.GlyphCode.Quilisma;else glyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t }\n\t\n\t this.build(ctxt).noteAt(note, glyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Punctum;\n\t}(Neume);\n\t\n\t/*\n\t * Salicus\n\t */\n\t\n\t\n\tvar Salicus = exports.Salicus = function (_Neume15) {\n\t _inherits(Salicus, _Neume15);\n\t\n\t function Salicus() {\n\t _classCallCheck(this, Salicus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Salicus).apply(this, arguments));\n\t }\n\t\n\t _createClass(Salicus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i, j;\n\t\n\t // by default place episema below\n\t // fixme: is this correct?\n\t for (i = 0; i < this.notes.length; i++) {\n\t for (j = 0; j < this.notes[i].epismata.length; j++) {\n\t if (this.notes[i].epismata[j].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[i].epismata[j].positionHint = _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Salicus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var first = this.notes[0];\n\t var second = this.notes[1];\n\t var third = this.notes[2];\n\t\n\t var builder = this.build(ctxt).noteAt(first, _Exsurge2.GlyphCode.PunctumQuadratum);\n\t\n\t // if the next note doesn't require a stem connector, then add a tad bit\n\t // of spacing here\n\t if (!(second.shapeModifiers & _Exsurge3.NoteShapeModifiers.Stemmed)) builder.advanceBy(ctxt.intraNeumeSpacing);\n\t\n\t // second note is always an oriscus, which may or may not be stemmed\n\t // to the first\n\t builder.noteAt(second, _Exsurge2.GlyphCode.OriscusAsc);\n\t\n\t // third note can be a punctum quadratum or various liquescent forms\n\t if (third.liquescent & _Exsurge3.LiquescentType.Small) builder.noteAt(third, _Exsurge2.GlyphCode.TerminatingAscLiquescent);else if (third.liquescent === _Exsurge3.LiquescentType.Ascending) builder.noteAt(third, _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent);else if (third.liquescent === _Exsurge3.LiquescentType.Descending) builder.noteAt(third, _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent);else builder.virgaAt(third);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Salicus;\n\t}(Neume);\n\t\n\t/*\n\t * Salicus Flexus\n\t */\n\t\n\t\n\tvar SalicusFlexus = exports.SalicusFlexus = function (_Neume16) {\n\t _inherits(SalicusFlexus, _Neume16);\n\t\n\t function SalicusFlexus() {\n\t _classCallCheck(this, SalicusFlexus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(SalicusFlexus).apply(this, arguments));\n\t }\n\t\n\t _createClass(SalicusFlexus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i, j;\n\t\n\t // by default place episema below\n\t // fixme: is this correct?\n\t for (i = 0; i < this.notes.length; i++) {\n\t for (j = 0; j < this.notes[i].epismata.length; j++) {\n\t if (this.notes[i].epismata[j].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[i].epismata[j].positionHint = _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(SalicusFlexus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var first = this.notes[0];\n\t var second = this.notes[1];\n\t var third = this.notes[2];\n\t var fourth = this.notes[3];\n\t\n\t var builder = this.build(ctxt).noteAt(first, _Exsurge2.GlyphCode.PunctumQuadratum);\n\t\n\t // if the next note doesn't require a stem connector, then add a tad bit\n\t // of spacing here\n\t if (!(second.shapeModifiers & _Exsurge3.NoteShapeModifiers.Stemmed)) builder.advanceBy(ctxt.intraNeumeSpacing);\n\t\n\t // second note is always an oriscus, which may or may not be stemmed\n\t // to the first\n\t builder.noteAt(second, _Exsurge2.GlyphCode.OriscusAsc);\n\t\n\t // third note can be a punctum quadratum or various liquescent forms,\n\t // ...based on note four though!\n\t if (fourth.liquescent & _Exsurge3.LiquescentType.Small) builder.noteAt(third, _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent);else builder.noteAt(third, _Exsurge2.GlyphCode.PunctumQuadratum);\n\t\n\t // finally, do the fourth note\n\t if (fourth.liquescent & _Exsurge3.LiquescentType.Small) builder.noteAt(fourth, _Exsurge2.GlyphCode.TerminatingDesLiquescent);else if (fourth.liquescent & _Exsurge3.LiquescentType.Ascending) builder.noteAt(fourth, _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent);else if (fourth.liquescent & _Exsurge3.LiquescentType.Descending) builder.noteAt(fourth, _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent);else builder.noteAt(fourth, _Exsurge2.GlyphCode.PunctumQuadratum);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return SalicusFlexus;\n\t}(Neume);\n\t\n\t/*\n\t * Scandicus\n\t */\n\t\n\t\n\tvar Scandicus = exports.Scandicus = function (_Neume17) {\n\t _inherits(Scandicus, _Neume17);\n\t\n\t function Scandicus() {\n\t _classCallCheck(this, Scandicus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Scandicus).apply(this, arguments));\n\t }\n\t\n\t _createClass(Scandicus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i;\n\t\n\t // by default place first note epismata below\n\t for (i = 0; i < this.notes[0].epismata.length; i++) {\n\t if (this.notes[0].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[0].epismata[i].positionHint = _ExsurgeChant.MarkingPositionHint.Below;\n\t }var positionHint = this.notes[2].shape === _Exsurge3.NoteShape.Virga ? _ExsurgeChant.MarkingPositionHint.Above : _ExsurgeChant.MarkingPositionHint.Below;\n\t for (i = 0; i < this.notes[1].epismata.length; i++) {\n\t if (this.notes[1].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[1].epismata[i].positionHint = positionHint;\n\t } // by default place third note epismata above\n\t for (i = 0; i < this.notes[2].epismata.length; i++) {\n\t if (this.notes[2].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[2].epismata[i].positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t\n\t // if the third note shape is a virga, then the scadicus is rendered\n\t // as a podatus followed by a virga. Otherwise, it's rendered as a\n\t // punctum followed by a podatus...\n\t\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Scandicus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var first = this.notes[0];\n\t var second = this.notes[1];\n\t var third = this.notes[2];\n\t\n\t if (third.shape === _Exsurge3.NoteShape.Virga) {\n\t this.build(ctxt).withPodatus(first, second).virgaAt(third);\n\t } else {\n\t this.build(ctxt).noteAt(first, _Exsurge2.GlyphCode.PunctumQuadratum).withPodatus(second, third);\n\t }\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Scandicus;\n\t}(Neume);\n\t\n\t/*\n\t * Scandicus Flexus\n\t */\n\t\n\t\n\tvar ScandicusFlexus = exports.ScandicusFlexus = function (_Neume18) {\n\t _inherits(ScandicusFlexus, _Neume18);\n\t\n\t function ScandicusFlexus() {\n\t _classCallCheck(this, ScandicusFlexus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(ScandicusFlexus).apply(this, arguments));\n\t }\n\t\n\t _createClass(ScandicusFlexus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i;\n\t\n\t // by default place first note epismata below\n\t for (i = 0; i < this.notes[0].epismata.length; i++) {\n\t if (this.notes[0].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[0].epismata[i].positionHint = _ExsurgeChant.MarkingPositionHint.Below;\n\t }var positionHint = this.notes[2].shape === _Exsurge3.NoteShape.Virga ? _ExsurgeChant.MarkingPositionHint.Above : _ExsurgeChant.MarkingPositionHint.Below;\n\t for (i = 0; i < this.notes[1].epismata.length; i++) {\n\t if (this.notes[1].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[1].epismata[i].positionHint = positionHint;\n\t } // by default place third note epismata above\n\t for (i = 0; i < this.notes[2].epismata.length; i++) {\n\t if (this.notes[2].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[2].epismata[i].positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t } // by default place fourth note epismata above\n\t for (i = 0; i < this.notes[3].epismata.length; i++) {\n\t if (this.notes[3].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[3].epismata[i].positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(ScandicusFlexus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var first = this.notes[0];\n\t var second = this.notes[1];\n\t var third = this.notes[2];\n\t var fourth = this.notes[3];\n\t\n\t if (third.shape === _Exsurge3.NoteShape.Virga) {\n\t this.build(ctxt).withPodatus(first, second).advanceBy(ctxt.intraNeumeSpacing).withClivis(third, fourth);\n\t } else {\n\t var fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t if (fourth.liquescent & _Exsurge3.LiquescentType.Ascending) fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent;else if (fourth.liquescent & _Exsurge3.LiquescentType.Descending) fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;\n\t\n\t this.build(ctxt).noteAt(first, _Exsurge2.GlyphCode.PunctumQuadratum).withPodatus(second, third).advanceBy(ctxt.intraNeumeSpacing).noteAt(fourth, fourthGlyph);\n\t }\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return ScandicusFlexus;\n\t}(Neume);\n\t\n\t/*\n\t * Torculus\n\t */\n\t\n\t\n\tvar Torculus = exports.Torculus = function (_Neume19) {\n\t _inherits(Torculus, _Neume19);\n\t\n\t function Torculus() {\n\t _classCallCheck(this, Torculus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Torculus).apply(this, arguments));\n\t }\n\t\n\t _createClass(Torculus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i;\n\t var hasMiddleEpisema = false;\n\t\n\t // first do the middle note to see if we should try to move\n\t // epismata on the other two lower notes\n\t for (i = 0; i < this.notes[1].epismata.length; i++) {\n\t marking = this.notes[1].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) {\n\t marking.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t hasMiddleEpisema = true;\n\t }\n\t }\n\t\n\t // 1. episema on lower notes should be below, upper note above\n\t // 2. morae: fixme: implement\n\t for (i = 0; i < this.notes[0].epismata.length; i++) {\n\t marking = this.notes[0].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = hasMiddleEpisema ? _ExsurgeChant.MarkingPositionHint.Above : _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t\n\t for (i = 0; i < this.notes[2].epismata.length; i++) {\n\t marking = this.notes[2].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = hasMiddleEpisema ? _ExsurgeChant.MarkingPositionHint.Above : _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Torculus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var note1 = this.notes[0];\n\t var note2 = this.notes[1];\n\t var note3 = this.notes[2];\n\t\n\t var glyph1, glyph3;\n\t\n\t if (note1.liquescent === _Exsurge3.LiquescentType.InitioDebilis) glyph1 = _Exsurge2.GlyphCode.TerminatingDesLiquescent;else if (note1.shape === _Exsurge3.NoteShape.Quilisma) glyph1 = _Exsurge2.GlyphCode.Quilisma;else glyph1 = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t if (note3.liquescent & _Exsurge3.LiquescentType.Small) glyph3 = _Exsurge2.GlyphCode.TerminatingDesLiquescent;else if (note3.liquescent & _Exsurge3.LiquescentType.Ascending) glyph3 = _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent;else if (note3.liquescent & _Exsurge3.LiquescentType.Descending) glyph3 = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;else glyph3 = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t this.build(ctxt).noteAt(note1, glyph1).noteAt(note2, _Exsurge2.GlyphCode.PunctumQuadratum).noteAt(note3, glyph3);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Torculus;\n\t}(Neume);\n\t\n\t/*\n\t * TorculusResupinus\n\t */\n\t\n\t\n\tvar TorculusResupinus = exports.TorculusResupinus = function (_Neume20) {\n\t _inherits(TorculusResupinus, _Neume20);\n\t\n\t function TorculusResupinus() {\n\t _classCallCheck(this, TorculusResupinus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(TorculusResupinus).apply(this, arguments));\n\t }\n\t\n\t _createClass(TorculusResupinus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i;\n\t var hasMiddleEpisema = false;\n\t\n\t // first do the middle note to see if we should try to move\n\t // epismata on the other two lower notes\n\t for (i = 0; i < this.notes[1].epismata.length; i++) {\n\t marking = this.notes[1].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) {\n\t marking.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t hasMiddleEpisema = true;\n\t }\n\t }\n\t\n\t // 1. episema on lower notes should be below, upper note above\n\t // 2. morae: fixme: implement\n\t for (i = 0; i < this.notes[0].epismata.length; i++) {\n\t marking = this.notes[0].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = hasMiddleEpisema ? _ExsurgeChant.MarkingPositionHint.Above : _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t\n\t for (i = 0; i < this.notes[2].epismata.length; i++) {\n\t marking = this.notes[2].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = hasMiddleEpisema ? _ExsurgeChant.MarkingPositionHint.Above : _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t\n\t for (i = 0; i < this.notes[3].epismata.length; i++) {\n\t marking = this.notes[3].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(TorculusResupinus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var first = this.notes[0];\n\t var second = this.notes[1];\n\t var third = this.notes[2];\n\t var fourth = this.notes[3];\n\t\n\t var firstGlyph, fourthGlyph;\n\t\n\t if (first.liquescent === _Exsurge3.LiquescentType.InitioDebilis) {\n\t firstGlyph = _Exsurge2.GlyphCode.TerminatingDesLiquescent;\n\t } else if (first.shape === _Exsurge3.NoteShape.Quilisma) firstGlyph = _Exsurge2.GlyphCode.Quilisma;else firstGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t if (fourth.liquescent & _Exsurge3.LiquescentType.Small) fourthGlyph = _Exsurge2.GlyphCode.TerminatingAscLiquescent;else if (third.liquescent & _Exsurge3.LiquescentType.Descending) fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;else fourthGlyph = _Exsurge2.GlyphCode.PodatusUpper;\n\t\n\t this.build(ctxt).noteAt(first, firstGlyph).withPorrectusSwash(second, third).noteAt(fourth, fourthGlyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return TorculusResupinus;\n\t}(Neume);\n\t\n\t/*\n\t * TorculusResupinusFlexus\n\t */\n\t\n\t\n\tvar TorculusResupinusFlexus = exports.TorculusResupinusFlexus = function (_Neume21) {\n\t _inherits(TorculusResupinusFlexus, _Neume21);\n\t\n\t function TorculusResupinusFlexus() {\n\t _classCallCheck(this, TorculusResupinusFlexus);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(TorculusResupinusFlexus).apply(this, arguments));\n\t }\n\t\n\t _createClass(TorculusResupinusFlexus, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i;\n\t var hasMiddleEpisema = false;\n\t\n\t // first do the middle note to see if we should try to move\n\t // epismata on the other two lower notes\n\t for (i = 0; i < this.notes[1].epismata.length; i++) {\n\t marking = this.notes[1].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) {\n\t marking.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t hasMiddleEpisema = true;\n\t }\n\t }\n\t\n\t // 1. episema on lower notes should be below, upper note above\n\t // 2. morae: fixme: implement\n\t for (i = 0; i < this.notes[0].epismata.length; i++) {\n\t marking = this.notes[0].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = hasMiddleEpisema ? _ExsurgeChant.MarkingPositionHint.Above : _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t\n\t for (i = 0; i < this.notes[2].epismata.length; i++) {\n\t marking = this.notes[2].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = hasMiddleEpisema ? _ExsurgeChant.MarkingPositionHint.Above : _ExsurgeChant.MarkingPositionHint.Below;\n\t }\n\t\n\t for (i = 0; i < this.notes[3].epismata.length; i++) {\n\t marking = this.notes[3].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t\n\t for (i = 0; i < this.notes[4].epismata.length; i++) {\n\t marking = this.notes[4].epismata[i];\n\t\n\t if (marking.positionHint === _ExsurgeChant.MarkingPositionHint.Default) marking.positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(TorculusResupinusFlexus.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t var first = this.notes[0];\n\t var second = this.notes[1];\n\t var third = this.notes[2];\n\t var fourth = this.notes[3];\n\t var fifth = this.notes[4];\n\t\n\t var firstGlyph,\n\t fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratum,\n\t fifthGlyph;\n\t\n\t if (first.liquescent === _Exsurge3.LiquescentType.InitioDebilis) {\n\t firstGlyph = _Exsurge2.GlyphCode.TerminatingDesLiquescent;\n\t } else if (first.shape === _Exsurge3.NoteShape.Quilisma) firstGlyph = _Exsurge2.GlyphCode.Quilisma;else firstGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t if (fifth.liquescent & _Exsurge3.LiquescentType.Small) {\n\t fourthGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;\n\t fifthGlyph = _Exsurge2.GlyphCode.TerminatingDesLiquescent;\n\t } else if (fifth.liquescent & _Exsurge3.LiquescentType.Ascending) fifthGlyph = _Exsurge2.GlyphCode.PunctumQuadratumAscLiquescent;else if (fifth.liquescent & _Exsurge3.LiquescentType.Descending) fifthGlyph = _Exsurge2.GlyphCode.PunctumQuadratumDesLiquescent;else fifthGlyph = _Exsurge2.GlyphCode.PunctumQuadratum;\n\t\n\t this.build(ctxt).noteAt(first, firstGlyph).withPorrectusSwash(second, third).noteAt(fourth, fourthGlyph).noteAt(fifth, fifthGlyph);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return TorculusResupinusFlexus;\n\t}(Neume);\n\t\n\t/*\n\t * Tristropha\n\t *\n\t * For simplicity in implementation, Tristropha's have three notes in the object\n\t * structure. These technically must be the same pitch though (like the\n\t * Distropha and Bivirga).\n\t */\n\t\n\t\n\tvar Tristropha = exports.Tristropha = function (_Neume22) {\n\t _inherits(Tristropha, _Neume22);\n\t\n\t function Tristropha() {\n\t _classCallCheck(this, Tristropha);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Tristropha).apply(this, arguments));\n\t }\n\t\n\t _createClass(Tristropha, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var marking, i, j;\n\t\n\t for (i = 0; i < this.notes.length; i++) {\n\t var positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t\n\t // logic here is this: if first episema is default position, place it above.\n\t // then place the second one (if there is one) opposite of the first.\n\t for (j = 0; j < this.notes[i].epismata.length; j++) {\n\t if (this.notes[i].epismata[j].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[i].epismata[j].positionHint = positionHint;else positionHint = this.notes[i].epismata[j].positionHint;\n\t\n\t // now place the next one in the opposite position\n\t positionHint = positionHint === _ExsurgeChant.MarkingPositionHint.Above ? _ExsurgeChant.MarkingPositionHint.Below : _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Tristropha.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.build(ctxt).noteAt(this.notes[0], Apostropha.getNoteGlyphCode(this.notes[0])).advanceBy(ctxt.intraNeumeSpacing).noteAt(this.notes[1], Apostropha.getNoteGlyphCode(this.notes[1])).advanceBy(ctxt.intraNeumeSpacing).noteAt(this.notes[2], Apostropha.getNoteGlyphCode(this.notes[2]));\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Tristropha;\n\t}(Neume);\n\t\n\t/*\n\t * Virga\n\t */\n\t\n\t\n\tvar Virga = exports.Virga = function (_Neume23) {\n\t _inherits(Virga, _Neume23);\n\t\n\t function Virga() {\n\t _classCallCheck(this, Virga);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(Virga).apply(this, arguments));\n\t }\n\t\n\t _createClass(Virga, [{\n\t key: 'positionMarkings',\n\t value: function positionMarkings() {\n\t var positionHint = _ExsurgeChant.MarkingPositionHint.Above;\n\t\n\t // logic here is this: if first episema is default position, place it above.\n\t // then place the second one (if there is one) opposite of the first.\n\t for (var i = 0; i < this.notes[0].epismata.length; i++) {\n\t if (this.notes[0].epismata[i].positionHint === _ExsurgeChant.MarkingPositionHint.Default) this.notes[0].epismata[i].positionHint = positionHint;else positionHint = this.notes[0].epismata[i].positionHint;\n\t\n\t // now place the next one in the opposite position\n\t positionHint = positionHint === _ExsurgeChant.MarkingPositionHint.Above ? _ExsurgeChant.MarkingPositionHint.Below : _ExsurgeChant.MarkingPositionHint.Above;\n\t }\n\t }\n\t }, {\n\t key: 'performLayout',\n\t value: function performLayout(ctxt) {\n\t _get(Object.getPrototypeOf(Virga.prototype), 'performLayout', this).call(this, ctxt);\n\t\n\t this.build(ctxt).virgaAt(this.notes[0]);\n\t\n\t this.finishLayout(ctxt);\n\t }\n\t }]);\n\t\n\t return Virga;\n\t}(Neume);\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** exsurge.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap bd694b8acb765eff97ca\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n'use strict';\n\nimport { Annotation, ChantContext } from 'Exsurge.Drawing'\nimport { Gabc } from 'Exsurge.Gabc'\n\n// client side support\n\nif (typeof document !== 'undefined') {\n var ChantVisualElementPrototype = Object.create(HTMLElement.prototype);\n\n ChantVisualElementPrototype.createdCallback = function() {\n var ctxt = new ChantContext();\n \n ctxt.lyricTextFont = \"'Crimson Text', serif\";\n ctxt.lyricTextSize *= 1.2;\n ctxt.dropCapTextFont = ctxt.lyricTextFont;\n ctxt.annotationTextFont = ctxt.lyricTextFont;\n\n var useDropCap = true;\n var useDropCapAttr = this.getAttribute(\"use-drop-cap\");\n if (useDropCapAttr === 'false')\n useDropCap = false;\n\n var score = Gabc.loadChantScore(ctxt, this.innerText, useDropCap);\n\n var annotationAttr = this.getAttribute(\"annotation\");\n if (annotationAttr) {\n // add an annotation\n score.annotation = new Annotation(ctxt, annotationAttr);\n }\n\n var _element = this;\n\n var width = 0;\n var doLayout = function() {\n var newWidth = _element.parentElement.clientWidth;\n if(width === newWidth) return;\n width = newWidth;\n // perform layout on the chant\n score.performLayout(ctxt, function() {\n score.layoutChantLines(ctxt, width, function() {\n // render the score to svg code\n _element.innerHTML = score.createSvgFragment(ctxt);\n });\n });\n }\n doLayout();\n if (window.addEventListener)\n window.addEventListener('resize',doLayout,false);\n else if (window.attachEvent)\n window.attachEvent('onresize',doLayout);\n }\n\n ChantVisualElementPrototype.attachedCallback = function() {\n \n }\n\n document.registerElement = document.registerElement || function() {};\n // register the custom element\n var ChantVisualElement = document.registerElement('chant-visual', {\n prototype: ChantVisualElementPrototype\n });\n}\n\nexport * from 'Exsurge.Core'\nexport * from 'Exsurge.Text'\nexport * from 'Exsurge.Glyphs'\nexport * from 'Exsurge.Drawing'\nexport * from 'Exsurge.Chant'\nexport * from 'Exsurge.Chant.Markings'\nexport * from 'Exsurge.Chant.Signs'\nexport * from 'Exsurge.Chant.Neumes'\nexport * from 'Exsurge.Gabc'\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nexport var Units = {\n // enums\n DeviceIndepenedent: 0, // device independent units: 96/inch\n Centimeters: 1,\n Millimeters: 2,\n Inches: 3,\n\n // constants for device independent units (diu)\n DIU_PER_INCH: 96,\n DIU_PER_CENTIMETER: 96 / 2.54,\n\n ToDeviceIndependent: function (n, inputUnits) {\n switch (inputUnits) {\n case Centimeters:\n return n * DIU_PER_CENTIMETER;\n case Millimeters:\n return n * DIU_PER_CENTIMETER / 10;\n case Inches:\n return n * DIU_PER_INCH;\n default:\n return n;\n }\n },\n\n FromDeviceIndependent: function (n, outputUnits) {\n switch (outputUnits) {\n case Centimeters:\n return n / DIU_PER_CENTIMETER;\n case Millimeters:\n return n / DIU_PER_CENTIMETER * 10;\n case Inches:\n return n / DIU_PER_INCH;\n default:\n return n;\n }\n },\n\n\n StringToUnitsType: function(s) {\n switch (s.ToLower()) {\n case \"in\":\n case \"inches\":\n return Inches;\n\n case \"cm\":\n case \"centimeters\":\n return Centimeters;\n\n case \"mm\":\n case \"millimeters\":\n return Millimeters;\n\n case \"di\":\n case \"device-independent\":\n return DeviceIndepenedent;\n\n default:\n return DeviceIndepenedent;\n }\n },\n\n UnitsTypeToString: function(units) {\n switch (units) {\n case Inches: return \"in\";\n case Centimeters: return \"cm\";\n case Millimeters: return \"mm\";\n case DeviceIndepenedent: return \"device-independent\";\n default: return \"device-independent\";\n }\n }\n}\n\nexport function DeviceIndependent(n) {\n return n;\n}\n\nexport function Centimeters(n) {\n return Units.ToDeviceIndependent(n, Units.Centimeters);\n}\n\nexport function Millimeters(n) {\n return Units.ToDeviceIndependent(n, Units.Millimeters);\n}\n\nexport function Inches(n) {\n return Units.ToDeviceIndependent(n, Units.Inches);\n}\n\nexport function ToCentimeters(n) {\n return Units.FromDeviceIndependent(n, Units.Centimeters);\n}\n\nexport function ToMillimeters(n) {\n return Units.FromDeviceIndependent(n, Units.Millimeters);\n}\n\nexport function ToInches(n) {\n return Units.FromDeviceIndependent(n, Units.Inches);\n}\n\n\n/*\n * Point\n */\nexport class Point {\n constructor(x, y) {\n this.x = (typeof x !== 'undefined') ? x : 0;\n this.y = (typeof y !== 'undefined') ? y : 0;\n }\n\n clone() {\n return new Point(this.x, this.y);\n }\n\n equals(point) {\n return this.x === point.x && this.y === point.y;\n }\n}\n\n/*\n * Rect\n */\nexport class Rect {\n constructor(x, y, width, height) {\n this.x = (typeof x !== 'undefined') ? x : Infinity;\n this.y = (typeof y !== 'undefined') ? y : Infinity;\n this.width = (typeof width !== 'undefined') ? width : -Infinity;\n this.height = (typeof height !== 'undefined') ? height : -Infinity;\n }\n\n clone() {\n return new Rect(this.x, this.y, this.width, this.height);\n }\n\n isEmpty() {\n return (this.x === Infinity &&\n this.y === Infinity &&\n this.width === -Infinity &&\n this.height === -Infinity);\n }\n\n // convenience method\n right() {\n return this.x + this.width;\n }\n\n bottom() {\n return this.y + this.height;\n }\n\n equals(rect) {\n return this.x === rect.x && this.y === rect.y &&\n this.width === rect.width && this.height === rect.height;\n }\n\n // other can be a Point or a Rect\n contains(other) {\n if (other instanceof Point) {\n return other.x >= this.x &&\n other.x <= this.x + this.width &&\n other.y >= this.y &&\n other.y <= this.y + this.height;\n } else { // better be instance of Rect\n return this.x <= other.x &&\n this.x + this.width >= other.x + other.width &&\n this.y <= other.y &&\n this.y + this.height >= other.y + other.height;\n }\n }\n\n union(rect) {\n\n var right = Math.max(this.x + this.width, rect.x + rect.width);\n var bottom = Math.max(this.y + this.height, rect.y + rect.height);\n\n this.x = Math.min(this.x, rect.x);\n this.y = Math.min(this.y, rect.y);\n\n this.width = right - this.x;\n this.height = bottom - this.y;\n }\n}\n\n/**\n * Margins\n *\n * @class\n */\nexport class Margins {\n constructor(left, top, right, bottom) {\n this.left = (typeof left !== 'undefined') ? left : 0;\n this.top = (typeof top !== 'undefined') ? top : 0;\n this.right = (typeof right !== 'undefined') ? right : 0;\n this.bottom = (typeof bottom !== 'undefined') ? bottom : 0;\n }\n\n clone() {\n return new Margins(this.left, this.top, this.right, this.bottom);\n }\n\n equals(margins) {\n return this.left === margins.left &&\n this.top === margins.top &&\n this.right === margins.right &&\n this.bottom === margins.bottom;\n }\n}\n\n/**\n * Size\n *\n * @class\n */\nexport class Size {\n constructor(width, height) {\n this.width = (typeof width !== 'undefined') ? width : 0;\n this.height = (typeof height !== 'undefined') ? height : 0;\n }\n\n clone() {\n return new Size(this.width, this.height);\n }\n\n equals(size) {\n return this.width === size.width && this.height === size.height;\n }\n}\n\n\n/*\n * Pitches, notes\n */\nexport var Step = {\n Do: 0,\n Du: 1,\n Re: 2,\n Me: 3,\n Mi: 4,\n Fa: 5,\n Fu: 6,\n So: 7,\n La: 9,\n Te: 10,\n Ti: 11\n};\n\n // this little array helps map step values to staff positions. The numeric values of steps\n // correspond to whole step increments (2) or half step increments (1). This gives us the ability\n // to compare pitches precisely, but makes it challenging to place steps on the staff. this little\n // array maps the steps to an incremental position the steps take on the staff line. This works\n // so simply because chant only uses do and fa clefs, and only has a flatted ti (te), making\n // for relatively easy mapping to staff line locations.\n // Do Du Re Me Mi Fa Fu So La Te Ti\nvar __StepToStaffPosition = [0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6];\nvar __StaffOffsetToStep = [Step.Do, Step.Re, Step.Mi, Step.Fa, Step.So, Step.La, Step.Ti]; // no accidentals in this one\n\n\nexport class Pitch {\n constructor(step, octave) {\n this.step = step;\n this.octave = octave;\n }\n \n toInt() {\n return this.octave * 12 + this.step;\n }\n\n isHigherThan(pitch) {\n return this.toInt() > pitch.toInt();\n }\n\n isLowerThan(pitch) {\n return this.toInt() < pitch.toInt();\n }\n\n equals(pitch) {\n return this.toInt() === pitch.toInt();\n }\n\n static stepToStaffOffset(step) {\n return __StepToStaffPosition[step];\n }\n\n static staffOffsetToStep(offset) {\n while (offset < 0)\n offset = __StaffOffsetToStep.length + offset;\n\n return __StaffOffsetToStep[offset % __StaffOffsetToStep.length];\n }\n}\n\nexport function generateRandomGuid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return s4() + s4();\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Core.js\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport * as Exsurge from 'Exsurge.Core'\n\n/**\n * @class\n */\nexport class Language {\n constructor(name) {\n this.name = (typeof name !== 'undefined') ? name : \"\";\n }\n\n /**\n * @param {String} text The string to parsed into words.\n * @return {Word[]} the resulting parsed words from syllabification\n */\n syllabify(text) {\n\n var parsedWords = [];\n\n if (typeof text === 'undefined' || text === \"\")\n return parsedWords;\n\n // Divide the text into words separated by whitespace\n var words = text.split(/[\\s]+/);\n\n for (var i = 0, end = words.length; i < end; i++)\n parsedWords.push(this.syllabifyWord(words[i]));\n\n return parsedWords;\n }\n}\n\n/**\n * @class\n */\nexport class Latin extends Language {\n\n /**\n * @constructs\n */\n constructor() {\n super(\"Latin\");\n\n // fixme: ui is only diphthong in the exceptional cases below (according to Wheelock's Latin)\n this.diphthongs = [\"ae\", \"au\", \"oe\", \"aé\", \"áu\", \"oé\"];\n // for centering over the vowel, we will need to know any combinations that might be diphthongs:\n this.possibleDiphthongs = this.diphthongs.concat([\"ei\", \"eu\", \"ui\", \"éi\", \"éu\", \"úi\"]);\n\n // some words that are simply exceptions to standard syllabification rules!\n var wordExceptions = new Object();\n\n // ui combos pronounced as diphthongs\n wordExceptions[\"huius\"] = [\"hui\", \"us\"];\n wordExceptions[\"cuius\"] = [\"cui\", \"us\"];\n wordExceptions[\"huic\"] = [\"huic\"];\n wordExceptions[\"cui\"] = [\"cui\"];\n wordExceptions[\"hui\"] = [\"hui\"];\n \n // eu combos pronounced as diphthongs\n wordExceptions[\"euge\"] = [\"eu\", \"ge\"];\n wordExceptions[\"seu\"] = [\"seu\"];\n\n this.vowels = ['a', 'e', 'i', 'o', 'u',\n 'á', 'é', 'í', 'ó', 'ú',\n 'æ', 'œ',\n 'ǽ', // no accented œ in unicode?\n 'y']; // y is treated as a vowel; not native to Latin but useful for words borrowed from Greek\n\n this.vowelsThatMightBeConsonants = ['i','u'];\n\n this.muteConsonantsAndF = ['b', 'c', 'd', 'g', 'p', 't', 'f'];\n\n this.liquidConsonants = ['l', 'r'];\n }\n\n // c must be lowercase!\n isVowel(c) {\n for (var i = 0, end = this.vowels.length; i < end; i++)\n if (this.vowels[i] === c)\n return true;\n\n return false;\n }\n\n isVowelThatMightBeConsonant(c) {\n for (var i = 0, end = this.vowelsThatMightBeConsonants.length; i < end; i++)\n if (this.vowelsThatMightBeConsonants[i] === c)\n return true;\n\n return false;\n }\n \n // substring should be a vowel and the character following\n isVowelActingAsConsonant(substring) {\n return this.isVowelThatMightBeConsonant(substring[0]) && this.isVowel(substring[1]);\n }\n\n /**\n * f is not a mute consonant, but we lump it together for syllabification\n * since it is syntactically treated the same way\n *\n * @param {String} c The character to test; must be lowercase\n * @return {boolean} true if c is an f or a mute consonant\n */\n isMuteConsonantOrF(c) {\n for (var i = 0, end = this.muteConsonantsAndF.length; i < end; i++)\n if (this.muteConsonantsAndF[i] === c)\n return true;\n\n return false;\n }\n\n /**\n *\n * @param {String} c The character to test; must be lowercase\n * @return {boolean} true if c is a liquid consonant\n */\n isLiquidConsonant(c) {\n for (var i = 0, end = this.liquidConsonants.length; i < end; i++)\n if (this.liquidConsonants[i] === c)\n return true;\n\n return false;\n }\n\n /**\n *\n * @param {String} s The string to test; must be lowercase\n * @return {boolean} true if s is a diphthong\n */\n isDiphthong(s) {\n for (var i = 0, end = this.diphthongs.length; i < end; i++)\n if (this.diphthongs[i] === s)\n return true;\n\n return false;\n }\n\n /**\n *\n * @param {String} s The string to test; must be lowercase\n * @return {boolean} true if s is a diphthong\n */\n isPossibleDiphthong(s) {\n for (var i = 0, end = this.possibleDiphthongs.length; i < end; i++)\n if (this.possibleDiphthongs[i] === s)\n return true;\n\n return false;\n }\n\n /**\n * Rules for Latin syllabification (from Collins, \"A Primer on Ecclesiastical Latin\")\n *\n * Divisions occur when:\n * 1. After open vowels (those not followed by a consonant) (e.g., \"pi-us\" and \"De-us\")\n * 2. After vowels followed by a single consonant (e.g., \"vi-ta\" and \"ho-ra\")\n * 3. After the first consonant when two or more consonants follow a vowel\n * (e.g., \"mis-sa\", \"minis-ter\", and \"san-ctus\").\n *\n * Exceptions:\n * 1. In compound words the consonants stay together (e.g., \"de-scribo\").\n * 2. A mute consonant (b, c, d, g, p, t) or f followed by a liquid consonant (l, r)\n * go with the succeeding vowel: \"la-crima\", \"pa-tris\"\n *\n * In addition to these rules, Wheelock's Latin provides this sound exception:\n * - Also counted as single consonants are qu and the aspirates ch, ph,\n * th, which should never be separated in syllabification:\n * architectus, ar-chi-tec-tus; loquacem, lo-qua-cem.\n *\n */\n syllabifyWord(word) {\n var syllables = [];\n var haveCompleteSyllable = false;\n var previousWasVowel = false;\n var workingString = word.toLowerCase();\n var startSyllable = 0;\n\n var c, lookahead, haveLookahead;\n\n // a helper function to create syllables\n var makeSyllable = function (length) {\n if (haveCompleteSyllable) {\n syllables.push(word.substr(startSyllable, length));\n startSyllable += length;\n }\n\n haveCompleteSyllable = false;\n }\n\n for (var i = 0, wordLength = workingString.length; i < wordLength; i++) {\n\n c = workingString[i];\n\n // get our lookahead in case we need them...\n lookahead = '*';\n haveLookahead = (i + 1) < wordLength;\n\n if (haveLookahead)\n lookahead = workingString[i + 1];\n\n var cIsVowel = this.isVowel(c);\n\n // i is a special case for a vowel. when i is at the beginning\n // of the word (Iesu) or i is between vowels (alleluia),\n // then the i is treated as a consonant (y)\n if (c === 'i') {\n if (i === 0 && haveLookahead && this.isVowel(lookahead))\n cIsVowel = false;\n else if (previousWasVowel && haveLookahead && this.isVowel(lookahead)) {\n cIsVowel = false;\n }\n }\n\n if (c === '-') {\n\n // a hyphen forces a syllable break, which effectively resets\n // the logic...\n\n haveCompleteSyllable = true;\n previousWasVowel = false;\n makeSyllable(i - startSyllable);\n startSyllable++;\n\n } else if (cIsVowel) {\n\n // once we get a vowel, we have a complete syllable\n haveCompleteSyllable = true;\n\n if (previousWasVowel && !this.isDiphthong(workingString[i - 1] + \"\" + c)) {\n makeSyllable(i - startSyllable);\n haveCompleteSyllable = true;\n }\n\n previousWasVowel = true;\n\n } else if (haveLookahead) {\n\n if ((c === 'q' && lookahead === 'u') ||\n (lookahead === 'h' && (c === 'c' || c === 'p' || c === 't'))) {\n // handle wheelock's exceptions for qu, ch, ph and th\n makeSyllable(i - startSyllable);\n i++; // skip over the 'h' or 'u'\n } else if (previousWasVowel && this.isVowel(lookahead)) {\n // handle division rule 2\n makeSyllable(i - startSyllable);\n } else if (this.isMuteConsonantOrF(c) && this.isLiquidConsonant(lookahead)) {\n // handle exception 2\n makeSyllable(i - startSyllable);\n } else if (haveCompleteSyllable) {\n // handle division rule 3\n makeSyllable(i + 1 - startSyllable);\n }\n\n previousWasVowel = false;\n }\n }\n\n // if we have a complete syllable, we can add it as a new one. Otherwise\n // we tack the remaining characters onto the last syllable.\n if (haveCompleteSyllable)\n syllables.push(word.substr(startSyllable));\n else if (startSyllable > 0)\n syllables[syllables.length - 1] += word.substr(startSyllable);\n\n return syllables;\n }\n\n /**\n * @param {String} s the string to search\n * @param {Number} startIndex The index at which to start searching for a vowel in the string\n * @retuns a custom class with three properties: {found: (true/false) startIndex: (start index in s of vowel segment) length ()}\n */\n findVowelSegment(s, startIndex) {\n\n var i, end, index;\n var workingString = s.toLowerCase();\n\n // do we have a diphthong?\n for (i = 0, end = this.possibleDiphthongs.length; i < end; i++) {\n var d = this.possibleDiphthongs[i];\n index = workingString.indexOf(d, startIndex);\n\n if (index >= 0)\n return { found: true, startIndex: index, length: d.length };\n }\n\n // no diphthongs. Let's look for single vowels then...\n for (i = 0, end = this.vowels.length; i < end; i++) {\n index = workingString.indexOf(this.vowels[i], startIndex);\n\n if (index >= 0) {\n // if the first vowel found might also be a consonant (U or I), and it is immediately followed by another vowel, (e.g., sanguis, quis), the first u counts as a consonant:\n // (in practice, this only affects words such as equus that contain a uu, since the alphabetically earlier vowel would be found before the U)\n if(this.isVowelActingAsConsonant(workingString.substr(index, 2))) {\n ++index;\n }\n return { found: true, startIndex: index, length: 1 };\n }\n }\n\n // no vowels sets found after startIndex!\n return { found: false, startIndex: -1, length: -1 };\n }\n}\n\n\n/**\n * @class\n */\nexport class Spanish extends Language {\n\n constructor() {\n super(\"Spanish\");\n\n this.vowels = ['a', 'e', 'i', 'o', 'u', 'y',\n 'á', 'é', 'í', 'ó', 'ú', 'ü'];\n\n this.weakVowels = ['i', 'u', 'ü', 'y'];\n\n this.strongVowels = ['a', 'e', 'o', 'á', 'é', 'í', 'ó', 'ú'];\n\n\n this.diphthongs = [\"ai\", \"ei\", \"oi\", \"ui\", \"ia\", \"ie\", \"io\", \"iu\", \"au\", \"eu\", \"ou\", \"ua\", \"ue\", \"uo\",\n \"ái\", \"éi\", \"ói\", \"úi\", \"iá\", \"ié\", \"ió\", \"iú\", \"áu\", \"éu\", \"óu\", \"uá\", \"ué\", \"uó\",\n \"üe\", \"üi\"];\n\n this.uDiphthongExceptions = [\"gue\", \"gui\", \"qua\", \"que\", \"qui\", \"quo\"];\n }\n\n // c must be lowercase!\n isVowel(c) {\n for (var i = 0, end = this.vowels.length; i < end; i++)\n if (this.vowels[i] === c)\n return true;\n\n return false;\n }\n\n /**\n * @param {String} c The character to test; must be lowercase\n * @return {boolean} true if c is an f or a mute consonant\n */\n isWeakVowel(c) {\n for (var i = 0, end = this.weakVowels.length; i < end; i++)\n if (this.weakVowels[i] === c)\n return true;\n\n return false;\n }\n\n /**\n * @param {String} c The character to test; must be lowercase\n * @return {boolean} true if c is an f or a mute consonant\n */\n isStrongVowel(c) {\n for (var i = 0, end = this.strongVowels.length; i < end; i++)\n if (this.strongVowels[i] === c)\n return true;\n\n return false;\n }\n\n /**\n *\n * @param {String} s The string to test; must be lowercase\n * @return {boolean} true if s is a diphthong\n */\n isDiphthong(s) {\n for (var i = 0, end = this.diphthongs.length; i < end; i++)\n if (this.diphthongs[i] === s)\n return true;\n\n return false;\n }\n\n createSyllable(text) {\n\n/*\n var accented = false;\n var ellidesToNext = false;\n\n if (text.length > 0) {\n \n if (text[0] == '`') {\n accented = true;\n text = text.substr(1);\n }\n\n if (text[text.length - 1] == '_') {\n ellidesToNext = true;\n text = text.substr(0, text.length - 1);\n }\n }\n\n var s = new Syllable(text);\n\n s.isMusicalAccent = accented;\n s.elidesToNext = ellidesToNext;*/\n\n return text;\n }\n\n /**\n */\n syllabifyWord(word) {\n\n var syllables = [];\n\n var haveCompleteSyllable = false;\n var previousIsVowel = false;\n var previousIsStrongVowel = false; // only valid if previousIsVowel == true\n var startSyllable = 0;\n\n // fixme: first check for prefixes\n\n for (i = 0; i < word.length; i++) {\n\n var c = word[i].toLowerCase();\n\n if (this.isVowel(c)) {\n\n // we have a complete syllable as soon as we have a vowel\n haveCompleteSyllable = true;\n\n var cIsStrongVowel = this.isStrongVowel(c);\n\n if (previousIsVowel) {\n // if we're at a strong vowel, then we finish out the last syllable\n if (cIsStrongVowel) {\n if (previousIsStrongVowel) {\n syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n startSyllable = i;\n }\n }\n }\n\n previousIsVowel = true;\n previousIsStrongVowel = cIsStrongVowel;\n\n } else {\n if (!haveCompleteSyllable) {\n // do nothing since we don't have a complete syllable yet...\n } else {\n\n // handle explicit syllable breaks\n if (word[i] === '-') {\n // start new syllable\n syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n startSyllable = ++i;\n } else {\n\n var numberOfConsonants = 1, consonant2;\n\n // count how many more consonants there are\n for (j = i + 1; j < word.length; j++) {\n if (this.isVowel(word[j]))\n break;\n numberOfConsonants++;\n }\n\n if (numberOfConsonants === 1) {\n // start new syllable\n syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n startSyllable = i;\n\n } else if (numberOfConsonants === 2) {\n consonant2 = word[i + 1].toLowerCase();\n if (consonant2 === 'l' || consonant2 === 'r' || (c === 'c' && consonant2 === 'h')) {\n // split before the consonant pair\n syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n startSyllable = i++;\n } else {\n //split the consonants\n syllables.push(this.createSyllable(word.substr(startSyllable, ++i - startSyllable)));\n startSyllable = i;\n }\n\n } else if (numberOfConsonants === 3) {\n consonant2 = word[i + 1].toLowerCase();\n\n // if second consonant is s, divide cc-c, otherwise divide c-cc\n if (consonant2 === 's') {\n i += 2;\n syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable)));\n } else\n syllables.push(this.createSyllable(word.substr(startSyllable, ++i - startSyllable)));\n\n startSyllable = i;\n\n } else if (numberOfConsonants === 4) {\n // four always get split cc-cc\n syllables.push(this.createSyllable(word.substr(startSyllable, i - startSyllable + 2)));\n startSyllable = i + 2;\n i += 3;\n }\n }\n\n haveCompleteSyllable = false;\n }\n\n previousIsVowel = false;\n }\n }\n\n\n // if we have a complete syllable, we can add it as a new one. Otherwise\n // we tack the remaining characters onto the last syllable.\n if (haveCompleteSyllable)\n syllables.push(word.substr(startSyllable));\n else if (startSyllable > 0)\n syllables[syllables.length - 1] += word.substr(startSyllable);\n else if (syllables.length === 0)\n syllables.push(this.createSyllable(word))\n\n return syllables;\n }\n\n /**\n * @param {String} s the string to search\n * @param {Number} startIndex The index at which to start searching for a vowel in the string\n * @retuns a custom class with three properties: {found: (true/false) startIndex: (start index in s of vowel segment) length ()}\n */\n findVowelSegment(s, startIndex) {\n\n var i, end, index;\n var workingString = s.toLowerCase();\n\n // do we have a diphthongs?\n for (i = 0, end = this.diphthongs.length; i < end; i++) {\n var d = this.diphthongs[i];\n index = workingString.indexOf(d, startIndex);\n\n if (index >= 0) {\n\n // check the exceptions...\n if (d[0] === 'u' && index > 0) {\n var tripthong = s.substr(index - 1, 3).toLowerCase();\n\n for (j = 0, endj = this.uDiphthongExceptions.length; i < endj; j++) {\n if (tripthong === this.uDiphthongExceptions[j]) {\n // search from after the u...\n return this.findVowelSegment(s, index + 1);\n }\n }\n }\n\n return { found: true, startIndex: index, length: d.length };\n }\n }\n\n // no diphthongs. Let's look for single vowels then...\n for (i = 0, end = this.vowels.length; i < end; i++) {\n index = workingString.indexOf(this.vowels[i], startIndex);\n\n if (index >= 0)\n return { found: true, startIndex: index, length: 1 };\n }\n\n // no vowels sets found after startIndex!\n return { found: false, startIndex: -1, length: -1 };\n }\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Text.js\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n\n// generated based on the svg data\nexport let Glyphs = {\n \"None\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 0,\n \"height\": 0\n },\n \"origin\": {\n \"x\": 0,\n \"y\": 0\n },\n \"align\": \"left\"\n },\n \"AcuteAccent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M4 0C-.614.52-.614.52-.803-3.182l60.768-108.422c4.52-7.182 10.543-13.67 18.075-13.67 5.27 0 14.31 1.264 23.346 7.793 7.53 5.223 8.803 11.752 8.803 16.975 0 3.917-.52 11.1-8.05 17.628L4 0z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 110.99200439453125,\n \"height\": 125.79399108886719\n },\n \"origin\": {\n \"x\": 0.8030000329017639,\n \"y\": 125.27399444580078\n },\n \"align\": \"left\"\n },\n \"Stropha\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M1.22-73.438c4.165 13.02 12.238 27.084 24.217 42.188L49.657 0 34.812 27.344C18.666 55.47-.084 72.396-21.438 78.124c4.687-3.645 7.03-8.593 7.03-14.843 0-8.853-4.947-20.572-14.843-35.155L-48 0 1.22-73.438z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 97.65699768066406,\n \"height\": 151.56201171875\n },\n \"origin\": {\n \"x\": 48,\n \"y\": 73.43800354003906\n },\n \"align\": \"left\"\n },\n \"BeginningAscLiquescent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-50 43.688V-61c4.167 7.292 12.76 10.938 25.78 10.938 9.376 0 20.053-1.563 32.032-4.688C31.773-60.48 45.833-71.677 50-88.344v117.97C43.75 42.645 32.812 51.5 17.187 56.186-.52 61.398-15.886 64-28.906 64-42.97 64-50 57.23-50 43.687z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 152.343994140625\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 88.34400177001953\n },\n \"align\": \"left\"\n },\n \"BeginningDesLiquescent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-50-56.03c0-13.022 7.03-19.532 21.094-19.532 13.02 0 28.385 2.604 46.093 7.812C32.813-63.583 43.75-54.73 50-41.187V76C45.833 59.854 31.77 48.656 7.812 42.406c-11.98-3.125-22.656-4.687-32.03-4.687-13.022 0-21.615 3.905-25.782 11.718v-105.47z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 151.56199645996094\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 75.56199645996094\n },\n \"align\": \"left\"\n },\n \"CustosDescLong\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M39.063 273.472c5.73.52 7.29-6.25 4.687-20.312V-65.59c-13.542 2.083-24.22 5.468-32.03 10.156C3.905-50.226 0-43.714 0-35.904V71.91c5.73-5.21 10.677-8.594 14.844-10.157 5.73-1.562 12.24-2.343 19.53-2.343v196.875c0 11.458 1.563 17.187 4.688 17.187\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 46.35300064086914,\n \"height\": 339.58197021484375\n },\n \"origin\": {\n \"x\": 0,\n \"y\": 65.58999633789062\n },\n \"align\": \"left\"\n },\n \"CustosDescShort\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M34.375 191.923c0 8.333 1.563 12.24 4.688 11.72 3.125-.522 4.687-7.033 4.687-19.533v-250c-13.542 2.084-24.22 5.47-32.03 10.157C3.905-50.525 0-44.015 0-36.203V71.61c5.73-5.208 10.677-8.593 14.844-10.156 5.73-1.562 12.24-2.344 19.53-2.344v132.813z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 43.75,\n \"height\": 270.0530090332031\n },\n \"origin\": {\n \"x\": 0,\n \"y\": 65.88999938964844\n },\n \"align\": \"left\"\n },\n \"CustosLong\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M39.063-269.562c5.73-.52 7.29 6.25 4.687 20.312V69.5c-13.542-2.083-24.22-5.47-32.03-10.156C3.905 54.134 0 47.624 0 39.812V-68c5.73 5.208 10.677 8.594 14.844 10.156 5.73 1.563 12.24 2.344 19.53 2.344v-196.875c0-11.458 1.563-17.187 4.688-17.187z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 46.35300064086914,\n \"height\": 339.5820007324219\n },\n \"origin\": {\n \"x\": 0,\n \"y\": 270.0820007324219\n },\n \"align\": \"left\"\n },\n \"CustosShort\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M34.375-188.125c0-8.333 1.563-12.24 4.688-11.72 3.125.522 4.687 7.033 4.687 19.532v250c-13.542-2.083-24.22-5.468-32.03-10.156C3.905 54.324 0 47.813 0 40V-67.813c5.73 5.21 10.677 8.594 14.844 10.157 5.73 1.562 12.24 2.344 19.53 2.343v-132.812z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 43.75,\n \"height\": 270.052001953125\n },\n \"origin\": {\n \"x\": 0,\n \"y\": 200.36500549316406\n },\n \"align\": \"left\"\n },\n \"DoClef\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M0 98.406V-97.688C0-118 5.99-134.275 17.97-146.516c11.978-12.24 27.603-18.36 46.874-18.36 10.937 0 19.53 3.126 25.78 9.376s9.376 14.583 9.376 25v107.813l-6.25-5.47c-4.167-3.645-10.287-7.42-18.36-11.327-8.072-3.907-16.796-5.86-26.17-5.86-11.46 0-21.486 4.427-30.08 13.282-8.593 8.854-12.89 19.53-12.89 32.03s4.297 23.308 12.89 32.423c8.594 9.115 18.62 13.672 30.08 13.672 9.374 0 18.098-1.822 26.17-5.468 8.073-3.646 14.193-7.292 18.36-10.938l6.25-6.25V132c0 9.896-3.125 18.1-9.375 24.61-6.25 6.51-14.844 9.765-25.78 9.765-19.272 0-34.897-6.25-46.876-18.75C5.99 135.125 0 118.72 0 98.405z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 331.2510070800781\n },\n \"origin\": {\n \"x\": 0,\n \"y\": 164.87600708007812\n },\n \"align\": \"left\"\n },\n \"FaClef\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M85.156-32v193.75c0 9.375-1.562 14.323-4.687 14.844-1.564 0-2.605-.52-3.126-1.563-.52-1.04-.782-2.603-.78-4.686V56.28c-8.335-8.332-19.793-12.5-34.376-12.5-17.71 0-31.77 3.907-42.188 11.72V-32c0-18.23 14.193-27.344 42.578-27.344 28.385 0 42.578 9.115 42.578 27.344zM98.438 93V-92.156c0-19.27 5.73-34.896 17.187-46.875 11.458-11.98 26.562-17.97 45.313-17.97 10.937 0 19.14 2.865 24.61 8.594 5.467 5.73 8.202 13.542 8.202 23.437v103.126l-5.47-4.687c-3.645-3.647-9.374-7.293-17.186-10.94-7.813-3.645-15.886-5.467-24.22-5.468-11.978 0-22.004 4.167-30.077 12.5-8.073 8.334-12.11 18.36-12.11 30.08 0 11.717 4.037 22.004 12.11 30.858s18.1 13.28 30.078 13.28c8.333 0 16.406-1.822 24.22-5.468 7.81-3.645 13.54-7.03 17.186-10.156l5.47-5.468V125.81c0 9.896-2.865 17.84-8.594 23.83-5.73 5.988-13.802 8.983-24.22 8.983-18.75 0-33.853-6.12-45.31-18.36-11.46-12.24-17.19-27.994-17.19-47.265z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 193.75201416015625,\n \"height\": 333.5950012207031\n },\n \"origin\": {\n \"x\": 0.001003265380859375,\n \"y\": 157.00100708007812\n },\n \"align\": \"left\"\n },\n \"Flat\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M7.813-204.406c4.166 0 6.25 5.208 6.25 15.625L12.5-10.657C33.854 13.302 54.167 25.28 73.438 25.28c9.374 0 14.062-4.686 14.062-14.06 0-6.25-1.042-11.72-3.125-16.407-2.083-4.688-7.03-9.766-14.844-15.235-7.81-5.47-13.02-8.984-15.624-10.547L27.344-45.81V-80.97c17.187 0 33.073 4.82 47.656 14.454C89.583-56.88 96.875-47.376 96.875-38c0 67.708-.26 101.562-.78 101.563-38.543 0-69.532-12.24-92.97-36.72C0-52.322-1.042-123.936 0-188c0-10.937 2.604-16.406 7.813-16.406z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 97.91699981689453,\n \"height\": 267.968994140625\n },\n \"origin\": {\n \"x\": 1.0420000553131104,\n \"y\": 204.406005859375\n },\n \"align\": \"left\"\n },\n \"Mora\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M47.478-24c6.957 0 12.793 2.288 17.49 6.883C69.662-12.52 72-6.904 72-.267c0 6.64-2.337 12.352-7.033 17.118C60.27 21.618 54.435 24 47.477 24c-6.26 0-11.748-2.383-16.444-7.15C26.337 12.086 24 6.374 24-.265c0-6.638 2.337-12.255 7.033-16.85C35.73-21.713 41.217-24 47.478-24z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 48,\n \"height\": 48\n },\n \"origin\": {\n \"x\": -24,\n \"y\": 24\n },\n \"align\": \"left\"\n },\n \"Natural\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M7.906-166.563c-2.864 0-5.614.52-8.218 1.563v13.28l.78 56.25.782 78.907v85.157c.52 3.646 2.604 5.73 6.25 6.25l23.438-3.906 23.437-3.907v29.69c0 42.186-.26 63.54-.78 64.06l6.25 2.345c1.04.52 2.082.78 3.124.78 2.603 0 4.947-1.3 7.03-3.905L67.656-71.25c-.52-2.604-2.083-3.906-4.687-3.906-7.814 0-17.19 1.04-28.126 3.125l-19.53 3.124.78-38.28V-165c-2.604-1.042-5.323-1.562-8.188-1.563zM55.938-40v71.875l-41.407 7.03c0-48.436.262-72.655.783-72.655L55.938-40z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 70.31100463867188,\n \"height\": 330.468994140625\n },\n \"origin\": {\n \"x\": 0.3120002746582031,\n \"y\": 166.56300354003906\n },\n \"align\": \"left\"\n },\n \"OriscusAsc\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M50 30.25c0 12.5-3.125 21.354-9.375 26.562-3.125 2.605-7.813 3.907-14.063 3.907-3.125 0-5.99-.522-8.593-1.564-2.605-1.04-5.6-2.474-8.986-4.297C5.6 53.035 2.734 51.603.39 50.56c-2.343-1.04-5.338-2.474-8.984-4.296-3.646-1.823-6.77-3.256-9.375-4.297-2.603-1.043-5.468-1.564-8.593-1.564-6.25 0-10.937 1.563-14.062 4.688C-46.875 50.824-50 59.677-50 71.656v-106.25c0-13.02 3.125-21.875 9.375-26.562 3.125-2.604 7.813-3.906 14.063-3.907 3.125 0 5.99.52 8.593 1.563 2.605 1.042 5.73 2.474 9.376 4.297 3.646 1.823 6.51 2.995 8.594 3.516l10.938 5.468c6.25 3.126 11.458 4.69 15.624 4.69 6.25 0 10.938-1.564 14.063-4.69C46.875-55.426 50-64.02 50-76V30.25z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 147.656005859375\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 76\n },\n \"align\": \"left\"\n },\n \"OriscusDes\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-50 30.844v-106.25c0 11.458 3.125 20.052 9.375 25.78 3.125 3.126 7.813 4.69 14.063 4.688 4.687 0 13.41-3.255 26.17-9.765 12.762-6.51 21.746-9.766 26.954-9.766 6.25 0 10.938 1.303 14.063 3.907C46.875-55.874 50-47.02 50-34V72.25c0-11.98-3.125-20.833-9.375-26.563C37.5 42.563 32.812 41 26.562 41 21.875 41 13.023 44.385 0 51.156c-4.167 2.604-8.594 4.948-13.28 7.032-4.69 2.083-9.116 3.124-13.283 3.124-6.25 0-10.937-1.302-14.062-3.906C-46.875 52.198-50 43.344-50 30.844z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 147.656005859375\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 75.40599822998047\n },\n \"align\": \"left\"\n },\n \"OriscusLiquescent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M 19.05539,78.886528 C 20.242277,78.486807 21.532179,77.890297 22.925106,77.09701 24.317891,76.303653 26.700882,74.417241 30.074091,71.437777 33.447144,68.45824 36.523539,64.985185 39.303286,61.018598 42.082855,57.051975 44.562739,51.395765 46.742952,44.049969 48.922975,36.704172 50.01304,28.671032 50.013135,19.950525 L 50.013135,-34.225545 C 50.01304,-54.464261 42.07377,-64.583661 26.195289,-64.583768 20.248326,-64.583661 11.518758,-61.410372 0.00656131,-55.06389 -11.505742,-48.717218 -20.23531,-45.543929 -26.182179,-45.544024 -34.515109,-45.543929 -40.567968,-48.520405 -44.340791,-54.473441 -48.113613,-60.426286 -50.000025,-67.369373 -50.000025,-75.302702 L -50.000025,30.069925 C -50.000025,49.909039 -42.060754,59.828603 -26.182179,59.828615 -21.022584,59.828603 -12.38991,56.455465 -0.28412107,49.709203 11.821549,42.96294 20.648023,39.589803 26.195289,39.589803 29.368506,40.776762 30.361665,44.249817 29.17479,50.00897 27.987759,55.768122 26.00143,62.020829 23.215789,68.767116 z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 147.656005859375\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 75.40599822998047\n },\n \"align\": \"left\"\n }, \n \"PodatusLower\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-4.688-30.28c22.396 0 34.636-.262 36.72-.782 5.728-1.563 8.593-5.21 8.593-10.938H50v97.656c0 2.604-1.302 4.167-3.906 4.688-5.21.52-21.355.78-48.438.78-23.958 0-38.54-.26-43.75-.78-2.604 0-3.906-1.302-3.906-3.906v-82.032c0-3.646 1.302-5.468 3.906-5.468h2.344c2.604.52 15.625.78 39.063.78z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 103.12399291992188\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 42\n },\n \"align\": \"left\"\n },\n \"PodatusUpper\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-46.094-63.78c13.542 0 24.61 2.473 33.203 7.42C-4.298-51.41 0-43.99 0-34.093V62h-9.375c0-10.938-2.604-19.14-7.812-24.61-5.21-5.468-14.844-8.203-28.907-8.202-18.23 0-33.333 4.166-45.312 12.5v-75.782c0-19.79 15.104-29.687 45.312-29.687z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 91.406005859375,\n \"height\": 125.78099822998047\n },\n \"origin\": {\n \"x\": 91.406005859375,\n \"y\": 63.78099822998047\n },\n \"align\": \"right\"\n },\n \"Porrectus1\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M233.594 162.875c-58.855 0-107.032-6.25-144.53-18.75C34.895 125.895-11.46 99.855-50 66V-52.75C-21.354-24.625 26.302 6.885 92.97 41.78 123.697 57.928 163.54 66 212.5 66c21.354 0 34.635-9.896 39.844-29.688V151.94c0 7.29-6.25 10.937-18.75 10.937z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 302.343994140625,\n \"height\": 215.6269989013672\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 52.75\n },\n \"align\": \"left\"\n },\n \"Porrectus2\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M309.375 259.375c-50.52 0-110.938-22.396-181.25-67.188C48.437 141.667-10.938 94.272-50 50V-68.75C0-3.125 60.417 52.083 131.25 96.875c58.333 36.98 110.677 58.854 157.03 65.625h7.033c16.145 0 26.822-9.896 32.03-29.688v114.844c0 7.812-5.99 11.72-17.968 11.72z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 377.3429870605469,\n \"height\": 328.1260070800781\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 68.75\n },\n \"align\": \"left\"\n },\n \"Porrectus3\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M309.375 355.78c-48.96-16.666-109.115-55.468-180.47-116.405C79.428 198.23 19.793 134.687-50 48.75V-70C20 40 94.104 103.79 135.25 148.063 190 200 230 230 288.28 258.906c4.168 2.083 8.334 3.125 12.5 3.125 12.5 0 21.355-10.937 26.564-32.81v114.06c0 9.376-3.386 14.063-10.156 14.064-2.084 0-4.688-.522-7.813-1.563z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 377.343994140625,\n \"height\": 427.3450012207031\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 70\n },\n \"align\": \"left\"\n },\n \"Porrectus4\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M350 453.438c-52.754-22.397-120-77.345-201.74-164.844C90.87 227.656 24.784 147.708-50 48.75V-70C-8.84-1.25 58.406 86.51 151.74 193.28c60.868 69.793 119.13 124.22 174.782 163.282 5.797 3.646 11.014 5.47 15.652 5.47 12.173 0 21.45-11.72 27.826-35.157V441.72c0 9.373-3.19 14.06-9.565 14.06-2.9 0-6.377-.78-10.435-2.342z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 420,\n \"height\": 525.780029296875\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 70\n },\n \"align\": \"left\"\n },\n \"PunctumCavum\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M0-60.906c33.333 0 50 9.635 50 28.906v94.53C39.062 51.595 22.396 46.126 0 46.126s-39.063 5.47-50 16.406V-32c0-19.27 16.667-28.906 50-28.906z\"\n },\n {\n \"type\": \"negative\",\n \"data\": \"M.08-42.56c9.585.206 20.126.53 27.954 6.822 4.96 3.9 4.71 10.792 4.574 16.482v51.278C22.09 27.066 7.283 26.072.168 26.01c-7.72.23-21.895.935-32.616 4.674.04-19.197-.083-38.395.064-57.59.567-7.5 7.834-12.33 14.62-13.774 5.818-1.498 11.857-1.86 17.844-1.88z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 123.43799591064453\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 60.90599822998047\n },\n \"align\": \"left\"\n },\n \"PunctumQuadratum\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M0-60.906c33.333 0 50 9.635 50 28.906v94.53C39.062 51.595 22.396 46.126 0 46.126s-39.063 5.47-50 16.406V-32c0-19.27 16.667-28.906 50-28.906z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 123.43799591064453\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 60.90599822998047\n },\n \"align\": \"left\"\n },\n \"PunctumQuadratumAscLiquescent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-50 43.688V-61c4.167 7.292 12.76 10.938 25.78 10.938 9.376 0 20.053-1.563 32.032-4.688C31.773-60.48 45.833-71.677 50-88.344v117.97C43.75 42.645 32.812 51.5 17.187 56.186-.52 61.398-15.886 64-28.906 64-42.97 64-50 57.23-50 43.687z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 152.343994140625\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 88.34400177001953\n },\n \"align\": \"left\"\n },\n \"PunctumQuadratumDesLiquescent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-50-56.03c0-13.022 7.03-19.532 21.094-19.532 13.02 0 28.385 2.604 46.093 7.812C32.813-63.583 43.75-54.73 50-41.187V76C45.833 59.854 31.77 48.656 7.812 42.406c-11.98-3.125-22.656-4.687-32.03-4.687-13.022 0-21.615 3.905-25.782 11.718v-105.47z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 151.56199645996094\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 75.56199645996094\n },\n \"align\": \"left\"\n },\n \"PunctumInclinatum\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M0-75.78L50 0 0 75-50 0 0-75.78z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 150.77999877929688\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 75.77999877929688\n },\n \"align\": \"left\"\n },\n \"PunctumInclinatumLiquescent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M 0,-53.164062 35,-0.1171875 0,52.382812 -35,-0.1171875 0,-53.164062 z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 70,\n \"height\": 105.546\n },\n \"origin\": {\n \"x\": 35,\n \"y\": 53.164062\n },\n \"align\": \"left\"\n },\n \"Quilisma\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-50 34.938V-51c5.73 20.833 13.02 31.25 21.875 31.25 7.813 0 12.5-15.625 14.063-46.875 3.645 12.5 6.9 21.224 9.765 26.172s6.9 7.422 12.11 7.422c5.208 0 9.374-14.324 12.5-42.97 5.73 22.917 10.677 34.375 14.843 34.375 5.73 0 10.677-15.885 14.844-47.656v100c0 17.707-3.125 26.56-9.375 26.56-4.688 0-9.115-5.988-13.28-17.968-2.085 21.875-8.074 32.813-17.97 32.813-7.813 0-16.146-7.292-25-21.875-4.688 20.312-10.677 30.47-17.97 30.47-5.207 0-9.244-2.605-12.108-7.814C-48.568 47.698-50 41.708-50 34.938z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 150\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 89.28199768066406\n },\n \"align\": \"left\"\n },\n \"TerminatingAscLiquescent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-9.375 40.22c0-11.98-4.948-17.97-14.844-17.97-10.936 0-19.53 3.646-25.78 10.938v-53.126c0-6.77 2.604-12.76 7.813-17.968 5.208-5.21 10.677-8.594 16.406-10.157 2.603-.52 5.207-.78 7.81-.78 3.647 0 7.032.78 10.157 2.343C-2.603-43.896 0-39.73 0-34V73.03h-9.375V40.22z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 49.999000549316406,\n \"height\": 121.87299346923828\n },\n \"origin\": {\n \"x\": 49.999000549316406,\n \"y\": 48.842994689941406\n },\n \"align\": \"right\"\n },\n \"TerminatingDesLiquescent\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-9.375-48.156V-80.97H0V26.845c0 5.73-2.604 9.896-7.813 12.5-3.125 1.562-6.51 2.343-10.156 2.343-2.603 0-5.207-.26-7.81-.78-5.73-1.563-11.2-4.95-16.407-10.157C-47.398 25.542-50 19.292-50 12v-52.344c6.25 7.292 14.844 10.938 25.78 10.938 9.897 0 14.845-6.25 14.845-18.75z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 50,\n \"height\": 122.65800476074219\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 80.97000122070312\n },\n \"align\": \"right\"\n },\n \"VerticalEpisemaAbove\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-8-80H8L4 0h-8l-4-80z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 16,\n \"height\": 80\n },\n \"origin\": {\n \"x\": 8,\n \"y\": 80\n },\n \"align\": \"left\"\n },\n \"VerticalEpisemaBelow\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M-8 80H8L4 0h-8l-4 80z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 16,\n \"height\": 80\n },\n \"origin\": {\n \"x\": 8,\n \"y\": 0\n },\n \"align\": \"left\"\n },\n \"VirgaLong\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M50-38v285.156c0 6.77-2.344 10.937-7.03 12.5-1.564 0-2.605-.78-3.126-2.344-.52-1.562-.782-10.156-.782-25.78V54.186C29.168 45.334 16.146 40.907 0 40.907c-22.917 0-39.583 5.208-50 15.624V-38c0-19.27 16.667-28.906 50-28.906S50-57.27 50-38z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 326.56201171875\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 66.90599822998047\n },\n \"align\": \"left\"\n },\n \"VirgaShort\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M50-38v211.72c0 7.29-2.344 11.457-7.03 12.5-1.564 0-2.606-.783-3.126-2.345-.52-1.563-.782-10.156-.782-25.78V54.187C29.167 45.332 16.146 40.906 0 40.906c-22.917 0-39.583 5.21-50 15.625V-38c0-19.27 16.667-28.906 50-28.906S50-57.27 50-38z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 100,\n \"height\": 253.12600708007812\n },\n \"origin\": {\n \"x\": 50,\n \"y\": 66.90599822998047\n },\n \"align\": \"left\"\n },\n \"Virgula\": {\n \"svgSrc\": \"\",\n \"paths\": [{\n \"type\": \"positive\",\n \"data\": \"M8.178-55.66c0-22.137 12.092-33.2 36.287-33.2 11.835 0 23.53 5.66 35.108 16.98C91.15-60.547 96.94-41.766 96.94-15.534c0 53.515-31.646 87.487-94.937 101.895-2.048-2.06-3.077-5.146-3.077-9.273 0-1.03.247-1.8.76-2.316 42.71-19.027 64.075-41.678 64.075-67.92 0-11.322-2.325-20.326-6.945-27.016-4.62-6.69-9.52-11.052-14.676-13.11-5.147-2.048-11.836-3.85-20.07-5.403C12.81-39.707 8.18-45.37 8.18-55.66z\"\n }],\n \"bounds\": {\n \"x\": 0,\n \"y\": 0,\n \"width\": 98.01399993896484,\n \"height\": 175.2209930419922\n },\n \"origin\": {\n \"x\": 1.0739939212799072,\n \"y\": 88.86000061035156\n },\n \"align\": \"left\"\n }\n};\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Glyphs.js\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { Units, Pitch, Point, Rect, Margins, Size, Step } from 'Exsurge.Core'\nimport { Glyphs } from 'Exsurge.Glyphs'\nimport { Latin } from 'Exsurge.Text'\n\n\n// load in the web font for special chant characters here:\nvar __exsurgeCharactersFont = require(\"url?limit=30000!../assets/fonts/ExsurgeChar.otf\");\n\n\nexport let GlyphCode = {\n\n None: \"None\",\n\n AcuteAccent: \"AcuteAccent\",\n Stropha: \"Stropha\",\n StrophaLiquescent: \"StrophaLiquescent\",\n\n BeginningAscLiquescent: \"BeginningAscLiquescent\",\n BeginningDesLiquescent: \"BeginningDesLiquescent\",\n\n CustosDescLong: \"CustosDescLong\",\n CustosDescShort: \"CustosDescShort\",\n CustosLong: \"CustosLong\",\n CustosShort: \"CustosShort\",\n\n // clefs and other markings\n DoClef: \"DoClef\",\n FaClef: \"FaClef\",\n Flat: \"Flat\",\n Mora: \"Mora\",\n Natural: \"Natural\",\n OriscusAsc: \"OriscusAsc\",\n OriscusDes: \"OriscusDes\",\n OriscusLiquescent: \"OriscusLiquescent\",\n\n PodatusLower: \"PodatusLower\",\n PodatusUpper: \"PodatusUpper\",\n\n Porrectus1: \"Porrectus1\", // 1 staff line difference,\n Porrectus2: \"Porrectus2\", // 2 lines difference, etc...\n Porrectus3: \"Porrectus3\",\n Porrectus4: \"Porrectus4\",\n\n PunctumCavum: \"PunctumCavum\",\n PunctumQuadratum: \"PunctumQuadratum\",\n PunctumQuadratumAscLiquescent: \"PunctumQuadratumAscLiquescent\",\n PunctumQuadratumDesLiquescent: \"PunctumQuadratumDesLiquescent\",\n PunctumInclinatum: \"PunctumInclinatum\",\n PunctumInclinatumLiquescent: \"PunctumInclinatumLiquescent\",\n Quilisma: \"Quilisma\",\n\n TerminatingAscLiquescent: \"TerminatingAscLiquescent\",\n TerminatingDesLiquescent: \"TerminatingDesLiquescent\",\n VerticalEpisemaAbove: \"VerticalEpisemaAbove\",\n VerticalEpisemaBelow: \"VerticalEpisemaBelow\",\n VirgaLong: \"VirgaLong\",\n VirgaShort: \"VirgaShort\",\n Virgula: \"Virgula\",\n\n UpperBrace: \"UpperBrace\"\n}; // GlyphCode\n\nexport var QuickSvg = {\n\n // namespaces \n ns: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xlink: 'http://www.w3.org/1999/xlink',\n\n // create the root level svg object\n svg: function(width, height) {\n var node = document.createElementNS(this.ns,'svg');\n\n node.setAttribute('xmlns', this.ns); \n node.setAttribute('version', '1.1');\n node.setAttributeNS(this.xmlns, 'xmlns:xlink', this.xlink);\n\n node.setAttribute('width', width);\n node.setAttribute('height', height);\n\n // create the defs element\n var defs = document.createElementNS(this.ns, 'defs');\n node.appendChild(defs);\n\n node.defs = defs;\n\n node.clearNotations = function() {\n // clear out all children except defs\n node.removeChild(defs);\n\n while (node.hasChildNodes())\n node.removeChild(node.lastChild);\n \n node.appendChild(defs);\n }\n\n return node;\n },\n\n rect: function(width, height) {\n var node = document.createElementNS(this.ns, 'rect');\n\n node.setAttribute('width', width);\n node.setAttribute('height', height);\n\n return node;\n },\n\n line: function(x1, y1, x2, y2) {\n var node = document.createElementNS(this.ns, 'line');\n\n node.setAttribute('x1', x1);\n node.setAttribute('y1', y1);\n node.setAttribute('x2', x2);\n node.setAttribute('y2', y2);\n\n return node;\n },\n\n g: function() {\n var node = document.createElementNS(this.ns, 'g');\n\n return node;\n },\n\n text: function() {\n var node = document.createElementNS(this.ns, 'text');\n\n return node;\n },\n\n tspan: function(str) {\n var node = document.createElementNS(this.ns, 'tspan');\n node.textContent = str;\n\n return node;\n },\n\n // nodeRef should be the id of the object in defs (without the #)\n use: function(nodeRef) {\n var node = document.createElementNS(this.ns, 'use');\n node.setAttributeNS(this.xlink, \"xlink:href\", '#' + nodeRef);\n\n return node;\n },\n\n createFragment: function(name, attributes, child) {\n if (child === undefined || child === null)\n child = '';\n\n var fragment = '<' + name + ' ';\n\n for (var attr in attributes) {\n if (attributes.hasOwnProperty(attr))\n fragment += attr + '=\"' + attributes[attr] + '\" ';\n }\n\n fragment += '>' + child + '';\n\n return fragment;\n },\n\n parseFragment: function(fragment) {\n\n // create temporary holder\n var well = document.createElement('svg');\n\n // act as a setter if svg is given\n if (fragment) {\n\n var container = this.g();\n\n // dump raw svg\n // do this to allow the browser to automatically create svg nodes?\n well.innerHTML = '' + fragment.replace(/\\n/, '').replace(/<(\\w+)([^<]+?)\\/>/g, '<$1$2>') + ''\n\n // transplant nodes\n for (var i = 0, il = well.firstChild.childNodes.length; i < il; i++)\n container.appendChild(well.firstChild.firstChild)\n \n return container;\n }\n },\n\n translate: function(node, x, y) {\n node.setAttribute('transform', 'translate(' + x + ',' + y + ')');\n return node;\n },\n\n scale: function(node, sx, sy) {\n node.setAttribute('transform', 'scale(' + sx + ',' + sy + ')');\n return node;\n }\n}\n\nexport var TextMeasuringStrategy = {\n // shapes\n Svg: 0,\n Canvas: 1\n};\n\n/*\n * ChantContext\n */\nexport class ChantContext {\n\n constructor(textMeasuringStrategy = TextMeasuringStrategy.Svg) {\n\n this.textMeasuringStrategy = textMeasuringStrategy;\n this.defs = {};\n\n // font styles\n this.lyricTextSize = 16; // in points?\n this.lyricTextFont = \"'Palatino Linotype', 'Book Antiqua', Palatino, serif\";\n this.lyricTextColor = \"#000\";\n \n this.dropCapTextSize = 64;\n this.dropCapTextFont = this.lyricTextFont;\n this.dropCapTextColor = this.lyricTextColor;\n \n this.annotationTextSize = 13;\n this.annotationTextFont = this.lyricTextFont;\n this.annotationTextColor = this.lyricTextColor;\n\n // everything depends on the scale of the punctum\n this.glyphPunctumWidth = Glyphs.PunctumQuadratum.bounds.width;\n this.glyphPunctumHeight = Glyphs.PunctumQuadratum.bounds.height;\n\n // fixme: for now, we just set these using the glyph scales as noted above, presuming a\n // staff line size of 0.5 in. Really what we should do is scale the punctum size based\n // on the text metrics, right? 1 punctum ~ x height size?\n this.glyphScaling = 1.0 / 16.0; \n\n this.staffInterval = this.glyphPunctumWidth * this.glyphScaling;\n\n // setup the line weights for the various elements.\n // we \n this.staffLineWeight = Math.round(this.glyphPunctumWidth * this.glyphScaling / 8);\n this.neumeLineWeight = this.staffLineWeight; // the weight of connecting lines in the glyphs.\n this.dividerLineWeight = this.neumeLineWeight; // of quarter bar, half bar, etc.\n this.episemaLineWeight = this.neumeLineWeight; // of horizontal episemae\n\n // for keeping track of the clef\n this.activeClef = null;\n\n this.neumeLineColor = \"#000\";\n this.staffLineColor = \"#000\";\n this.dividerLineColor = \"#000\";\n\n this.defaultLanguage = new Latin();\n\n this.canvas = document.createElement(\"canvas\");\n this.canvasCtxt = this.canvas.getContext(\"2d\");\n\n // calculate the pixel ratio for drawing to a canvas\n var dpr = window.devicePixelRatio || 1.0;\n var bsr = this.canvasCtxt.webkitBackingStorePixelRatio ||\n this.canvasCtxt.mozBackingStorePixelRatio ||\n this.canvasCtxt.msBackingStorePixelRatio ||\n this.canvasCtxt.oBackingStorePixelRatio ||\n this.canvasCtxt.backingStorePixelRatio || 1.0;\n\n this.pixelRatio = dpr / bsr;\n\n this.canvasCtxt.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n if(textMeasuringStrategy === TextMeasuringStrategy.Svg) {\n this.svgTextMeasurer = QuickSvg.svg(1,1);\n this.svgTextMeasurer.setAttribute('id', \"TextMeasurer\");\n document.querySelector('body').appendChild(this.svgTextMeasurer);\n }\n\n // measure the size of a hyphen for the lyrics\n var hyphen = new Lyric(this, \"-\", LyricType.SingleSyllable);\n this.hyphenWidth = hyphen.bounds.width;\n\n this.minLyricWordSpacing = this.hyphenWidth;\n\n this.intraNeumeSpacing = this.staffInterval / 2.0;\n\n // for connecting neume syllables...\n this.syllableConnector = '-';\n\n this.drawGuides = false;\n this.drawDebuggingBounds = true;\n\n // we keep track of where we are in processing notations, so that\n // we can maintain the context for notations to know about.\n //\n // these are only gauranteed to be valid during the performLayout phase!\n this.activeNotations = null;\n this.currNotationIndex = -1;\n\n // chant notation elements are normally separated by a minimum fixed amount of space\n // on the staff line. It can happen, however, that two text elements are almost close\n // enough to merge, only to be separated much more by the required hyphen (or other\n // connecting string).\n //\n // This tolerance value allows a little bit of flexibility to merge two close lyrical\n // elements, thus bringing the chant notation elements a bit closer than otherwise\n // would be normally allowed.\n //\n // condensing tolerance is a percentage value (0.0-1.0, inclusive) that indicates\n // how much the default spacing can shrink. E.g., a value of 0.80 allows the layout\n // engine to separate two glyphs by only 80% of the normal inter-neume spacing value.\n //\n // fixme: condensing tolerance is not implemented yet!\n this.condensingTolerance = 0.9;\n\n // if auto color is true, then exsurge tries to automatically colorize\n // some elements of the chant (directives become rubric color, etc.)\n this.autoColor = true;\n\n this.insertFontsInDoc();\n }\n\n calculateHeightFromStaffPosition(staffPosition) {\n return -staffPosition * this.staffInterval;\n }\n\n insertFontsInDoc() {\n\n var styleElement = document.getElementById('exsurge-fonts');\n\n if (styleElement === null) {\n // create it since it doesn't exist yet.\n styleElement = document.createElement('style');\n styleElement.id = 'exsurge-fonts';\n\n styleElement.appendChild(document.createTextNode(\"@font-face{font-family: 'Exsurge Characters';font-weight: normal;font-style: normal;src: url(\" + __exsurgeCharactersFont + \") format('opentype');}\"));\n\n document.head.appendChild(styleElement);\n }\n }\n\n // returns the next neume starting at this.currNotationIndex, or null\n // if there isn't a neume after this one...\n findNextNeume() {\n\n if (typeof this.currNotationIndex === 'undefined')\n throw \"findNextNeume() called without a valid currNotationIndex set\";\n\n for (var i = this.currNotationIndex + 1; i < this.notations.length; i++) {\n var notation = this.notations[i];\n\n if (notation.isNeume)\n return notation;\n }\n\n return null;\n }\n\n setCanvasSize(width, height) {\n this.canvas.width = width * this.pixelRatio;\n this.canvas.height = height * this.pixelRatio;\n this.canvas.style.width = width + \"px\";\n this.canvas.style.height = height + \"px\";\n\n this.canvasCtxt.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n }\n}\n\n\n/*\n * ChantLayoutElement\n */\nexport class ChantLayoutElement {\n\n constructor() {\n\n this.bounds = new Rect();\n this.origin = new Point(0, 0);\n\n this.selected = false;\n this.highlighted = false;\n }\n\n // draws the element on an html5 canvas\n draw(ctxt) {\n\n }\n\n // returns svg code for the element, used for printing support\n createSvgFragment(ctxt) {\n throw \"ChantLayout Elements must implement createSvgFragment(ctxt)\";\n }\n}\n\n\nexport class DividerLineVisualizer extends ChantLayoutElement {\n\n constructor(ctxt, staffPosition0, staffPosition1) {\n super();\n\n var y0 = ctxt.calculateHeightFromStaffPosition(staffPosition0);\n var y1 = ctxt.calculateHeightFromStaffPosition(staffPosition1);\n\n if (y0 > y1) {\n var temp = y0;\n y0 = y1;\n y1 = temp;\n }\n\n this.bounds.x = 0;\n this.bounds.y = y0;\n this.bounds.width = ctxt.dividerLineWeight;\n this.bounds.height = y1 - y0;\n\n this.origin.x = this.bounds.width / 2;\n this.origin.y = y0;\n }\n\n draw(ctxt) {\n var canvasCtxt = ctxt.canvasCtxt;\n\n canvasCtxt.lineWidth = this.bounds.width;\n canvasCtxt.strokeStyle = ctxt.dividerLineColor;\n\n canvasCtxt.beginPath();\n canvasCtxt.moveTo(this.bounds.x - this.origin.x, this.bounds.y);\n canvasCtxt.lineTo(this.bounds.x - this.origin.x, this.bounds.y + this.bounds.height);\n canvasCtxt.stroke();\n }\n\n createSvgFragment(ctxt) {\n\n return QuickSvg.createFragment('rect', {\n 'x': this.bounds.x,\n 'y': this.bounds.y,\n 'width': ctxt.dividerLineWeight,\n 'height': this.bounds.height,\n 'fill': ctxt.dividerLineColor,\n 'class': 'dividerLine'\n });\n }\n}\n\nexport class NeumeLineVisualizer extends ChantLayoutElement {\n\n constructor(ctxt, note0, note1, hanging) {\n super();\n\n var staffPosition0 = note0.staffPosition;\n var staffPosition1 = note1.staffPosition;\n\n // note0 should be the upper one for our calculations here\n if (staffPosition0 < staffPosition1) {\n var temp = staffPosition0;\n staffPosition0 = staffPosition1;\n staffPosition1 = temp;\n }\n\n var y0 = ctxt.calculateHeightFromStaffPosition(staffPosition0);\n var y1 = 0;\n\n if (hanging) {\n\n // if the difference between the notes is only one, and the upper\n // note is on a line, and the lower note is within the four staff lines,\n // then our hanging line goes past the lower note by a whole\n // staff interval\n if (staffPosition0 - staffPosition1 === 1 && Math.abs(staffPosition0) % 2 === 1 &&\n staffPosition1 > -3)\n staffPosition1--;\n\n y1 += ctxt.glyphPunctumHeight * ctxt.glyphScaling / 2.2;\n }\n\n y1 += ctxt.calculateHeightFromStaffPosition(staffPosition1);\n\n this.bounds.x = 0;\n this.bounds.y = y0;\n this.bounds.width = ctxt.neumeLineWeight;\n this.bounds.height = y1 - y0;\n\n this.origin.x = 0;\n this.origin.y = 0;\n }\n\n draw(ctxt) {\n var canvasCtxt = ctxt.canvasCtxt;\n\n canvasCtxt.lineWidth = this.bounds.width;\n canvasCtxt.strokeStyle = ctxt.neumeLineColor;\n\n canvasCtxt.beginPath();\n \n // since the canvas context draws strokes centered on the path\n // and neume lines are supposed to be draw left aligned,\n // we need to offset the line by half the line width.\n var x = this.bounds.x + this.bounds.width / 2;\n\n canvasCtxt.moveTo(x, this.bounds.y);\n canvasCtxt.lineTo(x, this.bounds.y + this.bounds.height);\n canvasCtxt.stroke();\n }\n\n createSvgFragment(ctxt) {\n\n return QuickSvg.createFragment('rect', {\n 'x': this.bounds.x,\n 'y': this.bounds.y,\n 'width': ctxt.neumeLineWeight,\n 'height': this.bounds.height,\n 'fill': ctxt.neumeLineColor,\n 'class': 'neumeLine'\n });\n }\n}\n\nexport class VirgaLineVisualizer extends ChantLayoutElement {\n\n constructor(ctxt, note) {\n super();\n\n var staffPosition = note.staffPosition;\n\n var y0 = ctxt.calculateHeightFromStaffPosition(staffPosition);\n var y1;\n\n if (Math.abs(staffPosition % 2) === 0)\n y1 = y0 + ctxt.staffInterval * 1.8;\n else\n y1 = y0 + ctxt.staffInterval * 2.7;\n\n this.bounds.x = 0;\n this.bounds.y = y0;\n this.bounds.width = ctxt.neumeLineWeight;\n this.bounds.height = y1 - y0;\n\n this.origin.x = 0;\n this.origin.y = 0;\n }\n\n draw(ctxt) {\n var canvasCtxt = ctxt.canvasCtxt;\n\n canvasCtxt.lineWidth = this.bounds.width;\n canvasCtxt.strokeStyle = ctxt.neumeLineColor;\n\n canvasCtxt.beginPath();\n canvasCtxt.moveTo(this.bounds.x, this.bounds.y);\n canvasCtxt.lineTo(this.bounds.x, this.bounds.y + this.bounds.height);\n canvasCtxt.stroke();\n }\n\n createSvgFragment(ctxt) {\n\n return QuickSvg.createFragment('rect', {\n 'x': this.bounds.x,\n 'y': this.bounds.y,\n 'width': ctxt.neumeLineWeight,\n 'height': this.bounds.height,\n 'fill': ctxt.neumeLineColor,\n 'class': 'neumeLine'\n });\n }\n}\n\nexport class GlyphVisualizer extends ChantLayoutElement {\n\n constructor(ctxt, glyphCode) {\n super();\n\n this.glyph = null;\n\n this.setGlyph(ctxt, glyphCode);\n }\n\n setGlyph(ctxt, glyphCode) {\n\n if (this.glyphCode === glyphCode)\n return;\n\n if (typeof glyphCode === 'undefined' || glyphCode === null || glyphCode === \"\")\n this.glyphCode = GlyphCode.None;\n else\n this.glyphCode = glyphCode;\n\n this.glyph = Glyphs[this.glyphCode];\n\n // if this glyph hasn't been used yet, then load it up in the defs section for sharing\n if (!ctxt.defs.hasOwnProperty(this.glyphCode)) {\n var glyphSrc = this.glyph.svgSrc;\n\n // create the ref\n ctxt.defs[this.glyphCode] = QuickSvg.createFragment('g', {\n id: this.glyphCode,\n 'class': 'glyph',\n transform: 'scale(' + ctxt.glyphScaling + ')'\n }, glyphSrc);\n }\n\n this.align = this.glyph.align;\n\n this.origin.x = this.glyph.origin.x * ctxt.glyphScaling;\n this.origin.y = this.glyph.origin.y * ctxt.glyphScaling;\n\n this.bounds.x = 0;\n this.bounds.y = -this.origin.y;\n this.bounds.width = this.glyph.bounds.width * ctxt.glyphScaling;\n this.bounds.height = this.glyph.bounds.height * ctxt.glyphScaling;\n }\n\n setStaffPosition(ctxt, staffPosition) {\n this.bounds.y += ctxt.calculateHeightFromStaffPosition(staffPosition);\n }\n\n draw(ctxt) {\n var canvasCtxt = ctxt.canvasCtxt;\n\n var x = this.bounds.x + this.origin.x;\n var y = this.bounds.y + this.origin.y;\n canvasCtxt.translate(x, y);\n canvasCtxt.scale(ctxt.glyphScaling, ctxt.glyphScaling);\n\n for (var i = 0; i < this.glyph.paths.length; i++) {\n var path = this.glyph.paths[i];\n canvasCtxt.fillStyle = ctxt.neumeLineColor;\n canvasCtxt.fill(new Path2D(path.data));\n }\n\n canvasCtxt.scale(1.0 / ctxt.glyphScaling, 1.0 / ctxt.glyphScaling);\n canvasCtxt.translate(-x, -y);\n }\n\n createSvgFragment(ctxt) {\n\n return QuickSvg.createFragment('use', {\n 'xlink:href': '#' + this.glyphCode,\n x: this.bounds.x + this.origin.x,\n y: this.bounds.y + this.origin.y\n });\n }\n}\n\nexport class RoundBraceVisualizer extends ChantLayoutElement {\n\n constructor(ctxt, x1, x2, y, isAbove) {\n super();\n\n if (x1 > x2) {\n // swap the xs\n var temp = x1;\n x1 = x2;\n x2 = temp;\n }\n\n this.isAbove = isAbove;\n this.braceHeight = ctxt.staffInterval / 2;\n\n this.bounds = new Rect(x1, y, x2 - x1, this.braceHeight);\n\n this.origin.x = 0;\n this.origin.y = 0;\n }\n\n createSvgFragment(ctxt) {\n var fragment = QuickSvg.createFragment('path', {\n 'd': this.generatePathString(),\n 'stroke': ctxt.neumeLineColor,\n 'stroke-width': ctxt.staffLineWeight + 'px',\n 'fill': 'none',\n 'class': 'brace'\n });\n\n if (this.acuteAccent) {\n\n fragment += this.acuteAccent.createSvgFragment(ctxt);\n\n return QuickSvg.createFragment('g', {\n 'class': 'accentedBrace'\n }, fragment);\n } else\n return fragment;\n }\n\n // returns svg path d string\n generatePathString() {\n\n var x1 = this.bounds.x;\n var x2 = this.bounds.right();\n var width = this.bounds.width;\n var y, dx, dy;\n\n if (this.isAbove) {\n y = this.bounds.bottom();\n dx = width / 6;\n dy = -width / 6;\n } else {\n y = this.bounds.y;\n dx = width / 6;\n dy = width / 6;\n }\n\n //Calculate Control Points of path,\n var cx1 = x1 + dx;\n var cy = y + dy;\n var cx2 = x2 - dx;\n\n // two decimal points should be enough, but if we need more precision, we can\n // up it here.\n var dp = 2;\n return \"M \" + x1.toFixed(dp) + \" \" + y.toFixed(dp) +\n \" C \" + cx1.toFixed(dp) + \" \" + cy.toFixed(dp) + \n \" \" + cx2.toFixed(dp) + \" \" + cy.toFixed(dp) +\n \" \" + x2.toFixed(dp) + \" \" + y.toFixed(dp);\n }\n}\n\nexport class CurlyBraceVisualizer extends ChantLayoutElement {\n\n constructor(ctxt, x1, x2, y, isAbove = true, addAcuteAccent = false) {\n super();\n\n if (x1 > x2) {\n // swap the xs\n var temp = x1;\n x1 = x2;\n x2 = temp;\n }\n\n this.isAbove = isAbove;\n this.braceHeight = ctxt.staffInterval / 2;\n\n // y is the actual vertical start of the brace (left hand side)\n // thus for a brace over notes, bounds.y is the bottom of brace,\n // but for a brace under the notes, y is simply the y passed in.\n if (isAbove)\n y -= this.braceHeight;\n\n var bounds = new Rect(x1, y, x2 - x1, this.braceHeight);\n\n if (addAcuteAccent && isAbove) {\n\n this.acuteAccent = new GlyphVisualizer(ctxt, GlyphCode.AcuteAccent);\n this.acuteAccent.bounds.x += bounds.x + (x2 - x1) / 2;\n this.acuteAccent.bounds.y += bounds.y - ctxt.staffInterval / 4;\n\n bounds.union(this.acuteAccent.bounds);\n }\n\n this.bounds = bounds;\n\n this.origin.x = 0;\n this.origin.y = 0;\n }\n\n createSvgFragment(ctxt) {\n var fragment = QuickSvg.createFragment('path', {\n 'd': this.generatePathString(),\n 'stroke': ctxt.neumeLineColor,\n 'stroke-width': ctxt.staffLineWeight + 'px',\n 'fill': 'none',\n 'class': 'brace'\n });\n\n if (this.acuteAccent) {\n\n fragment += this.acuteAccent.createSvgFragment(ctxt);\n\n return QuickSvg.createFragment('g', {\n 'class': 'accentedBrace'\n }, fragment);\n } else\n return fragment;\n }\n\n // code below inspired by: https://gist.github.com/alexhornbake\n // optimized for braces that are only drawn horizontally.\n // returns svg path d string\n generatePathString() {\n\n var q = 0.6; // .5 is normal, higher q = more expressive bracket\n\n var x1 = this.bounds.x;\n var x2 = this.bounds.right();\n var width = this.bounds.width;\n var y, h;\n\n if (this.isAbove) {\n y = this.bounds.bottom();\n h = -this.braceHeight;\n } else {\n y = this.bounds.y;\n h = this.braceHeight;\n }\n\n // calculate Control Points of path\n var qy1 = y + q * h;\n var qx2 = x1 + .25 * width;\n var qy2 = y + (1 - q) * h;\n var tx1 = x1 + .5 * width;\n var ty1 = y + h;\n var qy3 = y + q * h;\n var qx4 = x1 + .75 * width;\n var qy4 = y + (1 - q) * h;\n\n // two decimal points should be enough, but if we need more precision, we can\n // up it here.\n var dp = 2;\n return \"M \" + x1.toFixed(dp) + \" \" + y.toFixed(dp) +\n \" Q \" + x1.toFixed(dp) + \" \" + qy1.toFixed(dp) + \" \" + qx2.toFixed(dp) + \" \" + qy2.toFixed(dp) + \n \" T \" + tx1.toFixed(dp) + \" \" + ty1.toFixed(dp) +\n \" M \" + x2.toFixed(dp) + \" \" + y.toFixed(dp) +\n \" Q \" + x2.toFixed(dp) + \" \" + qy3.toFixed(dp) + \" \" + qx4.toFixed(dp) + \" \" + qy4.toFixed(dp) + \n \" T \" + tx1.toFixed(dp) + \" \" + ty1.toFixed(dp);\n }\n}\n\nvar TextSpan = function(text, properties) {\n if (typeof properties === 'undefined' || properties === null)\n properties = \"\";\n\n this.text = text;\n this.properties = properties;\n};\n\nvar boldMarkup = \"*\";\nvar italicMarkup = \"_\";\nvar redMarkup = \"^\";\nvar smallCapsMarkup = \"%\";\n\nfunction MarkupStackFrame(symbol, startIndex, properties) {\n this.symbol = symbol;\n this.startIndex = startIndex;\n this.properties = properties;\n}\n\nMarkupStackFrame.createStackFrame = function(symbol, startIndex) {\n\n var properties = \"\";\n\n switch(symbol) {\n case boldMarkup:\n properties = 'font-weight:bold;';\n break;\n case italicMarkup:\n properties = 'font-style:italic;';\n break;\n case redMarkup:\n properties = 'fill:#f00;'; // SVG text color is set by the fill property\n break;\n case smallCapsMarkup:\n properties = \"font-variant:small-caps;font-feature-settings:'smcp';-webkit-font-feature-settings:'smcp';\";\n break;\n }\n\n return new MarkupStackFrame(symbol, startIndex, properties);\n};\n\n\n// for escaping html strings before they go into the svgs\n// adapted from http://stackoverflow.com/a/12034334/5720160\nvar __subsForTspans = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\"\n};\n\nexport class TextElement extends ChantLayoutElement {\n\n constructor(ctxt, text, fontFamily, fontSize, textAnchor) {\n super();\n\n // set these to some sane values for now...\n this.bounds.x = 0;\n this.bounds.y = 0;\n this.bounds.width = 0;\n this.bounds.height = 0;\n this.origin.x = 0;\n this.origin.y = 0;\n\n this.fontFamily = fontFamily;\n this.fontSize = fontSize;\n this.textAnchor = textAnchor;\n this.dominantBaseline = 'baseline'; // default placement\n\n this.generateSpansFromText(ctxt, text);\n\n this.recalculateMetrics(ctxt);\n }\n\n generateSpansFromText(ctxt, text) {\n\n this.text = \"\";\n this.spans = [];\n\n // save ourselves a lot of grief for a very common text:\n if (text === \"*\" || text === \"†\") {\n this.spans.push(new TextSpan(text));\n return;\n }\n\n var markupStack = [];\n var spanStartIndex = 0;\n\n var filterFrames = (frame, symbol) => frame.Symbol === symbol;\n\n var that = this;\n var closeSpan = function (spanText, extraProperties) {\n if (spanText === \"\")\n return;\n\n that.text += spanText;\n\n var properties = \"\";\n for (var i = 0; i < markupStack.length; i++)\n properties += markupStack[i].properties;\n\n if (extraProperties)\n properties = properties + extraProperties;\n\n that.spans.push(new TextSpan(spanText, properties));\n };\n\n var markupRegex = /(\\*|_|\\^|%|[ARVarv]\\/\\.)/g;\n\n var match = null;\n while ((match = markupRegex.exec(text))) {\n\n var markupSymbol = match[0];\n\n // non-matching symbols first\n if (markupSymbol === \"A/.\" || markupSymbol === \"R/.\" || markupSymbol === \"V/.\" ||\n markupSymbol === \"a/.\" || markupSymbol === \"r/.\" || markupSymbol === \"v/.\") {\n closeSpan(text[match.index] + \".\", \"font-family:'Exsurge Characters';fill:#f00;\");\n } else if (markupStack.length === 0) {\n // otherwise we're dealing with matching markup delimeters\n // if this is our first markup frame, then just create an inline for preceding text and push the stack frame\n closeSpan(text.substring(spanStartIndex, match.index));\n markupStack.push(MarkupStackFrame.createStackFrame(markupSymbol, match.index));\n } else {\n\n if (markupStack[markupStack.length - 1].symbol === markupSymbol) {\n // group close\n closeSpan(text.substring(spanStartIndex, match.index));\n markupStack.pop();\n } else if (markupStack.filter(filterFrames).length > 0) {\n // trying to open a recursive group (or forgot to close a previous group)\n // in either case, we just unwind to the previous stack frame\n spanStartIndex = markupStack[markupStack.length - 1].startIndex;\n markupStack.pop();\n continue;\n } else {\n // group open\n closeSpan(text.substring(spanStartIndex, match.index));\n markupStack.push(MarkupStackFrame.createStackFrame(markupSymbol, match.index));\n }\n }\n\n // advance the start index past the current markup\n spanStartIndex = match.index + markupSymbol.length;\n }\n\n // if we finished matches, and there is still some text left, create one final run\n if (spanStartIndex < text.length)\n closeSpan(text.substring(spanStartIndex, text.length));\n\n // if after all of that we still didn't create any runs, then just add the entire text\n // string itself as a run\n if (this.spans.length === 0)\n closeSpan(text);\n }\n\n measureSubstring(ctxt, length) {\n if(length === 0) return 0;\n if(!length) length = Infinity;\n var canvasCtxt = ctxt.canvasCtxt;\n var baseFont = this.fontSize + \"px \" + this.fontFamily;\n var width = 0;\n var subStringLength = 0;\n for (var i = 0; i < this.spans.length; i++) {\n var font = '',\n span = this.spans[i],\n myText = span.text.slice(0, length - subStringLength);\n if(span.properties.indexOf('font-style:italic;') >= 0) font += 'italic ';\n if(span.properties.indexOf(\"font-variant:small-caps;\") >= 0) font += 'small-caps ';\n if(span.properties.indexOf('font-weight:bold;') >= 0) font += 'bold ';\n font += baseFont;\n canvasCtxt.font = font;\n var metrics = canvasCtxt.measureText(myText, this.bounds.x, this.bounds.y);\n width += metrics.width;\n subStringLength += myText.length;\n if(subStringLength === length) break;\n }\n return width;\n }\n\n recalculateMetrics(ctxt) {\n\n this.bounds.x = 0;\n this.bounds.y = 0;\n\n this.bounds.x = 0;\n this.bounds.y = 0;\n \n this.origin.x = 0;\n \n if(ctxt.textMeasuringStrategy === TextMeasuringStrategy.Svg) {\n var xml = '' + this.createSvgFragment(ctxt) + '';\n var doc = new DOMParser().parseFromString(xml, 'application/xml');\n \n while(ctxt.svgTextMeasurer.firstChild)\n ctxt.svgTextMeasurer.firstChild.remove();\n\n ctxt.svgTextMeasurer.appendChild(ctxt.svgTextMeasurer.ownerDocument.importNode(doc.documentElement, true).firstChild);\n\n var bbox = ctxt.svgTextMeasurer.firstChild.getBBox();\n this.bounds.width = bbox.width;\n this.bounds.height = bbox.height;\n this.origin.y = -bbox.y; // offset to baseline from top\n } else if(ctxt.textMeasuringStrategy === TextMeasuringStrategy.Canvas) {\n this.bounds.width = this.measureSubstring(ctxt);\n this.bounds.height = this.fontSize * 1.2;\n this.origin.y = this.fontSize;\n }\n }\n\n getCssClasses() {\n return \"\";\n }\n\n getExtraStyleProperties(ctxt) {\n return \"\";\n }\n\n static escapeForTspan(string) {\n return String(string).replace(/[&<>]/g, function (s) {\n return __subsForTspans[s];\n });\n }\n\n draw(ctxt) {\n\n var canvasCtxt = ctxt.canvasCtxt;\n\n if (this.textAnchor === 'middle')\n canvasCtxt.textAlign = 'center';\n else\n canvasCtxt.textAlign = 'start';\n\n canvasCtxt.font = this.fontSize + \"px \" + this.fontFamily;\n\n for (var i = 0; i < this.spans.length; i++)\n canvasCtxt.fillText(this.spans[i].text, this.bounds.x, this.bounds.y);\n }\n\n createSvgFragment(ctxt) {\n\n var spans = \"\";\n\n for (var i = 0; i < this.spans.length; i++) {\n var options = {};\n\n if (this.spans[i].properties)\n options['style'] = this.spans[i].properties;\n\n spans += QuickSvg.createFragment('tspan', options, TextElement.escapeForTspan(this.spans[i].text));\n }\n\n var styleProperties = \"font-family:\" + this.fontFamily +\n \";font-size:\" + this.fontSize + \"px\" +\n \";font-kerning:normal;\" +\n this.getExtraStyleProperties(ctxt);\n\n return QuickSvg.createFragment('text', {\n 'x': this.bounds.x,\n 'y': this.bounds.y,\n 'class': this.getCssClasses().trim(),\n 'text-anchor': this.textAnchor,\n 'dominant-baseline': this.dominantBaseline,\n 'style': styleProperties\n }, spans);\n }\n}\n\nexport var LyricType = {\n SingleSyllable: 0,\n BeginningSyllable: 1,\n MiddleSyllable: 2,\n EndingSyllable: 3,\n\n Directive: 4 // for asterisks, \"ij.\" elements, or other performance notes.\n};\n\nexport class Lyric extends TextElement {\n constructor(ctxt, text, lyricType) {\n super(ctxt, text, ctxt.lyricTextFont, ctxt.lyricTextSize, 'start');\n\n // save the original text in case we need to later use the lyric\n // in a dropcap...\n this.originalText = text;\n\n if (typeof lyricType === 'undefined' || lyricType === null || lyricType === \"\")\n this.lyricType = LyricType.SingleSyllable;\n else\n this.lyricType = lyricType;\n\n // Lyrics keep track of how to center them on notation elements.\n // centerTextIndex is the index in this.text where the centering starts,\n // centerLength is how many characters comprise the center point.\n // performLayout will do the processing\n this.centerStartIndex = -1;\n this.centerLength = text.length;\n\n this.needsConnector = false;\n\n // Lyrics can have their own language defined, which affects the alignment\n // of the text with the notation element\n this.language = null;\n }\n\n allowsConnector() {\n return this.lyricType === LyricType.BeginningSyllable ||\n this.lyricType === LyricType.MiddleSyllable;\n }\n\n setNeedsConnector(needs) {\n if (needs === true) {\n this.needsConnector = true;\n this.bounds.width = this.widthWithConnector;\n\n if (this.spans.length > 0)\n this.spans[this.spans.length - 1].text = this.lastSpanTextWithConnector;\n } else {\n this.needsConnector = false;\n this.bounds.width = this.widthWithoutConnector;\n\n if (this.spans.length > 0)\n this.spans[this.spans.length - 1].text = this.lastSpanText;\n }\n }\n\n generateSpansFromText(ctxt, text) {\n super.generateSpansFromText(ctxt, text);\n\n if (this.spans.length > 0) {\n this.lastSpanText = this.spans[this.spans.length - 1].text;\n this.lastSpanTextWithConnector = this.lastSpanText + ctxt.syllableConnector;\n } else {\n this.lastSpanText = \"\";\n this.lastSpanTextWithConnector = \"\";\n }\n }\n\n recalculateMetrics(ctxt) {\n super.recalculateMetrics(ctxt);\n\n this.widthWithoutConnector = this.bounds.width;\n this.textWithConnector = this.text + ctxt.syllableConnector;\n\n this.widthWithConnector = this.bounds.width + ctxt.hyphenWidth;\n\n var activeLanguage = this.language || ctxt.defaultLanguage;\n\n // calculate the point where the text lines up to the staff notation\n // and offset the rect that much. By default we just center the text,\n // but the logic below allows for smarter lyric alignment based\n // on manual override or language control.\n var offset = this.widthWithoutConnector / 2, x1, x2;\n\n // some simple checks for sanity, and disable manual centering if the numbers are bad\n if (this.centerStartIndex >= 0 && (this.centerStartIndex >= this.text.length ||\n this.centerLength < 0 ||\n this.centerStartIndex + this.centerLength > this.text.length))\n this.centerStartIndex = -1;\n\n if (this.text.length === 0) {\n // if we have no text to work with, then there's nothing to do!\n } else if (this.centerStartIndex >= 0) {\n // if we have manually overriden the centering logic for this lyric,\n // then always use that.\n if(ctxt.textMeasuringStrategy === TextMeasuringStrategy.Svg) {\n // svgTextMeasurer still has the current lyric in it...\n x1 = ctxt.svgTextMeasurer.firstChild.getSubStringLength(0, this.centerStartIndex);\n x2 = ctxt.svgTextMeasurer.firstChild.getSubStringLength(0, this.centerStartIndex + this.centerLength);\n } else if(ctxt.textMeasuringStrategy === TextMeasuringStrategy.Canvas) {\n x1 = this.measureSubstring(ctxt, this.centerStartIndex);\n x2 = this.measureSubstring(ctxt, this.centerStartIndex + this.centerLength);\n }\n offset = x1 + (x2 - x1) / 2;\n } else {\n\n // if it's a directive with no manual centering override, then\n // just center the text.\n if (this.lyricType !== LyricType.Directive) {\n\n // Non-directive elements are lined up to the chant notation based on vowel segments,\n var result = activeLanguage.findVowelSegment(this.text, 0);\n \n if (result.found === true) {\n if(ctxt.textMeasuringStrategy === TextMeasuringStrategy.Svg) {\n // svgTextMeasurer still has the current lyric in it...\n x1 = ctxt.svgTextMeasurer.firstChild.getSubStringLength(0, result.startIndex);\n x2 = ctxt.svgTextMeasurer.firstChild.getSubStringLength(0, result.startIndex + result.length);\n } else if(ctxt.textMeasuringStrategy === TextMeasuringStrategy.Canvas) {\n x1 = this.measureSubstring(ctxt, result.startIndex);\n x2 = this.measureSubstring(ctxt, result.startIndex + result.length);\n }\n offset = x1 + (x2 - x1) / 2;\n }\n }\n }\n\n this.bounds.x = -offset;\n this.bounds.y = 0;\n\n this.origin.x = offset;\n\n this.bounds.width = this.widthWithoutConnector;\n this.bounds.height = ctxt.lyricTextSize;\n }\n\n generateDropCap(ctxt) {\n\n var dropCap = new DropCap(ctxt, this.originalText.substring(0, 1));\n\n // if the dropcap is a single character syllable (vowel) that is the\n // beginning of the word, then we use a hyphen in place of the lyric text\n // and treat it as a single syllable.\n if (this.originalText.length === 1) {\n this.generateSpansFromText(ctxt, ctxt.syllableConnector);\n this.centerStartIndex = -1;\n this.lyricType = LyricType.SingleSyllable;\n } else {\n this.generateSpansFromText(ctxt, this.originalText.substring(1));\n this.centerStartIndex--; // lost a letter, so adjust centering accordingly\n }\n\n return dropCap;\n }\n\n getCssClasses() {\n\n var classes = \"lyric \";\n\n if (this.lyricType === LyricType.Directive)\n classes += \"directive \";\n\n return classes + super.getCssClasses();\n }\n\n getExtraStyleProperties(ctxt) {\n var props = super.getExtraStyleProperties();\n\n if (this.lyricType === LyricType.Directive && ctxt.autoColor === true)\n props += \"fill:#f00;\";\n\n return props;\n }\n\n createSvgFragment(ctxt) {\n if (this.spans.length > 0) {\n if (this.needsConnector)\n this.spans[this.spans.length - 1].text = this.lastSpanTextWithConnector;\n else\n this.spans[this.spans.length - 1].text = this.lastSpanText;\n }\n\n return super.createSvgFragment(ctxt);\n }\n}\n\nexport class DropCap extends TextElement {\n\n /**\n * @param {String} text\n */\n constructor(ctxt, text) {\n super(ctxt, text, ctxt.dropCapTextFont, ctxt.dropCapTextSize, 'middle');\n\n this.padding = ctxt.staffInterval * 2;\n }\n\n getCssClasses() {\n return \"dropCap \" + super.getCssClasses();\n }\n}\n\nexport class Annotation extends TextElement {\n\n /**\n * @param {String} text\n */\n constructor(ctxt, text) {\n super(ctxt, text, ctxt.annotationTextFont, ctxt.annotationTextSize, 'middle');\n this.padding = ctxt.staffInterval;\n this.dominantBaseline = 'hanging'; // so that annotations can be aligned at the top.\n }\n\n getCssClasses() {\n return \"annotation \" + super.getCssClasses();\n }\n}\n\n\n\nexport class ChantNotationElement extends ChantLayoutElement {\n\n constructor() {\n super();\n\n //double\n this.leadingSpace = 0.0;\n this.trailingSpace = -1; // if less than zero, this is automatically calculated at layout time\n this.keepWithNext = false;\n this.needsLayout = true;\n\n this.lyrics = [];\n\n this.score = null; // the ChantScore\n this.line = null; // the ChantLine\n\n this.visualizers = [];\n }\n\n hasLyrics() {\n if (this.lyrics.length !== 0)\n return true;\n else\n return false;\n }\n\n getLyricLeft(index) {\n // warning: no error checking on index or on whether lyric[index] is valid\n return this.bounds.x + this.lyrics[index].bounds.x;\n }\n\n getAllLyricsLeft() {\n if (this.lyrics.length === 0)\n return this.bounds.right();\n\n var x = Number.MAX_VALUE;\n for (var i = 0; i < this.lyrics.length; i++) {\n if (this.lyrics[i])\n x = Math.min(x, this.lyrics[i].bounds.x);\n }\n\n return this.bounds.x + x;\n }\n\n getLyricRight(index) {\n // warning: no error checking on index or on whether lyric[index] is valid\n return this.bounds.x + this.lyrics[index].bounds.x + this.lyrics[index].bounds.width;\n }\n\n getAllLyricsRight() {\n if (this.lyrics.length === 0)\n return this.bounds.x;\n\n var x = Number.MIN_VALUE;\n for (var i = 0; i < this.lyrics.length; i++) {\n if (this.lyrics[i])\n x = Math.max(x, this.lyrics[i].bounds.x + this.lyrics[i].bounds.width);\n }\n\n return this.bounds.x + x;\n }\n\n // used by subclasses while building up the chant notations.\n addVisualizer(chantLayoutElement) {\n if (this.bounds.isEmpty())\n this.bounds = chantLayoutElement.bounds.clone();\n else\n this.bounds.union(chantLayoutElement.bounds);\n\n this.visualizers.push(chantLayoutElement);\n }\n\n // same as addVisualizer, except the element is unshifted to the front\n // of the visualizer array rather than the end. This way, some\n // visualizers can be placed behind the others...ledger lines for example.\n prependVisualizer(chantLayoutElement) {\n if (this.bounds.isEmpty())\n this.bounds = chantLayoutElement.bounds.clone();\n else\n this.bounds.union(chantLayoutElement.bounds);\n\n this.visualizers.unshift(chantLayoutElement);\n }\n\n // chant notation elements are given an opportunity to perform their layout via this function.\n // subclasses should call this function first in overrides of this function.\n // on completion, exsurge presumes that the bounds, the origin, and the fragment objects are\n // all valid and prepared for higher level layout.\n performLayout(ctxt) {\n\n if (this.trailingSpace < 0)\n this.trailingSpace = ctxt.intraNeumeSpacing * 4;\n\n // reset the bounds and the staff notations before doing a layout\n this.visualizers = [];\n this.bounds = new Rect(Infinity, Infinity, -Infinity, -Infinity);\n\n for (var i = 0; i < this.lyrics.length; i++)\n this.lyrics[i].recalculateMetrics(ctxt);\n }\n\n // some subclasses have internal dependencies on other notations (for example,\n // a custos can depend on a later neume which it uses to set its height).\n // subclasses can override this function so that when the notations are \n // altered, the subclass can correctly invalidate (and later restore) its own\n // depedencies\n resetDependencies() {\n\n }\n\n // a helper function for subclasses to call after they are done performing layout...\n finishLayout(ctxt) {\n\n this.bounds.x = 0;\n\n for (var i = 0; i < this.lyrics.length; i++)\n this.lyrics[i].bounds.x = this.origin.x - this.lyrics[i].origin.x;\n\n this.needsLayout = false;\n }\n\n draw(ctxt) {\n\n var canvasCtxt = ctxt.canvasCtxt;\n canvasCtxt.translate(this.bounds.x, 0);\n\n for (var i = 0; i < this.visualizers.length; i++)\n this.visualizers[i].draw(ctxt);\n\n for (i = 0; i < this.lyrics.length; i++)\n this.lyrics[i].draw(ctxt);\n\n canvasCtxt.translate(-this.bounds.x, 0);\n }\n\n createSvgFragment(ctxt) {\n var inner = \"\";\n\n for (var i = 0; i < this.visualizers.length; i++)\n inner += this.visualizers[i].createSvgFragment(ctxt);\n\n for (i = 0; i < this.lyrics.length; i++)\n inner += this.lyrics[i].createSvgFragment(ctxt);\n\n return QuickSvg.createFragment('g', {\n // this.constructor.name will not be the same after being mangled by UglifyJS\n 'class': 'ChantNotationElement ' + this.constructor.name,\n 'transform': 'translate(' + this.bounds.x + ',' + 0 + ')'\n }, inner);\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Drawing.js\n **/","module.exports = \"data:font/opentype;base64,AAEAAAATAQAABAAwRFNJRwAAAAEAAENkAAAACEdERUYAbgADAABDbAAAABhHUE9TTxtiswAAQ4QAAAE8R1NVQjtgWB4AAETAAAAAlk9TLzJKLTibAAABuAAAAGBjbWFwCRIK1gAAA4gAAAEEY3Z0IAGGB0cAAAZ0AAAAGmZwZ20GWZw3AAAEjAAAAXNnYXNwABcACAAAQ1QAAAAQZ2x5ZhRQNO4AAAdQAAAEzGhlYWQKMl2QAAABPAAAADZoaGVhDC0CmQAAAXQAAAAkaG10eB67AO4AAAIYAAABbmtlcm4E1wS9AAAMHAAAAMZsb2NhLQ4u0gAABpAAAADAbWF4cAJtAJoAAAGYAAAAIG5hbWUmgJC3AAAM5AAANY5wb3N0CJUJxAAAQnQAAADgcHJlcNTHuIYAAAYAAAAAcgABAAAAAQAArr24P18PPPUAGwgAAAAAANLrfC8AAAAA0uuXUgAA/vAFLAYhAAAACQACAAAAAAAAAAEAAAb+/bwAAAUzAAD/UQUsAAEAAAAAAAAAAAAAAAAAAABYAAEAAABfAE4AAwAAAAAAAQAAAAAACgAAAgAASwAAAAAAAwNBAZAABQAAA1gDWAAABLADWANYAAAEsABkAfQAAAIABQMGAAACAAQAAAABAAAAAAAAAAAAAAAAICAgIABAACEAfgb+/bwAAAb+AkQAAAABAAAAAAOiBOwAAAAgAAIDMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAHVAIMDMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAAEwwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAR9ACkDMwAAA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AE8AUgAgAEEAIABQAEEAUgBUAEkAQwBVAEwAQQBSACAAUABVAFIAUABPAFMARQAgAEEATgBEACAATgBPAE4ASQBOAEYAUgBJAE4ARwBFAE0ARQBOAFQAIABPAEYAIABDAE8AUABZAFIASQBHAEgAVAAsACAAUABBAFQARQBOAFQALAAgAFQAUgBBAEQARQBNAEEAUgBLACwAIABPAFIAIABPAFQASABFAFIAIABSAEkARwBIAFQALgAgAEkATgAgAE4ATwAgAEUAVgBFAE4AVAAgAFMASABBAEwATAAgAFQASABFACAAQwBPAFAAWQBSAEkARwBIAFQAIABIAE8ATABEAEUAUgAgAEIARQAgAEwASQBBAEIATABFACAARgBPAFIAIABBAE4AWQAgAEMATABBAEkATQAsACAARABBAE0AQQBHAEUAUwAgAE8AUgAgAE8AVABIAEUAUgAgAEwASQBBAEIASQBMAEkAVABZACwAIABJAE4AQwBMAFUARABJAE4ARwAgAEEATgBZACAARwBFAE4ARQBSAEEATAAsACAAUwBQAEUAQwBJAEEATAAsACAASQBOAEQASQBSAEUAQwBUACwAIABJAE4AQwBJAEQARQBOAFQAQQBMACwAIABPAFIAIABDAE8ATgBTAEUAUQBVAEUATgBUAEkAQQBMACAARABBAE0AQQBHAEUAUwAsACAAVwBIAEUAVABIAEUAUgAgAEkATgAgAEEATgAgAEEAQwBUAEkATwBOACAATwBGACAAQwBPAE4AVABSAEEAQwBUACwAIABUAE8AUgBUACAATwBSACAATwBUAEgARQBSAFcASQBTAEUALAAgAEEAUgBJAFMASQBOAEcAIABGAFIATwBNACwAIABPAFUAVAAgAE8ARgAgAFQASABFACAAVQBTAEUAIABPAFIAIABJAE4AQQBCAEkATABJAFQAWQAgAFQATwAgAFUAUwBFACAAVABIAEUAIABGAE8ATgBUACAAUwBPAEYAVABXAEEAUgBFACAATwBSACAARgBSAE8ATQAgAE8AVABIAEUAUgAgAEQARQBBAEwASQBOAEcAUwAgAEkATgAgAFQASABFACAARgBPAE4AVAAgAFMATwBGAFQAVwBBAFIARQAuAAAAAgAAAAAAAP8GAGQAAAAAAAAAAAAAAAAAAAAAAAAAAABfAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQAAAAMACAACABAAAf//AAIAAAABAAAAAAABAAAADgAAAAAAAAAAAAIAAQAAAF4AAQABAAAACgBKAGQAAmN5cmwADmxhdG4AGAAEAAAAAP//AAAAEAACSVBBIAAaVklUIAAiAAD//wACAAEAAAAA//8AAQABAAD//wAAAAJrZXJuAA5tYXJrABQAAAABAAEAAAABAAAAAgAGAA4ABAAEAAEAEAACAAAAAQAsAAEADAAQAAAAIAAiAAIAAAABAAYAIQAyADYAQQBSAFYAAAAGAAEAjgAEAAAABgAWADAASgBkAHIAgAAGAA7/nAAhADYAQQA2ADIADQA2//IAUgAXAAYADv+cACEAWABBAFgAMgChADYAvQBSAE8ABgAO/nAAIf6TAEH+kwAy//kANgAOAFL/YQADAA7/nABSABcAVv/VAAMADv+cAFIANgBWAEwAAwAO/nAAUgAJAFYAGQABAAYAIQAyADYAQQBSAFYAAQAAAAoATgBoAAJjeXJsAA5sYXRuABoABAAAAAD//wABAAAAEAACSVBBIAAaVklUIAAiAAD//wACAAAAAQAA//8AAQAAAAD//wABAAAAAmFhbHQADnNtY3AAFAAAAAEAAAAAAAEAAAABAAQAAwAAAAEACAABABgAAwAMABAAFAABAEEAAQBSAAEAVgABAAMAIQAyADYAAA==\"\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/url-loader?limit=30000!./assets/fonts/ExsurgeChar.otf\n ** module id = 5\n ** module chunks = 0\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport * as Exsurge from 'Exsurge.Core'\nimport { Step, Pitch, Rect, Point, Margins } from 'Exsurge.Core'\nimport { QuickSvg, ChantLayoutElement, ChantNotationElement, GlyphCode, GlyphVisualizer, Lyric, Annotation, DropCap } from 'Exsurge.Drawing'\nimport { ChantLine } from 'Exsurge.Chant.ChantLine'\nimport { AccidentalType } from 'Exsurge.Chant.Signs'\nimport { MarkingPositionHint, HorizontalEpisemaAlignment, HorizontalEpisema, BraceStart, BraceEnd } from 'Exsurge.Chant.Markings'\nimport { Gabc } from 'Exsurge.Gabc'\n\nexport var LiquescentType = {\n None: 0,\n\n // flags that can be combined, though of course it\n // it doesn't make sense to combine some!\n Large: 1 << 0,\n Small: 1 << 1,\n Ascending: 1 << 2,\n Descending: 1 << 3,\n InitioDebilis: 1 << 4,\n\n // handy liquescent types\n LargeAscending: 1 << 0 | 1 << 2,\n LargeDescending: 1 << 0 | 1 << 3,\n SmallAscending: 1 << 1 | 1 << 2,\n SmallDescending: 1 << 1 | 1 << 3\n};\n\nexport var NoteShape = {\n // shapes\n Default: 0,\n Virga: 1,\n Inclinatum: 2,\n Quilisma: 3,\n Stropha: 4,\n Oriscus: 5\n};\n\nexport var NoteShapeModifiers = {\n\n // flags which modify the shape\n // not all of them apply to every shape of course\n None: 0,\n Ascending: 1 << 0,\n Descending: 1 << 1,\n Cavum: 1 << 2,\n Stemmed: 1 << 3\n};\n\n/**\n * @class\n */\nexport class Note extends ChantLayoutElement {\n\n /**\n * @para {Pitch} pitch\n */\n constructor(pitch) {\n super();\n\n if (typeof pitch !== 'undefined')\n this.pitch = pitch;\n else\n this.pitch = null;\n\n this.glyphVisualizer = null;\n\n // The staffPosition on a note is an integer that indicates the vertical position on the staff.\n // 0 is the center space on the staff (equivalent to gabc 'g'). Positive numbers go up\n // the staff, and negative numbers go down, i.e., 1 is gabc 'h', 2 is gabc 'i', -1 is gabc 'f', etc.\n this.staffPosition = 0;\n this.liquescent = LiquescentType.None;\n this.shape = NoteShape.Default;\n this.shapeModifiers = NoteShapeModifiers.None;\n\n // notes keep track of the neume they belong to in order to facilitate layout\n // this.neume gets set when a note is added to a neume via Neume.addNote()\n this.neume = null;\n\n // various markings that can exist on a note, organized by type\n // for faster access and simpler code logic\n this.epismata = [];\n this.morae = []; // silly to have an array of these, but gabc allows multiple morae per note!\n\n // these are set on the note when they are needed, otherwise, they're undefined\n // this.ictus\n // this.accuteAccent\n // this.braceStart\n // this.braceEnd\n }\n\n setGlyph(ctxt, glyphCode) {\n if (this.glyphVisualizer)\n this.glyphVisualizer.setGlyph(ctxt, glyphCode);\n else\n this.glyphVisualizer = new GlyphVisualizer(ctxt, glyphCode);\n\n this.glyphVisualizer.setStaffPosition(ctxt, this.staffPosition);\n\n // assign glyphvisualizer metrics to this note\n this.bounds.x = this.glyphVisualizer.bounds.x;\n this.bounds.y = this.glyphVisualizer.bounds.y;\n this.bounds.width = this.glyphVisualizer.bounds.width;\n this.bounds.height = this.glyphVisualizer.bounds.height;\n\n this.origin.x = this.glyphVisualizer.origin.x;\n this.origin.y = this.glyphVisualizer.origin.y;\n }\n\n // a utility function for modifiers\n shapeModifierMatches(shapeModifier) {\n if (shapeModifier === NoteShapeModifiers.None)\n return this.shapeModifier === NoteShapeModifiers.None;\n else\n return this.shapeModifier & shapeModifier !== 0;\n }\n\n draw(ctxt) {\n\n this.glyphVisualizer.bounds.x = this.bounds.x;\n this.glyphVisualizer.bounds.y = this.bounds.y;\n\n this.glyphVisualizer.draw(ctxt);\n }\n\n createSvgFragment(ctxt) {\n\n this.glyphVisualizer.bounds.x = this.bounds.x;\n this.glyphVisualizer.bounds.y = this.bounds.y;\n return this.glyphVisualizer.createSvgFragment(ctxt);\n }\n}\n\nexport class Clef extends ChantNotationElement {\n\n constructor(staffPosition, octave, defaultAccidental = null) {\n super();\n\n this.isClef = true;\n this.staffPosition = staffPosition;\n this.octave = octave;\n this.defaultAccidental = defaultAccidental;\n this.activeAccidental = defaultAccidental;\n }\n\n resetAccidentals() {\n this.activeAccidental = this.defaultAccidental;\n }\n\n pitchToStaffPosition(pitch) {\n\n }\n\n performLayout(ctxt) {\n\n ctxt.activeClef = this;\n\n if (this.defaultAccidental)\n this.defaultAccidental.performLayout(ctxt);\n\n super.performLayout(ctxt);\n }\n\n finishLayout(ctxt) {\n\n // if we have a default accidental, then add a glyph for it now\n if (this.defaultAccidental) {\n var accidentalGlyph = this.defaultAccidental.createGlyphVisualizer(ctxt);\n accidentalGlyph.bounds.x += this.visualizers[0].bounds.right() + ctxt.intraNeumeSpacing;\n this.addVisualizer(accidentalGlyph);\n }\n\n super.finishLayout(ctxt);\n }\n\n static default() {\n return __defaultDoClef;\n }\n}\n\nexport class DoClef extends Clef {\n\n constructor(staffPosition, octave, defaultAccidental = null) {\n super(staffPosition, octave, defaultAccidental);\n\n this.leadingSpace = 0.0;\n }\n\n pitchToStaffPosition(pitch) {\n return (pitch.octave - this.octave) * 7 + this.staffPosition +\n Pitch.stepToStaffOffset(pitch.step) -\n Pitch.stepToStaffOffset(Step.Do);\n }\n\n staffPositionToPitch(staffPosition) {\n var offset = staffPosition - this.staffPosition;\n var octaveOffset = Math.floor(offset / 7);\n\n var step = Pitch.staffOffsetToStep(offset);\n\n if (this.defaultAccidental !== null && step === this.defaultAccidental.step)\n step += this.defaultAccidental.accidentalType;\n\n return new Pitch(step, this.octave + octaveOffset);\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var glyph = new GlyphVisualizer(ctxt, GlyphCode.DoClef);\n glyph.setStaffPosition(ctxt, this.staffPosition);\n this.addVisualizer(glyph);\n\n this.finishLayout(ctxt);\n }\n\n clone() {\n return new DoClef(this.staffPosition, this.octave, this.defaultAccidental);\n }\n}\n\nvar __defaultDoClef = new DoClef(1, 2);\n\nexport class FaClef extends Clef {\n\n constructor(staffPosition, octave, defaultAccidental = null) {\n super(staffPosition, octave, defaultAccidental);\n\n this.octave = octave;\n\n this.leadingSpace = 0;\n }\n\n pitchToStaffPosition(pitch) {\n return (pitch.octave - this.octave) * 7 + this.staffPosition +\n Pitch.stepToStaffOffset(pitch.step) -\n Pitch.stepToStaffOffset(Step.Fa);\n }\n\n staffPositionToPitch(staffPosition) {\n var offset = staffPosition - this.staffPosition + 3; // + 3 because it's a fa clef (3 == offset from Do)\n var octaveOffset = Math.floor(offset / 7);\n\n var step = Pitch.staffOffsetToStep(offset);\n\n if (step === Step.Ti && this.defaultAccidental === AccidentalType.Flat)\n step = Step.Te;\n\n return new Pitch(step, this.octave + octaveOffset);\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var glyph = new GlyphVisualizer(ctxt, GlyphCode.FaClef);\n glyph.setStaffPosition(ctxt, this.staffPosition);\n this.addVisualizer(glyph);\n\n this.finishLayout(ctxt);\n }\n\n clone() {\n return new FaClef(this.staffPosition, this.octave, this.defaultAccidental);\n }\n}\n\n/*\n * TextOnly\n */\nexport class TextOnly extends ChantNotationElement {\n\n constructor() {\n super();\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n // add an empty glyph as a placeholder\n this.addVisualizer(new GlyphVisualizer(ctxt, GlyphCode.None));\n\n this.origin.x = 0;\n this.origin.y = 0;\n\n this.finishLayout(ctxt);\n }\n}\n\nexport class ChantLineBreak extends ChantNotationElement {\n\n constructor(justify) {\n super();\n\n this.justify = justify;\n }\n\n performLayout(ctxt) {\n\n // reset the bounds before doing a layout\n this.bounds = new Rect(0, 0, 0, 0);\n }\n\n clone() {\n var lb = new ChantLineBreak();\n lb.justify = this.justify;\n\n return lb;\n }\n}\n\n// a chant mapping is a lightweight format independent way of\n// tracking how a chant language (e.g., gabc) has been\n// mapped to exsurge notations.\nexport class ChantMapping {\n\n // source can be any object type. in the case of gabc, source is a text\n // string that maps to a gabc word (e.g.: \"no(g)bis(fg)\").\n // notations is an array of ChantNotationElements\n constructor(source, notations) {\n this.source = source;\n this.notations = notations;\n }\n}\n\n\n/*\n * Score, document\n */\nexport class ChantScore {\n\n // mappings is an array of ChantMappings.\n constructor(ctxt, mappings = [], useDropCap) {\n\n this.mappings = mappings;\n\n this.lines = [];\n this.notes = [];\n\n this.startingClef = null;\n\n this.useDropCap = useDropCap;\n this.dropCap = null;\n\n this.annotation = null;\n\n this.compiled = false;\n\n this.autoColoring = true;\n this.needsLayout = true;\n\n // valid after chant lines are created...\n this.bounds = new Rect();\n\n this.updateNotations(ctxt);\n }\n\n updateNotations(ctxt) {\n\n var i;\n\n // flatten all mappings into one array for N(0) access to notations\n this.notations = [];\n for(i = 0; i < this.mappings.length; i++)\n this.notations = this.notations.concat(this.mappings[i].notations);\n\n // find the starting clef...\n // start with a default clef in case the notations don't provide one.\n this.startingClef = null;\n var defaultClef = new DoClef(1, 2);\n\n for (i = 0; i < this.notations.length; i++) {\n\n // if there are neumes before the clef, then we just keep the default clef above\n if (this.notations[i].isNeume) {\n this.startingClef = defaultClef;\n break; \n }\n\n // otherwise, if we find a clef, before neumes then we use that as our default\n if (this.notations[i].isClef) {\n this.startingClef = this.notations[i];\n\n // the clef is taken out of the notations...\n this.notations.splice(i, 1); // remove a single notation\n\n break;\n }\n }\n\n // if we've reached this far and we *still* don't have a clef, then there aren't even\n // any neumes in the score. still, set the default clef just for good measure\n if (!this.startingClef)\n this.startingClef = defaultClef;\n\n // update drop cap\n if (this.useDropCap)\n this.recreateDropCap(ctxt);\n\n this.needsLayout = true;\n }\n\n recreateDropCap(ctxt) {\n\n // find the first notation with lyrics to use\n for (var i = 0; i < this.notations.length; i++) {\n if (this.notations[i].hasLyrics() && this.notations[i].lyrics[0] !== null) {\n this.dropCap = this.notations[i].lyrics[0].generateDropCap(ctxt);\n return;\n }\n } \n }\n\n // this is the the synchronous version of performLayout that\n // process everything without yielding to any other workers/threads.\n // good for server side processing or very small chant pieces.\n performLayout(ctxt) {\n\n if (this.needsLayout === false)\n return; // nothing to do here!\n\n // setup the context\n ctxt.activeClef = this.startingClef;\n ctxt.notations = this.notations;\n ctxt.currNotationIndex = 0;\n\n if (this.dropCap)\n this.dropCap.recalculateMetrics(ctxt);\n\n if (this.annotation)\n this.annotation.recalculateMetrics(ctxt);\n\n for (var i = 0; i < this.notations.length; i++) {\n this.notations[i].performLayout(ctxt);\n ctxt.currNotationIndex++;\n }\n\n this.needsLayout = false;\n }\n\n // for web applications, probably performLayoutAsync would be more\n // apppropriate that the above performLayout, since it will process\n // the notations without locking up the UI thread.\n performLayoutAsync(ctxt, finishedCallback) {\n\n if (this.needsLayout === false) {\n if (finishedCallback)\n setTimeout(() => finishedCallback(), 0);\n\n return; // nothing to do here!\n }\n\n // setup the context\n ctxt.activeClef = this.startingClef;\n ctxt.notations = this.notations;\n ctxt.currNotationIndex = 0;\n\n if (this.dropCap)\n this.dropCap.recalculateMetrics(ctxt);\n\n if (this.annotation)\n this.annotation.recalculateMetrics(ctxt);\n\n setTimeout(() => this.layoutElementsAsync(ctxt, 0, finishedCallback), 0);\n }\n\n layoutElementsAsync(ctxt, index, finishedCallback) {\n\n if (index >= this.notations.length) {\n this.needsLayout = false;\n\n if (finishedCallback)\n setTimeout(() => finishedCallback(), 0);\n\n return;\n }\n\n if (index === 0)\n ctxt.activeClef = this.startingClef;\n\n var timeout = new Date().getTime() + 50; // process for fifty milliseconds\n do {\n var notation = this.notations[index];\n if (notation.needsLayout) {\n ctxt.currNotationIndex = index;\n notation.performLayout(ctxt);\n }\n\n index++;\n\n } while (index < this.notations.length && new Date().getTime() < timeout);\n\n // schedule the next block of processing\n setTimeout(() => this.layoutElementsAsync(ctxt, index, finishedCallback), 0);\n }\n\n layoutChantLines(ctxt, width, finishedCallback) {\n\n this.lines = [];\n\n var y = 0;\n var currIndex = 0;\n\n ctxt.activeClef = this.startingClef;\n\n do {\n\n var line = new ChantLine(this);\n\n line.buildFromChantNotationIndex(ctxt, currIndex, width);\n currIndex = line.notationsStartIndex + line.numNotationsOnLine;\n line.performLayout(ctxt);\n this.lines.push(line);\n\n line.bounds.y = -line.bounds.y + y;\n y += line.bounds.height + ctxt.staffInterval * 1.5;\n\n } while (currIndex < this.notations.length);\n\n var lastLine = this.lines[this.lines.length - 1];\n\n this.bounds.x = 0;\n this.bounds.y = 0;\n this.bounds.width = lastLine.bounds.width;\n this.bounds.height = y;\n\n if (finishedCallback)\n finishedCallback(this);\n }\n\n draw(ctxt) {\n\n var canvasCtxt = ctxt.canvasCtxt;\n\n canvasCtxt.clearRect(0, 0, ctxt.canvas.width, ctxt.canvas.height);\n\n canvasCtxt.translate(this.bounds.x, this.bounds.y);\n\n for (var i = 0; i < this.lines.length; i++)\n this.lines[i].draw(ctxt);\n\n canvasCtxt.translate(-this.bounds.x, -this.bounds.y);\n }\n\n createSvg(ctxt) {\n\n var fragment = \"\";\n\n // create defs section\n for (var def in ctxt.defs)\n if (ctxt.defs.hasOwnProperty(def))\n fragment += ctxt.defs[def];\n\n fragment = QuickSvg.createFragment('defs', {}, fragment);\n\n for (var i = 0; i < this.lines.length; i++)\n fragment += this.lines[i].createSvgFragment(ctxt);\n\n fragment = QuickSvg.createFragment('g', {}, fragment);\n\n fragment = QuickSvg.createFragment('svg', {\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'version': '1.1',\n 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n 'class': 'ChantScore',\n 'width': this.bounds.width,\n 'height': this.bounds.height\n }, fragment);\n\n return fragment;\n }\n\n unserializeFromJson(data) {\n this.autoColoring = data['auto-coloring'];\n\n if (data.annotation !== null && data.annotation !== \"\") {\n // create the annotation\n this.annotation = new Annotation(ctxt, data.annotation);\n } else\n this.annotation = null;\n\n var createDropCap = data['drop-cap'] === 'auto' ? true : false;\n\n Gabc.parseChantNotations(data.notations, this, createDropCap);\n }\n\n serializeToJson() {\n var data = {};\n\n data['type'] = \"score\";\n data['auto-coloring'] = true;\n\n if (this.annotation !== null)\n data.annotation = this.annotation.unsanitizedText;\n else\n data.annotation = \"\";\n\n \n\n return data;\n }\n}\n\nexport class ChantDocument {\n constructor() {\n\n var defaults = {\n layout: {\n units: \"mm\",\n 'default-font': {\n 'font-family': \"Crimson\",\n 'font-size': 14\n },\n page: {\n width: 8.5,\n height: 11,\n 'margin-left': 0,\n 'margin-top': 0,\n 'margin-right': 0,\n 'margin-bottom': 0\n }\n },\n scores: []\n };\n\n // default layout\n this.copyLayout(this, defaults);\n\n this.scores = defaults.scores;\n }\n\n copyLayout(to, from) {\n\n to.layout = {\n units: from.layout.units,\n 'default-font': {\n 'font-family': from.layout['default-font']['font-family'],\n 'font-size': from.layout['default-font']['font-size']\n },\n page: {\n width: from.layout.page.width,\n height: from.layout.page.height,\n 'margin-left': from.layout.page['margin-left'],\n 'margin-top': from.layout.page['margin-top'],\n 'margin-right': from.layout.page['margin-right'],\n 'margin-bottom': from.layout.page['margin-bottom']\n }\n };\n }\n\n unserializeFromJson(data) {\n\n this.copyLayout(this, data);\n\n this.scores = [];\n\n // read in the scores\n for (var i = 0; i < data.scores.length; i++) {\n var score = new ChantScore();\n\n score.unserializeFromJson(data.scores[i]);\n this.scores.push(score);\n }\n }\n\n serializeToJson() {\n var data = {};\n\n this.copyLayout(data, this);\n\n data.scores = [];\n\n // save scores...\n for (var i = 0; i < this.scores.length; i++)\n data.scores.push(this.scores[i].serializeToJson());\n\n return data;\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Chant.js\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport * as Exsurge from 'Exsurge.Core'\nimport { Step, Pitch, Rect, Point, Margins } from 'Exsurge.Core'\nimport { QuickSvg, ChantLayoutElement, GlyphVisualizer, RoundBraceVisualizer, CurlyBraceVisualizer, Lyric, DropCap } from 'Exsurge.Drawing'\nimport { ChantLineBreak } from 'Exsurge.Chant'\nimport { Glyphs } from 'Exsurge.Glyphs'\nimport { Custos } from 'Exsurge.Chant.Signs'\nimport { MarkingPositionHint, HorizontalEpisemaAlignment, HorizontalEpisema, BraceShape, BracePoint } from 'Exsurge.Chant.Markings'\n\n\n// a chant line represents one staff line on the page. ChantLines are created by the score\n// and laid out by the page\nexport class ChantLine extends ChantLayoutElement {\n\n constructor(score) {\n super();\n\n this.score = score;\n\n this.notationsStartIndex = 0;\n this.numNotationsOnLine = 0;\n this.notationBounds = null; // Rect\n\n this.staffLeft = 0;\n this.staffRight = 0;\n\n this.startingClef = null; // necessary for the layout process\n this.custos = null;\n\n this.justify = true;\n\n // these are markings that exist at the chant line level rather than at the neume level.\n this.ledgerLines = [];\n this.braces = [];\n\n this.nextLine = null;\n this.previousLine = null; // for layout assistance\n\n this.lyricLineHeights = []; // height of each text line\n this.lyricLineBaselines = []; // offsets from the top of the text line to the baseline\n\n // fixme: make these configurable values from the score\n this.spaceAfterNotations = 0; // the space between the notation bounds and the first text track\n this.spaceBetweenTextTracks = 0; // spacing between each text track\n }\n\n performLayout(ctxt) {\n\n // start off with a rectangle that holds at least the four staff lines\n // we fudge the 3 to 3.1 so that the svg doesn't crop off the upper/lower staff lines...\n this.notationBounds = new Rect(this.staffLeft, -3.1 * ctxt.staffInterval,\n this.staffRight - this.staffLeft, 6.2 * ctxt.staffInterval);\n\n // run through all the elements of the line and calculate the bounds of the notations,\n // as well as the bounds of each text track we will use\n var i;\n var notations = this.score.notations;\n var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n var notation = null;\n\n this.notationBounds.union(this.startingClef.bounds);\n\n // reset the lyric line offsets before we [re]calculate them now\n this.lyricLineHeights = [];\n this.lyricLineBaselines = [];\n\n for (i = this.notationsStartIndex; i < lastIndex; i++) {\n notation = notations[i];\n\n this.notationBounds.union(notation.bounds);\n\n // keep track of lyric line offsets\n for (j = 0; j < notation.lyrics.length; j++) {\n if (this.lyricLineHeights.length < j + 1) {\n this.lyricLineHeights.push(0);\n this.lyricLineBaselines.push(0);\n }\n\n this.lyricLineHeights[j] = Math.max(this.lyricLineHeights[j], notation.lyrics[j].bounds.height);\n this.lyricLineBaselines[j] = Math.max(this.lyricLineBaselines[j], notation.lyrics[j].origin.y);\n }\n }\n\n if (this.custos)\n this.notationBounds.union(this.custos.bounds);\n\n // finalize the lyrics placement\n for (i = this.notationsStartIndex; i < lastIndex; i++) {\n notation = notations[i];\n\n var offset = this.notationBounds.y + this.notationBounds.height;\n\n for (var j = 0; j < notation.lyrics.length; j++) {\n notation.lyrics[j].bounds.y = offset + this.lyricLineBaselines[j];\n offset += this.lyricLineHeights[j];\n }\n }\n\n // add any braces to the notationBounds as well\n for (i = 0; i < this.braces.length; i++)\n this.notationBounds.union(this.braces[i].bounds);\n\n var totalHeight = this.notationBounds.height;\n\n // add up the lyric line heights to get the total height of the chant line\n for (i = 0; i < this.lyricLineHeights.length; i++)\n totalHeight += this.lyricLineHeights[i];\n\n // dropCap and the annotations\n if (this.notationsStartIndex === 0) {\n\n if (this.score.dropCap !== null) {\n\n var dropCapY;\n if (this.lyricLineHeights.length > 0) {\n dropCapY = this.notationBounds.y + this.notationBounds.height + this.lyricLineBaselines[0];\n } else\n dropCapY = this.notationBounds.y + this.notationBounds.height;\n\n // drop caps and annotations are drawn from their center, so aligning them\n // horizontally is as easy as this.staffLeft / 2\n this.score.dropCap.bounds.x = this.staffLeft / 2;\n this.score.dropCap.bounds.y = dropCapY;\n }\n\n if (this.score.annotation !== null) {\n // annotations use dominant-baseline to align text to the top\n this.score.annotation.bounds.x = this.staffLeft / 2;\n this.score.annotation.bounds.y = - ctxt.staffInterval * 3;\n }\n }\n\n this.notationBounds.height += ctxt.lyricTextSize;\n\n this.bounds.x = 0;\n this.bounds.y = this.notationBounds.y;\n this.bounds.width = this.notationBounds.right();\n this.bounds.height = totalHeight;\n\n // the origin of the chant line's coordinate space is at the center line of the left extremity of the staff\n this.origin = new Point(this.staffLeft, -this.notationBounds.y);\n }\n\n draw(ctxt) {\n\n var canvasCtxt = ctxt.canvasCtxt;\n\n canvasCtxt.translate(this.bounds.x, this.bounds.y);\n\n // draw the chant lines\n var i, x1 = this.staffLeft, x2 = this.staffRight, y;\n\n canvasCtxt.lineWidth = Math.round(ctxt.staffLineWeight);\n canvasCtxt.strokeStyle = ctxt.staffLineWeight;\n\n for (i = -3; i <= 3; i += 2) {\n\n y = Math.round(ctxt.staffInterval * i) + 0.5;\n\n canvasCtxt.beginPath();\n canvasCtxt.moveTo(x1, y);\n canvasCtxt.lineTo(x2, y);\n canvasCtxt.stroke();\n }\n\n // draw the ledger lines\n for (i = 0; i < this.ledgerLines.length; i++) {\n\n var ledgerLine = this.ledgerLines[i];\n y = ctxt.calculateHeightFromStaffPosition(ledgerLine.staffPosition);\n\n canvasCtxt.beginPath();\n canvasCtxt.moveTo(ledgerLine.x1, y);\n canvasCtxt.lineTo(ledgerLine.x2, y);\n canvasCtxt.stroke();\n }\n\n // fixme: draw the braces\n\n // draw the dropCap and the annotations\n if (this.notationsStartIndex === 0) {\n\n if (this.score.dropCap !== null)\n this.score.dropCap.draw(ctxt);\n\n if (this.score.annotation !== null)\n this.score.annotation.draw(ctxt);\n }\n\n // draw the notations\n var notations = this.score.notations;\n var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\n for (i = this.notationsStartIndex; i < lastIndex; i++)\n notations[i].draw(ctxt);\n\n this.startingClef.draw(ctxt);\n\n if (this.custos)\n this.custos.draw(ctxt);\n\n canvasCtxt.translate(-this.bounds.x, -this.bounds.y);\n }\n\n createSvgFragment(ctxt) {\n var inner = \"\";\n\n // add the chant lines\n var i, x1 = this.staffLeft, x2 = this.staffRight;\n\n // create the staff lines\n for (i = -3; i <= 3; i += 2) {\n\n inner += QuickSvg.createFragment('line', {\n 'x1': x1,\n 'y1': ctxt.staffInterval * i,\n 'x2': x2,\n 'y2': ctxt.staffInterval * i,\n 'stroke': ctxt.staffLineColor,\n 'stroke-width': ctxt.staffLineWeight,\n 'class': 'staffLine'\n });\n }\n\n // create the ledger lines\n for (i = 0; i < this.ledgerLines.length; i++) {\n\n var ledgerLine = this.ledgerLines[i];\n var y = ctxt.calculateHeightFromStaffPosition(ledgerLine.staffPosition);\n\n inner += QuickSvg.createFragment('line', {\n 'x1': ledgerLine.x1,\n 'y1': y,\n 'x2': ledgerLine.x2,\n 'y2': y,\n 'stroke': ctxt.staffLineColor,\n 'stroke-width': ctxt.staffLineWeight,\n 'class': 'ledgerLine'\n });\n }\n\n // add any braces\n for (i = 0; i < this.braces.length; i++)\n inner += this.braces[i].createSvgFragment(ctxt);\n\n // dropCap and the annotations\n if (this.notationsStartIndex === 0) {\n\n if (this.score.dropCap !== null)\n inner += this.score.dropCap.createSvgFragment(ctxt);\n\n if (this.score.annotation !== null)\n inner += this.score.annotation.createSvgFragment(ctxt);\n }\n\n inner += this.startingClef.createSvgFragment(ctxt);\n\n var notations = this.score.notations;\n var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\n // add all of the notations\n for (i = this.notationsStartIndex; i < lastIndex; i++)\n inner += notations[i].createSvgFragment(ctxt);\n\n if (this.custos)\n inner += this.custos.createSvgFragment(ctxt);\n\n return QuickSvg.createFragment('g', {\n 'class': 'chantLine',\n 'transform': 'translate(' + this.bounds.x + ',' + this.bounds.y + ')'\n }, inner);\n }\n\n // code below based on code by: https://gist.github.com/alexhornbake\n //\n // optimized for braces that are only drawn horizontally.\n // returns svg path string ready to insert into svg doc\n generateCurlyBraceDrawable(ctxt, x1, x2, y, isAbove) {\n\n var h;\n\n if (isAbove)\n h = -ctxt.staffInterval / 2;\n else\n h = ctxt.staffInterval / 2;\n\n // and q factor, .5 is normal, higher q = more expressive bracket \n var q = 0.6;\n\n var dx = -1;\n var len = x2 - x1;\n\n //Calculate Control Points of path,\n var qx1 = x1;\n var qy1 = y + q*h;\n var qx2 = x1 + .25*len;\n var qy2 = y + (1-q)*h;\n var tx1 = x1 + .5*len;\n var ty1 = y + h;\n var qx3 = x2;\n var qy3 = y + q*h;\n var qx4 = x1 + .75*len;\n var qy4 = y + (1-q)*h;\n var d = ( \"M \" + x1 + \" \" + y +\n \" Q \" + qx1 + \" \" + qy1 + \" \" + qx2 + \" \" + qy2 + \n \" T \" + tx1 + \" \" + ty1 +\n \" M \" + x2 + \" \" + y +\n \" Q \" + qx3 + \" \" + qy3 + \" \" + qx4 + \" \" + qy4 + \n \" T \" + tx1 + \" \" + ty1);\n\n return QuickSvg.createFragment('path', {\n 'd': d,\n 'stroke': ctxt.neumeLineColor,\n 'stroke-width': ctxt.neumeLineWeight + 'px',\n 'fill': 'none'\n });\n }\n\n\n buildFromChantNotationIndex(ctxt, newElementStart, width) {\n\n // todo: reset / clear the children we have in case they have data\n var notations = this.score.notations;\n this.notationsStartIndex = newElementStart;\n this.numNotationsOnLine = 0;\n\n this.staffLeft = 0;\n\n if (width > 0)\n this.staffRight = width;\n else\n this.staffRight = 99999999; // no limit to staff size\n\n // If this is the first chant line, then we have to make room for a\n // drop cap and/or annotation, if present\n if (this.notationsStartIndex === 0) {\n\n var padding = 0;\n\n if (this.score.dropCap !== null)\n padding = this.score.dropCap.bounds.width + this.score.dropCap.padding * 2;\n\n if (this.score.annotation !== null)\n padding = Math.max(padding, this.score.annotation.bounds.width + this.score.annotation.padding * 4);\n\n this.staffLeft += padding;\n }\n\n // set up the clef...\n // if the first notation on the line is a starting clef, then we treat it a little differently...\n // the clef becomes this line's starting clef and we skip over the clef in the notations array\n if (notations[newElementStart].isClef) {\n ctxt.activeClef = notations[newElementStart].clone();\n newElementStart++;\n this.notationsStartIndex++;\n }\n\n // make a copy for this line to use at the beginning\n this.startingClef = ctxt.activeClef.clone();\n this.startingClef.performLayout(ctxt);\n this.startingClef.bounds.x = this.staffLeft;\n\n var curr = this.startingClef, prev = null, prevWithLyrics = null;\n\n // estimate how much space we have available to us\n var rightNotationBoundary = this.staffRight - Glyphs.CustosLong.bounds.width * ctxt.glyphScaling - ctxt.intraNeumeSpacing * 4; // possible custos on the line\n\n // iterate through the notations, fittng what we can on this line\n var i, j, lastNotationIndex = notations.length - 1;\n\n\n for (i = newElementStart; i <= lastNotationIndex; i++) {\n\n if (curr.hasLyrics())\n prevWithLyrics = curr;\n\n prev = curr;\n curr = notations[i];\n \n var actualRightBoundary;\n if(i === lastNotationIndex) {\n // on the last notation of the score, we don't need a custos or trailing space, so we use staffRight as the\n // right boundary.\n actualRightBoundary = this.staffRight;\n } else if (i === lastNotationIndex - 1) {\n // on the penultimate notation, make sure there is at least enough room for whichever takes up less space,\n // between the final notation and a custos:\n actualRightBoundary = Math.max(rightNotationBoundary, this.staffRight - notations[lastNotationIndex].bounds.width);\n } else {\n // Otherwise, we use rightNotationBoundary, which leaves room for a custos...\n actualRightBoundary = rightNotationBoundary;\n }\n\n // try to fit the curr element on this line.\n // if it doesn't fit, we finish up here.\n var fitsOnLine = this.positionNotationElement(ctxt, prevWithLyrics, prev, curr, actualRightBoundary);\n if (fitsOnLine === false) {\n\n // check for an end brace in the curr element\n var braceEndIndex = curr.notes && curr.notes.reduce(function(result,n,i){ return result || (n.braceEnd && (i + 1)) || 0}, 0);\n var braceStartIndex = curr.notes && curr.notes.reduce(function(result,n,i){ return result || (n.braceStart && (i + 1)) || 0}, 0);\n // if there is not a start brace earlier in the element than the end brace, we need to find the earlier start brace\n // to keep the entire brace together on the next line\n if(braceEndIndex && (!braceStartIndex || braceStartIndex > braceEndIndex)) {\n // find last index of start brace\n var index = notations.slice(this.notationsStartIndex, i).reduceRight(function(accum,cne,index){\n if(accum === -1 && cne.notes) {\n var braceStart = cne.notes.filter(function(n){ return n.braceStart; }).length;\n var braceEnd = cne.notes.filter(function(n){ return n.braceEnd; }).length;\n // if we see another end brace before we get to a start brace, short circuit\n if(braceEnd) return -2;\n if(braceStart) return index;\n }\n return accum;\n },-1);\n // if the start brace was found, this line needs to end just before it:\n if(index > 0) {\n this.numNotationsOnLine = index;\n i = index + this.notationsStartIndex;\n }\n }\n\n // check if the prev elements want to be kept with this one\n for (j = i - 1; j > this.notationsStartIndex; j--) {\n var cne = notations[j];\n\n if (cne.keepWithNext === true || (j === i - 1 && curr.isDivider))\n this.numNotationsOnLine--;\n else\n break;\n }\n\n // we are at the end of the line!\n break;\n }\n\n curr.chantLine = this;\n this.numNotationsOnLine++;\n\n if (curr.isClef)\n ctxt.activeClef = curr;\n\n // line breaks are a special case indicating to stop processing here\n if (curr.constructor === ChantLineBreak && width > 0) {\n this.justify = curr.justify;\n break;\n }\n }\n\n // create the automatic custos at the end of the line if there are neumes left in the notations\n for (i = this.notationsStartIndex + this.numNotationsOnLine; i < notations.length; i++) {\n var notation = notations[i];\n\n if (notation.isNeume) {\n\n this.custos = new Custos(true);\n ctxt.currNotationIndex = i - 1; // make sure the context knows where the custos is \n this.custos.performLayout(ctxt);\n\n // Put the custos at the very end of the line\n this.custos.bounds.x = this.staffRight - this.custos.bounds.width - this.custos.leadingSpace;\n\n // nothing more to see here...\n break;\n }\n }\n\n // if the provided width is less than zero, then set the width of the line\n // based on the last notation\n var last = notations[this.notationsStartIndex + this.numNotationsOnLine - 1];\n if (width <= 0) {\n this.staffRight = last.bounds.right();\n this.justify = false;\n } else if (this.notationsStartIndex + this.numNotationsOnLine === notations.length) {\n // this is the last chant line.\n this.justify = true;\n this.justify = last.isDivider && ((this.staffRight - last.bounds.right()) / this.staffRight < .1);\n }\n \n // Justify the line if we need to\n if (this.justify === true)\n this.justifyElements();\n\n this.finishLayout(ctxt);\n }\n\n justifyElements() {\n\n var i;\n var toJustify = [];\n var notations = this.score.notations;\n var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\n // first step of justification is to determine how much space we have to use up\n var extraSpace = 0;\n\n if (this.numNotationsOnLine > 0) {\n var last = notations[lastIndex - 1], lastWithLyrics = null;\n\n for (i = lastIndex - 1; i >= this.notationsStartIndex; i--) {\n if (notations[i].hasLyrics()) {\n lastWithLyrics = notations[i];\n break;\n }\n }\n\n if (lastWithLyrics)\n extraSpace = this.staffRight - Math.max(lastWithLyrics.getAllLyricsRight(), last.bounds.right() + last.trailingSpace);\n else\n extraSpace = this.staffRight - (last.bounds.right() + last.trailingSpace); \n }\n\n if (this.custos)\n extraSpace -= this.custos.bounds.width + this.custos.leadingSpace;\n\n if (extraSpace <= 0)\n return;\n\n var prev = null, curr = null, prevWithLyrics = null;\n\n // first pass: determine the neumes we can space apart\n for (i = this.notationsStartIndex; i < lastIndex; i++) {\n\n if (curr !== null && curr.hasLyrics())\n prevWithLyrics = curr;\n\n prev = curr;\n curr = notations[i];\n\n if (prev !== null && prev.keepWithNext === true)\n continue;\n\n if (prevWithLyrics !== null && prevWithLyrics.lyrics[0].allowsConnector() && !prevWithLyrics.lyrics[0].needsConnector)\n continue;\n\n if (curr.constructor === ChantLineBreak)\n continue;\n\n // otherwise, we can add space before this element\n toJustify.push(curr);\n }\n\n if (toJustify.length === 0)\n return;\n\n var offset = 0;\n var increment = extraSpace / toJustify.length;\n var toJustifyIndex = 0;\n for (i = this.notationsStartIndex; i < lastIndex; i++) {\n\n curr = notations[i];\n\n if (toJustifyIndex < toJustify.length && toJustify[toJustifyIndex] === curr) {\n offset += increment;\n toJustifyIndex++;\n }\n\n curr.bounds.x += offset;\n }\n }\n\n finishLayout(ctxt) {\n\n this.ledgerLines = []; // clear any existing ledger lines\n\n var notations = this.score.notations;\n var lastIndex = this.notationsStartIndex + this.numNotationsOnLine;\n\n // an element needs to have a staffPosition property, as well as the standard\n // bounds property. so it could be a note, or it could be a custos\n // offsetX and offsetY can be used to add to the position info for the element,\n // useful in the case of notes.\n var processElementForLedgerLine = (element, offsetX = 0, offsetY = 0) => {\n\n // do we need a ledger line for this note?\n var staffPosition = element.staffPosition;\n\n if (staffPosition >= 5 || staffPosition <= -5) {\n\n var x1 = offsetX + element.bounds.x - ctxt.intraNeumeSpacing;\n var x2 = offsetX + element.bounds.x + element.bounds.width + ctxt.intraNeumeSpacing;\n\n // round the staffPosition to the nearest line\n if (staffPosition > 0)\n staffPosition = staffPosition - (staffPosition - 1) % 2;\n else\n staffPosition = staffPosition - (staffPosition + 1) % 2;\n\n // if we have a ledger line close by, then average out the distance between the two\n var minLedgerSeperation = ctxt.staffInterval * 5;\n\n if (this.ledgerLines.length > 0 &&\n this.ledgerLines[this.ledgerLines.length - 1].x2 + minLedgerSeperation >= x1) {\n\n // average out the distance\n var half = (x1 - this.ledgerLines[this.ledgerLines.length - 1].x2) / 2;\n this.ledgerLines[this.ledgerLines.length - 1].x2 += half;\n x1 -= half;\n }\n\n // never let a ledger line extend past the staff width\n if (x2 > this.staffRight)\n x2 = this.staffRight;\n\n // finally, add the ledger line\n this.ledgerLines.push({\n x1: x1,\n x2: x2,\n staffPosition: staffPosition\n });\n }\n };\n\n var epismata = []; // keep track of epismata in case we can connect some\n var startBrace = null, startBraceNotationIndex = 0;\n var minY = Number.MAX_VALUE, maxY = Number.MIN_VALUE; // for braces\n\n // make a final pass over all of the notes to add any necessary\n // ledger lines and to smooth out epismata\n for (var i = this.notationsStartIndex; i < lastIndex; i++) {\n\n minY = Math.min(minY, notations[i].bounds.y);\n maxY = Math.max(maxY, notations[i].bounds.bottom());\n\n if (notations[i].constructor === Custos) {\n processElementForLedgerLine(notations[i]);\n continue;\n }\n\n // if it's not a neume then just skip here\n if (!notations[i].isNeume)\n continue;\n\n var neume = notations[i];\n\n for (var j = 0; j < neume.notes.length; j++) {\n var k, note = neume.notes[j];\n\n processElementForLedgerLine(note, neume.bounds.x, neume.bounds.y);\n\n // blend epismata as we're able\n for (k = 0; k < note.epismata.length; k++) {\n\n var episema = note.epismata[k];\n\n var spaceBetweenEpismata = 0;\n\n // calculate the distance between the last epismata and this one...\n // lots of code for a simple: currEpismata.left - prevEpismata.right\n if (epismata.length > 0)\n spaceBetweenEpismata = neume.bounds.x + episema.bounds.x - (epismata[epismata.length - 1].note.neume.bounds.x + epismata[epismata.length - 1].bounds.right());\n\n // we try to blend the episema if we're able.\n if (epismata.length === 0 ||\n epismata[epismata.length - 1].positionHint !== episema.positionHint ||\n epismata[epismata.length - 1].terminating === true ||\n epismata[epismata.length - 1].alignment === HorizontalEpisemaAlignment.Left ||\n episema.alignment === HorizontalEpisemaAlignment.Right ||\n spaceBetweenEpismata > ctxt.intraNeumeSpacing * 2) {\n\n // start a new set of epismata to potentially blend\n epismata = [];\n epismata.push(episema);\n } else {\n // blend all previous with this one\n var newY;\n\n if (episema.positionHint === MarkingPositionHint.Below)\n newY = Math.max(episema.bounds.y, epismata[epismata.length - 1].bounds.y);\n else\n newY = Math.min(episema.bounds.y, epismata[epismata.length - 1].bounds.y);\n\n if (episema.bounds.y !== newY)\n episema.bounds.y = newY;\n else {\n for (var l = 0; l < epismata.length; l++)\n epismata[l].bounds.y = newY;\n }\n\n // extend the last episema to meet the new one\n var newWidth = (neume.bounds.x + episema.bounds.x) - (epismata[epismata.length - 1].note.neume.bounds.x + epismata[epismata.length - 1].bounds.x);\n epismata[epismata.length - 1].bounds.width = newWidth;\n\n epismata.push(episema);\n }\n }\n\n if (note.braceEnd) {\n\n // calculate the y value of the brace by iterating over all notations\n // under/over the brace.\n var y;\n var dy = ctxt.intraNeumeSpacing / 2; // some safe space between brace and notes.\n if (startBrace === null) {\n // fixme: this brace must have started on the previous line...what to do here, draw half a brace?\n } else {\n if (startBrace.isAbove) {\n y = ctxt.calculateHeightFromStaffPosition(4);\n for (k = startBraceNotationIndex; k <= i; k++)\n y = Math.min(y, notations[k].bounds.y - dy);\n } else {\n y = ctxt.calculateHeightFromStaffPosition(-4);\n for (k = startBraceNotationIndex; k <= i; k++)\n y = Math.max(y, notations[k].bounds.y + dy);\n }\n\n var addAcuteAccent = false;\n\n if (startBrace.shape === BraceShape.RoundBrace) {\n\n this.braces.push(new RoundBraceVisualizer(ctxt,\n startBrace.getAttachmentX(),\n note.braceEnd.getAttachmentX(),\n y,\n startBrace.isAbove));\n\n } else {\n\n if (startBrace.shape === BraceShape.AccentedCurlyBrace)\n addAcuteAccent = true;\n\n this.braces.push(new CurlyBraceVisualizer(ctxt,\n startBrace.getAttachmentX(),\n note.braceEnd.getAttachmentX(),\n y,\n startBrace.isAbove,\n addAcuteAccent));\n }\n }\n }\n\n if (note.braceStart) {\n startBrace = note.braceStart;\n startBraceNotationIndex = i;\n }\n\n // update the active brace y position if there is one\n if (startBrace !== null) {\n if (startBrace.isAbove)\n startBrace.bounds.y = Math.min(startBrace.bounds.y, note.bounds.y);\n else\n startBrace.bounds.y = Math.max(startBrace.bounds.y, note.bounds.bottom());\n }\n }\n }\n\n // if we still have an active brace, that means it spands two chant lines!\n if (startBrace !== null) {\n startBrace = startBrace;\n }\n\n // don't forget to also include the final custos, which may need a ledger line too\n if (this.custos)\n processElementForLedgerLine(this.custos);\n }\n\n\n // this is where the real core of positioning neumes takes place\n // returns true if positioning was able to fit the neume before rightNotationBoundary.\n // returns false if cannot fit before given right margin.\n // fixme: if this returns false, shouldn't we set the connectors on prev to be activated?!\n positionNotationElement(ctxt, prevWithLyrics, prev, curr, rightNotationBoundary) {\n\n var i;\n\n // To begin we just place the current notation right after the previous,\n // irrespective of lyrics.\n curr.bounds.x = prev.bounds.right() + prev.trailingSpace;\n\n // if the previous notation has no lyrics, then we simply make sure the\n // current notation with lyrics is in the bounds of the line\n if (prevWithLyrics === null) {\n\n var maxRight = curr.bounds.right() + curr.trailingSpace;\n\n // if the lyric left is negative, then offset the neume appropriately\n for (i = 0; i < curr.lyrics.length; i++) {\n\n curr.lyrics[i].setNeedsConnector(false); // we hope for the best!\n\n if (curr.getLyricLeft(i) < 0)\n curr.bounds.x += -curr.getLyricLeft(i);\n\n maxRight = Math.max(maxRight, curr.getLyricRight(i));\n }\n\n if (maxRight > rightNotationBoundary)\n return false;\n else\n return true;\n }\n\n // if the curr notation has no lyrics, then we force the prev notation\n // with lyrics to have syllable connectors.\n if (curr.hasLyrics() === false) {\n\n for (i = 0; i < prevWithLyrics.lyrics.length; i++) {\n\n if (prevWithLyrics.lyrics[i] !== null && prevWithLyrics.lyrics[i].allowsConnector())\n prevWithLyrics.lyrics[i].setNeedsConnector(true);\n }\n\n if (curr.bounds.right() + curr.trailingSpace < rightNotationBoundary)\n return true;\n else\n return false;\n }\n\n // if we have multiple lyrics on the current or the previous notation,\n // then we simplify the process. We don't try to eliminate syllable\n // connectors but we require them on every syllable in the previous\n // notation that permits a connector.\n //\n // A nice (but probably tricky) enhancement would be to combine lyrics\n // when possible, taking into consideration hyphenation of each syllable!\n var lyricCount = Math.max(prevWithLyrics.lyrics.length, curr.lyrics.length);\n\n if (lyricCount > 1) {\n\n var prevLyricRightMax = Number.MIN_VALUE;\n var currLyricLeftMin = Number.MAX_VALUE;\n var currLyricRightMax = Number.MIN_VALUE;\n\n for (i = 0; i < lyricCount; i++) {\n \n if (i < prevWithLyrics.lyrics.length && prevWithLyrics.lyrics[i] !== null) {\n\n var right = prevWithLyrics.getLyricRight(i);\n\n if (prevWithLyrics.lyrics[i].allowsConnector()) {\n prevWithLyrics.lyrics[i].setNeedsConnector(true);\n right += prevWithLyrics.lyrics[i].widthWithConnector - prevWithLyrics.lyrics[i].widthWithoutConnector;\n } else\n right += ctxt.minLyricWordSpacing;\n\n prevLyricRightMax = Math.max(prevLyricRightMax, right);\n }\n\n if (i < curr.lyrics.length && curr.lyrics[i] !== null) {\n currLyricLeftMin = Math.min(currLyricLeftMin, curr.getLyricLeft(i));\n currLyricRightMax = Math.max(currLyricRightMax, curr.getLyricRight(i));\n }\n }\n \n // if the lyrics overlap, then we need to shift over the current element a bit\n if (prevLyricRightMax > currLyricLeftMin) {\n curr.bounds.x += prevLyricRightMax - currLyricLeftMin;\n currLyricRightMax += prevLyricRightMax - currLyricLeftMin;\n }\n\n if (curr.bounds.right() < rightNotationBoundary && currLyricRightMax <= this.staffRight)\n return true;\n else {\n curr.bounds.x = 0 ;\n return false;\n }\n }\n \n // handling single lyric lines is a little more nuanced, since we carefully\n // eliminate syllable connectors when we're able...\n curr.lyrics[0].setNeedsConnector(false); // we hope for the best!\n\n var currLyricLeft = curr.getLyricLeft(0);\n var prevLyricRight = prevWithLyrics.getLyricRight(0);\n\n if (prevWithLyrics.lyrics[0].allowsConnector() === false) {\n\n // No connector needed, but include space between words if necessary!\n if (prevLyricRight + ctxt.minLyricWordSpacing > currLyricLeft) {\n // push the current element over a bit.\n curr.bounds.x += prevLyricRight + ctxt.minLyricWordSpacing - currLyricLeft;\n }\n\n } else {\n\n // we may need a connector yet...\n\n if (prevLyricRight > currLyricLeft) {\n // in this case, the lyric elements actually overlap.\n // so nope, no connector needed. instead, we just place the lyrics together\n // fixme: for better text layout, we could actually use the kerning values\n // between the prev and curr lyric elements!\n curr.bounds.x += prevLyricRight - currLyricLeft;\n\n } else {\n\n // bummer, looks like we couldn't merge the syllables together. Better add a connector...\n prevWithLyrics.lyrics[0].setNeedsConnector(true);\n prevLyricRight = prevWithLyrics.getLyricRight(0);\n\n if (prevLyricRight > currLyricLeft)\n curr.bounds.x += prevLyricRight - currLyricLeft;\n }\n }\n\n if (curr.bounds.right() + curr.trailingSpace < rightNotationBoundary &&\n curr.getLyricRight(0) <= this.staffRight)\n return true;\n\n // if we made it this far, then the element won't fit on this line.\n // set the position of the current element to the beginning of a chant line,\n // and mark the previous lyric as connecting if needed.\n // curr.bounds.x = this.startingClef.bounds.right();\n\n if (prevWithLyrics.hasLyrics() && prevWithLyrics.lyrics[0].allowsConnector())\n prevWithLyrics.lyrics[0].setNeedsConnector(true);\n\n return false;\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Chant.ChantLine.js\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport * as Exsurge from 'Exsurge.Core'\nimport { GlyphCode, GlyphVisualizer, DividerLineVisualizer, ChantNotationElement } from 'Exsurge.Drawing'\n\n/*\n *\n */\nexport class Custos extends ChantNotationElement {\n\n // if auto is true, then the custos will automatically try to determine it's height based on\n // subsequent notations\n constructor(auto = false) {\n super();\n this.auto = auto;\n this.staffPosition = 0; // default sane value\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var glyphCode;\n\n if (this.auto) {\n\n var neume = ctxt.findNextNeume();\n\n if (neume)\n this.staffPosition = ctxt.activeClef.pitchToStaffPosition(neume.notes[0].pitch);\n }\n\n var glyph = new GlyphVisualizer(ctxt, Custos.getGlyphCode(this.staffPosition));\n glyph.setStaffPosition(ctxt, this.staffPosition);\n this.addVisualizer(glyph);\n\n this.finishLayout(ctxt);\n }\n\n // called when layout has changed and our dependencies are no longer good\n resetDependencies() {\n\n // we only need to resolve new dependencies if we're an automatic custos\n if (this.auto)\n this.needsLayout = true;\n }\n\n static getGlyphCode(staffPosition) {\n\n if (staffPosition <= 2) {\n\n // ascending custodes\n if (Math.abs(staffPosition) % 2 === 1)\n return GlyphCode.CustosLong;\n else\n return GlyphCode.CustosShort;\n } else {\n\n // descending custodes\n if (Math.abs(staffPosition) % 2 === 1)\n return GlyphCode.CustosDescLong;\n else\n return GlyphCode.CustosDescShort;\n }\n }\n}\n\n/*\n * Divider\n */\nexport class Divider extends ChantNotationElement {\n\n constructor() {\n super();\n\n this.isDivider = true;\n this.resetsAccidentals = true;\n }\n}\n\n/*\n * QuarterBar\n */\nexport class QuarterBar extends Divider {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n this.addVisualizer(new DividerLineVisualizer(ctxt, 2, 4));\n\n this.origin.x = this.bounds.width / 2;\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * HalfBar\n */\nexport class HalfBar extends Divider {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.addVisualizer(new DividerLineVisualizer(ctxt, -2, 2));\n\n this.origin.x = this.bounds.width / 2;\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * FullBar\n */\nexport class FullBar extends Divider {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n \n this.addVisualizer(new DividerLineVisualizer(ctxt, -3, 3));\n\n this.origin.x = this.bounds.width / 2;\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * DoubleBar\n */\nexport class DoubleBar extends Divider {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var line0 = new DividerLineVisualizer(ctxt, -3, 3);\n line0.bounds.x = 0;\n this.addVisualizer(line0);\n\n var line1 = new DividerLineVisualizer(ctxt, -3, 3);\n line1.bounds.x = ctxt.intraNeumeSpacing * 2;\n this.addVisualizer(line1);\n\n this.origin.x = this.bounds.width / 2;\n\n this.finishLayout(ctxt);\n }\n}\n\nexport const AccidentalType = {\n Flat: -1,\n Natural: 0,\n Sharp: 1\n};\n\n/*\n * Accidental\n */\nexport class Accidental extends ChantNotationElement {\n\n constructor(staffPosition, accidentalType) {\n super();\n this.isAccidental = true;\n this.keepWithNext = true; // accidentals should always stay connected...\n \n this.staffPosition = staffPosition;\n this.accidentalType = accidentalType;\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.addVisualizer(this.createGlyphVisualizer(ctxt));\n\n this.finishLayout(ctxt);\n }\n\n // creation of the glyph visualizer is refactored out or performLayout\n // so that clefs can use the same logic for their accidental glyph\n createGlyphVisualizer(ctxt) {\n\n var glyphCode = GlyphCode.Flat;\n\n switch (this.accidentalType) {\n case AccidentalType.Natural:\n glyphCode = GlyphCode.Natural;\n break;\n case AccidentalType.Sharp:\n glyphCode = GlyphCode.Sharp;\n break;\n default:\n glyphCode = GlyphCode.Flat;\n break;\n }\n\n var glyph = new GlyphVisualizer(ctxt, glyphCode);\n glyph.setStaffPosition(ctxt, this.staffPosition);\n\n return glyph;\n }\n\n adjustStep(step) {\n switch (this.accidentalType) {\n case AccidentalType.Flat:\n if (step === Step.Ti) return Step.Te;\n if (step === Step.Mi) return Step.Me;\n break;\n case AccidentalType.Sharp:\n if (step === Step.Do) return Step.Du;\n if (step === Step.Fa) return Step.Fu;\n break;\n case AccidentalType.Natural:\n if (step === Step.Te) return Step.Ti;\n if (step === Step.Me) return Step.Mi;\n if (step === Step.Du) return Step.Do;\n if (step === Step.Fu) return Step.Fa;\n break;\n }\n\n // no adjustment needed\n return step;\n }\n\n applyToPitch(pitch) {\n\n // fixme: this is broken since we changed to staff positions\n\n // no adjusment needed\n if (this.octave !== pitch.octave)\n return;\n\n pitch.step = this.adjustStep(pitch.step);\n }\n}\n\n/*\n * Virgula\n */\nexport class Virgula extends Divider {\n\n constructor() {\n super();\n\n // unlike other dividers a virgula does not reset accidentals\n this.resetsAccidentals = false;\n\n // the staff position of the virgula is customizable, so that it\n // can be placed on different lines (top or bottom) depending on the\n // notation tradition of what is being notated (e.g., Benedictine has it\n // on top line, Norbertine at the bottom)\n this.staffPosition = 3;\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var glyph = new GlyphVisualizer(ctxt, GlyphCode.Virgula);\n glyph.setStaffPosition(ctxt, this.staffPosition);\n\n this.addVisualizer(glyph);\n\n this.origin.x = this.bounds.width / 2;\n\n this.finishLayout(ctxt);\n }\n}\n\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Chant.Signs.js\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport * as Exsurge from 'Exsurge.Core'\nimport { QuickSvg, ChantLayoutElement, GlyphCode, GlyphVisualizer } from 'Exsurge.Drawing'\nimport { Note, NoteShape } from 'Exsurge.Chant'\n\n\n// for positioning markings on notes\nexport var MarkingPositionHint = {\n Default: 0,\n Above: 1,\n Below: 2\n};\n\nexport class AcuteAccent extends GlyphVisualizer {\n\n constructor(ctxt, note) {\n super(ctxt, GlyphCode.AcuteAccent);\n this.note = note;\n this.positionHint = MarkingPositionHint.Above;\n }\n\n performLayout(ctxt) {\n\n this.bounds.x += this.bounds.width / 2; // center on the note itself\n\n // this puts the acute accent either over the staff lines, or over the note if the\n // note is above the staff lines\n this.setStaffPosition(ctxt, Math.max(this.note.staffPosition + 1, 4));\n }\n}\n\n// for positioning markings on notes\nexport var HorizontalEpisemaAlignment = {\n Default: 0,\n Left: 1,\n Center: 2,\n Right: 3\n};\n\n\n/*\n * HorizontalEpisema\n *\n * A horizontal episema marking is it's own visualizer (that is, it implements createSvgFragment)\n */\nexport class HorizontalEpisema extends ChantLayoutElement {\n\n constructor(note) {\n super();\n\n this.note = note;\n \n this.positionHint = MarkingPositionHint.Default;\n this.terminating = false; // indicates if this episema should terminate itself or not\n this.alignment = HorizontalEpisemaAlignment.Default;\n }\n\n performLayout(ctxt) {\n\n // following logic helps to keep the episemae away from staff lines if they get too close\n // the placement is based on a review of the Vatican and solesmes editions, which\n // seem to always place the epismata centered between staff lines. Probably helps\n // for visual layout, rather than letting epismata be at various heights.\n\n var y = 0, step;\n var minDistanceAway = ctxt.staffInterval * 0.4; // min distance from neume\n\n if (this.positionHint === MarkingPositionHint.Below) {\n y = this.note.bounds.bottom() + minDistanceAway; // the highest the line could be at\n step = Math.floor(y / ctxt.staffInterval);\n\n // if it's an odd step, that means we're on a staff line,\n // so we shift to between the staff line\n if (Math.abs(step % 2) === 1)\n step = step + 1;\n } else {\n y = this.note.bounds.y - minDistanceAway; // the lowest the line could be at\n step = Math.ceil(y / ctxt.staffInterval);\n\n // if it's an odd step, that means we're on a staff line,\n // so we shift to between the staff line\n if (Math.abs(step % 2) === 1)\n step = step - 1;\n }\n\n y = step * ctxt.staffInterval;\n\n var glyphCode = this.note.glyphVisualizer.glyphCode;\n var width;\n\n // The porrectus requires special handling of the note width,\n // otherwise the width is just that of the note itself\n if (glyphCode === GlyphCode.Porrectus1 ||\n glyphCode === GlyphCode.Porrectus2 ||\n glyphCode === GlyphCode.Porrectus3 ||\n glyphCode === GlyphCode.Porrectus4)\n width = ctxt.staffInterval;\n else\n width = this.note.bounds.width;\n\n var x = this.note.bounds.x;\n\n // also, the position hint can affect the x/width of the episema\n if (this.alignment === HorizontalEpisemaAlignment.Left) {\n width *= .80;\n } else if (this.alignment === HorizontalEpisemaAlignment.Center) {\n x += width * .20;\n width *= .60;\n } else if (this.alignment === HorizontalEpisemaAlignment.Right) {\n x += width * .20;\n width *= .80;\n }\n\n this.bounds.x = x;\n this.bounds.y = y;\n this.bounds.width = width;\n this.bounds.height = ctxt.episemaLineWeight;\n\n this.origin.x = 0;\n this.origin.y = 0;\n }\n\n createSvgFragment(ctxt) {\n\n return QuickSvg.createFragment('rect', {\n 'x': this.bounds.x,\n 'y': this.bounds.y,\n 'width': this.bounds.width,\n 'height': this.bounds.height,\n 'fill': ctxt.neumeLineColor,\n 'class': 'horizontalEpisema'\n });\n }\n}\n\n/*\n * Ictus\n */\nexport class Ictus extends GlyphVisualizer {\n\n constructor(ctxt, note) {\n super(ctxt, GlyphCode.VerticalEpisemaAbove);\n this.note = note;\n this.positionHint = MarkingPositionHint.Default;\n }\n\n performLayout(ctxt) {\n\n var glyphCode;\n\n // fixme: this positioning logic doesn't work for the ictus on a virga apparently...?\n\n if (this.positionHint === MarkingPositionHint.Above) {\n glyphCode = GlyphCode.VerticalEpisemaAbove;\n } else {\n glyphCode = GlyphCode.VerticalEpisemaBelow;\n }\n\n var staffPosition = this.note.staffPosition;\n \n var horizontalOffset = this.note.bounds.width / 2;\n var verticalOffset = 0;\n\n switch (glyphCode) {\n case GlyphCode.VerticalEpisemaAbove:\n if (staffPosition % 2 === 0)\n verticalOffset -= ctxt.staffInterval * 1.5;\n else\n verticalOffset -= ctxt.staffInterval * .9;\n break;\n\n case GlyphCode.VerticalEpisemaBelow:\n default:\n if (staffPosition % 2 === 0)\n verticalOffset += ctxt.staffInterval * 1.5;\n else\n verticalOffset += ctxt.staffInterval * .8;\n break;\n }\n\n this.setGlyph(ctxt, glyphCode);\n this.setStaffPosition(ctxt, staffPosition);\n\n this.bounds.x = this.note.bounds.x + horizontalOffset - this.origin.x;\n this.bounds.y += verticalOffset;\n }\n}\n\n/*\n * Mora\n */\nexport class Mora extends GlyphVisualizer {\n\n constructor(ctxt, note) {\n super(ctxt, GlyphCode.Mora);\n this.note = note;\n this.positionHint = MarkingPositionHint.Default;\n }\n\n performLayout(ctxt) {\n\n var staffPosition = this.note.staffPosition;\n\n this.setStaffPosition(ctxt, staffPosition);\n\n var verticalOffset = 0;\n if (this.positionHint === MarkingPositionHint.Above) {\n if (staffPosition % 2 === 0)\n verticalOffset -= ctxt.staffInterval + ctxt.staffInterval * .75;\n else\n verticalOffset -= ctxt.staffInterval * .75;\n } else if (this.positionHint === MarkingPositionHint.Below) {\n if (staffPosition % 2 === 0)\n verticalOffset += ctxt.staffInterval + ctxt.staffInterval * .75;\n else\n verticalOffset += ctxt.staffInterval * .75;\n } else {\n if (Math.abs(staffPosition) % 2 === 1)\n verticalOffset -= ctxt.staffInterval * .75;\n }\n\n this.bounds.x += this.note.bounds.right() + ctxt.staffInterval / 4.0;\n this.bounds.y += verticalOffset;\n }\n}\n\n// indicates the shape of the brace\nexport var BraceShape = {\n RoundBrace: 0,\n CurlyBrace: 1,\n AccentedCurlyBrace: 2\n};\n\n// indicates how the brace is alignerd to the note to which it's connected\nexport var BraceAttachment = {\n Left: 0,\n Right: 1\n};\n\n\nexport class BracePoint extends ChantLayoutElement {\n\n constructor(note, isAbove, shape, attachment) {\n super();\n\n this.note = note;\n this.isAbove = isAbove;\n this.shape = shape;\n this.attachment = attachment;\n }\n\n getAttachmentX() {\n if (this.attachment === BraceAttachment.Left)\n return this.note.neume.bounds.x + this.note.bounds.x;\n else\n return this.note.neume.bounds.x + this.note.bounds.right();\n }\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Chant.Markings.js\n **/","\n//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { Units, Pitch, Point, Rect, Margins, Size, Step } from 'Exsurge.Core'\nimport { LyricType, Lyric } from 'Exsurge.Drawing'\nimport { Note, LiquescentType, NoteShape, NoteShapeModifiers, ChantMapping, ChantScore, ChantDocument, Clef, DoClef, FaClef, TextOnly, ChantLineBreak } from 'Exsurge.Chant'\nimport * as Markings from 'Exsurge.Chant.Markings'\nimport * as Signs from 'Exsurge.Chant.Signs'\nimport * as Neumes from 'Exsurge.Chant.Neumes'\n\n// reusable reg exps\nvar __syllablesRegex = /(?=.)((?:[^(])*)(?:\\(?([^)]*)\\)?)?/g;\nvar __notationsRegex = /z0|z|Z|::|:|;|,|`|c1|c2|c3|c4|f3|f4|cb3|cb4|\\/\\/|\\/| |\\!|-?[a-mA-M][oOwWvVrRsxy#~\\+><_\\.'012345]*(?:\\[[^\\]]*\\]?)*/g;\n\n// for the brace string inside of [ and ] in notation data\n// the capturing groups are:\n// 1. o or u, to indicate over or under\n// 2. b, cb, or cba, to indicate the brace type\n// 3. 0 or 1 to indicate the attachment point\n// 4. {}( or ) to indicate opening/closing (this group will be null if the metric version is used)\n// 5. a float indicating the millimeter length of the brace (not supported yet)\nvar __braceSpecRegex = /([ou])(b|cb|cba):([01])(?:([{}])|;(\\d*(?:\\.\\d+)?)mm)/;\n\nexport class Gabc {\n\n // takes gabc source code (without the header info) and returns an array\n // of ChantMappings describing the chant. A chant score can then be created\n // fron the chant mappings and later updated via updateMappings() if need\n // be...\n static createMappingsFromSource(ctxt, gabcSource) {\n\n var words = this.splitWords(gabcSource);\n\n // set the default clef\n ctxt.activeClef = Clef.default();\n \n var mappings = this.createMappingsFromWords(ctxt, words, (clef) => ctxt.activeClef = clef);\n\n // always set the last notation to have a trailingSpace of 0. This makes layout for the last chant line simpler\n if (mappings.length > 0 && mappings[mappings.length - 1].notations.length > 0)\n mappings[mappings.length - 1].notations[mappings[mappings.length - 1].notations.length - 1].trailingSpace = 0;\n\n return mappings;\n }\n\n\n // A simple general purpose diff algorithm adapted here for comparing\n // an array of existing mappings with an updated list of gabc words.\n // note before is an array of mappings, and after is an array of strings\n // (gabc words).\n //\n // This is definitely not the most effecient diff algorithm, but for our\n // limited needs and source size it seems to work just fine...\n //\n // code is adapted from: https://github.com/paulgb/simplediff\n //\n // Returns:\n // A list of pairs, with the first part of the pair being one of three\n // strings ('-', '+', '=') and the second part being a list of values from\n // the original before and/or after lists. The first part of the pair\n // corresponds to whether the list of values is a deletion, insertion, or\n // unchanged, respectively.\n static diffDescriptorsAndNewWords(before, after) {\n\n // Create a map from before values to their indices\n var oldIndexMap = {}, i;\n for (i = 0; i < before.length; i ++) {\n oldIndexMap[before[i].source] = oldIndexMap[before[i].source] || [];\n oldIndexMap[before[i].source].push(i);\n }\n\n var overlap = [], startOld, startNew, subLength, inew;\n\n startOld = startNew = subLength = 0;\n\n for (inew = 0; inew < after.length; inew++) {\n var _overlap = [];\n oldIndexMap[after[inew]] = oldIndexMap[after[inew]] || [];\n for (i = 0; i < oldIndexMap[after[inew]].length; i++) {\n var iold = oldIndexMap[after[inew]][i];\n // now we are considering all values of val such that\n // `before[iold] == after[inew]`\n _overlap[iold] = ((iold && overlap[iold-1]) || 0) + 1;\n if (_overlap[iold] > subLength) {\n // this is the largest substring seen so far, so store its indices\n subLength = _overlap[iold];\n startOld = iold - subLength + 1;\n startNew = inew - subLength + 1;\n }\n }\n overlap = _overlap;\n }\n\n if (subLength === 0) {\n // If no common substring is found, we return an insert and delete...\n var result = [];\n\n if (before.length)\n result.push(['-', before]);\n \n if (after.length)\n result.push(['+', after]);\n\n return result;\n }\n\n // ...otherwise, the common substring is unchanged and we recursively\n // diff the text before and after that substring\n return [].concat(\n this.diffDescriptorsAndNewWords(before.slice(0, startOld), after.slice(0, startNew)),\n [['=', after.slice(startNew, startNew + subLength)]],\n this.diffDescriptorsAndNewWords(before.slice(startOld + subLength), after.slice(startNew + subLength))\n );\n }\n\n // this function essentially performs and applies a rudimentary diff between a\n // previously parsed set of mappings and between a new gabc source text.\n // the mappings array passed in is changed in place to be updated from the\n // new source\n static updateMappingsFromSource(ctxt, mappings, newGabcSource) {\n\n // always remove the last old mapping since it's spacing/trailingSpace is handled specially\n mappings.pop();\n\n var newWords = this.splitWords(newGabcSource);\n\n var results = this.diffDescriptorsAndNewWords(mappings, newWords);\n\n var index = 0, j, k;\n\n ctxt.activeClef = Clef.default();\n\n // apply the results to the mappings, marking notations that need to be processed\n for (var i = 0; i < results.length; i++) {\n\n var resultCode = results[i][0];\n var resultValues = results[i][1];\n\n if (resultCode === '=') {\n // skip over ones that haven't changed, but updating the clef as we go\n for (j = 0; j < resultValues.length; j++, index++) {\n for (k = 0; k < mappings[index].notations.length; k++) {\n // notify the notation that its dependencies are no longer valid\n mappings[index].notations[k].resetDependencies();\n\n if (mappings[index].notations[k].isClef)\n ctxt.activeClef = mappings[index].notations[k];\n }\n }\n\n } else if (resultCode === '-') {\n // delete elements that no longer exist, but first notify all\n // elements of the change\n mappings.splice(index, resultValues.length);\n\n } else if (resultCode === '+') {\n // insert new ones\n for (j = 0; j < resultValues.length; j++) {\n var mapping = this.createMappingFromWord(ctxt, resultValues[j]);\n\n for (k = 0; k < mapping.notations.length; k++)\n if (mapping.notations[k].isClef)\n ctxt.activeClef = mapping.notations[k];\n\n mappings.splice(index++, 0, mapping);\n }\n }\n }\n\n // always set the last notation to have a trailingSpace of 0. This makes layout for the last chant line simpler\n if (mappings.length > 0 && mappings[mappings.length - 1].notations.length > 0)\n mappings[mappings.length - 1].notations[mappings[mappings.length - 1].notations.length - 1].trailingSpace = 0;\n }\n\n // takes an array of gabc words (like that returned by splitWords below)\n // and returns an array of ChantMapping objects, one for each word.\n static createMappingsFromWords(ctxt, words) {\n var mappings = [];\n\n for (var i = 0; i < words.length; i++) {\n var word = words[i].trim();\n\n if (word === '')\n continue;\n\n var mapping = this.createMappingFromWord(ctxt, word);\n\n if (mapping)\n mappings.push(mapping);\n }\n\n return mappings;\n }\n\n // takes a gabc word (like those returned by splitWords below) and returns\n // a ChantMapping object that contains the gabc word source text as well\n // as the generated notations.\n static createMappingFromWord(ctxt, word) {\n\n var matches = [];\n var notations = [];\n var currSyllable = 0;\n \n while ((match = __syllablesRegex.exec(word)))\n matches.push(match);\n\n for (var j = 0; j < matches.length; j++) {\n var match = matches[j];\n\n var lyricText = match[1].trim();\n var notationData = match[2];\n\n var items = this.parseNotations(ctxt, notationData);\n\n if (items.length === 0)\n continue;\n\n notations = notations.concat(items);\n\n if (lyricText === '')\n continue;\n\n // add the lyrics to the first notation that makes sense...\n var notationWithLyrics = null;\n for (var i = 0; i < items.length; i++) {\n var cne = items[i];\n\n if (cne.isAccidental || cne.constructor === Signs.Custos)\n continue;\n\n notationWithLyrics = cne\n break;\n }\n\n if (notationWithLyrics === null)\n return notations;\n \n var proposedLyricType;\n \n // if it's not a neume or a TextOnly notation, then make the lyrics a directive\n if (!cne.isNeume && cne.constructor !== TextOnly)\n proposedLyricType = LyricType.Directive;\n // otherwise trye to guess the lyricType for the first lyric anyway\n else if (currSyllable === 0 && j === (matches.length - 1))\n proposedLyricType = LyricType.SingleSyllable;\n else if (currSyllable === 0 && j < (matches.length - 1))\n proposedLyricType = LyricType.BeginningSyllable;\n else if (j === matches.length - 1)\n proposedLyricType = LyricType.EndingSyllable;\n else\n proposedLyricType = LyricType.MiddleSyllable;\n\n currSyllable++;\n\n // also, new words reset the accidentals, per the Solesmes style (see LU xviij)\n if (proposedLyricType === LyricType.BeginningSyllable ||\n proposedLyricType === LyricType.SingleSyllable)\n ctxt.activeClef.resetAccidentals();\n\n var lyrics = this.createSyllableLyrics(ctxt, lyricText, proposedLyricType);\n\n if (lyrics === null || lyrics.length === 0)\n continue;\n\n notationWithLyrics.lyrics = lyrics;\n }\n\n return new ChantMapping(word, notations);\n }\n\n // returns an array of lyrics (an array because each syllable can have multiple lyrics)\n static createSyllableLyrics(ctxt, text, proposedLyricType) {\n\n var lyrics = [];\n\n // an extension to gabc: multiple lyrics per syllable can be separated by a |\n var lyricTexts = text.split('|');\n\n for (var i = 0; i < lyricTexts.length; i++) {\n\n var lyricText = lyricTexts[i];\n\n // gabc allows lyrics to indicate the centering part of the text by\n // using braces to indicate how to center the lyric. So a lyric can\n // look like \"f{i}re\" or \"{fenced}\" to center on the i or on the entire\n // word, respectively. Here we determine if the lyric should be spaced\n // manually with this method of using braces.\n var centerStartIndex = lyricText.indexOf('{');\n var centerLength = 0;\n\n if (centerStartIndex >= 0) {\n var indexClosingBracket = lyricText.indexOf('}');\n\n if (indexClosingBracket >= 0 && indexClosingBracket > centerStartIndex) {\n centerLength = indexClosingBracket - centerStartIndex - 1;\n\n // strip out the brackets...is this better than string.replace?\n lyricText = lyricText.substring(0, centerStartIndex) +\n lyricText.substring(centerStartIndex + 1, indexClosingBracket) + \n lyricText.substring(indexClosingBracket + 1, lyricText.length);\n } else\n centerStartIndex = -1; // if there's no closing bracket, don't enable centering\n }\n\n var lyric = this.makeLyric(ctxt, lyricText, proposedLyricType);\n\n // if we have manual lyric centering, then set it now\n if (centerStartIndex >= 0) {\n lyric.centerStartIndex = centerStartIndex;\n lyric.centerLength = centerLength;\n }\n\n lyrics.push(lyric);\n }\n\n return lyrics;\n }\n\n static makeLyric(ctxt, text, lyricType) {\n\n if (text.length > 1 && text[text.length - 1] === '-') {\n if (lyricType === LyricType.EndingSyllable)\n lyricType = LyricType.MiddleSyllable;\n else if (lyricType === LyricType.SingleSyllable)\n lyricType = LyricType.BeginningSyllable;\n\n text = text.substring(0, text.length - 1);\n }\n\n var elides = false;\n if (text.length > 1 && text[text.length - 1] === '_') {\n // must be an elision\n elides = true;\n text = text.substring(0, text.length - 1);\n }\n\n if (text === \"*\" || text === \"†\")\n lyricType = LyricType.Directive;\n\n var lyric = new Lyric(ctxt, text, lyricType);\n lyric.elidesToNext = elides;\n\n return lyric;\n }\n\n // takes a string of gabc notations and creates exsurge objects out of them.\n // returns an array of notations.\n static parseNotations(ctxt, data) {\n\n // if there is no data, then this must be a text only object\n if (!data)\n return [new TextOnly()];\n\n var notations = [];\n var notes = [];\n var trailingSpace = -1;\n\n var addNotation = (notation) => {\n\n // first, if we have any notes left over, we create a neume out of them\n if (notes.length > 0) {\n\n // create neume(s)\n var neumes = this.createNeumesFromNotes(ctxt, notes, trailingSpace);\n for (var i = 0; i < neumes.length; i++)\n notations.push(neumes[i]);\n\n // reset the trailing space\n trailingSpace = -1;\n\n notes = [];\n }\n\n // then, if we're passed a notation, let's add it\n // also, perform chant logic here\n if (notation !== null) {\n\n if (notation.isClef) {\n ctxt.activeClef = notation;\n } else if (notation.isAccidental)\n ctxt.activeClef.activeAccidental = notation;\n else if (notation.resetsAccidentals)\n ctxt.activeClef.resetAccidentals();\n\n notations.push(notation);\n }\n };\n\n var atoms = data.match(__notationsRegex);\n\n if (atoms === null)\n return notations;\n\n for (var i = 0; i < atoms.length; i++) {\n\n var atom = atoms[i];\n\n // handle the clefs and dividers here\n switch (atom) {\n case \",\":\n addNotation(new Signs.QuarterBar());\n break;\n case \"`\":\n addNotation(new Signs.Virgula());\n break;\n case \";\":\n addNotation(new Signs.HalfBar());\n break;\n case \":\":\n addNotation(new Signs.FullBar());\n break;\n case \"::\":\n addNotation(new Signs.DoubleBar());\n break;\n // other gregorio dividers are not supported yet\n\n case \"c1\":\n addNotation(ctxt.activeClef = new DoClef(-3, 2));\n break;\n\n case \"c2\":\n addNotation(ctxt.activeClef = new DoClef(-1, 2));\n break;\n\n case \"c3\":\n addNotation(ctxt.activeClef = new DoClef(1, 2));\n break;\n\n case \"c4\":\n addNotation(ctxt.activeClef = new DoClef(3, 2));\n break;\n\n case \"f3\":\n addNotation(ctxt.activeClef = new FaClef(1, 2));\n break;\n\n case \"f4\":\n addNotation(ctxt.activeClef = new FaClef(3, 2));\n break;\n\n case \"cb3\":\n addNotation(ctxt.activeClef = new DoClef(1, 2, new Signs.Accidental(0, Signs.AccidentalType.Flat)));\n break;\n\n case \"cb4\":\n addNotation(ctxt.activeClef = new DoClef(3, 2, new Signs.Accidental(2, Signs.AccidentalType.Flat)));\n break;\n\n case \"z\":\n addNotation(new ChantLineBreak(true));\n break;\n case \"Z\":\n addNotation(new ChantLineBreak(false));\n break;\n case \"z0\":\n addNotation(new Signs.Custos(true));\n break;\n\n // spacing indicators\n case \"!\":\n trailingSpace = 0;\n addNotation(null);\n break;\n case \"/\":\n trailingSpace = ctxt.intraNeumeSpacing;\n addNotation(null);\n break;\n case \"//\":\n trailingSpace = ctxt.intraNeumeSpacing * 2;\n addNotation(null);\n break;\n case ' ':\n // fixme: is this correct? logically what is the difference in gabc\n // between putting a space between notes vs putting '//' between notes?\n trailingSpace = ctxt.intraNeumeSpacing * 2;\n addNotation(null);\n break;\n\n\n default:\n // might be a custos, might be an accidental, or might be a note\n if (atom.length > 1 && atom[1] === '+') {\n // custos\n var custos = new Signs.Custos();\n\n custos.staffPosition = this.gabcHeightToExsurgeHeight(data[0]);\n\n addNotation(custos);\n\n } else if (atom.length > 1 && (atom[1] === 'x' || atom[1] === 'y' || atom[1] === '#')) {\n\n var accidentalType;\n\n switch (atom[1]) {\n case 'y':\n accidentalType = Signs.AccidentalType.Natural;\n break;\n case '#':\n accidentalType = Signs.AccidentalType.Sharp;\n break;\n default:\n accidentalType = Signs.AccidentalType.Flat;\n break;\n }\n\n var noteArray = [];\n this.createNoteFromData(ctxt, ctxt.activeClef, atom, noteArray);\n var accidental = new Signs.Accidental(noteArray[0].staffPosition, accidentalType);\n accidental.trailingSpace = ctxt.intraNeumeSpacing * 2;\n\n ctxt.activeClef.activeAccidental = accidental;\n \n addNotation(accidental);\n } else {\n\n // looks like it's a note\n this.createNoteFromData(ctxt, ctxt.activeClef, atom, notes);\n }\n break;\n }\n }\n\n // finish up any remaining notes we have left\n addNotation(null);\n\n return notations;\n }\n\n static createNeumesFromNotes(ctxt, notes, finalTrailingSpace) {\n \n var neumes = [];\n var firstNoteIndex = 0;\n var currNoteIndex = 0;\n\n // here we use a simple finite state machine to create the neumes from the notes\n // createNeume is helper function which returns the next state after a neume is created\n // (unknownState). Each state object has a neume() function and a handle() function.\n // neume() allows us to create the neume of the state in the event that we run out\n // of notes. handle() gives the state an opportunity to examine the currNote and\n // determine what to do...either transition to a different neume/state, or\n // continue building the neume of that state. handle() returns the next state\n\n var createNeume = function (neume, includeCurrNote, includePrevNote = true) {\n\n // add the notes to the neume\n var lastNoteIndex;\n if (includeCurrNote)\n lastNoteIndex = currNoteIndex;\n else if (includePrevNote)\n lastNoteIndex = currNoteIndex - 1;\n else\n lastNoteIndex = currNoteIndex - 2;\n\n if (lastNoteIndex < 0)\n return;\n\n while (firstNoteIndex <= lastNoteIndex)\n neume.addNote(notes[firstNoteIndex++]);\n\n neumes.push(neume);\n\n if (includeCurrNote === false) {\n currNoteIndex--;\n\n if (includePrevNote === false)\n currNoteIndex--;\n\n neume.keepWithNext = true;\n neume.trailingSpace = ctxt.intraNeumeSpacing;\n }\n\n return unknownState;\n };\n\n var unknownState = {\n neume: function() {\n return new Neumes.Punctum();\n },\n handle: function(currNote, prevNote) {\n\n if (currNote.shape === NoteShape.Virga)\n return virgaState;\n else if (currNote.shape === NoteShape.Stropha)\n return apostrophaState;\n else if (currNote.shape === NoteShape.Oriscus)\n return oriscusState;\n else if (currNote.shape === NoteShape.Inclinatum)\n return punctaInclinataState;\n else if (currNote.shapeModifiers & NoteShapeModifiers.Cavum)\n return createNeume(new Neumes.Punctum(), true);\n else\n return punctumState;\n }\n };\n\n var punctumState = {\n neume: function() {\n return new Neumes.Punctum();\n },\n handle: function(currNote, prevNote) {\n \n if (currNote.staffPosition > prevNote.staffPosition)\n return podatusState;\n else if (currNote.staffPosition < prevNote.staffPosition) {\n if (currNote.shape === NoteShape.Inclinatum)\n return climacusState;\n else\n return clivisState;\n } else\n return distrophaState;\n }\n };\n\n var punctaInclinataState = {\n neume: function() {\n return new Neumes.PunctaInclinata();\n },\n handle: function() {\n if (currNote.shape !== NoteShape.Inclinatum)\n return createNeume(new Neumes.PunctaInclinata(), false);\n else\n return punctaInclinataState;\n }\n }\n\n var oriscusState = {\n neume: function() {\n return new Neumes.Oriscus();\n },\n handle: function(currNote, prevNote) {\n \n if (currNote.shape === NoteShape.Default) {\n\n if (currNote.staffPosition > prevNote.staffPosition) {\n prevNote.shapeModifiers |= NoteShapeModifiers.Ascending;\n return createNeume(new Neumes.PesQuassus(), true);\n } else if (currNote.staffPosition < prevNote.staffPosition) {\n prevNote.shapeModifiers |= NoteShapeModifiers.Descending;\n return createNeume(new Neumes.Clivis(), true);\n }\n } else\n // stand alone oriscus\n return createNeume(new Neumes.Oriscus(), true);\n }\n };\n\n var podatusState = {\n neume: function() {\n return new Neumes.Podatus();\n },\n handle: function(currNote, prevNote) {\n\n if (currNote.staffPosition > prevNote.staffPosition) {\n\n if (prevNote.shape === NoteShape.Oriscus)\n return salicusState;\n else\n return scandicusState;\n\n } else if (currNote.staffPosition < prevNote.staffPosition) {\n if (currNote.shape === NoteShape.Inclinatum)\n return pesSubpunctisState;\n else\n return torculusState;\n } else\n return createNeume(new Neumes.Podatus(), false);\n }\n };\n\n var clivisState = {\n neume: function() {\n return new Neumes.Clivis();\n },\n handle: function(currNote, prevNote) {\n\n if (currNote.shape === NoteShape.Default && currNote.staffPosition > prevNote.staffPosition)\n return porrectusState;\n else\n return createNeume(new Neumes.Clivis(), false);\n }\n };\n\n var climacusState = {\n neume: function() {\n return new Neumes.Climacus();\n },\n handle: function(currNote, prevNote) {\n if (currNote.shape !== NoteShape.Inclinatum)\n return createNeume(new Neumes.Climacus(), false);\n else\n return state;\n }\n };\n\n var porrectusState = {\n neume: function() {\n return new Neumes.Porrectus();\n },\n handle: function(currNote, prevNote) {\n\n if (currNote.shape === NoteShape.Default && currNote.staffPosition < prevNote.staffPosition)\n return createNeume(new Neumes.PorrectusFlexus(), true);\n else\n return createNeume(new Neumes.Porrectus(), false);\n }\n };\n\n var pesSubpunctisState = {\n neume: function() {\n return new Neumes.PesSubpunctis();\n },\n handle: function(currNote, prevNote) {\n \n if (currNote.shape !== NoteShape.Inclinatum)\n return createNeume(new Neumes.PesSubpunctis(), false);\n else\n return state;\n }\n };\n\n var salicusState = {\n neume: function() {\n return new Neumes.Salicus();\n },\n handle: function(currNote, prevNote) {\n\n if (currNote.staffPosition < prevNote.staffPosition)\n return salicusFlexusState;\n else\n return createNeume(new Neumes.Salicus(), false);\n }\n };\n\n var salicusFlexusState = {\n neume: function() {\n return new Neumes.SalicusFlexus();\n },\n handle: function(currNote, prevNote) {\n return createNeume(new Neumes.SalicusFlexus(), false);\n }\n };\n\n var scandicusState = {\n neume: function() {\n return new Neumes.Scandicus();\n },\n handle: function(currNote, prevNote) {\n\n if (prevNote.shape === NoteShape.Virga && currNote.shape === NoteShape.Inclinatum &&\n currNote.staffPosition < prevNote.staffPosition) {\n // if we get here, then it seems we have a podatus, now being followed by a climacus\n // rather than a scandicus. react accordingly\n return createNeume(new Neumes.Podatus(), false, false);\n } else if (currNote.shape === NoteShape.Default && currNote.staffPosition < prevNote.staffPosition)\n return scandicusFlexusState;\n else\n return createNeume(new Neumes.Scandicus(), false);\n }\n };\n\n var scandicusFlexusState = {\n neume: function() {\n return new Neumes.ScandicusFlexus();\n },\n handle: function(currNote, prevNote) {\n return createNeume(new Neumes.ScandicusFlexus(), false);\n }\n };\n\n var virgaState = {\n neume: function() {\n return new Neumes.Virga();\n },\n handle: function(currNote, prevNote) {\n \n if (currNote.shape === NoteShape.Inclinatum && currNote.staffPosition < prevNote.staffPosition)\n return climacusState;\n else if (currNote.shape === NoteShape.Virga && currNote.staffPosition === prevNote.staffPosition)\n return bivirgaState;\n else\n return createNeume(new Neumes.Virga(), false);\n }\n };\n\n var bivirgaState = {\n neume: function() {\n return new Neumes.Bivirga();\n },\n handle: function(currNote, prevNote) {\n \n if (currNote.shape === NoteShape.Virga && currNote.staffPosition === prevNote.staffPosition)\n return createNeume(new Neumes.Trivirga(), true);\n else\n return createNeume(new Neumes.Bivirga(), false);\n }\n };\n\n var apostrophaState = {\n neume: function() {\n return new Neumes.Apostropha();\n },\n handle: function(currNote, prevNote) {\n if (currNote.staffPosition === prevNote.staffPosition)\n return distrophaState;\n else\n return createNeume(new Neumes.Apostropha(), false);\n }\n };\n\n var distrophaState = {\n neume: function() {\n return new Neumes.Distropha();\n },\n handle: function(currNote, prevNote) {\n if (currNote.staffPosition === prevNote.staffPosition)\n return tristrophaState;\n else\n return createNeume(new Neumes.Apostropha(), false, false);\n }\n };\n\n var tristrophaState = {\n neume: function() {\n return new Neumes.Tristropha();\n },\n handle: function(currNote, prevNote) {\n // we only create a tristropha when the note run ends after three\n // and the neume() function of this state is called. Otherwise\n // we always interpret the third note to belong to the next sequence\n // of notes.\n //\n // fixme: gabc allows any number of punctum/stropha in succession...\n // is this a valid neume type? Or is it just multiple *stropha neumes\n // in succession? Should we simplify the apostropha/distropha/\n // tristropha classes to a generic stropha neume that can have 1 or\n // more successive notes?\n return createNeume(new Neumes.Distropha(), false, false);\n }\n };\n\n var torculusState = {\n neume: function() {\n return new Neumes.Torculus();\n },\n handle: function(currNote, prevNote) {\n if (currNote.shape === NoteShape.Default && currNote.staffPosition > prevNote.staffPosition)\n return torculusResupinusState;\n else\n return createNeume(new Neumes.Torculus(), false);\n }\n };\n\n var torculusResupinusState = {\n neume: function() {\n return new Neumes.TorculusResupinus();\n },\n handle: function(currNote, prevNote) {\n if (currNote.shape === NoteShape.Default && currNote.staffPosition < prevNote.staffPosition)\n return createNeume(new Neumes.TorculusResupinusFlexus(), true);\n else\n return createNeume(new Neumes.TorculusResupinus(), false);\n }\n };\n\n var state = unknownState;\n\n while (currNoteIndex < notes.length) {\n\n var prevNote = currNoteIndex > 0 ? notes[currNoteIndex - 1] : null;\n var currNote = notes[currNoteIndex];\n\n state = state.handle(currNote, prevNote);\n\n // if we are on the last note, then try to create a neume if we need to.\n if (currNoteIndex === notes.length - 1 && state !== unknownState)\n createNeume(state.neume(), true);\n\n currNoteIndex++;\n }\n\n if (neumes.length > 0) {\n if (finalTrailingSpace >= 0) {\n neumes[neumes.length - 1].trailingSpace = finalTrailingSpace;\n\n if (finalTrailingSpace > ctxt.intraNeumeSpacing)\n neumes[neumes.length - 1].keepWithNext = false;\n else\n neumes[neumes.length - 1].keepWithNext = true;\n }\n }\n\n return neumes;\n }\n\n // appends any notes created to the notes array argument\n static createNoteFromData(ctxt, clef, data, notes) {\n\n var note = new Note();\n\n if (data.length < 1)\n throw 'Invalid note data: ' + data;\n\n if (data[0] === '-') { // liquescent initio debilis\n note.liquescent = LiquescentType.InitioDebilis;\n data = data.substring(1);\n }\n\n if (data.length < 1)\n throw 'Invalid note data: ' + data;\n\n // the next char is always the pitch\n var pitch = this.gabcHeightToExsurgePitch(clef, data[0]);\n\n if (data[0] === data[0].toUpperCase())\n note.shape = NoteShape.Inclinatum;\n\n note.staffPosition = this.gabcHeightToExsurgeHeight(data[0]);\n note.pitch = pitch;\n\n var mark;\n var j;\n\n var episemaNoteIndex = notes.length;\n var episemaNote = note;\n\n // process the modifiers\n for (var i = 1; i < data.length; i++) {\n\n var c = data[i];\n var lookahead = '\\0';\n\n var haveLookahead = i + 1 < data.length;\n if (haveLookahead)\n lookahead = data[i + 1];\n\n switch (c) {\n\n // rhythmic markings\n case '.':\n\n mark = null;\n\n // gabc supports putting up to two morae on each note, by repeating the\n // period. here, we check to see if we've already created a mora for the\n // note, and if so, we simply force the second one to have an Above\n // position hint. if a user decides to try to put position indicators\n // on the double morae (such as 1 or 2), then really the behavior is\n // not defined by gabc, so it's on the user to figure it out.\n if (note.morae.length > 0) {\n // if we already have one mora, then create another but force a\n // an alternative positionHint\n haveLookahead = true;\n if (Math.abs(note.staffPosition) % 2 === 0)\n lookahead = '1';\n else\n lookahead = '0';\n }\n\n mark = new Markings.Mora(ctxt, note);\n if (haveLookahead && lookahead === '1')\n mark.positionHint = Markings.MarkingPositionHint.Above;\n else if (haveLookahead && lookahead === '0')\n mark.positionHint = Markings.MarkingPositionHint.Below;\n \n note.morae.push(mark);\n break;\n\n case '_':\n \n var episemaHadModifier = false;\n\n mark = new Markings.HorizontalEpisema(episemaNote);\n while (haveLookahead) {\n\n if (lookahead === '0')\n mark.positionHint = Markings.MarkingPositionHint.Below;\n else if (lookahead === '1')\n mark.positionHint = Markings.MarkingPositionHint.Above;\n else if (lookahead === '2')\n mark.terminating = true; // episema terminates\n else if (lookahead === '3')\n mark.alignment = Markings.HorizontalEpisemaAlignment.Left;\n else if (lookahead === '4')\n mark.alignment = Markings.HorizontalEpisemaAlignment.Center;\n else if (lookahead === '5')\n mark.alignment = Markings.HorizontalEpisemaAlignment.Right;\n else\n break;\n\n // the gabc definition for epismata is so convoluted...\n // - double underscores create epismata over multiple notes.\n // - unless the _ has a 0, 1, 3, 4, or 5 modifier, which means\n // another underscore puts a second epismata on the same note\n // - (when there's a 2 lookahead, then this is treated as an\n // unmodified underscore, so another underscore would be\n // added to previous notes\n if (mark.alignment !== Markings.HorizontalEpisemaAlignment.Default &&\n mark.positionHint !== Markings.MarkingPositionHint.Below)\n episemaHadModifier = true;\n\n i++;\n haveLookahead = i + 1 < data.length;\n \n if (haveLookahead)\n lookahead = data[i + 1];\n }\n\n // since gabc allows consecutive underscores which is a shortcut to\n // apply the epismata to previous notes, we keep track of that here\n // in order to add the new episema to the correct note.\n\n if (episemaNote)\n episemaNote.epismata.push(mark);\n\n if (episemaNote === note && episemaHadModifier)\n episemaNote = note;\n else if (episemaNoteIndex >= 0 && notes.length > 0)\n episemaNote = notes[--episemaNoteIndex];\n\n break;\n\n case '\\'':\n mark = new Markings.Ictus(ctxt, note);\n if (haveLookahead && lookahead === '1')\n mark.positionHint = Markings.MarkingPositionHint.Above;\n else if (haveLookahead && lookahead === '0')\n mark.positionHint = Markings.MarkingPositionHint.Below;\n\n note.ictus = mark;\n break;\n\n //note shapes\n case 'r':\n if (haveLookahead && lookahead === '1') {\n note.acuteAccent = new Markings.AcuteAccent(ctxt, note);\n i++;\n } else\n note.shapeModifiers |= NoteShapeModifiers.Cavum;\n break;\n\n case 's':\n\n if (note.shape === NoteShape.Stropha) {\n // if we're already a stropha, that means this is gabc's\n // quick stropha feature (e.g., gsss). create a new note\n notes.push(note);\n note = new Note();\n episemaNoteIndex++; // since a new note was added, increase the index here\n }\n \n note.shape = NoteShape.Stropha;\n break;\n\n case 'v':\n\n if (note.shape === NoteShape.Virga) {\n // if we're already a stropha, that means this is gabc's\n // quick virga feature (e.g., gvvv). create a new note\n notes.push(note);\n note = new Note();\n episemaNoteIndex++; // since a new note was added, increase the index here\n }\n\n note.shape = NoteShape.Virga;\n break;\n\n case 'w':\n note.shape = NoteShape.Quilisma;\n break;\n\n case 'o':\n note.shape = NoteShape.Oriscus;\n if (haveLookahead && lookahead === '<') {\n note.shapeModifiers |= NoteShapeModifiers.Ascending;\n i++;\n } else if (haveLookahead && lookahead === '>') {\n note.shapeModifiers |= NoteShapeModifiers.Descending;\n i++;\n }\n break;\n\n case 'O':\n note.shape = NoteShape.Oriscus;\n if (haveLookahead && lookahead === '<') {\n note.shapeModifiers |= NoteShapeModifiers.Ascending | NoteShapeModifiers.Stemmed;\n i++;\n } else if (haveLookahead && lookahead === '>') {\n note.shapeModifiers |= NoteShapeModifiers.Descending | NoteShapeModifiers.Stemmed;\n i++;\n } else\n note.shapeModifiers |= NoteShapeModifiers.Stemmed;\n break;\n\n // liquescents\n case '~':\n if (note.shape === NoteShape.Inclinatum)\n note.liquescent |= LiquescentType.Small;\n else if (note.shape === NoteShape.Oriscus)\n note.liquescent |= LiquescentType.Large;\n else\n note.liquescent |= LiquescentType.Small;\n break;\n case '<':\n note.liquescent |= LiquescentType.Ascending;\n break;\n case '>':\n note.liquescent |= LiquescentType.Descending;\n break;\n\n // accidentals\n case 'x':\n if (note.pitch.step === Step.Mi)\n note.pitch.step = Step.Me;\n else if (note.pitch.step === Step.Ti)\n note.pitch.step = Step.Te;\n break;\n case 'y':\n if (note.pitch.step === Step.Te)\n note.pitch.step = Step.Ti;\n else if (note.pitch.step === Step.Me)\n note.pitch.step = Step.Mi;\n else if (note.pitch.step === Step.Du)\n note.pitch.step = Step.Do;\n else if (note.pitch.step === Step.Fu)\n note.pitch.step = Step.Fa;\n break;\n case '#':\n if (note.pitch.step === Step.Do)\n note.pitch.step = Step.Du;\n else if (note.pitch.step === Step.Fa)\n note.pitch.step = Step.Fu;\n break;\n\n // gabc special item groups\n case '[':\n // read in the whole group and parse it\n var startIndex = ++i;\n while (i < data.length && data[i] !== ']')\n i++;\n\n this.processInstructionForNote(ctxt, note, data.substring(startIndex, i));\n break;\n }\n }\n\n notes.push(note);\n }\n\n // an instruction in this context is referring to a special gabc coding found after\n // notes between ['s and ]'s. choral signs and braces fall into this\n // category.\n //\n // currently only brace instructions are supported here!\n static processInstructionForNote(ctxt, note, instruction) {\n\n var results = instruction.match(__braceSpecRegex);\n\n if (results === null)\n return;\n\n // see the comments at the definition of __braceSpecRegex for the\n // capturing groups\n var above = results[1] === 'o';\n var shape = Markings.BraceShape.CurlyBrace; // default\n\n switch(results[2]) {\n case 'b':\n shape = Markings.BraceShape.RoundBrace;\n break;\n case 'cb':\n shape = Markings.BraceShape.CurlyBrace;\n break;\n case 'cba':\n shape = Markings.BraceShape.AccentedCurlyBrace;\n break;\n }\n\n var attachmentPoint = results[3] === '0' ? Markings.BraceAttachment.Left : Markings.BraceAttachment.Right;\n var brace = null;\n var type;\n\n if (results[4] === '{')\n note.braceStart = new Markings.BracePoint(note, above, shape, attachmentPoint);\n else\n note.braceEnd = new Markings.BracePoint(note, above, shape, attachmentPoint);\n }\n\n // takes raw gabc text source and parses it into words. For example, passing\n // in a string of \"me(f.) (,) ma(fff)num(d!ewf) tu(fgF'E)am,(f.)\" would return\n // an array of four strings: [\"me(f.)\", \"(,)\", \"ma(fff)num(d!ewf)\", \"tu(fgF'E)am,(f.)\"]\n static splitWords(gabcNotations) {\n // split the notations on whitespace boundaries, as long as the space\n // immediately follows a set of parentheses. Prior to doing that, we replace\n // all whitespace with spaces, which prevents tabs and newlines from ending\n // up in the notation data.\n gabcNotations = gabcNotations.trim().replace(/\\s/g, ' ').replace(/\\) (?=[^\\)]*(?:\\(|$))/g,')\\n');\n return gabcNotations.split(/\\n/g);\n }\n\n static parseSource(gabcSource) {\n return this.parseWords(this.splitWords(gabcSource));\n }\n\n // gabcWords is an array of strings, e.g., the result of splitWords above\n static parseWords(gabcWords) {\n var words = [];\n\n for (var i = 0; i < gabcWords.length; i++)\n words.push(this.parseWord(gabcWords[i]));\n\n return words;\n }\n\n // returns an array of objects, each of which has the following properties\n // - notations (string)\n // - lyrics (array of strings)\n static parseWord(gabcWord) {\n\n var syllables = [];\n var matches = [];\n \n while ((match = __syllablesRegex.exec(gabcWord)))\n matches.push(match);\n\n for (var j = 0; j < matches.length; j++) {\n var match = matches[j];\n\n var lyrics = match[1].trim().split('|');\n var notations = match[2];\n\n syllables.push({\n notations: notations,\n lyrics: lyrics\n });\n }\n\n return syllables;\n }\n\n // returns pitch\n static gabcHeightToExsurgeHeight(gabcHeight) {\n return gabcHeight.toLowerCase().charCodeAt(0) - 'a'.charCodeAt(0) - 6;\n }\n\n // returns pitch\n static gabcHeightToExsurgePitch(clef, gabcHeight) {\n var exsurgeHeight = this.gabcHeightToExsurgeHeight(gabcHeight)\n\n var pitch = clef.staffPositionToPitch(exsurgeHeight);\n\n if (clef.activeAccidental !== null)\n clef.activeAccidental.applyToPitch(pitch);\n\n return pitch;\n }\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Gabc.js\n **/","//\n// Author(s):\n// Fr. Matthew Spencer, OSJ \n//\n// Copyright (c) 2008-2016 Fr. Matthew Spencer, OSJ\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport * as Exsurge from 'Exsurge.Core'\nimport { Step, Pitch, Rect, Point, Margins } from 'Exsurge.Core'\nimport { QuickSvg, ChantLayoutElement, ChantNotationElement, GlyphCode, GlyphVisualizer, NeumeLineVisualizer, VirgaLineVisualizer, HorizontalEpisemaLineVisualizer, CurlyBraceVisualizer } from 'Exsurge.Drawing'\nimport { Note, LiquescentType, NoteShape, NoteShapeModifiers } from 'Exsurge.Chant'\nimport { MarkingPositionHint, HorizontalEpisema, Mora } from 'Exsurge.Chant.Markings'\nimport { Glyphs } from 'Exsurge.Glyphs'\n\n\nclass NeumeBuilder {\n\n constructor(ctxt, neume, startingX = 0) {\n this.ctxt = ctxt;\n this.neume = neume;\n this.x = startingX;\n this.lastNote = null;\n this.lineIsHanging = false;\n }\n\n // used to start a hanging line on the left of the next note\n lineFrom(note) {\n this.lastNote = note;\n this.lineIsHanging = true;\n\n return this;\n }\n\n // add a note, with a connecting line on the left if we have one\n noteAt(note, glyph, withLineTo = true) {\n\n if (!note)\n throw \"NeumeBuilder.noteAt: note must be a valid note\";\n\n if (!glyph)\n throw \"NeumeBuilder.noteAt: glyph must be a valid glyph code\";\n\n note.setGlyph(this.ctxt, glyph);\n var noteAlignsRight = note.glyphVisualizer.align === \"right\";\n\n var needsLine = withLineTo && this.lastNote !== null &&\n (this.lineIsHanging ||\n this.lastNote.glyphVisualizer.align === 'right' ||\n Math.abs(this.lastNote.staffPosition - note.staffPosition) > 1);\n\n if (needsLine) {\n var line = new NeumeLineVisualizer(this.ctxt, this.lastNote, note, this.lineIsHanging);\n this.neume.addVisualizer(line);\n line.bounds.x = Math.max(0, this.x - line.bounds.width);\n\n if (!noteAlignsRight)\n this.x = line.bounds.x;\n }\n\n // if this is the first note of a right aligned glyph (probably an initio debilis),\n // then there's nothing to worry about. but if it's not then first, then this\n // subtraction will right align it visually\n if (noteAlignsRight && this.lastNote)\n note.bounds.x = this.x - note.bounds.width;\n else {\n note.bounds.x = this.x;\n this.x += note.bounds.width;\n }\n\n this.neume.addVisualizer(note);\n\n this.lastNote = note;\n this.lineIsHanging = false;\n\n return this;\n }\n\n // a special form of noteAdd that creates a virga\n // uses a punctum cuadratum and a line rather than the virga glyphs\n virgaAt(note, withLineTo = true) {\n\n // add the punctum for the virga\n this.noteAt(note, GlyphCode.PunctumQuadratum);\n\n // add a line for the virga\n var line = new VirgaLineVisualizer(this.ctxt, note);\n this.x -= line.bounds.width;\n line.bounds.x = this.x;\n this.neume.addVisualizer(line);\n\n this.lastNote = note;\n this.lineIsHanging = false;\n\n return this;\n }\n\n advanceBy(x) {\n this.lastNote = null;\n this.lineIsHanging = false;\n\n this.x += x;\n\n return this;\n }\n\n // for terminating hanging lines with no lower notes\n withLineEndingAt(note) {\n\n if (this.lastNote === null)\n return;\n\n var line = new NeumeLineVisualizer(this.ctxt, this.lastNote, note, true);\n this.neume.addVisualizer(line);\n this.x -= line.bounds.width;\n line.bounds.x = this.x;\n\n this.neume.addVisualizer(line);\n\n this.lastNote = note;\n\n return this;\n }\n\n withPodatus(lowerNote, upperNote) {\n\n var upperGlyph;\n var lowerGlyph;\n\n if (lowerNote.liquescent === LiquescentType.InitioDebilis) {\n\n // liquescent upper note or not?\n if (upperNote.liquescent === LiquescentType.None)\n upperGlyph = GlyphCode.PunctumQuadratum;\n else\n upperGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n\n lowerGlyph = GlyphCode.TerminatingDesLiquescent;\n } else if (upperNote.liquescent & LiquescentType.Small) {\n lowerGlyph = GlyphCode.BeginningAscLiquescent;\n upperGlyph = GlyphCode.TerminatingAscLiquescent;\n } else if (upperNote.liquescent & LiquescentType.Ascending) {\n lowerGlyph = GlyphCode.PunctumQuadratum;\n upperGlyph = GlyphCode.PunctumQuadratumAscLiquescent;\n } else if (upperNote.liquescent & LiquescentType.Descending) {\n lowerGlyph = GlyphCode.PunctumQuadratum;\n upperGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n } else {\n // standard shape\n lowerGlyph = GlyphCode.PodatusLower;\n upperGlyph = GlyphCode.PodatusUpper;\n }\n\n // allow a quilisma pes\n if (lowerNote.shape === NoteShape.Quilisma)\n lowerGlyph = GlyphCode.Quilisma;\n\n this.noteAt(lowerNote, lowerGlyph).noteAt(upperNote, upperGlyph);\n\n // make sure we don't have lines connected to the podatus\n this.lastNote = null;\n\n return this;\n }\n\n withClivis(upper, lower) {\n\n var line;\n\n var upperGlyph;\n var lowerGlyph;\n\n if (upper.shape === NoteShape.Oriscus)\n this.noteAt(upper, GlyphCode.OriscusDes, false);\n else\n this.lineFrom(lower).noteAt(upper, GlyphCode.PunctumQuadratum);\n\n if (lower.liquescent & LiquescentType.Small) {\n lowerGlyph = GlyphCode.TerminatingDesLiquescent;\n } else if (lower.liquescent === LiquescentType.Ascending)\n lowerGlyph = GlyphCode.PunctumQuadratumAscLiquescent;\n else if (lower.liquescent === LiquescentType.Descending)\n lowerGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n else\n lowerGlyph = GlyphCode.PunctumQuadratum;\n\n this.noteAt(lower, lowerGlyph);\n\n // make sure we don't have lines connected to the clivis\n this.lastNote = null;\n\n return this;\n }\n\n // lays out a sequence of notes that are inclinati (e.g., climacus, pes subpunctis)\n withInclinati(notes) {\n\n var staffPosition = notes[0].staffPosition, prevStaffPosition = notes[0].staffPosition;\n\n // it is important to advance by the width of the inclinatum glyph itself\n // rather than by individual note widths, so that any liquescents are spaced\n // the same as non-liquscents\n var advanceWidth = Glyphs.PunctumInclinatum.bounds.width * this.ctxt.glyphScaling;\n\n // now add all the punctum inclinati\n for (var i = 0; i < notes.length; i++, prevStaffPosition = staffPosition) {\n var note = notes[i];\n\n if (note.liquescent & LiquescentType.Small)\n note.setGlyph(this.ctxt, GlyphCode.PunctumInclinatumLiquescent);\n else if (note.liquescent & LiquescentType.Large)\n // fixme: is the large inclinatum liquescent the same as the apostropha?\n note.setGlyph(this.ctxt, GlyphCode.Stropha);\n else \n // fixme: some climaci in the new chant books end with a punctum quadratum\n // (see, for example, the antiphon \"Sancta Maria\" for October 7).\n note.setGlyph(this.ctxt, GlyphCode.PunctumInclinatum);\n\n staffPosition = note.staffPosition;\n\n // fixme: how do these calculations look for puncti inclinati based on staff position offsets?\n var multiple;\n switch (Math.abs(prevStaffPosition - staffPosition)) {\n case 0:\n multiple = 1.1;\n break;\n case 1:\n multiple = 0.8;\n break;\n default:\n multiple = 1.2;\n break;\n }\n\n if (i > 0)\n this.x += advanceWidth * multiple;\n \n note.bounds.x = this.x;\n\n this.neume.addVisualizer(note);\n }\n\n return this;\n }\n\n withPorrectusSwash(start, end) {\n\n var needsLine = this.lastNote !== null &&\n (this.lineIsHanging ||\n this.lastNote.glyphVisualizer.align === 'right' ||\n Math.abs(this.lastNote.staffPosition - start.staffPosition) > 1);\n\n if (needsLine) {\n var line = new NeumeLineVisualizer(this.ctxt, this.lastNote, start, this.lineIsHanging);\n this.x = Math.max(0, this.x - line.bounds.width);\n line.bounds.x = this.x;\n this.neume.addVisualizer(line);\n }\n\n var glyph;\n\n switch (start.staffPosition - end.staffPosition) {\n case 1:\n glyph = GlyphCode.Porrectus1;\n break;\n case 2:\n glyph = GlyphCode.Porrectus2;\n break;\n case 3:\n glyph = GlyphCode.Porrectus3;\n break;\n case 4:\n glyph = GlyphCode.Porrectus4;\n break;\n default:\n // fixme: should we generate an error here?\n glyph = GlyphCode.None;\n break;\n }\n\n start.setGlyph(this.ctxt, glyph);\n start.bounds.x = this.x;\n\n // the second glyph does not draw anything, but it still has logical importance for the editing\n // environment...it can respond to changes which will then change the swash glyph of the first.\n end.setGlyph(this.ctxt, GlyphCode.None);\n\n this.x = start.bounds.right();\n end.bounds.x = this.x - end.bounds.width;\n\n this.neume.addVisualizer(start);\n this.neume.addVisualizer(end);\n\n this.lastNote = end;\n this.lineIsHanging = false;\n\n return this;\n }\n}\n\n/*\n * Neumes base class\n */\nexport class Neume extends ChantNotationElement {\n\n constructor(notes = []) {\n\n super();\n\n this.isNeume = true; // poor man's reflection\n this.notes = notes;\n\n for (var i = 0; i < notes.length; i++)\n notes[i].neume = this;\n }\n\n addNote(note) {\n note.neume = this;\n this.notes.push(note);\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n }\n\n finishLayout(ctxt) {\n\n // allow subclasses an opportunity to position their own markings...\n this.positionMarkings();\n\n // layout the markings of the notes\n for (var i = 0; i < this.notes.length; i++) {\n var note = this.notes[i];\n var j;\n\n for (j = 0; j < note.epismata.length; j++) {\n note.epismata[j].performLayout(ctxt);\n this.addVisualizer(note.epismata[j]);\n }\n\n for (j = 0; j < note.morae.length; j++) {\n note.morae[j].performLayout(ctxt);\n this.addVisualizer(note.morae[j]);\n }\n\n // if the note has an ictus, then add it here\n if (note.ictus) {\n note.ictus.performLayout(ctxt);\n this.addVisualizer(note.ictus);\n }\n\n if (note.acuteAccent) {\n note.acuteAccent.performLayout(ctxt);\n this.addVisualizer(note.acuteAccent);\n }\n\n // braces are handled by the chant line, so we don't mess with them here\n // this is because brace size depends on chant line logic (neume spacing,\n // justification, etc.) so they are considered chant line level\n // markings rather than note level markings\n }\n\n this.origin.x = this.notes[0].origin.x;\n this.origin.y = this.notes[0].origin.y;\n\n super.finishLayout(ctxt);\n }\n\n resetDependencies() {\n\n }\n\n build(ctxt) {\n return new NeumeBuilder(ctxt, this);\n }\n\n // subclasses can override this in order to correctly place markings in a neume specific way\n positionMarkings() {\n\n }\n}\n\n/*\n * Apostropha\n */\nexport class Apostropha extends Neume {\n\n positionMarkings() {\n var positionHint = MarkingPositionHint.Above;\n\n // logic here is this: if first episema is default position, place it above.\n // then place the second one (if there is one) opposite of the first.\n for (var i = 0; i < this.notes[0].epismata.length; i++) {\n if (this.notes[0].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[0].epismata[i].positionHint = positionHint;\n else\n positionHint = this.notes[0].epismata[i].positionHint;\n\n // now place the next one in the opposite position\n positionHint = (positionHint === MarkingPositionHint.Above) ? MarkingPositionHint.Below : MarkingPositionHint.Above;\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var y = ctxt.calculateHeightFromStaffPosition(4);\n\n this.build(ctxt).noteAt(this.notes[0], Apostropha.getNoteGlyphCode(this.notes[0]));\n\n this.finishLayout(ctxt);\n }\n\n static getNoteGlyphCode(note) {\n\n if (note.shape === NoteShape.Stropha)\n return GlyphCode.Stropha;\n\n if (note.liquescent !== LiquescentType.None)\n return GlyphCode.StrophaLiquescent;\n\n if (note.shapeModifiers & NoteShapeModifiers.Cavum)\n return GlyphCode.PunctumCavum;\n\n return GlyphCode.PunctumQuadratum;\n }\n}\n\n/*\n * Bivirga\n *\n * For simplicity in implementation, Bivirga's have two notes in the object\n * structure. These technically must be the same pitch though.\n */\nexport class Bivirga extends Neume {\n\n positionMarkings() {\n var marking, i, j;\n\n for (i = 0; i < this.notes.length; i++) {\n var positionHint = MarkingPositionHint.Above;\n\n // logic here is this: if first episema is default position, place it above.\n // then place the second one (if there is one) opposite of the first.\n for (j = 0; j < this.notes[i].epismata.length; j++) {\n if (this.notes[i].epismata[j].positionHint === MarkingPositionHint.Default)\n this.notes[i].epismata[j].positionHint = positionHint;\n else\n positionHint = this.notes[i].epismata[j].positionHint;\n\n // now place the next one in the opposite position\n positionHint = (positionHint === MarkingPositionHint.Above) ? MarkingPositionHint.Below : MarkingPositionHint.Above;\n }\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.build(ctxt)\n .virgaAt(this.notes[0])\n .advanceBy(ctxt.intraNeumeSpacing)\n .virgaAt(this.notes[1]);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Trivirga\n *\n * For simplicity in implementation, Trivirga's have three notes in the object\n * structure. These technically must be the same pitch though.\n */\nexport class Trivirga extends Neume {\n\n positionMarkings() {\n var marking, i, j;\n\n for (i = 0; i < this.notes.length; i++) {\n var positionHint = MarkingPositionHint.Above;\n\n // logic here is this: if first episema is default position, place it above.\n // then place the second one (if there is one) opposite of the first.\n for (j = 0; j < this.notes[i].epismata.length; j++) {\n if (this.notes[i].epismata[j].positionHint === MarkingPositionHint.Default)\n this.notes[i].epismata[j].positionHint = positionHint;\n else\n positionHint = this.notes[i].epismata[j].positionHint;\n\n // now place the next one in the opposite position\n positionHint = (positionHint === MarkingPositionHint.Above) ? MarkingPositionHint.Below : MarkingPositionHint.Above;\n }\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.build(ctxt)\n .virgaAt(this.notes[0])\n .advanceBy(ctxt.intraNeumeSpacing)\n .virgaAt(this.notes[1])\n .advanceBy(ctxt.intraNeumeSpacing)\n .virgaAt(this.notes[2]);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Climacus\n */\nexport class Climacus extends Neume {\n\n positionMarkings() {\n\n for (var i = 0; i < this.notes.length; i++) {\n for (var j = 0; j < this.notes[i].epismata.length; j++) {\n var mark = this.notes[i].epismata[j];\n\n if (mark.positionHint === MarkingPositionHint.Default)\n mark.positionHint = MarkingPositionHint.Above;\n }\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.build(ctxt)\n .virgaAt(this.notes[0])\n .advanceBy(ctxt.intraNeumeSpacing / 2)\n .withInclinati(this.notes.slice(1));\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Clivis\n */\nexport class Clivis extends Neume {\n\n positionMarkings() {\n\n var hasLowerMora = false;\n var mark, i;\n\n // 1. morae need to be lined up if both notes have morae\n // 2. like the podatus, mora on lower note needs to below\n // under certain circumstances\n for (i = 0; i < this.notes[1].morae.length; i++) {\n mark = this.notes[1].morae[i];\n\n if (this.notes[0].staffPosition - this.notes[1].staffPosition === 1 &&\n Math.abs(this.notes[1].staffPosition % 2) === 1)\n mark.positionHint = MarkingPositionHint.Below;\n }\n\n for (i = 0; i < this.notes[0].morae.length; i++) {\n\n if (hasLowerMora) {\n mark = this.notes[0].morae[i];\n mark.positionHint = MarkingPositionHint.Above;\n mark.horizontalOffset += this.notes[1].bounds.right() - this.notes[0].bounds.right();\n }\n }\n\n for (i = 0; i < this.notes[0].epismata.length; i++) {\n mark = this.notes[0].epismata[i];\n\n if (mark.positionHint === MarkingPositionHint.Default)\n mark.positionHint = MarkingPositionHint.Above;\n }\n\n for (i = 0; i < this.notes[1].epismata.length; i++) {\n mark = this.notes[1].epismata[i];\n\n if (mark.positionHint === MarkingPositionHint.Default)\n mark.positionHint = MarkingPositionHint.Above;\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var upper = this.notes[0];\n var lower = this.notes[1];\n\n this.build(ctxt).withClivis(upper, lower);\n\n this.finishLayout(ctxt);\n }\n}\n\n\n\n/*\n * Distropha\n *\n * For simplicity in implementation, Distropha's have two notes in the object\n * structure. These technically must be the same pitch though (like Bivirga).\n */\nexport class Distropha extends Neume {\n\n positionMarkings() {\n\n for (var i = 0; i < this.notes.length; i++) {\n var positionHint = MarkingPositionHint.Above;\n\n // logic here is this: if first episema is default position, place it above.\n // then place the second one (if there is one) opposite of the first.\n for (var j = 0; j < this.notes[i].epismata.length; j++) {\n if (this.notes[i].epismata[j].positionHint === MarkingPositionHint.Default)\n this.notes[i].epismata[j].positionHint = positionHint;\n else\n positionHint = this.notes[i].epismata[j].positionHint;\n\n // now place the next one in the opposite position\n positionHint = (positionHint === MarkingPositionHint.Above) ? MarkingPositionHint.Below : MarkingPositionHint.Above;\n }\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.build(ctxt)\n .noteAt(this.notes[0], Apostropha.getNoteGlyphCode(this.notes[0]))\n .advanceBy(ctxt.intraNeumeSpacing)\n .noteAt(this.notes[1], Apostropha.getNoteGlyphCode(this.notes[1]));\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Oriscus\n */\nexport class Oriscus extends Neume {\n\n positionMarkings() {\n var positionHint = MarkingPositionHint.Above;\n\n // logic here is this: if first episema is default position, place it above.\n // then place the second one (if there is one) opposite of the first.\n for (var i = 0; i < this.notes[0].epismata.length; i++) {\n if (this.notes[0].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[0].epismata[i].positionHint = positionHint;\n else\n positionHint = this.notes[0].epismata[i].positionHint;\n\n // now place the next one in the opposite position\n positionHint = (positionHint === MarkingPositionHint.Above) ? MarkingPositionHint.Below : MarkingPositionHint.Above;\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n // determine the glyph to use\n var note = this.notes[0];\n var glyph;\n\n if (note.liquescent !== LiquescentType.None) {\n glyph = GlyphCode.OriscusLiquescent;\n } else {\n if (note.shapeModifiers & NoteShapeModifiers.Ascending)\n glyph = GlyphCode.OriscusAsc;\n else if (note.shapeModifiers & NoteShapeModifiers.Descending)\n glyph = GlyphCode.OriscusDes;\n else {\n // by default we take the descending form, unless we can figure out by a lookahead here\n glyph = GlyphCode.OriscusDes;\n\n // try to find a neume following this one\n var neume = ctxt.findNextNeume();\n\n if (neume) {\n var nextNoteStaffPosition = ctxt.activeClef.pitchToStaffPosition(neume.notes[0].pitch);\n\n if (nextNoteStaffPosition > note.staffPosition)\n glyph = GlyphCode.OriscusAsc;\n }\n }\n }\n\n this.build(ctxt).noteAt(note, glyph);\n\n this.finishLayout(ctxt);\n }\n\n resetDependencies() {\n\n // a single oriscus tries to automatically use the right direction\n // based on the following neumes. if we don't have a manually designated\n // direction, then we reset our layout so that we can try to guess it\n // at next layout phase.\n if (this.notes[0].shapeModifiers & NoteShapeModifiers.Ascending ||\n this.notes[0].shapeModifiers & NoteShapeModifiers.Descending)\n return;\n\n this.needsLayout = true;\n }\n}\n\n/*\n * PesQuassus\n */\nexport class PesQuassus extends Neume {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var lower = this.notes[0];\n var upper = this.notes[1];\n\n var lowerGlyph, upperGlyph;\n\n var lowerStaffPos = lower.staffPosition;\n var upperStaffPos = upper.staffPosition;\n\n if (lower.shape === NoteShape.Oriscus)\n lowerGlyph = GlyphCode.OriscusAsc;\n else\n lowerGlyph = GlyphCode.PunctumQuadratum;\n\n var builder = this.build(ctxt)\n .noteAt(lower, lowerGlyph);\n\n if (upperStaffPos - lowerStaffPos === 1)// use a virga glyph in this case\n builder.virgaAt(upper);\n else if (upper.liquescent === LiquescentType.LargeDescending)\n builder.noteAt(upper, GlyphCode.PunctumQuadratumDesLiquescent).withLineEndingAt(lower);\n else \n builder.noteAt(upper, GlyphCode.PunctumQuadratum).withLineEndingAt(lower);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * PesSubpunctis\n */\nexport class PesSubpunctis extends Neume {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n // podatus followed by inclinati\n this.build(ctxt)\n .withPodatus(this.notes[0], this.notes[1])\n .advanceBy(ctxt.intraNeumeSpacing / 2)\n .withInclinati(this.notes.slice(2));\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Podatus\n *\n * This podatus class handles a few neume types actually, depending on the note\n * data: Podatus (including various liquescent types on the upper note),\n * Podatus initio debilis, and Quilisma-Pes\n */\nexport class Podatus extends Neume {\n\n positionMarkings() {\n var marking, i;\n\n // 1. episema on lower note by default be below, upper note above\n // 2. morae: \n // a. if podatus difference is 1 and lower note is on a line,\n // the lower mora should be below\n for (i = 0; i < this.notes[0].epismata.length; i++)\n if (this.notes[0].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[0].epismata[i].positionHint = MarkingPositionHint.Below;\n\n // if this note has two or more (!?) morae then we just leave them be\n // since they have already been assigned position hints.\n if (this.notes[0].morae.length < 2) {\n for (i = 0; i < this.notes[0].morae.length; i++) {\n marking = this.notes[0].morae[i];\n\n if ((this.notes[1].staffPosition - this.notes[0].staffPosition) === 1 &&\n Math.abs(this.notes[0].staffPosition % 2) === 1)\n marking.positionHint = MarkingPositionHint.Below;\n }\n }\n\n for (i = 0; i < this.notes[1].epismata.length; i++)\n if (this.notes[1].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[1].epismata[i].positionHint = MarkingPositionHint.Above;\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.build(ctxt).withPodatus(this.notes[0], this.notes[1]);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Porrectus\n */\nexport class Porrectus extends Neume {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var first = this.notes[0];\n var second = this.notes[1];\n var third = this.notes[2];\n\n var thirdGlyph;\n\n if (third.liquescent & LiquescentType.Small)\n thirdGlyph = GlyphCode.TerminatingAscLiquescent;\n else if (third.liquescent & LiquescentType.Descending)\n thirdGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n else\n thirdGlyph = GlyphCode.PodatusUpper;\n\n this.build(ctxt)\n .lineFrom(second)\n .withPorrectusSwash(first, second)\n .noteAt(third, thirdGlyph);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * PorrectusFlexus\n */\nexport class PorrectusFlexus extends Neume {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var first = this.notes[0];\n var second = this.notes[1];\n var third = this.notes[2];\n var fourth = this.notes[3];\n\n var thirdGlyph = GlyphCode.PunctumQuadratum, fourthGlyph;\n\n if (fourth.liquescent & LiquescentType.Small) {\n thirdGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n fourthGlyph = GlyphCode.TerminatingDesLiquescent;\n } else if (fourth.liquescent & LiquescentType.Ascending)\n fourthGlyph = GlyphCode.PunctumQuadratumAscLiquescent;\n else if (fourth.liquescent & LiquescentType.Descending)\n fourthGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n else \n fourthGlyph = GlyphCode.PunctumQuadratum;\n\n this.build(ctxt)\n .lineFrom(second)\n .withPorrectusSwash(first, second)\n .noteAt(third, thirdGlyph)\n .noteAt(fourth, fourthGlyph);\n\n this.finishLayout(ctxt);\n }\n}\n\n// this is some type of pseudo nume right? there is no such thing as a neume\n// of puncta inclinata, but this will be part of other composite neumes.\nexport class PunctaInclinata extends Neume {\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.build(ctxt).withInclinati(this.notes);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Punctum\n */\nexport class Punctum extends Neume {\n\n positionMarkings() {\n var marking, i;\n var positionHint = MarkingPositionHint.Above;\n\n // logic here is this: if first episema is default position, place it above.\n // then place the second one (if there is one) opposite of the first.\n for (i = 0; i < this.notes[0].epismata.length; i++) {\n if (this.notes[0].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[0].epismata[i].positionHint = positionHint;\n else\n positionHint = this.notes[0].epismata[i].positionHint;\n\n // now place the next one in the opposite position\n positionHint = (positionHint === MarkingPositionHint.Above) ? MarkingPositionHint.Below : MarkingPositionHint.Above;\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var note = this.notes[0];\n var glyph = GlyphCode.PunctumQuadratum;\n\n // determine the glyph to use\n if (note.liquescent !== LiquescentType.None) {\n if (note.shape === NoteShape.Inclinatum)\n glyph = GlyphCode.PunctumInclinatumLiquescent;\n else if (note.shape === NoteShape.Oriscus)\n glyph = GlyphCode.OriscusLiquescent;\n else if (note.liquescent & LiquescentType.Ascending)\n glyph = GlyphCode.PunctumQuadratumAscLiquescent;\n else if (note.liquescent & LiquescentType.Descending)\n glyph = GlyphCode.PunctumQuadratumDesLiquescent;\n\n } else {\n\n if (note.shapeModifiers & NoteShapeModifiers.Cavum)\n glyph = GlyphCode.PunctumCavum;\n else if (note.shape === NoteShape.Inclinatum)\n glyph = GlyphCode.PunctumInclinatum;\n else if (note.shape === NoteShape.Quilisma)\n glyph = GlyphCode.Quilisma;\n else\n glyph = GlyphCode.PunctumQuadratum;\n }\n\n this.build(ctxt).noteAt(note, glyph);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Salicus\n */\nexport class Salicus extends Neume {\n\n positionMarkings() {\n var marking, i, j;\n\n // by default place episema below\n // fixme: is this correct?\n for (i = 0; i < this.notes.length; i++)\n for (j = 0; j < this.notes[i].epismata.length; j++)\n if (this.notes[i].epismata[j].positionHint === MarkingPositionHint.Default)\n this.notes[i].epismata[j].positionHint = MarkingPositionHint.Below;\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var first = this.notes[0];\n var second = this.notes[1];\n var third = this.notes[2];\n\n var builder = this.build(ctxt).noteAt(first, GlyphCode.PunctumQuadratum);\n\n // if the next note doesn't require a stem connector, then add a tad bit\n // of spacing here\n if (!(second.shapeModifiers & NoteShapeModifiers.Stemmed))\n builder.advanceBy(ctxt.intraNeumeSpacing);\n\n // second note is always an oriscus, which may or may not be stemmed\n // to the first\n builder.noteAt(second, GlyphCode.OriscusAsc);\n\n // third note can be a punctum quadratum or various liquescent forms\n if (third.liquescent & LiquescentType.Small)\n builder.noteAt(third, GlyphCode.TerminatingAscLiquescent);\n else if (third.liquescent === LiquescentType.Ascending)\n builder.noteAt(third, GlyphCode.PunctumQuadratumAscLiquescent);\n else if (third.liquescent === LiquescentType.Descending)\n builder.noteAt(third, GlyphCode.PunctumQuadratumDesLiquescent);\n else\n builder.virgaAt(third);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Salicus Flexus\n */\nexport class SalicusFlexus extends Neume {\n\n positionMarkings() {\n var marking, i, j;\n\n // by default place episema below\n // fixme: is this correct?\n for (i = 0; i < this.notes.length; i++)\n for (j = 0; j < this.notes[i].epismata.length; j++)\n if (this.notes[i].epismata[j].positionHint === MarkingPositionHint.Default)\n this.notes[i].epismata[j].positionHint = MarkingPositionHint.Below;\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var first = this.notes[0];\n var second = this.notes[1];\n var third = this.notes[2];\n var fourth = this.notes[3];\n\n var builder = this.build(ctxt).noteAt(first, GlyphCode.PunctumQuadratum);\n\n // if the next note doesn't require a stem connector, then add a tad bit\n // of spacing here\n if (!(second.shapeModifiers & NoteShapeModifiers.Stemmed))\n builder.advanceBy(ctxt.intraNeumeSpacing);\n\n // second note is always an oriscus, which may or may not be stemmed\n // to the first\n builder.noteAt(second, GlyphCode.OriscusAsc);\n\n // third note can be a punctum quadratum or various liquescent forms,\n // ...based on note four though!\n if (fourth.liquescent & LiquescentType.Small)\n builder.noteAt(third, GlyphCode.PunctumQuadratumDesLiquescent);\n else\n builder.noteAt(third, GlyphCode.PunctumQuadratum);\n\n // finally, do the fourth note\n if (fourth.liquescent & LiquescentType.Small)\n builder.noteAt(fourth, GlyphCode.TerminatingDesLiquescent);\n else if (fourth.liquescent & LiquescentType.Ascending)\n builder.noteAt(fourth, GlyphCode.PunctumQuadratumAscLiquescent);\n else if (fourth.liquescent & LiquescentType.Descending)\n builder.noteAt(fourth, GlyphCode.PunctumQuadratumDesLiquescent);\n else \n builder.noteAt(fourth, GlyphCode.PunctumQuadratum);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Scandicus\n */\nexport class Scandicus extends Neume {\n\n positionMarkings() {\n var marking, i;\n\n // by default place first note epismata below\n for (i = 0; i < this.notes[0].epismata.length; i++)\n if (this.notes[0].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[0].epismata[i].positionHint = MarkingPositionHint.Below;\n\n var positionHint = this.notes[2].shape === NoteShape.Virga ? MarkingPositionHint.Above : MarkingPositionHint.Below;\n for (i = 0; i < this.notes[1].epismata.length; i++)\n if (this.notes[1].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[1].epismata[i].positionHint = positionHint;\n\n // by default place third note epismata above\n for (i = 0; i < this.notes[2].epismata.length; i++)\n if (this.notes[2].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[2].epismata[i].positionHint = MarkingPositionHint.Above;\n }\n\n // if the third note shape is a virga, then the scadicus is rendered\n // as a podatus followed by a virga. Otherwise, it's rendered as a\n // punctum followed by a podatus...\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var first = this.notes[0];\n var second = this.notes[1];\n var third = this.notes[2];\n\n if (third.shape === NoteShape.Virga) {\n this.build(ctxt)\n .withPodatus(first, second)\n .virgaAt(third);\n } else {\n this.build(ctxt)\n .noteAt(first, GlyphCode.PunctumQuadratum)\n .withPodatus(second, third);\n }\n\n this.finishLayout(ctxt);\n }\n}\n\n\n/*\n * Scandicus Flexus\n */\nexport class ScandicusFlexus extends Neume {\n\n positionMarkings() {\n var marking, i;\n\n // by default place first note epismata below\n for (i = 0; i < this.notes[0].epismata.length; i++)\n if (this.notes[0].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[0].epismata[i].positionHint = MarkingPositionHint.Below;\n\n var positionHint = this.notes[2].shape === NoteShape.Virga ? MarkingPositionHint.Above : MarkingPositionHint.Below;\n for (i = 0; i < this.notes[1].epismata.length; i++)\n if (this.notes[1].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[1].epismata[i].positionHint = positionHint;\n\n // by default place third note epismata above\n for (i = 0; i < this.notes[2].epismata.length; i++)\n if (this.notes[2].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[2].epismata[i].positionHint = MarkingPositionHint.Above;\n\n // by default place fourth note epismata above\n for (i = 0; i < this.notes[3].epismata.length; i++)\n if (this.notes[3].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[3].epismata[i].positionHint = MarkingPositionHint.Above;\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var first = this.notes[0];\n var second = this.notes[1];\n var third = this.notes[2];\n var fourth = this.notes[3];\n\n if (third.shape === NoteShape.Virga) {\n this.build(ctxt)\n .withPodatus(first, second)\n .advanceBy(ctxt.intraNeumeSpacing)\n .withClivis(third, fourth);\n } else {\n var fourthGlyph = GlyphCode.PunctumQuadratum;\n \n if (fourth.liquescent & LiquescentType.Ascending)\n fourthGlyph = GlyphCode.PunctumQuadratumAscLiquescent;\n else if (fourth.liquescent & LiquescentType.Descending)\n fourthGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n\n this.build(ctxt)\n .noteAt(first, GlyphCode.PunctumQuadratum)\n .withPodatus(second, third)\n .advanceBy(ctxt.intraNeumeSpacing)\n .noteAt(fourth, fourthGlyph);\n }\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Torculus\n */\nexport class Torculus extends Neume {\n\n positionMarkings() {\n var marking, i;\n var hasMiddleEpisema = false;\n\n // first do the middle note to see if we should try to move\n // epismata on the other two lower notes\n for (i = 0; i < this.notes[1].epismata.length; i++) {\n marking = this.notes[1].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default) {\n marking.positionHint = MarkingPositionHint.Above;\n hasMiddleEpisema = true;\n }\n }\n\n // 1. episema on lower notes should be below, upper note above\n // 2. morae: fixme: implement\n for (i = 0; i < this.notes[0].epismata.length; i++) {\n marking = this.notes[0].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = hasMiddleEpisema ? MarkingPositionHint.Above : MarkingPositionHint.Below;\n }\n\n for (i = 0; i < this.notes[2].epismata.length; i++) {\n marking = this.notes[2].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = hasMiddleEpisema ? MarkingPositionHint.Above : MarkingPositionHint.Below;\n } \n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var note1 = this.notes[0];\n var note2 = this.notes[1];\n var note3 = this.notes[2];\n\n var glyph1, glyph3;\n\n if (note1.liquescent === LiquescentType.InitioDebilis)\n glyph1 = GlyphCode.TerminatingDesLiquescent;\n else if (note1.shape === NoteShape.Quilisma)\n glyph1 = GlyphCode.Quilisma;\n else\n glyph1 = GlyphCode.PunctumQuadratum;\n\n if (note3.liquescent & LiquescentType.Small)\n glyph3 = GlyphCode.TerminatingDesLiquescent;\n else if (note3.liquescent & LiquescentType.Ascending)\n glyph3 = GlyphCode.PunctumQuadratumAscLiquescent;\n else if (note3.liquescent & LiquescentType.Descending)\n glyph3 = GlyphCode.PunctumQuadratumDesLiquescent;\n else \n glyph3 = GlyphCode.PunctumQuadratum;\n\n this.build(ctxt)\n .noteAt(note1, glyph1)\n .noteAt(note2, GlyphCode.PunctumQuadratum)\n .noteAt(note3, glyph3);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * TorculusResupinus\n */\nexport class TorculusResupinus extends Neume {\n\n positionMarkings() {\n var marking, i;\n var hasMiddleEpisema = false;\n\n // first do the middle note to see if we should try to move\n // epismata on the other two lower notes\n for (i = 0; i < this.notes[1].epismata.length; i++) {\n marking = this.notes[1].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default) {\n marking.positionHint = MarkingPositionHint.Above;\n hasMiddleEpisema = true;\n }\n }\n\n // 1. episema on lower notes should be below, upper note above\n // 2. morae: fixme: implement\n for (i = 0; i < this.notes[0].epismata.length; i++) {\n marking = this.notes[0].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = hasMiddleEpisema ? MarkingPositionHint.Above : MarkingPositionHint.Below;\n }\n\n for (i = 0; i < this.notes[2].epismata.length; i++) {\n marking = this.notes[2].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = hasMiddleEpisema ? MarkingPositionHint.Above : MarkingPositionHint.Below;\n } \n\n for (i = 0; i < this.notes[3].epismata.length; i++) {\n marking = this.notes[3].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = MarkingPositionHint.Above;\n } \n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var first = this.notes[0];\n var second = this.notes[1];\n var third = this.notes[2];\n var fourth = this.notes[3];\n\n var firstGlyph, fourthGlyph;\n\n if (first.liquescent === LiquescentType.InitioDebilis) {\n firstGlyph = GlyphCode.TerminatingDesLiquescent;\n } else if (first.shape === NoteShape.Quilisma)\n firstGlyph = GlyphCode.Quilisma;\n else\n firstGlyph = GlyphCode.PunctumQuadratum;\n\n if (fourth.liquescent & LiquescentType.Small)\n fourthGlyph = GlyphCode.TerminatingAscLiquescent;\n else if (third.liquescent & LiquescentType.Descending)\n fourthGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n else\n fourthGlyph = GlyphCode.PodatusUpper;\n\n this.build(ctxt)\n .noteAt(first, firstGlyph)\n .withPorrectusSwash(second, third)\n .noteAt(fourth, fourthGlyph);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * TorculusResupinusFlexus\n */\nexport class TorculusResupinusFlexus extends Neume {\n\n positionMarkings() {\n var marking, i;\n var hasMiddleEpisema = false;\n\n // first do the middle note to see if we should try to move\n // epismata on the other two lower notes\n for (i = 0; i < this.notes[1].epismata.length; i++) {\n marking = this.notes[1].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default) {\n marking.positionHint = MarkingPositionHint.Above;\n hasMiddleEpisema = true;\n }\n }\n\n // 1. episema on lower notes should be below, upper note above\n // 2. morae: fixme: implement\n for (i = 0; i < this.notes[0].epismata.length; i++) {\n marking = this.notes[0].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = hasMiddleEpisema ? MarkingPositionHint.Above : MarkingPositionHint.Below;\n }\n\n for (i = 0; i < this.notes[2].epismata.length; i++) {\n marking = this.notes[2].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = hasMiddleEpisema ? MarkingPositionHint.Above : MarkingPositionHint.Below;\n } \n\n for (i = 0; i < this.notes[3].epismata.length; i++) {\n marking = this.notes[3].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = MarkingPositionHint.Above;\n } \n\n for (i = 0; i < this.notes[4].epismata.length; i++) {\n marking = this.notes[4].epismata[i];\n\n if (marking.positionHint === MarkingPositionHint.Default)\n marking.positionHint = MarkingPositionHint.Above;\n } \n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n var first = this.notes[0];\n var second = this.notes[1];\n var third = this.notes[2];\n var fourth = this.notes[3];\n var fifth = this.notes[4];\n\n var firstGlyph, fourthGlyph = GlyphCode.PunctumQuadratum, fifthGlyph;\n\n if (first.liquescent === LiquescentType.InitioDebilis) {\n firstGlyph = GlyphCode.TerminatingDesLiquescent;\n } else if (first.shape === NoteShape.Quilisma)\n firstGlyph = GlyphCode.Quilisma;\n else\n firstGlyph = GlyphCode.PunctumQuadratum;\n\n if (fifth.liquescent & LiquescentType.Small) {\n fourthGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n fifthGlyph = GlyphCode.TerminatingDesLiquescent;\n } else if (fifth.liquescent & LiquescentType.Ascending)\n fifthGlyph = GlyphCode.PunctumQuadratumAscLiquescent;\n else if (fifth.liquescent & LiquescentType.Descending)\n fifthGlyph = GlyphCode.PunctumQuadratumDesLiquescent;\n else \n fifthGlyph = GlyphCode.PunctumQuadratum;\n\n this.build(ctxt)\n .noteAt(first, firstGlyph)\n .withPorrectusSwash(second, third)\n .noteAt(fourth, fourthGlyph)\n .noteAt(fifth, fifthGlyph);\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Tristropha\n *\n * For simplicity in implementation, Tristropha's have three notes in the object\n * structure. These technically must be the same pitch though (like the\n * Distropha and Bivirga).\n */\nexport class Tristropha extends Neume {\n\n positionMarkings() {\n var marking, i, j;\n\n for (i = 0; i < this.notes.length; i++) {\n var positionHint = MarkingPositionHint.Above;\n\n // logic here is this: if first episema is default position, place it above.\n // then place the second one (if there is one) opposite of the first.\n for (j = 0; j < this.notes[i].epismata.length; j++) {\n if (this.notes[i].epismata[j].positionHint === MarkingPositionHint.Default)\n this.notes[i].epismata[j].positionHint = positionHint;\n else\n positionHint = this.notes[i].epismata[j].positionHint;\n\n // now place the next one in the opposite position\n positionHint = (positionHint === MarkingPositionHint.Above) ? MarkingPositionHint.Below : MarkingPositionHint.Above;\n }\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.build(ctxt)\n .noteAt(this.notes[0], Apostropha.getNoteGlyphCode(this.notes[0]))\n .advanceBy(ctxt.intraNeumeSpacing)\n .noteAt(this.notes[1], Apostropha.getNoteGlyphCode(this.notes[1]))\n .advanceBy(ctxt.intraNeumeSpacing)\n .noteAt(this.notes[2], Apostropha.getNoteGlyphCode(this.notes[2]));\n\n this.finishLayout(ctxt);\n }\n}\n\n/*\n * Virga\n */\nexport class Virga extends Neume {\n\n positionMarkings() {\n var positionHint = MarkingPositionHint.Above;\n\n // logic here is this: if first episema is default position, place it above.\n // then place the second one (if there is one) opposite of the first.\n for (var i = 0; i < this.notes[0].epismata.length; i++) {\n if (this.notes[0].epismata[i].positionHint === MarkingPositionHint.Default)\n this.notes[0].epismata[i].positionHint = positionHint;\n else\n positionHint = this.notes[0].epismata[i].positionHint;\n\n // now place the next one in the opposite position\n positionHint = (positionHint === MarkingPositionHint.Above) ? MarkingPositionHint.Below : MarkingPositionHint.Above;\n }\n }\n\n performLayout(ctxt) {\n super.performLayout(ctxt);\n\n this.build(ctxt).virgaAt(this.notes[0]);\n\n this.finishLayout(ctxt);\n }\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Exsurge.Chant.Neumes.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/gabc.css b/gabc.css new file mode 100644 index 0000000..819f15b --- /dev/null +++ b/gabc.css @@ -0,0 +1,10 @@ +grego-chant[inline] { + display:inline; !important + width:fit-content; + position: relative; + bottom: -9px; +} +grego-chant { + width:100%;display:block; +} +@font-face{font-family: 'Exsurge Characters';font-weight: normal;font-style: normal;src: url(data:font/opentype;base64,AAEAAAATAQAABAAwRFNJRwAAAAEAAENkAAAACEdERUYAbgADAABDbAAAABhHUE9TTxtiswAAQ4QAAAE8R1NVQjtgWB4AAETAAAAAlk9TLzJKLTibAAABuAAAAGBjbWFwCRIK1gAAA4gAAAEEY3Z0IAGGB0cAAAZ0AAAAGmZwZ20GWZw3AAAEjAAAAXNnYXNwABcACAAAQ1QAAAAQZ2x5ZhRQNO4AAAdQAAAEzGhlYWQKMl2QAAABPAAAADZoaGVhDC0CmQAAAXQAAAAkaG10eB67AO4AAAIYAAABbmtlcm4E1wS9AAAMHAAAAMZsb2NhLQ4u0gAABpAAAADAbWF4cAJtAJoAAAGYAAAAIG5hbWUmgJC3AAAM5AAANY5wb3N0CJUJxAAAQnQAAADgcHJlcNTHuIYAAAYAAAAAcgABAAAAAQAArr24P18PPPUAGwgAAAAAANLrfC8AAAAA0uuXUgAA/vAFLAYhAAAACQACAAAAAAAAAAEAAAb+/bwAAAUzAAD/UQUsAAEAAAAAAAAAAAAAAAAAAABYAAEAAABfAE4AAwAAAAAAAQAAAAAACgAAAgAASwAAAAAAAwNBAZAABQAAA1gDWAAABLADWANYAAAEsABkAfQAAAIABQMGAAACAAQAAAABAAAAAAAAAAAAAAAAICAgIABAACEAfgb+/bwAAAb+AkQAAAABAAAAAAOiBOwAAAAgAAIDMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAHVAIMDMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAAEwwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAMzAAADMwAAAzMAAAR9ACkDMwAAAz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E8AUgAgAEEAIABQAEEAUgBUAEkAQwBVAEwAQQBSACAAUABVAFIAUABPAFMARQAgAEEATgBEACAATgBPAE4ASQBOAEYAUgBJAE4ARwBFAE0ARQBOAFQAIABPAEYAIABDAE8AUABZAFIASQBHAEgAVAAsACAAUABBAFQARQBOAFQALAAgAFQAUgBBAEQARQBNAEEAUgBLACwAIABPAFIAIABPAFQASABFAFIAIABSAEkARwBIAFQALgAgAEkATgAgAE4ATwAgAEUAVgBFAE4AVAAgAFMASABBAEwATAAgAFQASABFACAAQwBPAFAAWQBSAEkARwBIAFQAIABIAE8ATABEAEUAUgAgAEIARQAgAEwASQBBAEIATABFACAARgBPAFIAIABBAE4AWQAgAEMATABBAEkATQAsACAARABBAE0AQQBHAEUAUwAgAE8AUgAgAE8AVABIAEUAUgAgAEwASQBBAEIASQBMAEkAVABZACwAIABJAE4AQwBMAFUARABJAE4ARwAgAEEATgBZACAARwBFAE4ARQBSAEEATAAsACAAUwBQAEUAQwBJAEEATAAsACAASQBOAEQASQBSAEUAQwBUACwAIABJAE4AQwBJAEQARQBOAFQAQQBMACwAIABPAFIAIABDAE8ATgBTAEUAUQBVAEUATgBUAEkAQQBMACAARABBAE0AQQBHAEUAUwAsACAAVwBIAEUAVABIAEUAUgAgAEkATgAgAEEATgAgAEEAQwBUAEkATwBOACAATwBGACAAQwBPAE4AVABSAEEAQwBUACwAIABUAE8AUgBUACAATwBSACAATwBUAEgARQBSAFcASQBTAEUALAAgAEEAUgBJAFMASQBOAEcAIABGAFIATwBNACwAIABPAFUAVAAgAE8ARgAgAFQASABFACAAVQBTAEUAIABPAFIAIABJAE4AQQBCAEkATABJAFQAWQAgAFQATwAgAFUAUwBFACAAVABIAEUAIABGAE8ATgBUACAAUwBPAEYAVABXAEEAUgBFACAATwBSACAARgBSAE8ATQAgAE8AVABIAEUAUgAgAEQARQBBAEwASQBOAEcAUwAgAEkATgAgAFQASABFACAARgBPAE4AVAAgAFMATwBGAFQAVwBBAFIARQAuAAAAAgAAAAAAAP8GAGQAAAAAAAAAAAAAAAAAAAAAAAAAAABfAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQAAAAMACAACABAAAf//AAIAAAABAAAAAAABAAAADgAAAAAAAAAAAAIAAQAAAF4AAQABAAAACgBKAGQAAmN5cmwADmxhdG4AGAAEAAAAAP//AAAAEAACSVBBIAAaVklUIAAiAAD//wACAAEAAAAA//8AAQABAAD//wAAAAJrZXJuAA5tYXJrABQAAAABAAEAAAABAAAAAgAGAA4ABAAEAAEAEAACAAAAAQAsAAEADAAQAAAAIAAiAAIAAAABAAYAIQAyADYAQQBSAFYAAAAGAAEAjgAEAAAABgAWADAASgBkAHIAgAAGAA7/nAAhADYAQQA2ADIADQA2//IAUgAXAAYADv+cACEAWABBAFgAMgChADYAvQBSAE8ABgAO/nAAIf6TAEH+kwAy//kANgAOAFL/YQADAA7/nABSABcAVv/VAAMADv+cAFIANgBWAEwAAwAO/nAAUgAJAFYAGQABAAYAIQAyADYAQQBSAFYAAQAAAAoATgBoAAJjeXJsAA5sYXRuABoABAAAAAD//wABAAAAEAACSVBBIAAaVklUIAAiAAD//wACAAAAAQAA//8AAQAAAAD//wABAAAAAmFhbHQADnNtY3AAFAAAAAEAAAAAAAEAAAABAAQAAwAAAAEACAABABgAAwAMABAAFAABAEEAAQBSAAEAVgABAAMAIQAyADYAAA==) format('opentype');} \ No newline at end of file diff --git a/gabc.js b/gabc.js new file mode 100644 index 0000000..ef0c459 --- /dev/null +++ b/gabc.js @@ -0,0 +1,44 @@ +class GregoChant extends HTMLElement { + constructor() { + super() + this.score_src = this.innerText + } + connectedCallback() { + /* testing exsurge */ + var ctxt = new exsurge.ChantContext(); + ctxt.lyricTextFont = "'Crimson Text', serif"; + ctxt.lyricTextSize *= 1.2; + ctxt.dropCapTextFont = ctxt.lyricTextFont; + ctxt.annotationTextFont = ctxt.lyricTextFont; + var score; + if (score) { + exsurge.Gabc.updateMappingsFromSource(ctxt, score.mappings, this.score_src); + score.updateNotations(ctxt); + } else { + var mappings = exsurge.Gabc.createMappingsFromSource(ctxt, this.score_src); + var useDropCap = true; + var useDropCapAttr = this.getAttribute("use-drop-cap"); + if (useDropCapAttr === 'false') + useDropCap = false; + score = new exsurge.ChantScore(ctxt, mappings, useDropCap); + var annotationAttr = this.getAttribute("annotation"); + if (annotationAttr) { + // add an annotation + score.annotation = new exsurge.Annotation(ctxt, annotationAttr); + } + } + this.doLayout = () => { + // perform layout on the chant + score.performLayoutAsync(ctxt, () => { + score.layoutChantLines(ctxt, this.clientWidth, () => { + // render the score to svg code + this.innerHTML = score.createSvg(ctxt); + }); + }); + } + this.doLayout() + new ResizeObserver(this.doLayout).observe(this) + } +} + +window.customElements.define("grego-chant", GregoChant); diff --git a/tree.xsl b/tree.xsl index 95f1b10..258a827 100644 --- a/tree.xsl +++ b/tree.xsl @@ -12,6 +12,8 @@ + + + -- 2.51.2