@vue-skuilder/cli 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/cli.js +8 -0
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/studio.d.ts +3 -0
  4. package/dist/commands/studio.d.ts.map +1 -0
  5. package/dist/commands/studio.js +396 -0
  6. package/dist/commands/studio.js.map +1 -0
  7. package/dist/commands/unpack.d.ts +3 -0
  8. package/dist/commands/unpack.d.ts.map +1 -0
  9. package/dist/commands/unpack.js +228 -0
  10. package/dist/commands/unpack.js.map +1 -0
  11. package/dist/studio-ui-assets/assets/BrowseView-BJbixGOU.js +2 -0
  12. package/dist/studio-ui-assets/assets/BrowseView-BJbixGOU.js.map +1 -0
  13. package/dist/studio-ui-assets/assets/BrowseView-CM4HBO4j.css +1 -0
  14. package/dist/studio-ui-assets/assets/BulkImportView-DB6DYDJU.js +2 -0
  15. package/dist/studio-ui-assets/assets/BulkImportView-DB6DYDJU.js.map +1 -0
  16. package/dist/studio-ui-assets/assets/BulkImportView-g4wQUfPA.css +1 -0
  17. package/dist/studio-ui-assets/assets/CourseEditorView-BIlhlhw1.js +2 -0
  18. package/dist/studio-ui-assets/assets/CourseEditorView-BIlhlhw1.js.map +1 -0
  19. package/dist/studio-ui-assets/assets/CourseEditorView-WuPNLVKp.css +1 -0
  20. package/dist/studio-ui-assets/assets/CreateCardView-CyNOKCkm.css +1 -0
  21. package/dist/studio-ui-assets/assets/CreateCardView-DPjPvzzt.js +2 -0
  22. package/dist/studio-ui-assets/assets/CreateCardView-DPjPvzzt.js.map +1 -0
  23. package/dist/studio-ui-assets/assets/edit-ui.es-DiUxqbgF.js +330 -0
  24. package/dist/studio-ui-assets/assets/edit-ui.es-DiUxqbgF.js.map +1 -0
  25. package/dist/studio-ui-assets/assets/index--zY88pg6.css +14 -0
  26. package/dist/studio-ui-assets/assets/index-BnAv1C72.js +287 -0
  27. package/dist/studio-ui-assets/assets/index-BnAv1C72.js.map +1 -0
  28. package/dist/studio-ui-assets/assets/index-DHMXQY3-.js +192 -0
  29. package/dist/studio-ui-assets/assets/index-DHMXQY3-.js.map +1 -0
  30. package/dist/studio-ui-assets/assets/materialdesignicons-webfont-B7mPwVP_.ttf +0 -0
  31. package/dist/studio-ui-assets/assets/materialdesignicons-webfont-CSr8KVlo.eot +0 -0
  32. package/dist/studio-ui-assets/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 +0 -0
  33. package/dist/studio-ui-assets/assets/materialdesignicons-webfont-PXm3-2wK.woff +0 -0
  34. package/dist/studio-ui-assets/assets/vue-DZcMATiC.js +28 -0
  35. package/dist/studio-ui-assets/assets/vue-DZcMATiC.js.map +1 -0
  36. package/dist/studio-ui-assets/assets/vuetify-qg7mRxy_.js +6 -0
  37. package/dist/studio-ui-assets/assets/vuetify-qg7mRxy_.js.map +1 -0
  38. package/dist/studio-ui-assets/index.html +16 -0
  39. package/dist/utils/NodeFileSystemAdapter.d.ts +14 -0
  40. package/dist/utils/NodeFileSystemAdapter.d.ts.map +1 -0
  41. package/dist/utils/NodeFileSystemAdapter.js +55 -0
  42. package/dist/utils/NodeFileSystemAdapter.js.map +1 -0
  43. package/dist/utils/template.d.ts +1 -1
  44. package/dist/utils/template.d.ts.map +1 -1
  45. package/dist/utils/template.js +19 -5
  46. package/dist/utils/template.js.map +1 -1
  47. package/package.json +7 -4
  48. package/src/cli.ts +8 -0
  49. package/src/commands/studio.ts +497 -0
  50. package/src/commands/unpack.ts +259 -0
  51. package/src/utils/NodeFileSystemAdapter.ts +72 -0
  52. package/src/utils/template.ts +26 -7
@@ -0,0 +1,287 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DHMXQY3-.js","assets/vue-DZcMATiC.js","assets/vuetify-qg7mRxy_.js","assets/index--zY88pg6.css"])))=>i.map(i=>d[i]);
2
+ import{S as ur,N as Rg,Q as fi,l as t7,s as r7,j as i7,F as br,D as di,c as fl,u as ri,k as ii,A as zd,U as Ra,n as n7,R as Bl,h as Bg,o as s7,m as a7}from"./index-DHMXQY3-.js";import{N as o7,h as Vr,ai as Pt,aj as St,ak as ht,am as Or,V as ir,F as qr,as as An,d as Lt,c as Sr,x as Nn,R as ql,X as hr,m as xr,Q as Qr,A as l7,q as r3,H as c7,W as u7,aq as h7,an as ho,ao as _n,ar as ei,av as f7,w as d7}from"./vue-DZcMATiC.js";const i3={NonEmptyString:{instructions:"",test:e=>e.length!==0?{status:ur.ok,msg:""}:{status:ur.error,msg:"Input cannot be empty"}}};var p7=Object.defineProperty,g7=(e,t,n)=>t in e?p7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t,n)=>g7(e,typeof t!="symbol"?t+"":t,n),ol=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function v7(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var i0={exports:{}};/**
3
+ * @license
4
+ * Lodash <https://lodash.com/>
5
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
6
+ * Released under MIT license <https://lodash.com/license>
7
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
8
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
9
+ */var m7=i0.exports,qg;function _7(){return qg||(qg=1,function(e,t){(function(){var n,a="4.17.21",o=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",h="Expected a function",f="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",S=500,M="__lodash_placeholder__",C=1,y=2,g=4,w=1,p=2,E=1,N=2,I=4,O=8,V=16,U=32,D=64,me=128,B=256,ie=512,he=30,ae="...",fe=800,le=16,Y=1,$=2,ne=3,we=1/0,ye=9007199254740991,F=17976931348623157e292,H=NaN,W=4294967295,_e=W-1,Te=W>>>1,Re=[["ary",me],["bind",E],["bindKey",N],["curry",O],["curryRight",V],["flip",ie],["partial",U],["partialRight",D],["rearg",B]],Ie="[object Arguments]",st="[object Array]",wt="[object AsyncFunction]",Ze="[object Boolean]",dt="[object Date]",bt="[object DOMException]",et="[object Error]",Nt="[object Function]",xt="[object GeneratorFunction]",at="[object Map]",rr="[object Number]",Xt="[object Null]",Ht="[object Object]",nr="[object Promise]",Ar="[object Proxy]",fr="[object RegExp]",qe="[object Set]",je="[object String]",Fe="[object Symbol]",Ue="[object Undefined]",Qe="[object WeakMap]",r="[object WeakSet]",c="[object ArrayBuffer]",m="[object DataView]",x="[object Float32Array]",k="[object Float64Array]",T="[object Int8Array]",R="[object Int16Array]",L="[object Int32Array]",q="[object Uint8Array]",z="[object Uint8ClampedArray]",X="[object Uint16Array]",Z="[object Uint32Array]",Q=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,ce=/(__e\(.*?\)|\b__t\)) \+\n'';/g,te=/&(?:amp|lt|gt|quot|#39);/g,oe=/[&<>"']/g,ee=RegExp(te.source),re=RegExp(oe.source),K=/<%-([\s\S]+?)%>/g,se=/<%([\s\S]+?)%>/g,de=/<%=([\s\S]+?)%>/g,ve=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ue=/^\w*$/,Ce=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Me=/[\\^$.*+?()[\]{}|]/g,Ae=RegExp(Me.source),Oe=/^\s+/,ke=/\s/,Le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,De=/\{\n\/\* \[wrapped with (.+)\] \*/,ze=/,? & /,He=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,$e=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vt=/\w*$/,kt=/^[-+]0x[0-9a-f]+$/i,tt=/^0b[01]+$/i,nt=/^\[object .+?Constructor\]$/,_t=/^0o[0-7]+$/i,Et=/^(?:0|[1-9]\d*)$/,Mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dt=/($^)/,Rt=/['\n\r\u2028\u2029\\]/g,Ft="\\ud800-\\udfff",$t="\\u0300-\\u036f",Vt="\\ufe20-\\ufe2f",Rr="\\u20d0-\\u20ff",Br=$t+Vt+Rr,Kr="\\u2700-\\u27bf",mt="a-z\\xdf-\\xf6\\xf8-\\xff",pr="\\xac\\xb1\\xd7\\xf7",wr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",pi="\\u2000-\\u206f",Gr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",gi="A-Z\\xc0-\\xd6\\xd8-\\xde",Zi="\\ufe0e\\ufe0f",xi=pr+wr+pi+Gr,vi="['’]",mi="["+Ft+"]",si="["+xi+"]",Yr="["+Br+"]",Lr="\\d+",Rs="["+Kr+"]",Bs="["+mt+"]",aa="[^"+Ft+xi+Lr+Kr+mt+gi+"]",qs="\\ud83c[\\udffb-\\udfff]",Ha="(?:"+Yr+"|"+qs+")",oa="[^"+Ft+"]",Ji="(?:\\ud83c[\\udde6-\\uddff]){2}",On="[\\ud800-\\udbff][\\udc00-\\udfff]",Fi="["+gi+"]",Dn="\\u200d",zi="(?:"+Bs+"|"+aa+")",Qt="(?:"+Fi+"|"+aa+")",Ni="(?:"+vi+"(?:d|ll|m|re|s|t|ve))?",wi="(?:"+vi+"(?:D|LL|M|RE|S|T|VE))?",Li=Ha+"?",Ci="["+Zi+"]?",Rn="(?:"+Dn+"(?:"+[oa,Ji,On].join("|")+")"+Ci+Li+")*",la="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ca="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",d=Ci+Li+Rn,P="(?:"+[Rs,Ji,On].join("|")+")"+d,J="(?:"+[oa+Yr+"?",Yr,Ji,On,mi].join("|")+")",pe=RegExp(vi,"g"),Ee=RegExp(Yr,"g"),We=RegExp(qs+"(?="+qs+")|"+J+d,"g"),Ke=RegExp([Fi+"?"+Bs+"+"+Ni+"(?="+[si,Fi,"$"].join("|")+")",Qt+"+"+wi+"(?="+[si,Fi+zi,"$"].join("|")+")",Fi+"?"+zi+"+"+Ni,Fi+"+"+wi,ca,la,Lr,P].join("|"),"g"),pt=RegExp("["+Dn+Ft+Br+Zi+"]"),yt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Gt=-1,jt={};jt[x]=jt[k]=jt[T]=jt[R]=jt[L]=jt[q]=jt[z]=jt[X]=jt[Z]=!0,jt[Ie]=jt[st]=jt[c]=jt[Ze]=jt[m]=jt[dt]=jt[et]=jt[Nt]=jt[at]=jt[rr]=jt[Ht]=jt[fr]=jt[qe]=jt[je]=jt[Qe]=!1;var gr={};gr[Ie]=gr[st]=gr[c]=gr[m]=gr[Ze]=gr[dt]=gr[x]=gr[k]=gr[T]=gr[R]=gr[L]=gr[at]=gr[rr]=gr[Ht]=gr[fr]=gr[qe]=gr[je]=gr[Fe]=gr[q]=gr[z]=gr[X]=gr[Z]=!0,gr[et]=gr[Nt]=gr[Qe]=!1;var is={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Bn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ns={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Hi={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qn=parseFloat,ic=parseInt,ko=typeof ol=="object"&&ol&&ol.Object===Object&&ol,Va=typeof self=="object"&&self&&self.Object===Object&&self,ai=ko||Va||Function("return this")(),Mo=t&&!t.nodeType&&t,Fn=Mo&&!0&&e&&!e.nodeType&&e,k0=Fn&&Fn.exports===Mo,Ua=k0&&ko.process,Vi=function(){try{var Ve=Fn&&Fn.require&&Fn.require("util").types;return Ve||Ua&&Ua.binding&&Ua.binding("util")}catch{}}(),ua=Vi&&Vi.isArrayBuffer,ss=Vi&&Vi.isDate,ha=Vi&&Vi.isMap,Eo=Vi&&Vi.isRegExp,zn=Vi&&Vi.isSet,Ao=Vi&&Vi.isTypedArray;function kr(Ve,it,Xe){switch(Xe.length){case 0:return Ve.call(it);case 1:return Ve.call(it,Xe[0]);case 2:return Ve.call(it,Xe[0],Xe[1]);case 3:return Ve.call(it,Xe[0],Xe[1],Xe[2])}return Ve.apply(it,Xe)}function nc(Ve,it,Xe,xe){for(var Pe=-1,Ye=Ve==null?0:Ve.length;++Pe<Ye;){var Je=Ve[Pe];it(xe,Je,Xe(Je),Ve)}return xe}function ki(Ve,it){for(var Xe=-1,xe=Ve==null?0:Ve.length;++Xe<xe&&it(Ve[Xe],Xe,Ve)!==!1;);return Ve}function Fs(Ve,it){for(var Xe=Ve==null?0:Ve.length;Xe--&&it(Ve[Xe],Xe,Ve)!==!1;);return Ve}function M0(Ve,it){for(var Xe=-1,xe=Ve==null?0:Ve.length;++Xe<xe;)if(!it(Ve[Xe],Xe,Ve))return!1;return!0}function Hn(Ve,it){for(var Xe=-1,xe=Ve==null?0:Ve.length,Pe=0,Ye=[];++Xe<xe;){var Je=Ve[Xe];it(Je,Xe,Ve)&&(Ye[Pe++]=Je)}return Ye}function Ga(Ve,it){var Xe=Ve==null?0:Ve.length;return!!Xe&&os(Ve,it,0)>-1}function To(Ve,it,Xe){for(var xe=-1,Pe=Ve==null?0:Ve.length;++xe<Pe;)if(Xe(it,Ve[xe]))return!0;return!1}function Dr(Ve,it){for(var Xe=-1,xe=Ve==null?0:Ve.length,Pe=Array(xe);++Xe<xe;)Pe[Xe]=it(Ve[Xe],Xe,Ve);return Pe}function Vn(Ve,it){for(var Xe=-1,xe=it.length,Pe=Ve.length;++Xe<xe;)Ve[Pe+Xe]=it[Xe];return Ve}function Po(Ve,it,Xe,xe){var Pe=-1,Ye=Ve==null?0:Ve.length;for(xe&&Ye&&(Xe=Ve[++Pe]);++Pe<Ye;)Xe=it(Xe,Ve[Pe],Pe,Ve);return Xe}function sc(Ve,it,Xe,xe){var Pe=Ve==null?0:Ve.length;for(xe&&Pe&&(Xe=Ve[--Pe]);Pe--;)Xe=it(Xe,Ve[Pe],Pe,Ve);return Xe}function Io(Ve,it){for(var Xe=-1,xe=Ve==null?0:Ve.length;++Xe<xe;)if(it(Ve[Xe],Xe,Ve))return!0;return!1}var as=Wa("length");function ni(Ve){return Ve.split("")}function E0(Ve){return Ve.match(He)||[]}function zs(Ve,it,Xe){var xe;return Xe(Ve,function(Pe,Ye,Je){if(it(Pe,Ye,Je))return xe=Ye,!1}),xe}function Ya(Ve,it,Xe,xe){for(var Pe=Ve.length,Ye=Xe+(xe?1:-1);xe?Ye--:++Ye<Pe;)if(it(Ve[Ye],Ye,Ve))return Ye;return-1}function os(Ve,it,Xe){return it===it?Oo(Ve,it,Xe):Ya(Ve,fa,Xe)}function ac(Ve,it,Xe,xe){for(var Pe=Xe-1,Ye=Ve.length;++Pe<Ye;)if(xe(Ve[Pe],it))return Pe;return-1}function fa(Ve){return Ve!==Ve}function ls(Ve,it){var Xe=Ve==null?0:Ve.length;return Xe?Ka(Ve,it)/Xe:H}function Wa(Ve){return function(it){return it==null?n:it[Ve]}}function $a(Ve){return function(it){return Ve==null?n:Ve[it]}}function vr(Ve,it,Xe,xe,Pe){return Pe(Ve,function(Ye,Je,Ct){Xe=xe?(xe=!1,Ye):it(Xe,Ye,Je,Ct)}),Xe}function No(Ve,it){var Xe=Ve.length;for(Ve.sort(it);Xe--;)Ve[Xe]=Ve[Xe].value;return Ve}function Ka(Ve,it){for(var Xe,xe=-1,Pe=Ve.length;++xe<Pe;){var Ye=it(Ve[xe]);Ye!==n&&(Xe=Xe===n?Ye:Xe+Ye)}return Xe}function ja(Ve,it){for(var Xe=-1,xe=Array(Ve);++Xe<Ve;)xe[Xe]=it(Xe);return xe}function oi(Ve,it){return Dr(it,function(Xe){return[Xe,Ve[Xe]]})}function Sn(Ve){return Ve&&Ve.slice(0,Za(Ve)+1).replace(Oe,"")}function qt(Ve){return function(it){return Ve(it)}}function da(Ve,it){return Dr(it,function(Xe){return Ve[Xe]})}function Pr(Ve,it){return Ve.has(it)}function pa(Ve,it){for(var Xe=-1,xe=Ve.length;++Xe<xe&&os(it,Ve[Xe],0)>-1;);return Xe}function Un(Ve,it){for(var Xe=Ve.length;Xe--&&os(it,Ve[Xe],0)>-1;);return Xe}function jr(Ve,it){for(var Xe=Ve.length,xe=0;Xe--;)Ve[Xe]===it&&++xe;return xe}var xn=$a(is),Xa=$a(Bn);function oc(Ve){return"\\"+Hi[Ve]}function Lo(Ve,it){return Ve==null?n:Ve[it]}function Hs(Ve){return pt.test(Ve)}function en(Ve){return yt.test(Ve)}function ga(Ve){for(var it,Xe=[];!(it=Ve.next()).done;)Xe.push(it.value);return Xe}function cs(Ve){var it=-1,Xe=Array(Ve.size);return Ve.forEach(function(xe,Pe){Xe[++it]=[Pe,xe]}),Xe}function Qa(Ve,it){return function(Xe){return Ve(it(Xe))}}function Cn(Ve,it){for(var Xe=-1,xe=Ve.length,Pe=0,Ye=[];++Xe<xe;){var Je=Ve[Xe];(Je===it||Je===M)&&(Ve[Xe]=M,Ye[Pe++]=Xe)}return Ye}function va(Ve){var it=-1,Xe=Array(Ve.size);return Ve.forEach(function(xe){Xe[++it]=xe}),Xe}function _i(Ve){var it=-1,Xe=Array(Ve.size);return Ve.forEach(function(xe){Xe[++it]=[xe,xe]}),Xe}function Oo(Ve,it,Xe){for(var xe=Xe-1,Pe=Ve.length;++xe<Pe;)if(Ve[xe]===it)return xe;return-1}function lc(Ve,it,Xe){for(var xe=Xe+1;xe--;)if(Ve[xe]===it)return xe;return xe}function Vs(Ve){return Hs(Ve)?ma(Ve):as(Ve)}function Oi(Ve){return Hs(Ve)?Do(Ve):ni(Ve)}function Za(Ve){for(var it=Ve.length;it--&&ke.test(Ve.charAt(it)););return it}var cc=$a(ns);function ma(Ve){for(var it=We.lastIndex=0;We.test(Ve);)++it;return it}function Do(Ve){return Ve.match(We)||[]}function uc(Ve){return Ve.match(Ke)||[]}var hc=function Ve(it){it=it==null?ai:us.defaults(ai.Object(),it,us.pick(ai,Zt));var Xe=it.Array,xe=it.Date,Pe=it.Error,Ye=it.Function,Je=it.Math,Ct=it.Object,zt=it.RegExp,Kt=it.String,Jt=it.TypeError,Mi=Xe.prototype,hs=Ye.prototype,Gn=Ct.prototype,fs=it["__core-js_shared__"],Ja=hs.toString,Ir=Gn.hasOwnProperty,Xy=0,$1=function(){var u=/[^.]+$/.exec(fs&&fs.keys&&fs.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),A0=Gn.toString,Qy=Ja.call(Ct),Zy=ai._,Jy=zt("^"+Ja.call(Ir).replace(Me,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T0=k0?it.Buffer:n,Us=it.Symbol,P0=it.Uint8Array,K1=T0?T0.allocUnsafe:n,I0=Qa(Ct.getPrototypeOf,Ct),j1=Ct.create,X1=Gn.propertyIsEnumerable,N0=Mi.splice,Q1=Us?Us.isConcatSpreadable:n,Ro=Us?Us.iterator:n,_a=Us?Us.toStringTag:n,L0=function(){try{var u=xa(Ct,"defineProperty");return u({},"",{}),u}catch{}}(),e5=it.clearTimeout!==ai.clearTimeout&&it.clearTimeout,t5=xe&&xe.now!==ai.Date.now&&xe.now,r5=it.setTimeout!==ai.setTimeout&&it.setTimeout,O0=Je.ceil,D0=Je.floor,fc=Ct.getOwnPropertySymbols,i5=T0?T0.isBuffer:n,Z1=it.isFinite,n5=Mi.join,s5=Qa(Ct.keys,Ct),li=Je.max,Ei=Je.min,a5=xe.now,o5=it.parseInt,J1=Je.random,l5=Mi.reverse,dc=xa(it,"DataView"),Bo=xa(it,"Map"),pc=xa(it,"Promise"),eo=xa(it,"Set"),qo=xa(it,"WeakMap"),Fo=xa(Ct,"create"),R0=qo&&new qo,to={},c5=Ca(dc),u5=Ca(Bo),h5=Ca(pc),f5=Ca(eo),d5=Ca(qo),B0=Us?Us.prototype:n,zo=B0?B0.valueOf:n,ep=B0?B0.toString:n;function be(u){if(Xr(u)&&!tr(u)&&!(u instanceof mr)){if(u instanceof cn)return u;if(Ir.call(u,"__wrapped__"))return tg(u)}return new cn(u)}var ro=function(){function u(){}return function(_){if(!Wr(_))return{};if(j1)return j1(_);u.prototype=_;var A=new u;return u.prototype=n,A}}();function q0(){}function cn(u,_){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!_,this.__index__=0,this.__values__=n}be.templateSettings={escape:K,evaluate:se,interpolate:de,variable:"",imports:{_:be}},be.prototype=q0.prototype,be.prototype.constructor=be,cn.prototype=ro(q0.prototype),cn.prototype.constructor=cn;function mr(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=W,this.__views__=[]}function p5(){var u=new mr(this.__wrapped__);return u.__actions__=Ui(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Ui(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Ui(this.__views__),u}function g5(){if(this.__filtered__){var u=new mr(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function v5(){var u=this.__wrapped__.value(),_=this.__dir__,A=tr(u),G=_<0,ge=A?u.length:0,Se=A6(0,ge,this.__views__),Ne=Se.start,Be=Se.end,Ge=Be-Ne,ot=G?Be:Ne-1,lt=this.__iteratees__,ut=lt.length,At=0,Ot=Ei(Ge,this.__takeCount__);if(!A||!G&&ge==Ge&&Ot==Ge)return Cp(u,this.__actions__);var Yt=[];e:for(;Ge--&&At<Ot;){ot+=_;for(var lr=-1,Wt=u[ot];++lr<ut;){var dr=lt[lr],yr=dr.iteratee,nn=dr.type,Bi=yr(Wt);if(nn==$)Wt=Bi;else if(!Bi){if(nn==Y)continue e;break e}}Yt[At++]=Wt}return Yt}mr.prototype=ro(q0.prototype),mr.prototype.constructor=mr;function ba(u){var _=-1,A=u==null?0:u.length;for(this.clear();++_<A;){var G=u[_];this.set(G[0],G[1])}}function m5(){this.__data__=Fo?Fo(null):{},this.size=0}function _5(u){var _=this.has(u)&&delete this.__data__[u];return this.size-=_?1:0,_}function b5(u){var _=this.__data__;if(Fo){var A=_[u];return A===b?n:A}return Ir.call(_,u)?_[u]:n}function y5(u){var _=this.__data__;return Fo?_[u]!==n:Ir.call(_,u)}function w5(u,_){var A=this.__data__;return this.size+=this.has(u)?0:1,A[u]=Fo&&_===n?b:_,this}ba.prototype.clear=m5,ba.prototype.delete=_5,ba.prototype.get=b5,ba.prototype.has=y5,ba.prototype.set=w5;function ds(u){var _=-1,A=u==null?0:u.length;for(this.clear();++_<A;){var G=u[_];this.set(G[0],G[1])}}function S5(){this.__data__=[],this.size=0}function x5(u){var _=this.__data__,A=F0(_,u);if(A<0)return!1;var G=_.length-1;return A==G?_.pop():N0.call(_,A,1),--this.size,!0}function C5(u){var _=this.__data__,A=F0(_,u);return A<0?n:_[A][1]}function k5(u){return F0(this.__data__,u)>-1}function M5(u,_){var A=this.__data__,G=F0(A,u);return G<0?(++this.size,A.push([u,_])):A[G][1]=_,this}ds.prototype.clear=S5,ds.prototype.delete=x5,ds.prototype.get=C5,ds.prototype.has=k5,ds.prototype.set=M5;function ps(u){var _=-1,A=u==null?0:u.length;for(this.clear();++_<A;){var G=u[_];this.set(G[0],G[1])}}function E5(){this.size=0,this.__data__={hash:new ba,map:new(Bo||ds),string:new ba}}function A5(u){var _=Q0(this,u).delete(u);return this.size-=_?1:0,_}function T5(u){return Q0(this,u).get(u)}function P5(u){return Q0(this,u).has(u)}function I5(u,_){var A=Q0(this,u),G=A.size;return A.set(u,_),this.size+=A.size==G?0:1,this}ps.prototype.clear=E5,ps.prototype.delete=A5,ps.prototype.get=T5,ps.prototype.has=P5,ps.prototype.set=I5;function ya(u){var _=-1,A=u==null?0:u.length;for(this.__data__=new ps;++_<A;)this.add(u[_])}function N5(u){return this.__data__.set(u,b),this}function L5(u){return this.__data__.has(u)}ya.prototype.add=ya.prototype.push=N5,ya.prototype.has=L5;function kn(u){var _=this.__data__=new ds(u);this.size=_.size}function O5(){this.__data__=new ds,this.size=0}function D5(u){var _=this.__data__,A=_.delete(u);return this.size=_.size,A}function R5(u){return this.__data__.get(u)}function B5(u){return this.__data__.has(u)}function q5(u,_){var A=this.__data__;if(A instanceof ds){var G=A.__data__;if(!Bo||G.length<o-1)return G.push([u,_]),this.size=++A.size,this;A=this.__data__=new ps(G)}return A.set(u,_),this.size=A.size,this}kn.prototype.clear=O5,kn.prototype.delete=D5,kn.prototype.get=R5,kn.prototype.has=B5,kn.prototype.set=q5;function tp(u,_){var A=tr(u),G=!A&&ka(u),ge=!A&&!G&&Ks(u),Se=!A&&!G&&!ge&&ao(u),Ne=A||G||ge||Se,Be=Ne?ja(u.length,Kt):[],Ge=Be.length;for(var ot in u)(_||Ir.call(u,ot))&&!(Ne&&(ot=="length"||ge&&(ot=="offset"||ot=="parent")||Se&&(ot=="buffer"||ot=="byteLength"||ot=="byteOffset")||_s(ot,Ge)))&&Be.push(ot);return Be}function rp(u){var _=u.length;return _?u[kc(0,_-1)]:n}function F5(u,_){return Z0(Ui(u),wa(_,0,u.length))}function z5(u){return Z0(Ui(u))}function gc(u,_,A){(A!==n&&!Mn(u[_],A)||A===n&&!(_ in u))&&gs(u,_,A)}function Ho(u,_,A){var G=u[_];(!(Ir.call(u,_)&&Mn(G,A))||A===n&&!(_ in u))&&gs(u,_,A)}function F0(u,_){for(var A=u.length;A--;)if(Mn(u[A][0],_))return A;return-1}function H5(u,_,A,G){return Gs(u,function(ge,Se,Ne){_(G,ge,A(ge),Ne)}),G}function ip(u,_){return u&&Wn(_,bi(_),u)}function V5(u,_){return u&&Wn(_,Yi(_),u)}function gs(u,_,A){_=="__proto__"&&L0?L0(u,_,{configurable:!0,enumerable:!0,value:A,writable:!0}):u[_]=A}function vc(u,_){for(var A=-1,G=_.length,ge=Xe(G),Se=u==null;++A<G;)ge[A]=Se?n:Xc(u,_[A]);return ge}function wa(u,_,A){return u===u&&(A!==n&&(u=u<=A?u:A),_!==n&&(u=u>=_?u:_)),u}function un(u,_,A,G,ge,Se){var Ne,Be=_&C,Ge=_&y,ot=_&g;if(A&&(Ne=ge?A(u,G,ge,Se):A(u)),Ne!==n)return Ne;if(!Wr(u))return u;var lt=tr(u);if(lt){if(Ne=P6(u),!Be)return Ui(u,Ne)}else{var ut=Ai(u),At=ut==Nt||ut==xt;if(Ks(u))return Ep(u,Be);if(ut==Ht||ut==Ie||At&&!ge){if(Ne=Ge||At?{}:Wp(u),!Be)return Ge?b6(u,V5(Ne,u)):_6(u,ip(Ne,u))}else{if(!gr[ut])return ge?u:{};Ne=I6(u,ut,Be)}}Se||(Se=new kn);var Ot=Se.get(u);if(Ot)return Ot;Se.set(u,Ne),wg(u)?u.forEach(function(Wt){Ne.add(un(Wt,_,A,Wt,u,Se))}):bg(u)&&u.forEach(function(Wt,dr){Ne.set(dr,un(Wt,_,A,dr,u,Se))});var Yt=ot?Ge?Rc:Dc:Ge?Yi:bi,lr=lt?n:Yt(u);return ki(lr||u,function(Wt,dr){lr&&(dr=Wt,Wt=u[dr]),Ho(Ne,dr,un(Wt,_,A,dr,u,Se))}),Ne}function U5(u){var _=bi(u);return function(A){return np(A,u,_)}}function np(u,_,A){var G=A.length;if(u==null)return!G;for(u=Ct(u);G--;){var ge=A[G],Se=_[ge],Ne=u[ge];if(Ne===n&&!(ge in u)||!Se(Ne))return!1}return!0}function sp(u,_,A){if(typeof u!="function")throw new Jt(h);return Ko(function(){u.apply(n,A)},_)}function Vo(u,_,A,G){var ge=-1,Se=Ga,Ne=!0,Be=u.length,Ge=[],ot=_.length;if(!Be)return Ge;A&&(_=Dr(_,qt(A))),G?(Se=To,Ne=!1):_.length>=o&&(Se=Pr,Ne=!1,_=new ya(_));e:for(;++ge<Be;){var lt=u[ge],ut=A==null?lt:A(lt);if(lt=G||lt!==0?lt:0,Ne&&ut===ut){for(var At=ot;At--;)if(_[At]===ut)continue e;Ge.push(lt)}else Se(_,ut,G)||Ge.push(lt)}return Ge}var Gs=Np(Yn),ap=Np(_c,!0);function G5(u,_){var A=!0;return Gs(u,function(G,ge,Se){return A=!!_(G,ge,Se),A}),A}function z0(u,_,A){for(var G=-1,ge=u.length;++G<ge;){var Se=u[G],Ne=_(Se);if(Ne!=null&&(Be===n?Ne===Ne&&!rn(Ne):A(Ne,Be)))var Be=Ne,Ge=Se}return Ge}function Y5(u,_,A,G){var ge=u.length;for(A=sr(A),A<0&&(A=-A>ge?0:ge+A),G=G===n||G>ge?ge:sr(G),G<0&&(G+=ge),G=A>G?0:xg(G);A<G;)u[A++]=_;return u}function op(u,_){var A=[];return Gs(u,function(G,ge,Se){_(G,ge,Se)&&A.push(G)}),A}function Si(u,_,A,G,ge){var Se=-1,Ne=u.length;for(A||(A=L6),ge||(ge=[]);++Se<Ne;){var Be=u[Se];_>0&&A(Be)?_>1?Si(Be,_-1,A,G,ge):Vn(ge,Be):G||(ge[ge.length]=Be)}return ge}var mc=Lp(),lp=Lp(!0);function Yn(u,_){return u&&mc(u,_,bi)}function _c(u,_){return u&&lp(u,_,bi)}function H0(u,_){return Hn(_,function(A){return bs(u[A])})}function Sa(u,_){_=Ws(_,u);for(var A=0,G=_.length;u!=null&&A<G;)u=u[$n(_[A++])];return A&&A==G?u:n}function cp(u,_,A){var G=_(u);return tr(u)?G:Vn(G,A(u))}function Di(u){return u==null?u===n?Ue:Xt:_a&&_a in Ct(u)?E6(u):z6(u)}function bc(u,_){return u>_}function W5(u,_){return u!=null&&Ir.call(u,_)}function $5(u,_){return u!=null&&_ in Ct(u)}function K5(u,_,A){return u>=Ei(_,A)&&u<li(_,A)}function yc(u,_,A){for(var G=A?To:Ga,ge=u[0].length,Se=u.length,Ne=Se,Be=Xe(Se),Ge=1/0,ot=[];Ne--;){var lt=u[Ne];Ne&&_&&(lt=Dr(lt,qt(_))),Ge=Ei(lt.length,Ge),Be[Ne]=!A&&(_||ge>=120&&lt.length>=120)?new ya(Ne&&lt):n}lt=u[0];var ut=-1,At=Be[0];e:for(;++ut<ge&&ot.length<Ge;){var Ot=lt[ut],Yt=_?_(Ot):Ot;if(Ot=A||Ot!==0?Ot:0,!(At?Pr(At,Yt):G(ot,Yt,A))){for(Ne=Se;--Ne;){var lr=Be[Ne];if(!(lr?Pr(lr,Yt):G(u[Ne],Yt,A)))continue e}At&&At.push(Yt),ot.push(Ot)}}return ot}function j5(u,_,A,G){return Yn(u,function(ge,Se,Ne){_(G,A(ge),Se,Ne)}),G}function Uo(u,_,A){_=Ws(_,u),u=Xp(u,_);var G=u==null?u:u[$n(fn(_))];return G==null?n:kr(G,u,A)}function up(u){return Xr(u)&&Di(u)==Ie}function X5(u){return Xr(u)&&Di(u)==c}function Q5(u){return Xr(u)&&Di(u)==dt}function Go(u,_,A,G,ge){return u===_?!0:u==null||_==null||!Xr(u)&&!Xr(_)?u!==u&&_!==_:Z5(u,_,A,G,Go,ge)}function Z5(u,_,A,G,ge,Se){var Ne=tr(u),Be=tr(_),Ge=Ne?st:Ai(u),ot=Be?st:Ai(_);Ge=Ge==Ie?Ht:Ge,ot=ot==Ie?Ht:ot;var lt=Ge==Ht,ut=ot==Ht,At=Ge==ot;if(At&&Ks(u)){if(!Ks(_))return!1;Ne=!0,lt=!1}if(At&&!lt)return Se||(Se=new kn),Ne||ao(u)?Up(u,_,A,G,ge,Se):k6(u,_,Ge,A,G,ge,Se);if(!(A&w)){var Ot=lt&&Ir.call(u,"__wrapped__"),Yt=ut&&Ir.call(_,"__wrapped__");if(Ot||Yt){var lr=Ot?u.value():u,Wt=Yt?_.value():_;return Se||(Se=new kn),ge(lr,Wt,A,G,Se)}}return At?(Se||(Se=new kn),M6(u,_,A,G,ge,Se)):!1}function J5(u){return Xr(u)&&Ai(u)==at}function wc(u,_,A,G){var ge=A.length,Se=ge,Ne=!G;if(u==null)return!Se;for(u=Ct(u);ge--;){var Be=A[ge];if(Ne&&Be[2]?Be[1]!==u[Be[0]]:!(Be[0]in u))return!1}for(;++ge<Se;){Be=A[ge];var Ge=Be[0],ot=u[Ge],lt=Be[1];if(Ne&&Be[2]){if(ot===n&&!(Ge in u))return!1}else{var ut=new kn;if(G)var At=G(ot,lt,Ge,u,_,ut);if(!(At===n?Go(lt,ot,w|p,G,ut):At))return!1}}return!0}function hp(u){if(!Wr(u)||D6(u))return!1;var _=bs(u)?Jy:nt;return _.test(Ca(u))}function e6(u){return Xr(u)&&Di(u)==fr}function t6(u){return Xr(u)&&Ai(u)==qe}function r6(u){return Xr(u)&&nl(u.length)&&!!jt[Di(u)]}function fp(u){return typeof u=="function"?u:u==null?Wi:typeof u=="object"?tr(u)?gp(u[0],u[1]):pp(u):Og(u)}function Sc(u){if(!$o(u))return s5(u);var _=[];for(var A in Ct(u))Ir.call(u,A)&&A!="constructor"&&_.push(A);return _}function i6(u){if(!Wr(u))return F6(u);var _=$o(u),A=[];for(var G in u)G=="constructor"&&(_||!Ir.call(u,G))||A.push(G);return A}function xc(u,_){return u<_}function dp(u,_){var A=-1,G=Gi(u)?Xe(u.length):[];return Gs(u,function(ge,Se,Ne){G[++A]=_(ge,Se,Ne)}),G}function pp(u){var _=qc(u);return _.length==1&&_[0][2]?Kp(_[0][0],_[0][1]):function(A){return A===u||wc(A,u,_)}}function gp(u,_){return zc(u)&&$p(_)?Kp($n(u),_):function(A){var G=Xc(A,u);return G===n&&G===_?Qc(A,u):Go(_,G,w|p)}}function V0(u,_,A,G,ge){u!==_&&mc(_,function(Se,Ne){if(ge||(ge=new kn),Wr(Se))n6(u,_,Ne,A,V0,G,ge);else{var Be=G?G(Vc(u,Ne),Se,Ne+"",u,_,ge):n;Be===n&&(Be=Se),gc(u,Ne,Be)}},Yi)}function n6(u,_,A,G,ge,Se,Ne){var Be=Vc(u,A),Ge=Vc(_,A),ot=Ne.get(Ge);if(ot){gc(u,A,ot);return}var lt=Se?Se(Be,Ge,A+"",u,_,Ne):n,ut=lt===n;if(ut){var At=tr(Ge),Ot=!At&&Ks(Ge),Yt=!At&&!Ot&&ao(Ge);lt=Ge,At||Ot||Yt?tr(Be)?lt=Be:Zr(Be)?lt=Ui(Be):Ot?(ut=!1,lt=Ep(Ge,!0)):Yt?(ut=!1,lt=Ap(Ge,!0)):lt=[]:jo(Ge)||ka(Ge)?(lt=Be,ka(Be)?lt=Cg(Be):(!Wr(Be)||bs(Be))&&(lt=Wp(Ge))):ut=!1}ut&&(Ne.set(Ge,lt),ge(lt,Ge,G,Se,Ne),Ne.delete(Ge)),gc(u,A,lt)}function vp(u,_){var A=u.length;if(A)return _+=_<0?A:0,_s(_,A)?u[_]:n}function mp(u,_,A){_.length?_=Dr(_,function(Se){return tr(Se)?function(Ne){return Sa(Ne,Se.length===1?Se[0]:Se)}:Se}):_=[Wi];var G=-1;_=Dr(_,qt(Ut()));var ge=dp(u,function(Se,Ne,Be){var Ge=Dr(_,function(ot){return ot(Se)});return{criteria:Ge,index:++G,value:Se}});return No(ge,function(Se,Ne){return m6(Se,Ne,A)})}function s6(u,_){return _p(u,_,function(A,G){return Qc(u,G)})}function _p(u,_,A){for(var G=-1,ge=_.length,Se={};++G<ge;){var Ne=_[G],Be=Sa(u,Ne);A(Be,Ne)&&Yo(Se,Ws(Ne,u),Be)}return Se}function a6(u){return function(_){return Sa(_,u)}}function Cc(u,_,A,G){var ge=G?ac:os,Se=-1,Ne=_.length,Be=u;for(u===_&&(_=Ui(_)),A&&(Be=Dr(u,qt(A)));++Se<Ne;)for(var Ge=0,ot=_[Se],lt=A?A(ot):ot;(Ge=ge(Be,lt,Ge,G))>-1;)Be!==u&&N0.call(Be,Ge,1),N0.call(u,Ge,1);return u}function bp(u,_){for(var A=u?_.length:0,G=A-1;A--;){var ge=_[A];if(A==G||ge!==Se){var Se=ge;_s(ge)?N0.call(u,ge,1):Ac(u,ge)}}return u}function kc(u,_){return u+D0(J1()*(_-u+1))}function o6(u,_,A,G){for(var ge=-1,Se=li(O0((_-u)/(A||1)),0),Ne=Xe(Se);Se--;)Ne[G?Se:++ge]=u,u+=A;return Ne}function Mc(u,_){var A="";if(!u||_<1||_>ye)return A;do _%2&&(A+=u),_=D0(_/2),_&&(u+=u);while(_);return A}function cr(u,_){return Uc(jp(u,_,Wi),u+"")}function l6(u){return rp(oo(u))}function c6(u,_){var A=oo(u);return Z0(A,wa(_,0,A.length))}function Yo(u,_,A,G){if(!Wr(u))return u;_=Ws(_,u);for(var ge=-1,Se=_.length,Ne=Se-1,Be=u;Be!=null&&++ge<Se;){var Ge=$n(_[ge]),ot=A;if(Ge==="__proto__"||Ge==="constructor"||Ge==="prototype")return u;if(ge!=Ne){var lt=Be[Ge];ot=G?G(lt,Ge,Be):n,ot===n&&(ot=Wr(lt)?lt:_s(_[ge+1])?[]:{})}Ho(Be,Ge,ot),Be=Be[Ge]}return u}var yp=R0?function(u,_){return R0.set(u,_),u}:Wi,u6=L0?function(u,_){return L0(u,"toString",{configurable:!0,enumerable:!1,value:Jc(_),writable:!0})}:Wi;function h6(u){return Z0(oo(u))}function hn(u,_,A){var G=-1,ge=u.length;_<0&&(_=-_>ge?0:ge+_),A=A>ge?ge:A,A<0&&(A+=ge),ge=_>A?0:A-_>>>0,_>>>=0;for(var Se=Xe(ge);++G<ge;)Se[G]=u[G+_];return Se}function f6(u,_){var A;return Gs(u,function(G,ge,Se){return A=_(G,ge,Se),!A}),!!A}function U0(u,_,A){var G=0,ge=u==null?G:u.length;if(typeof _=="number"&&_===_&&ge<=Te){for(;G<ge;){var Se=G+ge>>>1,Ne=u[Se];Ne!==null&&!rn(Ne)&&(A?Ne<=_:Ne<_)?G=Se+1:ge=Se}return ge}return Ec(u,_,Wi,A)}function Ec(u,_,A,G){var ge=0,Se=u==null?0:u.length;if(Se===0)return 0;_=A(_);for(var Ne=_!==_,Be=_===null,Ge=rn(_),ot=_===n;ge<Se;){var lt=D0((ge+Se)/2),ut=A(u[lt]),At=ut!==n,Ot=ut===null,Yt=ut===ut,lr=rn(ut);if(Ne)var Wt=G||Yt;else ot?Wt=Yt&&(G||At):Be?Wt=Yt&&At&&(G||!Ot):Ge?Wt=Yt&&At&&!Ot&&(G||!lr):Ot||lr?Wt=!1:Wt=G?ut<=_:ut<_;Wt?ge=lt+1:Se=lt}return Ei(Se,_e)}function wp(u,_){for(var A=-1,G=u.length,ge=0,Se=[];++A<G;){var Ne=u[A],Be=_?_(Ne):Ne;if(!A||!Mn(Be,Ge)){var Ge=Be;Se[ge++]=Ne===0?0:Ne}}return Se}function Sp(u){return typeof u=="number"?u:rn(u)?H:+u}function tn(u){if(typeof u=="string")return u;if(tr(u))return Dr(u,tn)+"";if(rn(u))return ep?ep.call(u):"";var _=u+"";return _=="0"&&1/u==-1/0?"-0":_}function Ys(u,_,A){var G=-1,ge=Ga,Se=u.length,Ne=!0,Be=[],Ge=Be;if(A)Ne=!1,ge=To;else if(Se>=o){var ot=_?null:x6(u);if(ot)return va(ot);Ne=!1,ge=Pr,Ge=new ya}else Ge=_?[]:Be;e:for(;++G<Se;){var lt=u[G],ut=_?_(lt):lt;if(lt=A||lt!==0?lt:0,Ne&&ut===ut){for(var At=Ge.length;At--;)if(Ge[At]===ut)continue e;_&&Ge.push(ut),Be.push(lt)}else ge(Ge,ut,A)||(Ge!==Be&&Ge.push(ut),Be.push(lt))}return Be}function Ac(u,_){return _=Ws(_,u),u=Xp(u,_),u==null||delete u[$n(fn(_))]}function xp(u,_,A,G){return Yo(u,_,A(Sa(u,_)),G)}function G0(u,_,A,G){for(var ge=u.length,Se=G?ge:-1;(G?Se--:++Se<ge)&&_(u[Se],Se,u););return A?hn(u,G?0:Se,G?Se+1:ge):hn(u,G?Se+1:0,G?ge:Se)}function Cp(u,_){var A=u;return A instanceof mr&&(A=A.value()),Po(_,function(G,ge){return ge.func.apply(ge.thisArg,Vn([G],ge.args))},A)}function Tc(u,_,A){var G=u.length;if(G<2)return G?Ys(u[0]):[];for(var ge=-1,Se=Xe(G);++ge<G;)for(var Ne=u[ge],Be=-1;++Be<G;)Be!=ge&&(Se[ge]=Vo(Se[ge]||Ne,u[Be],_,A));return Ys(Si(Se,1),_,A)}function kp(u,_,A){for(var G=-1,ge=u.length,Se=_.length,Ne={};++G<ge;){var Be=G<Se?_[G]:n;A(Ne,u[G],Be)}return Ne}function Pc(u){return Zr(u)?u:[]}function Ic(u){return typeof u=="function"?u:Wi}function Ws(u,_){return tr(u)?u:zc(u,_)?[u]:eg(Tr(u))}var d6=cr;function $s(u,_,A){var G=u.length;return A=A===n?G:A,!_&&A>=G?u:hn(u,_,A)}var Mp=e5||function(u){return ai.clearTimeout(u)};function Ep(u,_){if(_)return u.slice();var A=u.length,G=K1?K1(A):new u.constructor(A);return u.copy(G),G}function Nc(u){var _=new u.constructor(u.byteLength);return new P0(_).set(new P0(u)),_}function p6(u,_){var A=_?Nc(u.buffer):u.buffer;return new u.constructor(A,u.byteOffset,u.byteLength)}function g6(u){var _=new u.constructor(u.source,vt.exec(u));return _.lastIndex=u.lastIndex,_}function v6(u){return zo?Ct(zo.call(u)):{}}function Ap(u,_){var A=_?Nc(u.buffer):u.buffer;return new u.constructor(A,u.byteOffset,u.length)}function Tp(u,_){if(u!==_){var A=u!==n,G=u===null,ge=u===u,Se=rn(u),Ne=_!==n,Be=_===null,Ge=_===_,ot=rn(_);if(!Be&&!ot&&!Se&&u>_||Se&&Ne&&Ge&&!Be&&!ot||G&&Ne&&Ge||!A&&Ge||!ge)return 1;if(!G&&!Se&&!ot&&u<_||ot&&A&&ge&&!G&&!Se||Be&&A&&ge||!Ne&&ge||!Ge)return-1}return 0}function m6(u,_,A){for(var G=-1,ge=u.criteria,Se=_.criteria,Ne=ge.length,Be=A.length;++G<Ne;){var Ge=Tp(ge[G],Se[G]);if(Ge){if(G>=Be)return Ge;var ot=A[G];return Ge*(ot=="desc"?-1:1)}}return u.index-_.index}function Pp(u,_,A,G){for(var ge=-1,Se=u.length,Ne=A.length,Be=-1,Ge=_.length,ot=li(Se-Ne,0),lt=Xe(Ge+ot),ut=!G;++Be<Ge;)lt[Be]=_[Be];for(;++ge<Ne;)(ut||ge<Se)&&(lt[A[ge]]=u[ge]);for(;ot--;)lt[Be++]=u[ge++];return lt}function Ip(u,_,A,G){for(var ge=-1,Se=u.length,Ne=-1,Be=A.length,Ge=-1,ot=_.length,lt=li(Se-Be,0),ut=Xe(lt+ot),At=!G;++ge<lt;)ut[ge]=u[ge];for(var Ot=ge;++Ge<ot;)ut[Ot+Ge]=_[Ge];for(;++Ne<Be;)(At||ge<Se)&&(ut[Ot+A[Ne]]=u[ge++]);return ut}function Ui(u,_){var A=-1,G=u.length;for(_||(_=Xe(G));++A<G;)_[A]=u[A];return _}function Wn(u,_,A,G){var ge=!A;A||(A={});for(var Se=-1,Ne=_.length;++Se<Ne;){var Be=_[Se],Ge=G?G(A[Be],u[Be],Be,A,u):n;Ge===n&&(Ge=u[Be]),ge?gs(A,Be,Ge):Ho(A,Be,Ge)}return A}function _6(u,_){return Wn(u,Fc(u),_)}function b6(u,_){return Wn(u,Gp(u),_)}function Y0(u,_){return function(A,G){var ge=tr(A)?nc:H5,Se=_?_():{};return ge(A,u,Ut(G,2),Se)}}function io(u){return cr(function(_,A){var G=-1,ge=A.length,Se=ge>1?A[ge-1]:n,Ne=ge>2?A[2]:n;for(Se=u.length>3&&typeof Se=="function"?(ge--,Se):n,Ne&&Ri(A[0],A[1],Ne)&&(Se=ge<3?n:Se,ge=1),_=Ct(_);++G<ge;){var Be=A[G];Be&&u(_,Be,G,Se)}return _})}function Np(u,_){return function(A,G){if(A==null)return A;if(!Gi(A))return u(A,G);for(var ge=A.length,Se=_?ge:-1,Ne=Ct(A);(_?Se--:++Se<ge)&&G(Ne[Se],Se,Ne)!==!1;);return A}}function Lp(u){return function(_,A,G){for(var ge=-1,Se=Ct(_),Ne=G(_),Be=Ne.length;Be--;){var Ge=Ne[u?Be:++ge];if(A(Se[Ge],Ge,Se)===!1)break}return _}}function y6(u,_,A){var G=_&E,ge=Wo(u);function Se(){var Ne=this&&this!==ai&&this instanceof Se?ge:u;return Ne.apply(G?A:this,arguments)}return Se}function Op(u){return function(_){_=Tr(_);var A=Hs(_)?Oi(_):n,G=A?A[0]:_.charAt(0),ge=A?$s(A,1).join(""):_.slice(1);return G[u]()+ge}}function no(u){return function(_){return Po(Ng(Ig(_).replace(pe,"")),u,"")}}function Wo(u){return function(){var _=arguments;switch(_.length){case 0:return new u;case 1:return new u(_[0]);case 2:return new u(_[0],_[1]);case 3:return new u(_[0],_[1],_[2]);case 4:return new u(_[0],_[1],_[2],_[3]);case 5:return new u(_[0],_[1],_[2],_[3],_[4]);case 6:return new u(_[0],_[1],_[2],_[3],_[4],_[5]);case 7:return new u(_[0],_[1],_[2],_[3],_[4],_[5],_[6])}var A=ro(u.prototype),G=u.apply(A,_);return Wr(G)?G:A}}function w6(u,_,A){var G=Wo(u);function ge(){for(var Se=arguments.length,Ne=Xe(Se),Be=Se,Ge=so(ge);Be--;)Ne[Be]=arguments[Be];var ot=Se<3&&Ne[0]!==Ge&&Ne[Se-1]!==Ge?[]:Cn(Ne,Ge);if(Se-=ot.length,Se<A)return Fp(u,_,W0,ge.placeholder,n,Ne,ot,n,n,A-Se);var lt=this&&this!==ai&&this instanceof ge?G:u;return kr(lt,this,Ne)}return ge}function Dp(u){return function(_,A,G){var ge=Ct(_);if(!Gi(_)){var Se=Ut(A,3);_=bi(_),A=function(Be){return Se(ge[Be],Be,ge)}}var Ne=u(_,A,G);return Ne>-1?ge[Se?_[Ne]:Ne]:n}}function Rp(u){return ms(function(_){var A=_.length,G=A,ge=cn.prototype.thru;for(u&&_.reverse();G--;){var Se=_[G];if(typeof Se!="function")throw new Jt(h);if(ge&&!Ne&&X0(Se)=="wrapper")var Ne=new cn([],!0)}for(G=Ne?G:A;++G<A;){Se=_[G];var Be=X0(Se),Ge=Be=="wrapper"?Bc(Se):n;Ge&&Hc(Ge[0])&&Ge[1]==(me|O|U|B)&&!Ge[4].length&&Ge[9]==1?Ne=Ne[X0(Ge[0])].apply(Ne,Ge[3]):Ne=Se.length==1&&Hc(Se)?Ne[Be]():Ne.thru(Se)}return function(){var ot=arguments,lt=ot[0];if(Ne&&ot.length==1&&tr(lt))return Ne.plant(lt).value();for(var ut=0,At=A?_[ut].apply(this,ot):lt;++ut<A;)At=_[ut].call(this,At);return At}})}function W0(u,_,A,G,ge,Se,Ne,Be,Ge,ot){var lt=_&me,ut=_&E,At=_&N,Ot=_&(O|V),Yt=_&ie,lr=At?n:Wo(u);function Wt(){for(var dr=arguments.length,yr=Xe(dr),nn=dr;nn--;)yr[nn]=arguments[nn];if(Ot)var Bi=so(Wt),sn=jr(yr,Bi);if(G&&(yr=Pp(yr,G,ge,Ot)),Se&&(yr=Ip(yr,Se,Ne,Ot)),dr-=sn,Ot&&dr<ot){var Jr=Cn(yr,Bi);return Fp(u,_,W0,Wt.placeholder,A,yr,Jr,Be,Ge,ot-dr)}var En=ut?A:this,ws=At?En[u]:u;return dr=yr.length,Be?yr=H6(yr,Be):Yt&&dr>1&&yr.reverse(),lt&&Ge<dr&&(yr.length=Ge),this&&this!==ai&&this instanceof Wt&&(ws=lr||Wo(ws)),ws.apply(En,yr)}return Wt}function Bp(u,_){return function(A,G){return j5(A,u,_(G),{})}}function $0(u,_){return function(A,G){var ge;if(A===n&&G===n)return _;if(A!==n&&(ge=A),G!==n){if(ge===n)return G;typeof A=="string"||typeof G=="string"?(A=tn(A),G=tn(G)):(A=Sp(A),G=Sp(G)),ge=u(A,G)}return ge}}function Lc(u){return ms(function(_){return _=Dr(_,qt(Ut())),cr(function(A){var G=this;return u(_,function(ge){return kr(ge,G,A)})})})}function K0(u,_){_=_===n?" ":tn(_);var A=_.length;if(A<2)return A?Mc(_,u):_;var G=Mc(_,O0(u/Vs(_)));return Hs(_)?$s(Oi(G),0,u).join(""):G.slice(0,u)}function S6(u,_,A,G){var ge=_&E,Se=Wo(u);function Ne(){for(var Be=-1,Ge=arguments.length,ot=-1,lt=G.length,ut=Xe(lt+Ge),At=this&&this!==ai&&this instanceof Ne?Se:u;++ot<lt;)ut[ot]=G[ot];for(;Ge--;)ut[ot++]=arguments[++Be];return kr(At,ge?A:this,ut)}return Ne}function qp(u){return function(_,A,G){return G&&typeof G!="number"&&Ri(_,A,G)&&(A=G=n),_=ys(_),A===n?(A=_,_=0):A=ys(A),G=G===n?_<A?1:-1:ys(G),o6(_,A,G,u)}}function j0(u){return function(_,A){return typeof _=="string"&&typeof A=="string"||(_=dn(_),A=dn(A)),u(_,A)}}function Fp(u,_,A,G,ge,Se,Ne,Be,Ge,ot){var lt=_&O,ut=lt?Ne:n,At=lt?n:Ne,Ot=lt?Se:n,Yt=lt?n:Se;_|=lt?U:D,_&=~(lt?D:U),_&I||(_&=-4);var lr=[u,_,ge,Ot,ut,Yt,At,Be,Ge,ot],Wt=A.apply(n,lr);return Hc(u)&&Qp(Wt,lr),Wt.placeholder=G,Zp(Wt,u,_)}function Oc(u){var _=Je[u];return function(A,G){if(A=dn(A),G=G==null?0:Ei(sr(G),292),G&&Z1(A)){var ge=(Tr(A)+"e").split("e"),Se=_(ge[0]+"e"+(+ge[1]+G));return ge=(Tr(Se)+"e").split("e"),+(ge[0]+"e"+(+ge[1]-G))}return _(A)}}var x6=eo&&1/va(new eo([,-0]))[1]==we?function(u){return new eo(u)}:ru;function zp(u){return function(_){var A=Ai(_);return A==at?cs(_):A==qe?_i(_):oi(_,u(_))}}function vs(u,_,A,G,ge,Se,Ne,Be){var Ge=_&N;if(!Ge&&typeof u!="function")throw new Jt(h);var ot=G?G.length:0;if(ot||(_&=-97,G=ge=n),Ne=Ne===n?Ne:li(sr(Ne),0),Be=Be===n?Be:sr(Be),ot-=ge?ge.length:0,_&D){var lt=G,ut=ge;G=ge=n}var At=Ge?n:Bc(u),Ot=[u,_,A,G,ge,lt,ut,Se,Ne,Be];if(At&&q6(Ot,At),u=Ot[0],_=Ot[1],A=Ot[2],G=Ot[3],ge=Ot[4],Be=Ot[9]=Ot[9]===n?Ge?0:u.length:li(Ot[9]-ot,0),!Be&&_&(O|V)&&(_&=-25),!_||_==E)var Yt=y6(u,_,A);else _==O||_==V?Yt=w6(u,_,Be):(_==U||_==(E|U))&&!ge.length?Yt=S6(u,_,A,G):Yt=W0.apply(n,Ot);var lr=At?yp:Qp;return Zp(lr(Yt,Ot),u,_)}function Hp(u,_,A,G){return u===n||Mn(u,Gn[A])&&!Ir.call(G,A)?_:u}function Vp(u,_,A,G,ge,Se){return Wr(u)&&Wr(_)&&(Se.set(_,u),V0(u,_,n,Vp,Se),Se.delete(_)),u}function C6(u){return jo(u)?n:u}function Up(u,_,A,G,ge,Se){var Ne=A&w,Be=u.length,Ge=_.length;if(Be!=Ge&&!(Ne&&Ge>Be))return!1;var ot=Se.get(u),lt=Se.get(_);if(ot&&lt)return ot==_&&lt==u;var ut=-1,At=!0,Ot=A&p?new ya:n;for(Se.set(u,_),Se.set(_,u);++ut<Be;){var Yt=u[ut],lr=_[ut];if(G)var Wt=Ne?G(lr,Yt,ut,_,u,Se):G(Yt,lr,ut,u,_,Se);if(Wt!==n){if(Wt)continue;At=!1;break}if(Ot){if(!Io(_,function(dr,yr){if(!Pr(Ot,yr)&&(Yt===dr||ge(Yt,dr,A,G,Se)))return Ot.push(yr)})){At=!1;break}}else if(!(Yt===lr||ge(Yt,lr,A,G,Se))){At=!1;break}}return Se.delete(u),Se.delete(_),At}function k6(u,_,A,G,ge,Se,Ne){switch(A){case m:if(u.byteLength!=_.byteLength||u.byteOffset!=_.byteOffset)return!1;u=u.buffer,_=_.buffer;case c:return!(u.byteLength!=_.byteLength||!Se(new P0(u),new P0(_)));case Ze:case dt:case rr:return Mn(+u,+_);case et:return u.name==_.name&&u.message==_.message;case fr:case je:return u==_+"";case at:var Be=cs;case qe:var Ge=G&w;if(Be||(Be=va),u.size!=_.size&&!Ge)return!1;var ot=Ne.get(u);if(ot)return ot==_;G|=p,Ne.set(u,_);var lt=Up(Be(u),Be(_),G,ge,Se,Ne);return Ne.delete(u),lt;case Fe:if(zo)return zo.call(u)==zo.call(_)}return!1}function M6(u,_,A,G,ge,Se){var Ne=A&w,Be=Dc(u),Ge=Be.length,ot=Dc(_),lt=ot.length;if(Ge!=lt&&!Ne)return!1;for(var ut=Ge;ut--;){var At=Be[ut];if(!(Ne?At in _:Ir.call(_,At)))return!1}var Ot=Se.get(u),Yt=Se.get(_);if(Ot&&Yt)return Ot==_&&Yt==u;var lr=!0;Se.set(u,_),Se.set(_,u);for(var Wt=Ne;++ut<Ge;){At=Be[ut];var dr=u[At],yr=_[At];if(G)var nn=Ne?G(yr,dr,At,_,u,Se):G(dr,yr,At,u,_,Se);if(!(nn===n?dr===yr||ge(dr,yr,A,G,Se):nn)){lr=!1;break}Wt||(Wt=At=="constructor")}if(lr&&!Wt){var Bi=u.constructor,sn=_.constructor;Bi!=sn&&"constructor"in u&&"constructor"in _&&!(typeof Bi=="function"&&Bi instanceof Bi&&typeof sn=="function"&&sn instanceof sn)&&(lr=!1)}return Se.delete(u),Se.delete(_),lr}function ms(u){return Uc(jp(u,n,ng),u+"")}function Dc(u){return cp(u,bi,Fc)}function Rc(u){return cp(u,Yi,Gp)}var Bc=R0?function(u){return R0.get(u)}:ru;function X0(u){for(var _=u.name+"",A=to[_],G=Ir.call(to,_)?A.length:0;G--;){var ge=A[G],Se=ge.func;if(Se==null||Se==u)return ge.name}return _}function so(u){var _=Ir.call(be,"placeholder")?be:u;return _.placeholder}function Ut(){var u=be.iteratee||eu;return u=u===eu?fp:u,arguments.length?u(arguments[0],arguments[1]):u}function Q0(u,_){var A=u.__data__;return O6(_)?A[typeof _=="string"?"string":"hash"]:A.map}function qc(u){for(var _=bi(u),A=_.length;A--;){var G=_[A],ge=u[G];_[A]=[G,ge,$p(ge)]}return _}function xa(u,_){var A=Lo(u,_);return hp(A)?A:n}function E6(u){var _=Ir.call(u,_a),A=u[_a];try{u[_a]=n;var G=!0}catch{}var ge=A0.call(u);return G&&(_?u[_a]=A:delete u[_a]),ge}var Fc=fc?function(u){return u==null?[]:(u=Ct(u),Hn(fc(u),function(_){return X1.call(u,_)}))}:iu,Gp=fc?function(u){for(var _=[];u;)Vn(_,Fc(u)),u=I0(u);return _}:iu,Ai=Di;(dc&&Ai(new dc(new ArrayBuffer(1)))!=m||Bo&&Ai(new Bo)!=at||pc&&Ai(pc.resolve())!=nr||eo&&Ai(new eo)!=qe||qo&&Ai(new qo)!=Qe)&&(Ai=function(u){var _=Di(u),A=_==Ht?u.constructor:n,G=A?Ca(A):"";if(G)switch(G){case c5:return m;case u5:return at;case h5:return nr;case f5:return qe;case d5:return Qe}return _});function A6(u,_,A){for(var G=-1,ge=A.length;++G<ge;){var Se=A[G],Ne=Se.size;switch(Se.type){case"drop":u+=Ne;break;case"dropRight":_-=Ne;break;case"take":_=Ei(_,u+Ne);break;case"takeRight":u=li(u,_-Ne);break}}return{start:u,end:_}}function T6(u){var _=u.match(De);return _?_[1].split(ze):[]}function Yp(u,_,A){_=Ws(_,u);for(var G=-1,ge=_.length,Se=!1;++G<ge;){var Ne=$n(_[G]);if(!(Se=u!=null&&A(u,Ne)))break;u=u[Ne]}return Se||++G!=ge?Se:(ge=u==null?0:u.length,!!ge&&nl(ge)&&_s(Ne,ge)&&(tr(u)||ka(u)))}function P6(u){var _=u.length,A=new u.constructor(_);return _&&typeof u[0]=="string"&&Ir.call(u,"index")&&(A.index=u.index,A.input=u.input),A}function Wp(u){return typeof u.constructor=="function"&&!$o(u)?ro(I0(u)):{}}function I6(u,_,A){var G=u.constructor;switch(_){case c:return Nc(u);case Ze:case dt:return new G(+u);case m:return p6(u,A);case x:case k:case T:case R:case L:case q:case z:case X:case Z:return Ap(u,A);case at:return new G;case rr:case je:return new G(u);case fr:return g6(u);case qe:return new G;case Fe:return v6(u)}}function N6(u,_){var A=_.length;if(!A)return u;var G=A-1;return _[G]=(A>1?"& ":"")+_[G],_=_.join(A>2?", ":" "),u.replace(Le,`{
10
+ /* [wrapped with `+_+`] */
11
+ `)}function L6(u){return tr(u)||ka(u)||!!(Q1&&u&&u[Q1])}function _s(u,_){var A=typeof u;return _=_??ye,!!_&&(A=="number"||A!="symbol"&&Et.test(u))&&u>-1&&u%1==0&&u<_}function Ri(u,_,A){if(!Wr(A))return!1;var G=typeof _;return(G=="number"?Gi(A)&&_s(_,A.length):G=="string"&&_ in A)?Mn(A[_],u):!1}function zc(u,_){if(tr(u))return!1;var A=typeof u;return A=="number"||A=="symbol"||A=="boolean"||u==null||rn(u)?!0:ue.test(u)||!ve.test(u)||_!=null&&u in Ct(_)}function O6(u){var _=typeof u;return _=="string"||_=="number"||_=="symbol"||_=="boolean"?u!=="__proto__":u===null}function Hc(u){var _=X0(u),A=be[_];if(typeof A!="function"||!(_ in mr.prototype))return!1;if(u===A)return!0;var G=Bc(A);return!!G&&u===G[0]}function D6(u){return!!$1&&$1 in u}var R6=fs?bs:nu;function $o(u){var _=u&&u.constructor,A=typeof _=="function"&&_.prototype||Gn;return u===A}function $p(u){return u===u&&!Wr(u)}function Kp(u,_){return function(A){return A==null?!1:A[u]===_&&(_!==n||u in Ct(A))}}function B6(u){var _=rl(u,function(G){return A.size===S&&A.clear(),G}),A=_.cache;return _}function q6(u,_){var A=u[1],G=_[1],ge=A|G,Se=ge<(E|N|me),Ne=G==me&&A==O||G==me&&A==B&&u[7].length<=_[8]||G==(me|B)&&_[7].length<=_[8]&&A==O;if(!(Se||Ne))return u;G&E&&(u[2]=_[2],ge|=A&E?0:I);var Be=_[3];if(Be){var Ge=u[3];u[3]=Ge?Pp(Ge,Be,_[4]):Be,u[4]=Ge?Cn(u[3],M):_[4]}return Be=_[5],Be&&(Ge=u[5],u[5]=Ge?Ip(Ge,Be,_[6]):Be,u[6]=Ge?Cn(u[5],M):_[6]),Be=_[7],Be&&(u[7]=Be),G&me&&(u[8]=u[8]==null?_[8]:Ei(u[8],_[8])),u[9]==null&&(u[9]=_[9]),u[0]=_[0],u[1]=ge,u}function F6(u){var _=[];if(u!=null)for(var A in Ct(u))_.push(A);return _}function z6(u){return A0.call(u)}function jp(u,_,A){return _=li(_===n?u.length-1:_,0),function(){for(var G=arguments,ge=-1,Se=li(G.length-_,0),Ne=Xe(Se);++ge<Se;)Ne[ge]=G[_+ge];ge=-1;for(var Be=Xe(_+1);++ge<_;)Be[ge]=G[ge];return Be[_]=A(Ne),kr(u,this,Be)}}function Xp(u,_){return _.length<2?u:Sa(u,hn(_,0,-1))}function H6(u,_){for(var A=u.length,G=Ei(_.length,A),ge=Ui(u);G--;){var Se=_[G];u[G]=_s(Se,A)?ge[Se]:n}return u}function Vc(u,_){if(!(_==="constructor"&&typeof u[_]=="function")&&_!="__proto__")return u[_]}var Qp=Jp(yp),Ko=r5||function(u,_){return ai.setTimeout(u,_)},Uc=Jp(u6);function Zp(u,_,A){var G=_+"";return Uc(u,N6(G,V6(T6(G),A)))}function Jp(u){var _=0,A=0;return function(){var G=a5(),ge=le-(G-A);if(A=G,ge>0){if(++_>=fe)return arguments[0]}else _=0;return u.apply(n,arguments)}}function Z0(u,_){var A=-1,G=u.length,ge=G-1;for(_=_===n?G:_;++A<_;){var Se=kc(A,ge),Ne=u[Se];u[Se]=u[A],u[A]=Ne}return u.length=_,u}var eg=B6(function(u){var _=[];return u.charCodeAt(0)===46&&_.push(""),u.replace(Ce,function(A,G,ge,Se){_.push(ge?Se.replace(ct,"$1"):G||A)}),_});function $n(u){if(typeof u=="string"||rn(u))return u;var _=u+"";return _=="0"&&1/u==-1/0?"-0":_}function Ca(u){if(u!=null){try{return Ja.call(u)}catch{}try{return u+""}catch{}}return""}function V6(u,_){return ki(Re,function(A){var G="_."+A[0];_&A[1]&&!Ga(u,G)&&u.push(G)}),u.sort()}function tg(u){if(u instanceof mr)return u.clone();var _=new cn(u.__wrapped__,u.__chain__);return _.__actions__=Ui(u.__actions__),_.__index__=u.__index__,_.__values__=u.__values__,_}function U6(u,_,A){(A?Ri(u,_,A):_===n)?_=1:_=li(sr(_),0);var G=u==null?0:u.length;if(!G||_<1)return[];for(var ge=0,Se=0,Ne=Xe(O0(G/_));ge<G;)Ne[Se++]=hn(u,ge,ge+=_);return Ne}function G6(u){for(var _=-1,A=u==null?0:u.length,G=0,ge=[];++_<A;){var Se=u[_];Se&&(ge[G++]=Se)}return ge}function Y6(){var u=arguments.length;if(!u)return[];for(var _=Xe(u-1),A=arguments[0],G=u;G--;)_[G-1]=arguments[G];return Vn(tr(A)?Ui(A):[A],Si(_,1))}var W6=cr(function(u,_){return Zr(u)?Vo(u,Si(_,1,Zr,!0)):[]}),$6=cr(function(u,_){var A=fn(_);return Zr(A)&&(A=n),Zr(u)?Vo(u,Si(_,1,Zr,!0),Ut(A,2)):[]}),K6=cr(function(u,_){var A=fn(_);return Zr(A)&&(A=n),Zr(u)?Vo(u,Si(_,1,Zr,!0),n,A):[]});function j6(u,_,A){var G=u==null?0:u.length;return G?(_=A||_===n?1:sr(_),hn(u,_<0?0:_,G)):[]}function X6(u,_,A){var G=u==null?0:u.length;return G?(_=A||_===n?1:sr(_),_=G-_,hn(u,0,_<0?0:_)):[]}function Q6(u,_){return u&&u.length?G0(u,Ut(_,3),!0,!0):[]}function Z6(u,_){return u&&u.length?G0(u,Ut(_,3),!0):[]}function J6(u,_,A,G){var ge=u==null?0:u.length;return ge?(A&&typeof A!="number"&&Ri(u,_,A)&&(A=0,G=ge),Y5(u,_,A,G)):[]}function rg(u,_,A){var G=u==null?0:u.length;if(!G)return-1;var ge=A==null?0:sr(A);return ge<0&&(ge=li(G+ge,0)),Ya(u,Ut(_,3),ge)}function ig(u,_,A){var G=u==null?0:u.length;if(!G)return-1;var ge=G-1;return A!==n&&(ge=sr(A),ge=A<0?li(G+ge,0):Ei(ge,G-1)),Ya(u,Ut(_,3),ge,!0)}function ng(u){var _=u==null?0:u.length;return _?Si(u,1):[]}function e4(u){var _=u==null?0:u.length;return _?Si(u,we):[]}function t4(u,_){var A=u==null?0:u.length;return A?(_=_===n?1:sr(_),Si(u,_)):[]}function r4(u){for(var _=-1,A=u==null?0:u.length,G={};++_<A;){var ge=u[_];G[ge[0]]=ge[1]}return G}function sg(u){return u&&u.length?u[0]:n}function i4(u,_,A){var G=u==null?0:u.length;if(!G)return-1;var ge=A==null?0:sr(A);return ge<0&&(ge=li(G+ge,0)),os(u,_,ge)}function n4(u){var _=u==null?0:u.length;return _?hn(u,0,-1):[]}var s4=cr(function(u){var _=Dr(u,Pc);return _.length&&_[0]===u[0]?yc(_):[]}),a4=cr(function(u){var _=fn(u),A=Dr(u,Pc);return _===fn(A)?_=n:A.pop(),A.length&&A[0]===u[0]?yc(A,Ut(_,2)):[]}),o4=cr(function(u){var _=fn(u),A=Dr(u,Pc);return _=typeof _=="function"?_:n,_&&A.pop(),A.length&&A[0]===u[0]?yc(A,n,_):[]});function l4(u,_){return u==null?"":n5.call(u,_)}function fn(u){var _=u==null?0:u.length;return _?u[_-1]:n}function c4(u,_,A){var G=u==null?0:u.length;if(!G)return-1;var ge=G;return A!==n&&(ge=sr(A),ge=ge<0?li(G+ge,0):Ei(ge,G-1)),_===_?lc(u,_,ge):Ya(u,fa,ge,!0)}function u4(u,_){return u&&u.length?vp(u,sr(_)):n}var h4=cr(ag);function ag(u,_){return u&&u.length&&_&&_.length?Cc(u,_):u}function f4(u,_,A){return u&&u.length&&_&&_.length?Cc(u,_,Ut(A,2)):u}function d4(u,_,A){return u&&u.length&&_&&_.length?Cc(u,_,n,A):u}var p4=ms(function(u,_){var A=u==null?0:u.length,G=vc(u,_);return bp(u,Dr(_,function(ge){return _s(ge,A)?+ge:ge}).sort(Tp)),G});function g4(u,_){var A=[];if(!(u&&u.length))return A;var G=-1,ge=[],Se=u.length;for(_=Ut(_,3);++G<Se;){var Ne=u[G];_(Ne,G,u)&&(A.push(Ne),ge.push(G))}return bp(u,ge),A}function Gc(u){return u==null?u:l5.call(u)}function v4(u,_,A){var G=u==null?0:u.length;return G?(A&&typeof A!="number"&&Ri(u,_,A)?(_=0,A=G):(_=_==null?0:sr(_),A=A===n?G:sr(A)),hn(u,_,A)):[]}function m4(u,_){return U0(u,_)}function _4(u,_,A){return Ec(u,_,Ut(A,2))}function b4(u,_){var A=u==null?0:u.length;if(A){var G=U0(u,_);if(G<A&&Mn(u[G],_))return G}return-1}function y4(u,_){return U0(u,_,!0)}function w4(u,_,A){return Ec(u,_,Ut(A,2),!0)}function S4(u,_){var A=u==null?0:u.length;if(A){var G=U0(u,_,!0)-1;if(Mn(u[G],_))return G}return-1}function x4(u){return u&&u.length?wp(u):[]}function C4(u,_){return u&&u.length?wp(u,Ut(_,2)):[]}function k4(u){var _=u==null?0:u.length;return _?hn(u,1,_):[]}function M4(u,_,A){return u&&u.length?(_=A||_===n?1:sr(_),hn(u,0,_<0?0:_)):[]}function E4(u,_,A){var G=u==null?0:u.length;return G?(_=A||_===n?1:sr(_),_=G-_,hn(u,_<0?0:_,G)):[]}function A4(u,_){return u&&u.length?G0(u,Ut(_,3),!1,!0):[]}function T4(u,_){return u&&u.length?G0(u,Ut(_,3)):[]}var P4=cr(function(u){return Ys(Si(u,1,Zr,!0))}),I4=cr(function(u){var _=fn(u);return Zr(_)&&(_=n),Ys(Si(u,1,Zr,!0),Ut(_,2))}),N4=cr(function(u){var _=fn(u);return _=typeof _=="function"?_:n,Ys(Si(u,1,Zr,!0),n,_)});function L4(u){return u&&u.length?Ys(u):[]}function O4(u,_){return u&&u.length?Ys(u,Ut(_,2)):[]}function D4(u,_){return _=typeof _=="function"?_:n,u&&u.length?Ys(u,n,_):[]}function Yc(u){if(!(u&&u.length))return[];var _=0;return u=Hn(u,function(A){if(Zr(A))return _=li(A.length,_),!0}),ja(_,function(A){return Dr(u,Wa(A))})}function og(u,_){if(!(u&&u.length))return[];var A=Yc(u);return _==null?A:Dr(A,function(G){return kr(_,n,G)})}var R4=cr(function(u,_){return Zr(u)?Vo(u,_):[]}),B4=cr(function(u){return Tc(Hn(u,Zr))}),q4=cr(function(u){var _=fn(u);return Zr(_)&&(_=n),Tc(Hn(u,Zr),Ut(_,2))}),F4=cr(function(u){var _=fn(u);return _=typeof _=="function"?_:n,Tc(Hn(u,Zr),n,_)}),z4=cr(Yc);function H4(u,_){return kp(u||[],_||[],Ho)}function V4(u,_){return kp(u||[],_||[],Yo)}var U4=cr(function(u){var _=u.length,A=_>1?u[_-1]:n;return A=typeof A=="function"?(u.pop(),A):n,og(u,A)});function lg(u){var _=be(u);return _.__chain__=!0,_}function G4(u,_){return _(u),u}function J0(u,_){return _(u)}var Y4=ms(function(u){var _=u.length,A=_?u[0]:0,G=this.__wrapped__,ge=function(Se){return vc(Se,u)};return _>1||this.__actions__.length||!(G instanceof mr)||!_s(A)?this.thru(ge):(G=G.slice(A,+A+(_?1:0)),G.__actions__.push({func:J0,args:[ge],thisArg:n}),new cn(G,this.__chain__).thru(function(Se){return _&&!Se.length&&Se.push(n),Se}))});function W4(){return lg(this)}function $4(){return new cn(this.value(),this.__chain__)}function K4(){this.__values__===n&&(this.__values__=Sg(this.value()));var u=this.__index__>=this.__values__.length,_=u?n:this.__values__[this.__index__++];return{done:u,value:_}}function j4(){return this}function X4(u){for(var _,A=this;A instanceof q0;){var G=tg(A);G.__index__=0,G.__values__=n,_?ge.__wrapped__=G:_=G;var ge=G;A=A.__wrapped__}return ge.__wrapped__=u,_}function Q4(){var u=this.__wrapped__;if(u instanceof mr){var _=u;return this.__actions__.length&&(_=new mr(this)),_=_.reverse(),_.__actions__.push({func:J0,args:[Gc],thisArg:n}),new cn(_,this.__chain__)}return this.thru(Gc)}function Z4(){return Cp(this.__wrapped__,this.__actions__)}var J4=Y0(function(u,_,A){Ir.call(u,A)?++u[A]:gs(u,A,1)});function ew(u,_,A){var G=tr(u)?M0:G5;return A&&Ri(u,_,A)&&(_=n),G(u,Ut(_,3))}function tw(u,_){var A=tr(u)?Hn:op;return A(u,Ut(_,3))}var rw=Dp(rg),iw=Dp(ig);function nw(u,_){return Si(el(u,_),1)}function sw(u,_){return Si(el(u,_),we)}function aw(u,_,A){return A=A===n?1:sr(A),Si(el(u,_),A)}function cg(u,_){var A=tr(u)?ki:Gs;return A(u,Ut(_,3))}function ug(u,_){var A=tr(u)?Fs:ap;return A(u,Ut(_,3))}var ow=Y0(function(u,_,A){Ir.call(u,A)?u[A].push(_):gs(u,A,[_])});function lw(u,_,A,G){u=Gi(u)?u:oo(u),A=A&&!G?sr(A):0;var ge=u.length;return A<0&&(A=li(ge+A,0)),sl(u)?A<=ge&&u.indexOf(_,A)>-1:!!ge&&os(u,_,A)>-1}var cw=cr(function(u,_,A){var G=-1,ge=typeof _=="function",Se=Gi(u)?Xe(u.length):[];return Gs(u,function(Ne){Se[++G]=ge?kr(_,Ne,A):Uo(Ne,_,A)}),Se}),uw=Y0(function(u,_,A){gs(u,A,_)});function el(u,_){var A=tr(u)?Dr:dp;return A(u,Ut(_,3))}function hw(u,_,A,G){return u==null?[]:(tr(_)||(_=_==null?[]:[_]),A=G?n:A,tr(A)||(A=A==null?[]:[A]),mp(u,_,A))}var fw=Y0(function(u,_,A){u[A?0:1].push(_)},function(){return[[],[]]});function dw(u,_,A){var G=tr(u)?Po:vr,ge=arguments.length<3;return G(u,Ut(_,4),A,ge,Gs)}function pw(u,_,A){var G=tr(u)?sc:vr,ge=arguments.length<3;return G(u,Ut(_,4),A,ge,ap)}function gw(u,_){var A=tr(u)?Hn:op;return A(u,il(Ut(_,3)))}function vw(u){var _=tr(u)?rp:l6;return _(u)}function mw(u,_,A){(A?Ri(u,_,A):_===n)?_=1:_=sr(_);var G=tr(u)?F5:c6;return G(u,_)}function _w(u){var _=tr(u)?z5:h6;return _(u)}function bw(u){if(u==null)return 0;if(Gi(u))return sl(u)?Vs(u):u.length;var _=Ai(u);return _==at||_==qe?u.size:Sc(u).length}function yw(u,_,A){var G=tr(u)?Io:f6;return A&&Ri(u,_,A)&&(_=n),G(u,Ut(_,3))}var ww=cr(function(u,_){if(u==null)return[];var A=_.length;return A>1&&Ri(u,_[0],_[1])?_=[]:A>2&&Ri(_[0],_[1],_[2])&&(_=[_[0]]),mp(u,Si(_,1),[])}),tl=t5||function(){return ai.Date.now()};function Sw(u,_){if(typeof _!="function")throw new Jt(h);return u=sr(u),function(){if(--u<1)return _.apply(this,arguments)}}function hg(u,_,A){return _=A?n:_,_=u&&_==null?u.length:_,vs(u,me,n,n,n,n,_)}function fg(u,_){var A;if(typeof _!="function")throw new Jt(h);return u=sr(u),function(){return--u>0&&(A=_.apply(this,arguments)),u<=1&&(_=n),A}}var Wc=cr(function(u,_,A){var G=E;if(A.length){var ge=Cn(A,so(Wc));G|=U}return vs(u,G,_,A,ge)}),dg=cr(function(u,_,A){var G=E|N;if(A.length){var ge=Cn(A,so(dg));G|=U}return vs(_,G,u,A,ge)});function pg(u,_,A){_=A?n:_;var G=vs(u,O,n,n,n,n,n,_);return G.placeholder=pg.placeholder,G}function gg(u,_,A){_=A?n:_;var G=vs(u,V,n,n,n,n,n,_);return G.placeholder=gg.placeholder,G}function vg(u,_,A){var G,ge,Se,Ne,Be,Ge,ot=0,lt=!1,ut=!1,At=!0;if(typeof u!="function")throw new Jt(h);_=dn(_)||0,Wr(A)&&(lt=!!A.leading,ut="maxWait"in A,Se=ut?li(dn(A.maxWait)||0,_):Se,At="trailing"in A?!!A.trailing:At);function Ot(Jr){var En=G,ws=ge;return G=ge=n,ot=Jr,Ne=u.apply(ws,En),Ne}function Yt(Jr){return ot=Jr,Be=Ko(dr,_),lt?Ot(Jr):Ne}function lr(Jr){var En=Jr-Ge,ws=Jr-ot,Dg=_-En;return ut?Ei(Dg,Se-ws):Dg}function Wt(Jr){var En=Jr-Ge,ws=Jr-ot;return Ge===n||En>=_||En<0||ut&&ws>=Se}function dr(){var Jr=tl();if(Wt(Jr))return yr(Jr);Be=Ko(dr,lr(Jr))}function yr(Jr){return Be=n,At&&G?Ot(Jr):(G=ge=n,Ne)}function nn(){Be!==n&&Mp(Be),ot=0,G=Ge=ge=Be=n}function Bi(){return Be===n?Ne:yr(tl())}function sn(){var Jr=tl(),En=Wt(Jr);if(G=arguments,ge=this,Ge=Jr,En){if(Be===n)return Yt(Ge);if(ut)return Mp(Be),Be=Ko(dr,_),Ot(Ge)}return Be===n&&(Be=Ko(dr,_)),Ne}return sn.cancel=nn,sn.flush=Bi,sn}var xw=cr(function(u,_){return sp(u,1,_)}),Cw=cr(function(u,_,A){return sp(u,dn(_)||0,A)});function kw(u){return vs(u,ie)}function rl(u,_){if(typeof u!="function"||_!=null&&typeof _!="function")throw new Jt(h);var A=function(){var G=arguments,ge=_?_.apply(this,G):G[0],Se=A.cache;if(Se.has(ge))return Se.get(ge);var Ne=u.apply(this,G);return A.cache=Se.set(ge,Ne)||Se,Ne};return A.cache=new(rl.Cache||ps),A}rl.Cache=ps;function il(u){if(typeof u!="function")throw new Jt(h);return function(){var _=arguments;switch(_.length){case 0:return!u.call(this);case 1:return!u.call(this,_[0]);case 2:return!u.call(this,_[0],_[1]);case 3:return!u.call(this,_[0],_[1],_[2])}return!u.apply(this,_)}}function Mw(u){return fg(2,u)}var Ew=d6(function(u,_){_=_.length==1&&tr(_[0])?Dr(_[0],qt(Ut())):Dr(Si(_,1),qt(Ut()));var A=_.length;return cr(function(G){for(var ge=-1,Se=Ei(G.length,A);++ge<Se;)G[ge]=_[ge].call(this,G[ge]);return kr(u,this,G)})}),$c=cr(function(u,_){var A=Cn(_,so($c));return vs(u,U,n,_,A)}),mg=cr(function(u,_){var A=Cn(_,so(mg));return vs(u,D,n,_,A)}),Aw=ms(function(u,_){return vs(u,B,n,n,n,_)});function Tw(u,_){if(typeof u!="function")throw new Jt(h);return _=_===n?_:sr(_),cr(u,_)}function Pw(u,_){if(typeof u!="function")throw new Jt(h);return _=_==null?0:li(sr(_),0),cr(function(A){var G=A[_],ge=$s(A,0,_);return G&&Vn(ge,G),kr(u,this,ge)})}function Iw(u,_,A){var G=!0,ge=!0;if(typeof u!="function")throw new Jt(h);return Wr(A)&&(G="leading"in A?!!A.leading:G,ge="trailing"in A?!!A.trailing:ge),vg(u,_,{leading:G,maxWait:_,trailing:ge})}function Nw(u){return hg(u,1)}function Lw(u,_){return $c(Ic(_),u)}function Ow(){if(!arguments.length)return[];var u=arguments[0];return tr(u)?u:[u]}function Dw(u){return un(u,g)}function Rw(u,_){return _=typeof _=="function"?_:n,un(u,g,_)}function Bw(u){return un(u,C|g)}function qw(u,_){return _=typeof _=="function"?_:n,un(u,C|g,_)}function Fw(u,_){return _==null||np(u,_,bi(_))}function Mn(u,_){return u===_||u!==u&&_!==_}var zw=j0(bc),Hw=j0(function(u,_){return u>=_}),ka=up(function(){return arguments}())?up:function(u){return Xr(u)&&Ir.call(u,"callee")&&!X1.call(u,"callee")},tr=Xe.isArray,Vw=ua?qt(ua):X5;function Gi(u){return u!=null&&nl(u.length)&&!bs(u)}function Zr(u){return Xr(u)&&Gi(u)}function Uw(u){return u===!0||u===!1||Xr(u)&&Di(u)==Ze}var Ks=i5||nu,Gw=ss?qt(ss):Q5;function Yw(u){return Xr(u)&&u.nodeType===1&&!jo(u)}function Ww(u){if(u==null)return!0;if(Gi(u)&&(tr(u)||typeof u=="string"||typeof u.splice=="function"||Ks(u)||ao(u)||ka(u)))return!u.length;var _=Ai(u);if(_==at||_==qe)return!u.size;if($o(u))return!Sc(u).length;for(var A in u)if(Ir.call(u,A))return!1;return!0}function $w(u,_){return Go(u,_)}function Kw(u,_,A){A=typeof A=="function"?A:n;var G=A?A(u,_):n;return G===n?Go(u,_,n,A):!!G}function Kc(u){if(!Xr(u))return!1;var _=Di(u);return _==et||_==bt||typeof u.message=="string"&&typeof u.name=="string"&&!jo(u)}function jw(u){return typeof u=="number"&&Z1(u)}function bs(u){if(!Wr(u))return!1;var _=Di(u);return _==Nt||_==xt||_==wt||_==Ar}function _g(u){return typeof u=="number"&&u==sr(u)}function nl(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=ye}function Wr(u){var _=typeof u;return u!=null&&(_=="object"||_=="function")}function Xr(u){return u!=null&&typeof u=="object"}var bg=ha?qt(ha):J5;function Xw(u,_){return u===_||wc(u,_,qc(_))}function Qw(u,_,A){return A=typeof A=="function"?A:n,wc(u,_,qc(_),A)}function Zw(u){return yg(u)&&u!=+u}function Jw(u){if(R6(u))throw new Pe(l);return hp(u)}function e2(u){return u===null}function t2(u){return u==null}function yg(u){return typeof u=="number"||Xr(u)&&Di(u)==rr}function jo(u){if(!Xr(u)||Di(u)!=Ht)return!1;var _=I0(u);if(_===null)return!0;var A=Ir.call(_,"constructor")&&_.constructor;return typeof A=="function"&&A instanceof A&&Ja.call(A)==Qy}var jc=Eo?qt(Eo):e6;function r2(u){return _g(u)&&u>=-9007199254740991&&u<=ye}var wg=zn?qt(zn):t6;function sl(u){return typeof u=="string"||!tr(u)&&Xr(u)&&Di(u)==je}function rn(u){return typeof u=="symbol"||Xr(u)&&Di(u)==Fe}var ao=Ao?qt(Ao):r6;function i2(u){return u===n}function n2(u){return Xr(u)&&Ai(u)==Qe}function s2(u){return Xr(u)&&Di(u)==r}var a2=j0(xc),o2=j0(function(u,_){return u<=_});function Sg(u){if(!u)return[];if(Gi(u))return sl(u)?Oi(u):Ui(u);if(Ro&&u[Ro])return ga(u[Ro]());var _=Ai(u),A=_==at?cs:_==qe?va:oo;return A(u)}function ys(u){if(!u)return u===0?u:0;if(u=dn(u),u===we||u===-1/0){var _=u<0?-1:1;return _*F}return u===u?u:0}function sr(u){var _=ys(u),A=_%1;return _===_?A?_-A:_:0}function xg(u){return u?wa(sr(u),0,W):0}function dn(u){if(typeof u=="number")return u;if(rn(u))return H;if(Wr(u)){var _=typeof u.valueOf=="function"?u.valueOf():u;u=Wr(_)?_+"":_}if(typeof u!="string")return u===0?u:+u;u=Sn(u);var A=tt.test(u);return A||_t.test(u)?ic(u.slice(2),A?2:8):kt.test(u)?H:+u}function Cg(u){return Wn(u,Yi(u))}function l2(u){return u?wa(sr(u),-9007199254740991,ye):u===0?u:0}function Tr(u){return u==null?"":tn(u)}var c2=io(function(u,_){if($o(_)||Gi(_)){Wn(_,bi(_),u);return}for(var A in _)Ir.call(_,A)&&Ho(u,A,_[A])}),kg=io(function(u,_){Wn(_,Yi(_),u)}),al=io(function(u,_,A,G){Wn(_,Yi(_),u,G)}),u2=io(function(u,_,A,G){Wn(_,bi(_),u,G)}),h2=ms(vc);function f2(u,_){var A=ro(u);return _==null?A:ip(A,_)}var d2=cr(function(u,_){u=Ct(u);var A=-1,G=_.length,ge=G>2?_[2]:n;for(ge&&Ri(_[0],_[1],ge)&&(G=1);++A<G;)for(var Se=_[A],Ne=Yi(Se),Be=-1,Ge=Ne.length;++Be<Ge;){var ot=Ne[Be],lt=u[ot];(lt===n||Mn(lt,Gn[ot])&&!Ir.call(u,ot))&&(u[ot]=Se[ot])}return u}),p2=cr(function(u){return u.push(n,Vp),kr(Mg,n,u)});function g2(u,_){return zs(u,Ut(_,3),Yn)}function v2(u,_){return zs(u,Ut(_,3),_c)}function m2(u,_){return u==null?u:mc(u,Ut(_,3),Yi)}function _2(u,_){return u==null?u:lp(u,Ut(_,3),Yi)}function b2(u,_){return u&&Yn(u,Ut(_,3))}function y2(u,_){return u&&_c(u,Ut(_,3))}function w2(u){return u==null?[]:H0(u,bi(u))}function S2(u){return u==null?[]:H0(u,Yi(u))}function Xc(u,_,A){var G=u==null?n:Sa(u,_);return G===n?A:G}function x2(u,_){return u!=null&&Yp(u,_,W5)}function Qc(u,_){return u!=null&&Yp(u,_,$5)}var C2=Bp(function(u,_,A){_!=null&&typeof _.toString!="function"&&(_=A0.call(_)),u[_]=A},Jc(Wi)),k2=Bp(function(u,_,A){_!=null&&typeof _.toString!="function"&&(_=A0.call(_)),Ir.call(u,_)?u[_].push(A):u[_]=[A]},Ut),M2=cr(Uo);function bi(u){return Gi(u)?tp(u):Sc(u)}function Yi(u){return Gi(u)?tp(u,!0):i6(u)}function E2(u,_){var A={};return _=Ut(_,3),Yn(u,function(G,ge,Se){gs(A,_(G,ge,Se),G)}),A}function A2(u,_){var A={};return _=Ut(_,3),Yn(u,function(G,ge,Se){gs(A,ge,_(G,ge,Se))}),A}var T2=io(function(u,_,A){V0(u,_,A)}),Mg=io(function(u,_,A,G){V0(u,_,A,G)}),P2=ms(function(u,_){var A={};if(u==null)return A;var G=!1;_=Dr(_,function(Se){return Se=Ws(Se,u),G||(G=Se.length>1),Se}),Wn(u,Rc(u),A),G&&(A=un(A,C|y|g,C6));for(var ge=_.length;ge--;)Ac(A,_[ge]);return A});function I2(u,_){return Eg(u,il(Ut(_)))}var N2=ms(function(u,_){return u==null?{}:s6(u,_)});function Eg(u,_){if(u==null)return{};var A=Dr(Rc(u),function(G){return[G]});return _=Ut(_),_p(u,A,function(G,ge){return _(G,ge[0])})}function L2(u,_,A){_=Ws(_,u);var G=-1,ge=_.length;for(ge||(ge=1,u=n);++G<ge;){var Se=u==null?n:u[$n(_[G])];Se===n&&(G=ge,Se=A),u=bs(Se)?Se.call(u):Se}return u}function O2(u,_,A){return u==null?u:Yo(u,_,A)}function D2(u,_,A,G){return G=typeof G=="function"?G:n,u==null?u:Yo(u,_,A,G)}var Ag=zp(bi),Tg=zp(Yi);function R2(u,_,A){var G=tr(u),ge=G||Ks(u)||ao(u);if(_=Ut(_,4),A==null){var Se=u&&u.constructor;ge?A=G?new Se:[]:Wr(u)?A=bs(Se)?ro(I0(u)):{}:A={}}return(ge?ki:Yn)(u,function(Ne,Be,Ge){return _(A,Ne,Be,Ge)}),A}function B2(u,_){return u==null?!0:Ac(u,_)}function q2(u,_,A){return u==null?u:xp(u,_,Ic(A))}function F2(u,_,A,G){return G=typeof G=="function"?G:n,u==null?u:xp(u,_,Ic(A),G)}function oo(u){return u==null?[]:da(u,bi(u))}function z2(u){return u==null?[]:da(u,Yi(u))}function H2(u,_,A){return A===n&&(A=_,_=n),A!==n&&(A=dn(A),A=A===A?A:0),_!==n&&(_=dn(_),_=_===_?_:0),wa(dn(u),_,A)}function V2(u,_,A){return _=ys(_),A===n?(A=_,_=0):A=ys(A),u=dn(u),K5(u,_,A)}function U2(u,_,A){if(A&&typeof A!="boolean"&&Ri(u,_,A)&&(_=A=n),A===n&&(typeof _=="boolean"?(A=_,_=n):typeof u=="boolean"&&(A=u,u=n)),u===n&&_===n?(u=0,_=1):(u=ys(u),_===n?(_=u,u=0):_=ys(_)),u>_){var G=u;u=_,_=G}if(A||u%1||_%1){var ge=J1();return Ei(u+ge*(_-u+qn("1e-"+((ge+"").length-1))),_)}return kc(u,_)}var G2=no(function(u,_,A){return _=_.toLowerCase(),u+(A?Pg(_):_)});function Pg(u){return Zc(Tr(u).toLowerCase())}function Ig(u){return u=Tr(u),u&&u.replace(Mt,xn).replace(Ee,"")}function Y2(u,_,A){u=Tr(u),_=tn(_);var G=u.length;A=A===n?G:wa(sr(A),0,G);var ge=A;return A-=_.length,A>=0&&u.slice(A,ge)==_}function W2(u){return u=Tr(u),u&&re.test(u)?u.replace(oe,Xa):u}function $2(u){return u=Tr(u),u&&Ae.test(u)?u.replace(Me,"\\$&"):u}var K2=no(function(u,_,A){return u+(A?"-":"")+_.toLowerCase()}),j2=no(function(u,_,A){return u+(A?" ":"")+_.toLowerCase()}),X2=Op("toLowerCase");function Q2(u,_,A){u=Tr(u),_=sr(_);var G=_?Vs(u):0;if(!_||G>=_)return u;var ge=(_-G)/2;return K0(D0(ge),A)+u+K0(O0(ge),A)}function Z2(u,_,A){u=Tr(u),_=sr(_);var G=_?Vs(u):0;return _&&G<_?u+K0(_-G,A):u}function J2(u,_,A){u=Tr(u),_=sr(_);var G=_?Vs(u):0;return _&&G<_?K0(_-G,A)+u:u}function e9(u,_,A){return A||_==null?_=0:_&&(_=+_),o5(Tr(u).replace(Oe,""),_||0)}function t9(u,_,A){return(A?Ri(u,_,A):_===n)?_=1:_=sr(_),Mc(Tr(u),_)}function r9(){var u=arguments,_=Tr(u[0]);return u.length<3?_:_.replace(u[1],u[2])}var i9=no(function(u,_,A){return u+(A?"_":"")+_.toLowerCase()});function n9(u,_,A){return A&&typeof A!="number"&&Ri(u,_,A)&&(_=A=n),A=A===n?W:A>>>0,A?(u=Tr(u),u&&(typeof _=="string"||_!=null&&!jc(_))&&(_=tn(_),!_&&Hs(u))?$s(Oi(u),0,A):u.split(_,A)):[]}var s9=no(function(u,_,A){return u+(A?" ":"")+Zc(_)});function a9(u,_,A){return u=Tr(u),A=A==null?0:wa(sr(A),0,u.length),_=tn(_),u.slice(A,A+_.length)==_}function o9(u,_,A){var G=be.templateSettings;A&&Ri(u,_,A)&&(_=n),u=Tr(u),_=al({},_,G,Hp);var ge=al({},_.imports,G.imports,Hp),Se=bi(ge),Ne=da(ge,Se),Be,Ge,ot=0,lt=_.interpolate||Dt,ut="__p += '",At=zt((_.escape||Dt).source+"|"+lt.source+"|"+(lt===de?ft:Dt).source+"|"+(_.evaluate||Dt).source+"|$","g"),Ot="//# sourceURL="+(Ir.call(_,"sourceURL")?(_.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Gt+"]")+`
12
+ `;u.replace(At,function(Wt,dr,yr,nn,Bi,sn){return yr||(yr=nn),ut+=u.slice(ot,sn).replace(Rt,oc),dr&&(Be=!0,ut+=`' +
13
+ __e(`+dr+`) +
14
+ '`),Bi&&(Ge=!0,ut+=`';
15
+ `+Bi+`;
16
+ __p += '`),yr&&(ut+=`' +
17
+ ((__t = (`+yr+`)) == null ? '' : __t) +
18
+ '`),ot=sn+Wt.length,Wt}),ut+=`';
19
+ `;var Yt=Ir.call(_,"variable")&&_.variable;if(!Yt)ut=`with (obj) {
20
+ `+ut+`
21
+ }
22
+ `;else if($e.test(Yt))throw new Pe(f);ut=(Ge?ut.replace(Q,""):ut).replace(j,"$1").replace(ce,"$1;"),ut="function("+(Yt||"obj")+`) {
23
+ `+(Yt?"":`obj || (obj = {});
24
+ `)+"var __t, __p = ''"+(Be?", __e = _.escape":"")+(Ge?`, __j = Array.prototype.join;
25
+ function print() { __p += __j.call(arguments, '') }
26
+ `:`;
27
+ `)+ut+`return __p
28
+ }`;var lr=Lg(function(){return Ye(Se,Ot+"return "+ut).apply(n,Ne)});if(lr.source=ut,Kc(lr))throw lr;return lr}function l9(u){return Tr(u).toLowerCase()}function c9(u){return Tr(u).toUpperCase()}function u9(u,_,A){if(u=Tr(u),u&&(A||_===n))return Sn(u);if(!u||!(_=tn(_)))return u;var G=Oi(u),ge=Oi(_),Se=pa(G,ge),Ne=Un(G,ge)+1;return $s(G,Se,Ne).join("")}function h9(u,_,A){if(u=Tr(u),u&&(A||_===n))return u.slice(0,Za(u)+1);if(!u||!(_=tn(_)))return u;var G=Oi(u),ge=Un(G,Oi(_))+1;return $s(G,0,ge).join("")}function f9(u,_,A){if(u=Tr(u),u&&(A||_===n))return u.replace(Oe,"");if(!u||!(_=tn(_)))return u;var G=Oi(u),ge=pa(G,Oi(_));return $s(G,ge).join("")}function d9(u,_){var A=he,G=ae;if(Wr(_)){var ge="separator"in _?_.separator:ge;A="length"in _?sr(_.length):A,G="omission"in _?tn(_.omission):G}u=Tr(u);var Se=u.length;if(Hs(u)){var Ne=Oi(u);Se=Ne.length}if(A>=Se)return u;var Be=A-Vs(G);if(Be<1)return G;var Ge=Ne?$s(Ne,0,Be).join(""):u.slice(0,Be);if(ge===n)return Ge+G;if(Ne&&(Be+=Ge.length-Be),jc(ge)){if(u.slice(Be).search(ge)){var ot,lt=Ge;for(ge.global||(ge=zt(ge.source,Tr(vt.exec(ge))+"g")),ge.lastIndex=0;ot=ge.exec(lt);)var ut=ot.index;Ge=Ge.slice(0,ut===n?Be:ut)}}else if(u.indexOf(tn(ge),Be)!=Be){var At=Ge.lastIndexOf(ge);At>-1&&(Ge=Ge.slice(0,At))}return Ge+G}function p9(u){return u=Tr(u),u&&ee.test(u)?u.replace(te,cc):u}var g9=no(function(u,_,A){return u+(A?" ":"")+_.toUpperCase()}),Zc=Op("toUpperCase");function Ng(u,_,A){return u=Tr(u),_=A?n:_,_===n?en(u)?uc(u):E0(u):u.match(_)||[]}var Lg=cr(function(u,_){try{return kr(u,n,_)}catch(A){return Kc(A)?A:new Pe(A)}}),v9=ms(function(u,_){return ki(_,function(A){A=$n(A),gs(u,A,Wc(u[A],u))}),u});function m9(u){var _=u==null?0:u.length,A=Ut();return u=_?Dr(u,function(G){if(typeof G[1]!="function")throw new Jt(h);return[A(G[0]),G[1]]}):[],cr(function(G){for(var ge=-1;++ge<_;){var Se=u[ge];if(kr(Se[0],this,G))return kr(Se[1],this,G)}})}function _9(u){return U5(un(u,C))}function Jc(u){return function(){return u}}function b9(u,_){return u==null||u!==u?_:u}var y9=Rp(),w9=Rp(!0);function Wi(u){return u}function eu(u){return fp(typeof u=="function"?u:un(u,C))}function S9(u){return pp(un(u,C))}function x9(u,_){return gp(u,un(_,C))}var C9=cr(function(u,_){return function(A){return Uo(A,u,_)}}),k9=cr(function(u,_){return function(A){return Uo(u,A,_)}});function tu(u,_,A){var G=bi(_),ge=H0(_,G);A==null&&!(Wr(_)&&(ge.length||!G.length))&&(A=_,_=u,u=this,ge=H0(_,bi(_)));var Se=!(Wr(A)&&"chain"in A)||!!A.chain,Ne=bs(u);return ki(ge,function(Be){var Ge=_[Be];u[Be]=Ge,Ne&&(u.prototype[Be]=function(){var ot=this.__chain__;if(Se||ot){var lt=u(this.__wrapped__),ut=lt.__actions__=Ui(this.__actions__);return ut.push({func:Ge,args:arguments,thisArg:u}),lt.__chain__=ot,lt}return Ge.apply(u,Vn([this.value()],arguments))})}),u}function M9(){return ai._===this&&(ai._=Zy),this}function ru(){}function E9(u){return u=sr(u),cr(function(_){return vp(_,u)})}var A9=Lc(Dr),T9=Lc(M0),P9=Lc(Io);function Og(u){return zc(u)?Wa($n(u)):a6(u)}function I9(u){return function(_){return u==null?n:Sa(u,_)}}var N9=qp(),L9=qp(!0);function iu(){return[]}function nu(){return!1}function O9(){return{}}function D9(){return""}function R9(){return!0}function B9(u,_){if(u=sr(u),u<1||u>ye)return[];var A=W,G=Ei(u,W);_=Ut(_),u-=W;for(var ge=ja(G,_);++A<u;)_(A);return ge}function q9(u){return tr(u)?Dr(u,$n):rn(u)?[u]:Ui(eg(Tr(u)))}function F9(u){var _=++Xy;return Tr(u)+_}var z9=$0(function(u,_){return u+_},0),H9=Oc("ceil"),V9=$0(function(u,_){return u/_},1),U9=Oc("floor");function G9(u){return u&&u.length?z0(u,Wi,bc):n}function Y9(u,_){return u&&u.length?z0(u,Ut(_,2),bc):n}function W9(u){return ls(u,Wi)}function $9(u,_){return ls(u,Ut(_,2))}function K9(u){return u&&u.length?z0(u,Wi,xc):n}function j9(u,_){return u&&u.length?z0(u,Ut(_,2),xc):n}var X9=$0(function(u,_){return u*_},1),Q9=Oc("round"),Z9=$0(function(u,_){return u-_},0);function J9(u){return u&&u.length?Ka(u,Wi):0}function e7(u,_){return u&&u.length?Ka(u,Ut(_,2)):0}return be.after=Sw,be.ary=hg,be.assign=c2,be.assignIn=kg,be.assignInWith=al,be.assignWith=u2,be.at=h2,be.before=fg,be.bind=Wc,be.bindAll=v9,be.bindKey=dg,be.castArray=Ow,be.chain=lg,be.chunk=U6,be.compact=G6,be.concat=Y6,be.cond=m9,be.conforms=_9,be.constant=Jc,be.countBy=J4,be.create=f2,be.curry=pg,be.curryRight=gg,be.debounce=vg,be.defaults=d2,be.defaultsDeep=p2,be.defer=xw,be.delay=Cw,be.difference=W6,be.differenceBy=$6,be.differenceWith=K6,be.drop=j6,be.dropRight=X6,be.dropRightWhile=Q6,be.dropWhile=Z6,be.fill=J6,be.filter=tw,be.flatMap=nw,be.flatMapDeep=sw,be.flatMapDepth=aw,be.flatten=ng,be.flattenDeep=e4,be.flattenDepth=t4,be.flip=kw,be.flow=y9,be.flowRight=w9,be.fromPairs=r4,be.functions=w2,be.functionsIn=S2,be.groupBy=ow,be.initial=n4,be.intersection=s4,be.intersectionBy=a4,be.intersectionWith=o4,be.invert=C2,be.invertBy=k2,be.invokeMap=cw,be.iteratee=eu,be.keyBy=uw,be.keys=bi,be.keysIn=Yi,be.map=el,be.mapKeys=E2,be.mapValues=A2,be.matches=S9,be.matchesProperty=x9,be.memoize=rl,be.merge=T2,be.mergeWith=Mg,be.method=C9,be.methodOf=k9,be.mixin=tu,be.negate=il,be.nthArg=E9,be.omit=P2,be.omitBy=I2,be.once=Mw,be.orderBy=hw,be.over=A9,be.overArgs=Ew,be.overEvery=T9,be.overSome=P9,be.partial=$c,be.partialRight=mg,be.partition=fw,be.pick=N2,be.pickBy=Eg,be.property=Og,be.propertyOf=I9,be.pull=h4,be.pullAll=ag,be.pullAllBy=f4,be.pullAllWith=d4,be.pullAt=p4,be.range=N9,be.rangeRight=L9,be.rearg=Aw,be.reject=gw,be.remove=g4,be.rest=Tw,be.reverse=Gc,be.sampleSize=mw,be.set=O2,be.setWith=D2,be.shuffle=_w,be.slice=v4,be.sortBy=ww,be.sortedUniq=x4,be.sortedUniqBy=C4,be.split=n9,be.spread=Pw,be.tail=k4,be.take=M4,be.takeRight=E4,be.takeRightWhile=A4,be.takeWhile=T4,be.tap=G4,be.throttle=Iw,be.thru=J0,be.toArray=Sg,be.toPairs=Ag,be.toPairsIn=Tg,be.toPath=q9,be.toPlainObject=Cg,be.transform=R2,be.unary=Nw,be.union=P4,be.unionBy=I4,be.unionWith=N4,be.uniq=L4,be.uniqBy=O4,be.uniqWith=D4,be.unset=B2,be.unzip=Yc,be.unzipWith=og,be.update=q2,be.updateWith=F2,be.values=oo,be.valuesIn=z2,be.without=R4,be.words=Ng,be.wrap=Lw,be.xor=B4,be.xorBy=q4,be.xorWith=F4,be.zip=z4,be.zipObject=H4,be.zipObjectDeep=V4,be.zipWith=U4,be.entries=Ag,be.entriesIn=Tg,be.extend=kg,be.extendWith=al,tu(be,be),be.add=z9,be.attempt=Lg,be.camelCase=G2,be.capitalize=Pg,be.ceil=H9,be.clamp=H2,be.clone=Dw,be.cloneDeep=Bw,be.cloneDeepWith=qw,be.cloneWith=Rw,be.conformsTo=Fw,be.deburr=Ig,be.defaultTo=b9,be.divide=V9,be.endsWith=Y2,be.eq=Mn,be.escape=W2,be.escapeRegExp=$2,be.every=ew,be.find=rw,be.findIndex=rg,be.findKey=g2,be.findLast=iw,be.findLastIndex=ig,be.findLastKey=v2,be.floor=U9,be.forEach=cg,be.forEachRight=ug,be.forIn=m2,be.forInRight=_2,be.forOwn=b2,be.forOwnRight=y2,be.get=Xc,be.gt=zw,be.gte=Hw,be.has=x2,be.hasIn=Qc,be.head=sg,be.identity=Wi,be.includes=lw,be.indexOf=i4,be.inRange=V2,be.invoke=M2,be.isArguments=ka,be.isArray=tr,be.isArrayBuffer=Vw,be.isArrayLike=Gi,be.isArrayLikeObject=Zr,be.isBoolean=Uw,be.isBuffer=Ks,be.isDate=Gw,be.isElement=Yw,be.isEmpty=Ww,be.isEqual=$w,be.isEqualWith=Kw,be.isError=Kc,be.isFinite=jw,be.isFunction=bs,be.isInteger=_g,be.isLength=nl,be.isMap=bg,be.isMatch=Xw,be.isMatchWith=Qw,be.isNaN=Zw,be.isNative=Jw,be.isNil=t2,be.isNull=e2,be.isNumber=yg,be.isObject=Wr,be.isObjectLike=Xr,be.isPlainObject=jo,be.isRegExp=jc,be.isSafeInteger=r2,be.isSet=wg,be.isString=sl,be.isSymbol=rn,be.isTypedArray=ao,be.isUndefined=i2,be.isWeakMap=n2,be.isWeakSet=s2,be.join=l4,be.kebabCase=K2,be.last=fn,be.lastIndexOf=c4,be.lowerCase=j2,be.lowerFirst=X2,be.lt=a2,be.lte=o2,be.max=G9,be.maxBy=Y9,be.mean=W9,be.meanBy=$9,be.min=K9,be.minBy=j9,be.stubArray=iu,be.stubFalse=nu,be.stubObject=O9,be.stubString=D9,be.stubTrue=R9,be.multiply=X9,be.nth=u4,be.noConflict=M9,be.noop=ru,be.now=tl,be.pad=Q2,be.padEnd=Z2,be.padStart=J2,be.parseInt=e9,be.random=U2,be.reduce=dw,be.reduceRight=pw,be.repeat=t9,be.replace=r9,be.result=L2,be.round=Q9,be.runInContext=Ve,be.sample=vw,be.size=bw,be.snakeCase=i9,be.some=yw,be.sortedIndex=m4,be.sortedIndexBy=_4,be.sortedIndexOf=b4,be.sortedLastIndex=y4,be.sortedLastIndexBy=w4,be.sortedLastIndexOf=S4,be.startCase=s9,be.startsWith=a9,be.subtract=Z9,be.sum=J9,be.sumBy=e7,be.template=o9,be.times=B9,be.toFinite=ys,be.toInteger=sr,be.toLength=xg,be.toLower=l9,be.toNumber=dn,be.toSafeInteger=l2,be.toString=Tr,be.toUpper=c9,be.trim=u9,be.trimEnd=h9,be.trimStart=f9,be.truncate=d9,be.unescape=p9,be.uniqueId=F9,be.upperCase=g9,be.upperFirst=Zc,be.each=cg,be.eachRight=ug,be.first=sg,tu(be,function(){var u={};return Yn(be,function(_,A){Ir.call(be.prototype,A)||(u[A]=_)}),u}(),{chain:!1}),be.VERSION=a,ki(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){be[u].placeholder=be}),ki(["drop","take"],function(u,_){mr.prototype[u]=function(A){A=A===n?1:li(sr(A),0);var G=this.__filtered__&&!_?new mr(this):this.clone();return G.__filtered__?G.__takeCount__=Ei(A,G.__takeCount__):G.__views__.push({size:Ei(A,W),type:u+(G.__dir__<0?"Right":"")}),G},mr.prototype[u+"Right"]=function(A){return this.reverse()[u](A).reverse()}}),ki(["filter","map","takeWhile"],function(u,_){var A=_+1,G=A==Y||A==ne;mr.prototype[u]=function(ge){var Se=this.clone();return Se.__iteratees__.push({iteratee:Ut(ge,3),type:A}),Se.__filtered__=Se.__filtered__||G,Se}}),ki(["head","last"],function(u,_){var A="take"+(_?"Right":"");mr.prototype[u]=function(){return this[A](1).value()[0]}}),ki(["initial","tail"],function(u,_){var A="drop"+(_?"":"Right");mr.prototype[u]=function(){return this.__filtered__?new mr(this):this[A](1)}}),mr.prototype.compact=function(){return this.filter(Wi)},mr.prototype.find=function(u){return this.filter(u).head()},mr.prototype.findLast=function(u){return this.reverse().find(u)},mr.prototype.invokeMap=cr(function(u,_){return typeof u=="function"?new mr(this):this.map(function(A){return Uo(A,u,_)})}),mr.prototype.reject=function(u){return this.filter(il(Ut(u)))},mr.prototype.slice=function(u,_){u=sr(u);var A=this;return A.__filtered__&&(u>0||_<0)?new mr(A):(u<0?A=A.takeRight(-u):u&&(A=A.drop(u)),_!==n&&(_=sr(_),A=_<0?A.dropRight(-_):A.take(_-u)),A)},mr.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},mr.prototype.toArray=function(){return this.take(W)},Yn(mr.prototype,function(u,_){var A=/^(?:filter|find|map|reject)|While$/.test(_),G=/^(?:head|last)$/.test(_),ge=be[G?"take"+(_=="last"?"Right":""):_],Se=G||/^find/.test(_);ge&&(be.prototype[_]=function(){var Ne=this.__wrapped__,Be=G?[1]:arguments,Ge=Ne instanceof mr,ot=Be[0],lt=Ge||tr(Ne),ut=function(dr){var yr=ge.apply(be,Vn([dr],Be));return G&&At?yr[0]:yr};lt&&A&&typeof ot=="function"&&ot.length!=1&&(Ge=lt=!1);var At=this.__chain__,Ot=!!this.__actions__.length,Yt=Se&&!At,lr=Ge&&!Ot;if(!Se&&lt){Ne=lr?Ne:new mr(this);var Wt=u.apply(Ne,Be);return Wt.__actions__.push({func:J0,args:[ut],thisArg:n}),new cn(Wt,At)}return Yt&&lr?u.apply(this,Be):(Wt=this.thru(ut),Yt?G?Wt.value()[0]:Wt.value():Wt)})}),ki(["pop","push","shift","sort","splice","unshift"],function(u){var _=Mi[u],A=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",G=/^(?:pop|shift)$/.test(u);be.prototype[u]=function(){var ge=arguments;if(G&&!this.__chain__){var Se=this.value();return _.apply(tr(Se)?Se:[],ge)}return this[A](function(Ne){return _.apply(tr(Ne)?Ne:[],ge)})}}),Yn(mr.prototype,function(u,_){var A=be[_];if(A){var G=A.name+"";Ir.call(to,G)||(to[G]=[]),to[G].push({name:_,func:A})}}),to[W0(n,N).name]=[{name:"wrapper",func:n}],mr.prototype.clone=p5,mr.prototype.reverse=g5,mr.prototype.value=v5,be.prototype.at=Y4,be.prototype.chain=W4,be.prototype.commit=$4,be.prototype.next=K4,be.prototype.plant=X4,be.prototype.reverse=Q4,be.prototype.toJSON=be.prototype.valueOf=be.prototype.value=Z4,be.prototype.first=be.prototype.head,Ro&&(be.prototype[Ro]=j4),be},us=hc();Fn?((Fn.exports=us)._=us,Mo._=us):ai._=us}).call(m7)}(i0,i0.exports)),i0.exports}var b7=_7();const po=Fl(b7);function ks(e,t){return Math.floor(Math.random()*(t-e+1))+e}function Xo(e){return Math.cos(n3(e))}function Qo(e){return Math.sin(n3(e))}function n3(e){return e/360*2*Math.PI}function s3(e,t){const n=new Array(t.length).fill("_"),a=e.split("");console.log(e,t),console.log("Attempt char codes:",e.split("").map(o=>o.charCodeAt(0))),console.log("Answer char codes:",t.split("").map(o=>o.charCodeAt(0)));for(let o=0;o<t.length;o++)o<a.length&&a[o]===t[o]&&(n[o]=a[o],a[o]="");for(let o=t.length-1;o>=0;o--)if(n[o]==="_"){const l=a.findIndex(h=>h===t[o]);l!==-1&&(n[o]=t[o],a[l]="")}return console.log(n.join(" ")),n.join(" ")}const y7=Vr({name:"FillInView",components:{MarkdownRenderer:f7(()=>a7(()=>import("./index-DHMXQY3-.js").then(e=>e.p),__vite__mapDeps([0,1,2,3])).then(e=>e.MarkdownRenderer)),RadioMultipleChoice:Bl,AudioAutoPlayer:zd},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"FillInView"),a=ii(n);a.question.value=new go(e.data);const o=Lt(),l=Sr(()=>{if(!a.question.value)throw n.logger.error("Question not initialized"),new Error("Question not initialized");return a.question.value});Nn(()=>{try{if(a.question.value||(a.question.value=new go(e.data)),a.question.value.options){const N=p();o.value=po.shuffle(N)}}catch(N){n.logger.error("Failed to initialize question:",N)}}),ql(()=>{a.question.value=void 0});const h=Sr(()=>o.value),f=Sr(()=>!!e.data[0]["image-1"]),b=Sr(()=>{if(!f.value)return[""];const N=[];let I=1;for(;e.data[0][`image-${I}`];)N.push(URL.createObjectURL(e.data[0][`image-${I}`])),I++;return N}),S=Sr(()=>!!e.data[0]["audio-1"]),M=Sr(()=>{var N;return((N=l.value)==null?void 0:N.mdText)||""}),C=Sr(()=>{if(!S.value)return[""];const N=[];let I=1;for(;e.data[0][`audio-${I}`];)N.push(URL.createObjectURL(e.data[0][`audio-${I}`])),I++;return N}),y=Sr(()=>{if(l.value.answers)return l.value.answers[Math.floor(l.value.answers.length*Math.random())];throw new Error("No answers provided")}),g=Sr(()=>{var N;const I=y.value;if(console.log(`Prior answers: ${a.priorAnswers.value}`),I&&((N=a.priorAnswers.value[0])!=null&&N[0])&&a.priorAnswers.value[0][1]==="UserInputString")return s3(a.priorAnswers.value[0][0],I);if(console.log("found no UserInputString"),y.value){let O="";for(let V=0;V<y.value.length;V++)O+="_ ";return O}return""}),w=Sr(()=>!!(l.value.answers&&l.value.answers.length>0)),p=()=>{var N;if(!((N=l.value)!=null&&N.options))return;if(l.value.options.length<=6)return l.value.options;const I=[];I.push(l.value.answers[Math.floor(Math.random()*l.value.answers.length)]);let O=po.shuffle(l.value.options.filter(V=>{var U;return((U=l.value.answers)==null?void 0:U.indexOf(V))===-1}));return e.modifyDifficulty&&(console.log(`Modifying difficulty: ${e.modifyDifficulty}`),e.modifyDifficulty<-200?O=O.slice(0,1):e.modifyDifficulty<-150?O=O.slice(0,2):e.modifyDifficulty<-100?O=O.slice(0,3):e.modifyDifficulty<-50?O=O.slice(0,4):O=O.slice(0,5)),I.push(...O.slice(0,5)),I},E=()=>{a.submitAnswer("")};return d7(()=>e.data,N=>{var I;try{if(a.question.value=new go(N),(I=a.question.value)!=null&&I.options){const O=p();o.value=po.shuffle(O)}}catch(O){n.logger.error("Failed to initialize/update question:",O)}},{deep:!0}),{...n,...a,question:l,truncatedOptions:h,hasImage:f,imageURLs:b,hasAudio:S,audioURL:C,obscuredAnswer:g,someAnswer:y,isQuestion:w,handleNext:E,markdownText:M}}}),Ur=(e,t)=>{const n=e.__vccOpts||e;for(const[a,o]of t)n[a]=o;return n},w7={"data-viewable":"FillInView"},S7=["src"],x7={key:4,class:"text-center text-h6"},C7={key:5,class:"text-center text-h6"};function k7(e,t,n,a,o,l){var h;const f=hr("audio-auto-player"),b=hr("markdown-renderer"),S=hr("radio-multiple-choice"),M=hr("v-spacer"),C=hr("v-btn"),y=hr("v-card-actions");return St(),Pt("div",w7,[e.hasAudio?(St(),ho(f,{key:0,src:e.audioURL},null,8,["src"])):Or("",!0),e.hasImage?(St(!0),Pt(qr,{key:1},An(e.imageURLs,(g,w)=>(St(),Pt("img",{key:w,src:g},null,8,S7))),128)):Or("",!0),e.markdownText?(St(),ho(b,{key:2,md:e.markdownText},null,8,["md"])):Or("",!0),(h=e.question)!=null&&h.options?(St(),ho(S,{key:3,"choice-list":e.truncatedOptions},null,8,["choice-list"])):e.priorAttempts==1?(St(),Pt("div",x7,[ht("span",null,ir(e.obscuredAnswer),1)])):e.priorAttempts==2?(St(),Pt("div",C7,[ht("span",null,ir(e.someAnswer),1)])):Or("",!0),e.isQuestion?Or("",!0):(St(),ho(y,{key:6},{default:_n(()=>[xr(M),xr(C,{color:"primary",autofocus:"autofocus",onClick:e.handleNext},{default:_n(()=>t[0]||(t[0]=[Qr(" Next ")])),_:1},8,["onClick"])]),_:1}))])}const M7=Ur(y7,[["render",k7],["__scopeId","data-v-23c3a587"]]),a3=[{name:di.Blanks,fields:[{name:"Input",type:br.MARKDOWN},{name:"Uploads",type:br.MEDIA_UPLOADS}]}];function Fg(e,t,n){const a=e.split(t),o=a[0],l=a[1].split(n),h=l[0],f=l[1];return{left:o,middle:h,right:f}}const Hd=class nd extends fi{constructor(t){var n;super(t),rt(this,"mdText",""),rt(this,"answers",null),rt(this,"options",null),this.mdText=t[0].Input,this.mdText===void 0&&(this.mdText="");const a=r7(this.mdText,"{{","}}"),o=[];for(let l=0;l<a.length;l++)try{const h=this.optionsFromString(a[l]);this.answers=h.answers,this.options=h.options,(n=this.options)!=null&&n.length?o.push("{{ || }}"):o.push("{{ }}")}catch{o.push(a[l])}this.mdText=o.join("")}splitTextToken(t){if(i7(t)){const n=Fg(t.text,"{{","}}"),a=Fg(t.raw,"{{","}}"),o=[];return a.left.length>0&&o.push({type:"text",raw:a.left,text:n.left}),a.middle.length>0&&o.push({type:"text",raw:"{{"+a.middle+"}}",text:"{{"+n.middle+"}}"}),a.right.length>0&&o.push({type:"text",raw:a.right,text:n.right}),o}else return[t]}optionsFromString(t){if(!t.startsWith("{{")||!t.endsWith("}}"))throw new Error(`string ${t} is not fill-in text - must look like "{{someText}}"`);t=t.substring(2,t.length-2);const n=t.split("||");if(n.length>1){const a=n[0].split("|").map(h=>h.trim()),l=n[1].split("|").map(h=>h.trim()).filter(h=>!a.includes(h));return l.push(a[ks(0,a.length-1)]),{answers:a,options:po.shuffle(l)}}else return{answers:[t.trim()],options:null}}isCorrect(t){if(console.log(`answers:${this.answers}
29
+ user answer: ${JSON.stringify(t)}`),typeof t=="string"){if(this.answers)return this.answers.includes(t);if(t==="")return!0;throw new Error("Question has no configured answers!")}else if(Array.isArray(t)){if(this.answers)return t.every(n=>this.answers.includes(n));throw new Error("Question has no configured answers!")}else return this.isCorrectRadio(t)}dataShapes(){return nd.dataShapes}views(){return nd.views}isCorrectRadio(t){return this.answers?this.answers.includes(t.choiceList[t.selection]):!1}};rt(Hd,"dataShapes",a3);rt(Hd,"views",[M7]);let go=Hd;class Ns{constructor(t,n){rt(this,"name"),rt(this,"questionList"),this.name=t,this.questionList=n,this.questionList=this.questionList.concat(this.getBaseQTypes())}get questions(){return this.questionList}get allViews(){const t=new Array;return this.questionList.forEach(n=>{n.views.forEach(a=>{t.push(a)})}),t}get allViewsMap(){const t={};return this.allViews.forEach(n=>{if(n.name)t[n.name]=n;else throw new Error("View has no name")}),t}getQuestion(t){return this.questionList.find(n=>{const a=n.name.replace(/^_/,"").replace(/\d+$/,""),o=t.replace(/^_/,"").replace(/\d+$/,"");return n.name===t||a===o||n.name.includes(o)||t.includes(a)})}getBaseQTypes(){return[go]}}const E7=new Ns("default",[go]),A7=["cg-white","cg-black"],xl=["a","b","c","d","e","f","g","h"],Cl=["1","2","3","4","5","6","7","8"],T7=[...Cl].reverse(),Vd=Array.prototype.concat(...xl.map(e=>Cl.map(t=>e+t))),vn=e=>Vd[8*e[0]+e[1]],$r=e=>[e.charCodeAt(0)-97,e.charCodeAt(1)-49],o3=Vd.map($r);function P7(e){let t;const n=()=>(t===void 0&&(t=e()),t);return n.clear=()=>{t=void 0},n}const I7=()=>{let e;return{start(){e=performance.now()},cancel(){e=void 0},stop(){if(!e)return 0;const t=performance.now()-e;return e=void 0,t}}},Ud=e=>e==="cg-white"?"cg-black":"cg-white",o0=(e,t)=>{const n=e[0]-t[0],a=e[1]-t[1];return n*n+a*a},sd=(e,t)=>e.role===t.role&&e.color===t.color,d0=e=>(t,n)=>[(n?t[0]:7-t[0])*e.width/8,(n?7-t[1]:t[1])*e.height/8],jn=(e,t)=>{e.style.transform=`translate(${t[0]}px,${t[1]}px)`},l3=(e,t,n=1)=>{e.style.transform=`translate(${t[0]}px,${t[1]}px) scale(${n})`},Gd=(e,t)=>{e.style.visibility=t?"visible":"hidden"},Ba=e=>{var t;if(e.clientX||e.clientX===0)return[e.clientX,e.clientY];if((t=e.targetTouches)!=null&&t[0])return[e.targetTouches[0].clientX,e.targetTouches[0].clientY]},c3=e=>e.button===2,Ms=(e,t)=>{const n=document.createElement(e);return t&&(n.className=t),n};function u3(e,t,n){const a=$r(e);return t||(a[0]=7-a[0],a[1]=7-a[1]),[n.left+n.width*a[0]/8+n.width/16,n.top+n.height*(7-a[1])/8+n.height/16]}const La=(e,t)=>Math.abs(e-t),N7=e=>(t,n,a,o)=>La(t,a)<2&&(e==="cg-white"?o===n+1||n<=1&&o===n+2&&t===a:o===n-1||n>=6&&o===n-2&&t===a),h3=(e,t,n,a)=>{const o=La(e,n),l=La(t,a);return o===1&&l===2||o===2&&l===1},f3=(e,t,n,a)=>La(e,n)===La(t,a),d3=(e,t,n,a)=>e===n||t===a,p3=(e,t,n,a)=>f3(e,t,n,a)||d3(e,t,n,a),L7=(e,t,n)=>(a,o,l,h)=>La(a,l)<2&&La(o,h)<2||n&&o===h&&o===(e==="cg-white"?0:7)&&(a===4&&(l===2&&t.includes(0)||l===6&&t.includes(7))||t.includes(l));function O7(e,t){const n=t==="cg-white"?"1":"8",a=[];for(const[o,l]of e)o[1]===n&&l.color===t&&l.role==="rook"&&a.push($r(o)[0]);return a}function g3(e,t,n){const a=e.get(t);if(!a)return[];const o=$r(t),l=a.role,h=l==="pawn"?N7(a.color):l==="knight"?h3:l==="bishop"?f3:l==="rook"?d3:l==="queen"?p3:L7(a.color,O7(e,a.color),n);return o3.filter(f=>(o[0]!==f[0]||o[1]!==f[1])&&h(o[0],o[1],f[0],f[1])).map(vn)}function ji(e,...t){e&&setTimeout(()=>e(...t),1)}function D7(e){e.orientation=Ud(e.orientation),e.animation.current=e.draggable.current=e.selected=void 0}function R7(e,t){for(const[n,a]of t)a?e.pieces.set(n,a):e.pieces.delete(n)}function B7(e,t){if(e.check=void 0,t===!0&&(t=e.turnColor),t)for(const[n,a]of e.pieces)a.role==="king"&&a.color===t&&(e.check=n)}function q7(e,t,n,a){ia(e),e.premovable.current=[t,n],ji(e.premovable.events.set,t,n,a)}function ra(e){e.premovable.current&&(e.premovable.current=void 0,ji(e.premovable.events.unset))}function F7(e,t,n){ra(e),e.predroppable.current={role:t,key:n},ji(e.predroppable.events.set,t,n)}function ia(e){const t=e.predroppable;t.current&&(t.current=void 0,ji(t.events.unset))}function z7(e,t,n){if(!e.autoCastle)return!1;const a=e.pieces.get(t);if(!a||a.role!=="king")return!1;const o=$r(t),l=$r(n);if(o[1]!==0&&o[1]!==7||o[1]!==l[1])return!1;o[0]===4&&!e.pieces.has(n)&&(l[0]===6?n=vn([7,l[1]]):l[0]===2&&(n=vn([0,l[1]])));const h=e.pieces.get(n);return!h||h.color!==a.color||h.role!=="rook"?!1:(e.pieces.delete(t),e.pieces.delete(n),o[0]<l[0]?(e.pieces.set(vn([6,l[1]]),a),e.pieces.set(vn([5,l[1]]),h)):(e.pieces.set(vn([2,l[1]]),a),e.pieces.set(vn([3,l[1]]),h)),!0)}function v3(e,t,n){const a=e.pieces.get(t),o=e.pieces.get(n);if(t===n||!a)return!1;const l=o&&o.color!==a.color?o:void 0;return n===e.selected&&bn(e),ji(e.events.move,t,n,l),z7(e,t,n)||(e.pieces.set(n,a),e.pieces.delete(t)),e.lastMove=[t,n],e.check=void 0,ji(e.events.change),l||!0}function Yd(e,t,n,a){if(e.pieces.has(n))if(a)e.pieces.delete(n);else return!1;return ji(e.events.dropNewPiece,t,n),e.pieces.set(n,t),e.lastMove=[n],e.check=void 0,ji(e.events.change),e.movable.dests=void 0,e.turnColor=Ud(e.turnColor),!0}function m3(e,t,n){const a=v3(e,t,n);return a&&(e.movable.dests=void 0,e.turnColor=Ud(e.turnColor),e.animation.current=void 0),a}function _3(e,t,n){if(Wd(e,t,n)){const a=m3(e,t,n);if(a){const o=e.hold.stop();bn(e);const l={premove:!1,ctrlKey:e.stats.ctrlKey,holdTime:o};return a!==!0&&(l.captured=a),ji(e.movable.events.after,t,n,l),!0}}else if(V7(e,t,n))return q7(e,t,n,{ctrlKey:e.stats.ctrlKey}),bn(e),!0;return bn(e),!1}function b3(e,t,n,a){const o=e.pieces.get(t);o&&(H7(e,t,n)||a)?(e.pieces.delete(t),Yd(e,o,n,a),ji(e.movable.events.afterNewPiece,o.role,n,{premove:!1,predrop:!1})):o&&U7(e,t,n)?F7(e,o.role,n):(ra(e),ia(e)),e.pieces.delete(t),bn(e)}function ad(e,t,n){if(ji(e.events.select,t),e.selected){if(e.selected===t&&!e.draggable.enabled){bn(e),e.hold.cancel();return}else if((e.selectable.enabled||n)&&e.selected!==t&&_3(e,e.selected,t)){e.stats.dragged=!1;return}}(e.selectable.enabled||e.draggable.enabled)&&(w3(e,t)||$d(e,t))&&(y3(e,t),e.hold.start())}function y3(e,t){e.selected=t,$d(e,t)?e.premovable.customDests||(e.premovable.dests=g3(e.pieces,t,e.premovable.castle)):e.premovable.dests=void 0}function bn(e){e.selected=void 0,e.premovable.dests=void 0,e.hold.cancel()}function w3(e,t){const n=e.pieces.get(t);return!!n&&(e.movable.color==="both"||e.movable.color===n.color&&e.turnColor===n.color)}const Wd=(e,t,n)=>{var a,o;return t!==n&&w3(e,t)&&(e.movable.free||!!((o=(a=e.movable.dests)==null?void 0:a.get(t))!=null&&o.includes(n)))};function H7(e,t,n){const a=e.pieces.get(t);return!!a&&(t===n||!e.pieces.has(n))&&(e.movable.color==="both"||e.movable.color===a.color&&e.turnColor===a.color)}function $d(e,t){const n=e.pieces.get(t);return!!n&&e.premovable.enabled&&e.movable.color===n.color&&e.turnColor!==n.color}function V7(e,t,n){var a;const o=((a=e.premovable.customDests)==null?void 0:a.get(t))??g3(e.pieces,t,e.premovable.castle);return t!==n&&$d(e,t)&&o.includes(n)}function U7(e,t,n){const a=e.pieces.get(t),o=e.pieces.get(n);return!!a&&(!o||o.color!==e.movable.color)&&e.predroppable.enabled&&(a.role!=="pawn"||n[1]!=="1"&&n[1]!=="8")&&e.movable.color===a.color&&e.turnColor!==a.color}function G7(e,t){const n=e.pieces.get(t);return!!n&&e.draggable.enabled&&(e.movable.color==="both"||e.movable.color===n.color&&(e.turnColor===n.color||e.premovable.enabled))}function Y7(e){const t=e.premovable.current;if(!t)return!1;const n=t[0],a=t[1];let o=!1;if(Wd(e,n,a)){const l=m3(e,n,a);if(l){const h={premove:!0};l!==!0&&(h.captured=l),ji(e.movable.events.after,n,a,h),o=!0}}return ra(e),o}function W7(e,t){const n=e.predroppable.current;let a=!1;if(!n)return!1;if(t(n)){const o={role:n.role,color:e.movable.color};Yd(e,o,n.key)&&(ji(e.movable.events.afterNewPiece,n.role,n.key,{premove:!1,predrop:!0}),a=!0)}return ia(e),a}function Kd(e){ra(e),ia(e),bn(e)}function zg(e){e.movable.color=e.movable.dests=e.animation.current=void 0,Kd(e)}function qa(e,t,n){let a=Math.floor(8*(e[0]-n.left)/n.width);t||(a=7-a);let o=7-Math.floor(8*(e[1]-n.top)/n.height);return t||(o=7-o),a>=0&&a<8&&o>=0&&o<8?vn([a,o]):void 0}function $7(e,t,n,a){const o=$r(e),l=o3.filter(S=>p3(o[0],o[1],S[0],S[1])||h3(o[0],o[1],S[0],S[1])),f=l.map(S=>u3(vn(S),n,a)).map(S=>o0(t,S)),[,b]=f.reduce((S,M,C)=>S[0]<M?S:[M,C],[f[0],0]);return vn(l[b])}const Xi=e=>e.orientation==="cg-white",S3="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR",K7={p:"pawn",r:"rook",n:"knight",b:"bishop",q:"queen",k:"king"},j7={pawn:"p",rook:"r",knight:"n",bishop:"b",queen:"q",king:"k"};function x3(e){e==="start"&&(e=S3);const t=new Map;let n=7,a=0;for(const o of e)switch(o){case" ":case"[":return t;case"/":if(--n,n<0)return t;a=0;break;case"~":{const l=t.get(vn([a-1,n]));l&&(l.promoted=!0);break}default:{const l=o.charCodeAt(0);if(l<57)a+=l-48;else{const h=o.toLowerCase();t.set(vn([a,n]),{role:K7[h],color:o===h?"cg-black":"cg-white"}),++a}}}return t}function X7(e){return T7.map(t=>xl.map(n=>{const a=e.get(n+t);if(a){let o=j7[a.role];return a.color==="cg-white"&&(o=o.toUpperCase()),a.promoted&&(o+="~"),o}else return"1"}).join("")).join("/").replace(/1{2,}/g,t=>t.length.toString())}function C3(e,t){t.animation&&(jd(e.animation,t.animation),(e.animation.duration||0)<70&&(e.animation.enabled=!1))}function k3(e,t){var n,a,o;if((n=t.movable)!=null&&n.dests&&(e.movable.dests=void 0),(a=t.drawable)!=null&&a.autoShapes&&(e.drawable.autoShapes=[]),jd(e,t),t.fen&&(e.pieces=x3(t.fen),e.drawable.shapes=((o=t.drawable)==null?void 0:o.shapes)||[]),"check"in t&&B7(e,t.check||!1),"lastMove"in t&&!t.lastMove?e.lastMove=void 0:t.lastMove&&(e.lastMove=t.lastMove),e.selected&&y3(e,e.selected),C3(e,t),!e.movable.rookCastle&&e.movable.dests){const l=e.movable.color==="cg-white"?"1":"8",h="e"+l,f=e.movable.dests.get(h),b=e.pieces.get(h);if(!f||!b||b.role!=="king")return;e.movable.dests.set(h,f.filter(S=>!(S==="a"+l&&f.includes("c"+l))&&!(S==="h"+l&&f.includes("g"+l))))}}function jd(e,t){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)&&Hg(e[n])&&Hg(t[n])?jd(e[n],t[n]):e[n]=t[n])}function Hg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}const Ta=(e,t)=>t.animation.enabled?J7(e,t):Qs(e,t);function Qs(e,t){const n=e(t);return t.dom.redraw(),n}const su=(e,t)=>({key:e,pos:$r(e),piece:t}),Q7=(e,t)=>t.sort((n,a)=>o0(e.pos,n.pos)-o0(e.pos,a.pos))[0];function Z7(e,t){const n=new Map,a=[],o=new Map,l=[],h=[],f=new Map;let b,S,M;for(const[C,y]of e)f.set(C,su(C,y));for(const C of Vd)b=t.pieces.get(C),S=f.get(C),b?S?sd(b,S.piece)||(l.push(S),h.push(su(C,b))):h.push(su(C,b)):S&&l.push(S);for(const C of h)S=Q7(C,l.filter(y=>sd(C.piece,y.piece))),S&&(M=[S.pos[0]-C.pos[0],S.pos[1]-C.pos[1]],n.set(C.key,M.concat(M)),a.push(S.key));for(const C of l)a.includes(C.key)||o.set(C.key,C.piece);return{anims:n,fadings:o}}function M3(e,t){const n=e.animation.current;if(n===void 0){e.dom.destroyed||e.dom.redrawNow();return}const a=1-(t-n.start)*n.frequency;if(a<=0)e.animation.current=void 0,e.dom.redrawNow();else{const o=e8(a);for(const l of n.plan.anims.values())l[2]=l[0]*o,l[3]=l[1]*o;e.dom.redrawNow(!0),requestAnimationFrame((l=performance.now())=>M3(e,l))}}function J7(e,t){const n=new Map(t.pieces),a=e(t),o=Z7(n,t);if(o.anims.size||o.fadings.size){const l=t.animation.current&&t.animation.current.start;t.animation.current={start:performance.now(),frequency:1/t.animation.duration,plan:o},l||M3(t,performance.now())}else t.dom.redraw();return a}const e8=e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,t8=["green","red","blue","yellow"];function r8(e,t){if(t.touches&&t.touches.length>1)return;t.stopPropagation(),t.preventDefault(),t.ctrlKey?bn(e):Kd(e);const n=Ba(t),a=qa(n,Xi(e),e.dom.bounds());a&&(e.drawable.current={orig:a,pos:n,brush:a8(t),snapToValidMove:e.drawable.defaultSnapToValidMove},E3(e))}function E3(e){requestAnimationFrame(()=>{const t=e.drawable.current;if(t){const n=qa(t.pos,Xi(e),e.dom.bounds());n||(t.snapToValidMove=!1);const a=t.snapToValidMove?$7(t.orig,t.pos,Xi(e),e.dom.bounds()):n;a!==t.mouseSq&&(t.mouseSq=a,t.dest=a!==t.orig?a:void 0,e.dom.redrawNow()),E3(e)}})}function i8(e,t){e.drawable.current&&(e.drawable.current.pos=Ba(t))}function n8(e){const t=e.drawable.current;t&&(t.mouseSq&&o8(e.drawable,t),A3(e))}function A3(e){e.drawable.current&&(e.drawable.current=void 0,e.dom.redraw())}function s8(e){e.drawable.shapes.length&&(e.drawable.shapes=[],e.dom.redraw(),T3(e.drawable))}function a8(e){var t;const n=(e.shiftKey||e.ctrlKey)&&c3(e),a=e.altKey||e.metaKey||((t=e.getModifierState)==null?void 0:t.call(e,"AltGraph"));return t8[(n?1:0)+(a?2:0)]}function o8(e,t){const n=o=>o.orig===t.orig&&o.dest===t.dest,a=e.shapes.find(n);a&&(e.shapes=e.shapes.filter(o=>!n(o))),(!a||a.brush!==t.brush)&&e.shapes.push({orig:t.orig,dest:t.dest,brush:t.brush}),T3(e)}function T3(e){e.onChange&&e.onChange(e.shapes)}function l8(e,t){if(!(e.trustAllEvents||t.isTrusted)||t.buttons!==void 0&&t.buttons>1||t.touches&&t.touches.length>1)return;const n=e.dom.bounds(),a=Ba(t),o=qa(a,Xi(e),n);if(!o)return;const l=e.pieces.get(o),h=e.selected;if(!h&&e.drawable.enabled&&(e.drawable.eraseOnClick||!l||l.color!==e.turnColor)&&s8(e),t.cancelable!==!1&&(!t.touches||e.blockTouchScroll||l||h||c8(e,a)))t.preventDefault();else if(t.touches)return;const f=!!e.premovable.current,b=!!e.predroppable.current;e.stats.ctrlKey=t.ctrlKey,e.selected&&Wd(e,e.selected,o)?Ta(C=>ad(C,o),e):ad(e,o);const S=e.selected===o,M=I3(e,o);if(l&&M&&S&&G7(e,o)){e.draggable.current={orig:o,piece:l,origPos:a,pos:a,started:e.draggable.autoDistance&&e.stats.dragged,element:M,previouslySelected:h,originTarget:t.target,keyHasChanged:!1},M.cgDragging=!0,M.classList.add("dragging");const C=e.dom.elements.ghost;C&&(C.className=`ghost ${l.color} ${l.role}`,jn(C,d0(n)($r(o),Xi(e))),Gd(C,!0)),Xd(e)}else f&&ra(e),b&&ia(e);e.dom.redraw()}function c8(e,t){const n=Xi(e),a=e.dom.bounds(),o=Math.pow(a.width/8,2);for(const l of e.pieces.keys()){const h=u3(l,n,a);if(o0(h,t)<=o)return!0}return!1}function u8(e,t,n,a){const o="a0";e.pieces.set(o,t),e.dom.redraw();const l=Ba(n);e.draggable.current={orig:o,piece:t,origPos:l,pos:l,started:!0,element:()=>I3(e,o),originTarget:n.target,newPiece:!0,force:!!a,keyHasChanged:!1},Xd(e)}function Xd(e){requestAnimationFrame(()=>{var t;const n=e.draggable.current;if(!n)return;(t=e.animation.current)!=null&&t.plan.anims.has(n.orig)&&(e.animation.current=void 0);const a=e.pieces.get(n.orig);if(!a||!sd(a,n.piece))kl(e);else if(!n.started&&o0(n.pos,n.origPos)>=Math.pow(e.draggable.distance,2)&&(n.started=!0),n.started){if(typeof n.element=="function"){const l=n.element();if(!l)return;l.cgDragging=!0,l.classList.add("dragging"),n.element=l}const o=e.dom.bounds();jn(n.element,[n.pos[0]-o.left-o.width/16,n.pos[1]-o.top-o.height/16]),n.keyHasChanged=n.keyHasChanged||n.orig!==qa(n.pos,Xi(e),o)}Xd(e)})}function h8(e,t){e.draggable.current&&(!t.touches||t.touches.length<2)&&(e.draggable.current.pos=Ba(t))}function f8(e,t){const n=e.draggable.current;if(!n)return;if(t.type==="touchend"&&t.cancelable!==!1&&t.preventDefault(),t.type==="touchend"&&n.originTarget!==t.target&&!n.newPiece){e.draggable.current=void 0;return}ra(e),ia(e);const a=Ba(t)||n.pos,o=qa(a,Xi(e),e.dom.bounds());o&&n.started&&n.orig!==o?n.newPiece?b3(e,n.orig,o,n.force):(e.stats.ctrlKey=t.ctrlKey,_3(e,n.orig,o)&&(e.stats.dragged=!0)):n.newPiece?e.pieces.delete(n.orig):e.draggable.deleteOnDropOff&&!o&&(e.pieces.delete(n.orig),ji(e.events.change)),(n.orig===n.previouslySelected||n.keyHasChanged)&&(n.orig===o||!o)?bn(e):e.selectable.enabled||bn(e),P3(e),e.draggable.current=void 0,e.dom.redraw()}function kl(e){const t=e.draggable.current;t&&(t.newPiece&&e.pieces.delete(t.orig),e.draggable.current=void 0,bn(e),P3(e),e.dom.redraw())}function P3(e){const t=e.dom.elements;t.ghost&&Gd(t.ghost,!1)}function I3(e,t){let n=e.dom.elements.board.firstChild;for(;n;){if(n.cgKey===t&&n.tagName==="PIECE")return n;n=n.nextSibling}}function d8(e,t){e.exploding={stage:1,keys:t},e.dom.redraw(),setTimeout(()=>{Vg(e,2),setTimeout(()=>Vg(e,void 0),120)},120)}function Vg(e,t){e.exploding&&(t?e.exploding.stage=t:e.exploding=void 0,e.dom.redraw())}function p8(e,t){function n(){D7(e),t()}return{set(a){a.orientation&&a.orientation!==e.orientation&&n(),C3(e,a),(a.fen?Ta:Qs)(o=>k3(o,a),e)},state:e,getFen:()=>X7(e.pieces),toggleOrientation:n,setPieces(a){Ta(o=>R7(o,a),e)},selectSquare(a,o){a?Ta(l=>ad(l,a,o),e):e.selected&&(bn(e),e.dom.redraw())},move(a,o){Ta(l=>v3(l,a,o),e)},newPiece(a,o){Ta(l=>Yd(l,a,o),e)},playPremove(){if(e.premovable.current){if(Ta(Y7,e))return!0;e.dom.redraw()}return!1},playPredrop(a){if(e.predroppable.current){const o=W7(e,a);return e.dom.redraw(),o}return!1},cancelPremove(){Qs(ra,e)},cancelPredrop(){Qs(ia,e)},cancelMove(){Qs(a=>{Kd(a),kl(a)},e)},stop(){Qs(a=>{zg(a),kl(a)},e)},explode(a){d8(e,a)},setAutoShapes(a){Qs(o=>o.drawable.autoShapes=a,e)},setShapes(a){Qs(o=>o.drawable.shapes=a,e)},getKeyAtDomPos(a){return qa(a,Xi(e),e.dom.bounds())},redrawAll:t,dragNewPiece(a,o,l){u8(e,a,o,l)},destroy(){zg(e),e.dom.unbind&&e.dom.unbind(),e.dom.destroyed=!0}}}function g8(){return{pieces:x3(S3),orientation:"cg-white",turnColor:"cg-white",coordinates:!0,coordinatesOnSquares:!1,ranksPosition:"right",autoCastle:!0,viewOnly:!1,disableContextMenu:!1,addPieceZIndex:!1,blockTouchScroll:!1,pieceKey:!1,trustAllEvents:!1,highlight:{lastMove:!0,check:!0},animation:{enabled:!0,duration:200},movable:{free:!0,color:"both",showDests:!0,events:{},rookCastle:!0},premovable:{enabled:!0,showDests:!0,castle:!0,events:{}},predroppable:{enabled:!1,events:{}},draggable:{enabled:!0,distance:3,autoDistance:!0,showGhost:!0,deleteOnDropOff:!1},dropmode:{active:!1},selectable:{enabled:!0},stats:{dragged:!("ontouchstart"in window)},events:{},drawable:{enabled:!0,visible:!0,defaultSnapToValidMove:!0,eraseOnClick:!0,shapes:[],autoShapes:[],brushes:{green:{key:"g",color:"#15781B",opacity:1,lineWidth:10},red:{key:"r",color:"#882020",opacity:1,lineWidth:10},blue:{key:"b",color:"#003088",opacity:1,lineWidth:10},yellow:{key:"y",color:"#e68f00",opacity:1,lineWidth:10},paleBlue:{key:"pb",color:"#003088",opacity:.4,lineWidth:15},paleGreen:{key:"pg",color:"#15781B",opacity:.4,lineWidth:15},paleRed:{key:"pr",color:"#882020",opacity:.4,lineWidth:15},paleGrey:{key:"pgr",color:"#4a4a4a",opacity:.35,lineWidth:15},purple:{key:"purple",color:"#68217a",opacity:.65,lineWidth:10},pink:{key:"pink",color:"#ee2080",opacity:.5,lineWidth:10},white:{key:"white",color:"white",opacity:1,lineWidth:10}},prevSvgHash:""},hold:I7()}}const Ug={hilitePrimary:{key:"hilitePrimary",color:"#3291ff",opacity:1,lineWidth:1},hiliteWhite:{key:"hiliteWhite",color:"#ffffff",opacity:1,lineWidth:1}};function v8(){const e=ui("defs"),t=qi(ui("filter"),{id:"cg-filter-blur"});return t.appendChild(qi(ui("feGaussianBlur"),{stdDeviation:"0.019"})),e.appendChild(t),e}function m8(e,t,n){const a=e.drawable,o=a.current,l=o&&o.mouseSq?o:void 0,h=new Map,f=e.dom.bounds(),b=a.autoShapes.filter(y=>!y.piece);for(const y of a.shapes.concat(b).concat(l?[l]:[])){if(!y.dest)continue;const g=h.get(y.dest)??new Set,w=Al(El($r(y.orig),e.orientation),f),p=Al(El($r(y.dest),e.orientation),f);g.add(ld(w,p)),h.set(y.dest,g)}const S=a.shapes.concat(b).map(y=>({shape:y,current:!1,hash:Gg(y,od(y.dest,h),!1,f)}));l&&S.push({shape:l,current:!0,hash:Gg(l,od(l.dest,h),!0,f)});const M=S.map(y=>y.hash).join(";");if(M===e.drawable.prevSvgHash)return;e.drawable.prevSvgHash=M;const C=t.querySelector("defs");_8(a,S,C),b8(S,t.querySelector("g"),n.querySelector("g"),y=>S8(e,y,a.brushes,h,f))}function _8(e,t,n){var a;const o=new Map;let l;for(const b of t.filter(S=>S.shape.dest&&S.shape.brush))l=N3(e.brushes[b.shape.brush],b.shape.modifiers),(a=b.shape.modifiers)!=null&&a.hilite&&o.set(Ml(l).key,Ml(l)),o.set(l.key,l);const h=new Set;let f=n.firstElementChild;for(;f;)h.add(f.getAttribute("cgKey")),f=f.nextElementSibling;for(const[b,S]of o.entries())h.has(b)||n.appendChild(k8(S))}function b8(e,t,n,a){const o=new Map;for(const l of e)o.set(l.hash,!1);for(const l of[t,n]){const h=[];let f=l.firstElementChild,b;for(;f;)b=f.getAttribute("cgHash"),o.has(b)?o.set(b,!0):h.push(f),f=f.nextElementSibling;for(const S of h)l.removeChild(S)}for(const l of e.filter(h=>!o.get(h.hash)))for(const h of a(l))h.isCustom?n.appendChild(h.el):t.appendChild(h.el)}function Gg({orig:e,dest:t,brush:n,piece:a,modifiers:o,customSvg:l,label:h},f,b,S){var M;return[S.width,S.height,b,e,t,n,f&&"-",a&&y8(a),o&&w8(o),l&&`custom-${Yg(l.html)},${((M=l.center)==null?void 0:M[0])??"o"}`,h&&`label-${Yg(h.text)}`].filter(C=>C).join(",")}function y8(e){return[e.color,e.role,e.scale].filter(t=>t).join(",")}function w8(e){return[e.lineWidth,e.hilite&&"*"].filter(t=>t).join(",")}function Yg(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)>>>0;return t.toString()}function S8(e,{shape:t,current:n,hash:a},o,l,h){const f=Al(El($r(t.orig),e.orientation),h),b=t.dest?Al(El($r(t.dest),e.orientation),h):f,S=t.brush&&N3(o[t.brush],t.modifiers),M=l.get(t.dest),C=[];if(S){const y=qi(ui("g"),{cgHash:a});C.push({el:y}),f[0]!==b[0]||f[1]!==b[1]?y.appendChild(C8(t,S,f,b,n,od(t.dest,l))):y.appendChild(x8(o[t.brush],f,n,h))}if(t.label){const y=t.label;y.fill||t.brush&&o[t.brush]&&(y.fill=o[t.brush].color);const g=t.brush?void 0:"tr";C.push({el:M8(y,a,f,b,M,g),isCustom:!0})}if(t.customSvg){const y=t.customSvg.center??"orig",[g,w]=y==="label"?O3(f,b,M).map(E=>E-.5):y==="dest"?b:f,p=qi(ui("g"),{transform:`translate(${g},${w})`,cgHash:a});p.innerHTML=`<svg width="1" height="1" viewBox="0 0 100 100">${t.customSvg.html}</svg>`,C.push({el:p,isCustom:!0})}return C}function x8(e,t,n,a){const o=E8(),l=(a.width+a.height)/(4*Math.max(a.width,a.height));return qi(ui("circle"),{stroke:e.color,"stroke-width":o[n?0:1],fill:"none",opacity:L3(e,n),cx:t[0],cy:t[1],r:l-o[1]/2})}function Ml(e){return["#ffffff","#fff","white"].includes(e.color)?Ug.hilitePrimary:Ug.hiliteWhite}function C8(e,t,n,a,o,l){var h;function f(M){var C;const y=T8(l&&!o),g=a[0]-n[0],w=a[1]-n[1],p=Math.atan2(w,g),E=Math.cos(p)*y,N=Math.sin(p)*y;return qi(ui("line"),{stroke:M?Ml(t).color:t.color,"stroke-width":A8(t,o)+(M?.04:0),"stroke-linecap":"round","marker-end":`url(#arrowhead-${M?Ml(t).key:t.key})`,opacity:(C=e.modifiers)!=null&&C.hilite?1:L3(t,o),x1:n[0],y1:n[1],x2:a[0]-E,y2:a[1]-N})}if(!((h=e.modifiers)!=null&&h.hilite))return f(!1);const b=ui("g"),S=qi(ui("g"),{filter:"url(#cg-filter-blur)"});return S.appendChild(P8(n,a)),S.appendChild(f(!0)),b.appendChild(S),b.appendChild(f(!1)),b}function k8(e){const t=qi(ui("marker"),{id:"arrowhead-"+e.key,orient:"auto",overflow:"visible",markerWidth:4,markerHeight:4,refX:e.key.startsWith("hilite")?1.86:2.05,refY:2});return t.appendChild(qi(ui("path"),{d:"M0,0 V4 L3,2 Z",fill:e.color})),t.setAttribute("cgKey",e.key),t}function M8(e,t,n,a,o,l){const f=.4*.75**e.text.length,b=O3(n,a,o),S=l==="tr"?.4:0,M=qi(ui("g"),{transform:`translate(${b[0]+S},${b[1]-S})`,cgHash:t});M.appendChild(qi(ui("circle"),{r:.4/2,"fill-opacity":l?1:.8,"stroke-opacity":l?1:.7,"stroke-width":.03,fill:e.fill??"#666",stroke:"white"}));const C=qi(ui("text"),{"font-size":f,"font-family":"Noto Sans","text-anchor":"middle",fill:"white",y:.13*.75**e.text.length});return C.innerHTML=e.text,M.appendChild(C),M}function El(e,t){return t==="cg-white"?e:[7-e[0],7-e[1]]}function od(e,t){return(e&&t.has(e)&&t.get(e).size>1)===!0}function ui(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function qi(e,t){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.setAttribute(n,t[n]);return e}function N3(e,t){return t?{color:e.color,opacity:Math.round(e.opacity*10)/10,lineWidth:Math.round(t.lineWidth||e.lineWidth),key:[e.key,t.lineWidth].filter(n=>n).join("")}:e}function E8(){return[3/64,4/64]}function A8(e,t){return(e.lineWidth||10)*(t?.85:1)/64}function L3(e,t){return(e.opacity||1)*(t?.9:1)}function T8(e){return(e?20:10)/64}function Al(e,t){const n=Math.min(1,t.width/t.height),a=Math.min(1,t.height/t.width);return[(e[0]-3.5)*n,(3.5-e[1])*a]}function P8(e,t){const n={from:[Math.floor(Math.min(e[0],t[0])),Math.floor(Math.min(e[1],t[1]))],to:[Math.ceil(Math.max(e[0],t[0])),Math.ceil(Math.max(e[1],t[1]))]};return qi(ui("rect"),{x:n.from[0],y:n.from[1],width:n.to[0]-n.from[0],height:n.to[1]-n.from[1],fill:"none",stroke:"none"})}function ld(e,t,n=!0){const a=Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI;return n?(Math.round(a*8/Math.PI)+16)%16:a}function I8(e,t){return Math.sqrt([e[0]-t[0],e[1]-t[1]].reduce((n,a)=>n+a*a,0))}function O3(e,t,n){let a=I8(e,t);const o=ld(e,t,!1);if(n&&(a-=33/64,n.size>1)){a-=10/64;const l=ld(e,t);(n.has((l+1)%16)||n.has((l+15)%16))&&l&1&&(a-=.4)}return[e[0]-Math.cos(o)*a,e[1]-Math.sin(o)*a].map(l=>l+.5)}function N8(e,t){e.innerHTML="",e.classList.add("cg-wrap");for(const b of A7)e.classList.toggle("orientation-"+b,t.orientation===b);e.classList.toggle("manipulable",!t.viewOnly);const n=Ms("cg-container");e.appendChild(n);const a=Ms("cg-board");n.appendChild(a);let o,l,h;if(t.drawable.visible&&(o=qi(ui("svg"),{class:"cg-shapes",viewBox:"-4 -4 8 8",preserveAspectRatio:"xMidYMid slice"}),o.appendChild(v8()),o.appendChild(ui("g")),l=qi(ui("svg"),{class:"cg-custom-svgs",viewBox:"-3.5 -3.5 8 8",preserveAspectRatio:"xMidYMid slice"}),l.appendChild(ui("g")),h=Ms("cg-auto-pieces"),n.appendChild(o),n.appendChild(l),n.appendChild(h)),t.coordinates){const b=t.orientation==="cg-black"?" black":"",S=t.ranksPosition==="left"?" left":"";if(t.coordinatesOnSquares){const M=t.orientation==="cg-white"?C=>C+1:C=>8-C;xl.forEach((C,y)=>n.appendChild(au(Cl.map(g=>C+g),"squares rank"+M(y)+b+S)))}else n.appendChild(au(Cl,"ranks"+b+S)),n.appendChild(au(xl,"files"+b))}let f;return t.draggable.enabled&&t.draggable.showGhost&&(f=Ms("piece","ghost"),Gd(f,!1),n.appendChild(f)),{board:a,container:n,wrap:e,ghost:f,svg:o,customSvg:l,autoPieces:h}}function au(e,t){const n=Ms("coords",t);let a;for(const o of e)a=Ms("coord"),a.textContent=o,n.appendChild(a);return n}function L8(e,t){if(!e.dropmode.active)return;ra(e),ia(e);const n=e.dropmode.piece;if(n){e.pieces.set("a0",n);const a=Ba(t),o=a&&qa(a,Xi(e),e.dom.bounds());o&&b3(e,"a0",o)}e.dom.redraw()}function O8(e){const t=e.dom.elements.board;if((e.disableContextMenu||e.drawable.enabled)&&t.addEventListener("contextmenu",a=>a.preventDefault()),e.viewOnly)return;const n=R8(e);t.addEventListener("touchstart",n,{passive:!1}),t.addEventListener("mousedown",n,{passive:!1})}function D8(e,t){const n=[];if("ResizeObserver"in window||n.push(Zo(document.body,"chessground.resize",t)),!e.viewOnly){const a=Wg(e,h8,i8),o=Wg(e,f8,n8);for(const h of["touchmove","mousemove"])n.push(Zo(document,h,a));for(const h of["touchend","mouseup"])n.push(Zo(document,h,o));const l=()=>e.dom.bounds.clear();n.push(Zo(document,"scroll",l,{capture:!0,passive:!0})),n.push(Zo(window,"resize",l,{passive:!0}))}return()=>n.forEach(a=>a())}function Zo(e,t,n,a){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n,a)}const R8=e=>t=>{e.draggable.current?kl(e):e.drawable.current?A3(e):t.shiftKey||c3(t)?e.drawable.enabled&&r8(e,t):e.viewOnly||(e.dropmode.active?L8(e,t):l8(e,t))},Wg=(e,t,n)=>a=>{e.drawable.current?e.drawable.enabled&&n(e,a):e.viewOnly||t(e,a)};function B8(e){const t=Xi(e),n=d0(e.dom.bounds()),a=e.dom.elements.board,o=e.pieces,l=e.animation.current,h=l?l.plan.anims:new Map,f=l?l.plan.fadings:new Map,b=e.draggable.current,S=F8(e),M=new Set,C=new Set,y=new Map,g=new Map;let w,p,E,N,I,O,V,U,D,me;for(p=a.firstChild;p;){if(w=p.cgKey,D3(p))if(E=o.get(w),I=h.get(w),O=f.get(w),N=p.cgPiece,p.cgDragging&&(!b||b.orig!==w)&&(p.classList.remove("dragging"),jn(p,n($r(w),t)),p.cgDragging=!1),!O&&p.cgFading&&(p.cgFading=!1,p.classList.remove("fading")),E){if(I&&p.cgAnimating&&N===Jo(E)){const B=$r(w);B[0]+=I[2],B[1]+=I[3],p.classList.add("anim"),jn(p,n(B,t))}else p.cgAnimating&&(p.cgAnimating=!1,p.classList.remove("anim"),jn(p,n($r(w),t)),e.addPieceZIndex&&(p.style.zIndex=ou($r(w),t)));N===Jo(E)&&(!O||!p.cgFading)?M.add(w):O&&N===Jo(O)?(p.classList.add("fading"),p.cgFading=!0):lu(y,N,p)}else lu(y,N,p);else if(R3(p)){const B=p.className;S.get(w)===B?C.add(w):lu(g,B,p)}p=p.nextSibling}for(const[B,ie]of S)if(!C.has(B)){D=g.get(ie),me=D&&D.pop();const he=n($r(B),t);if(me)me.cgKey=B,jn(me,he);else{const ae=Ms("square",ie);ae.cgKey=B,jn(ae,he),a.insertBefore(ae,a.firstChild)}}for(const[B,ie]of o)if(I=h.get(B),!M.has(B))if(V=y.get(Jo(ie)),U=V&&V.pop(),U){U.cgKey=B,U.cgFading&&(U.classList.remove("fading"),U.cgFading=!1);const he=$r(B);e.addPieceZIndex&&(U.style.zIndex=ou(he,t)),I&&(U.cgAnimating=!0,U.classList.add("anim"),he[0]+=I[2],he[1]+=I[3]),jn(U,n(he,t))}else{const he=Jo(ie),ae=Ms("piece",he),fe=$r(B);ae.cgPiece=he,ae.cgKey=B,I&&(ae.cgAnimating=!0,fe[0]+=I[2],fe[1]+=I[3]),jn(ae,n(fe,t)),e.addPieceZIndex&&(ae.style.zIndex=ou(fe,t)),a.appendChild(ae)}for(const B of y.values())Kg(e,B);for(const B of g.values())Kg(e,B)}function q8(e){const t=Xi(e),n=d0(e.dom.bounds());let a=e.dom.elements.board.firstChild;for(;a;)(D3(a)&&!a.cgAnimating||R3(a))&&jn(a,n($r(a.cgKey),t)),a=a.nextSibling}function $g(e){var t,n;const a=e.dom.elements.wrap.getBoundingClientRect(),o=e.dom.elements.container,l=a.height/a.width,h=Math.floor(a.width*window.devicePixelRatio/8)*8/window.devicePixelRatio,f=h*l;o.style.width=h+"px",o.style.height=f+"px",e.dom.bounds.clear(),(t=e.addDimensionsCssVarsTo)==null||t.style.setProperty("---cg-width",h+"px"),(n=e.addDimensionsCssVarsTo)==null||n.style.setProperty("---cg-height",f+"px")}const D3=e=>e.tagName==="PIECE",R3=e=>e.tagName==="SQUARE";function Kg(e,t){for(const n of t)e.dom.elements.board.removeChild(n)}function ou(e,t){const a=e[1];return`${t?10-a:3+a}`}const Jo=e=>`${e.color} ${e.role}`;function F8(e){var t,n;const a=new Map;if(e.lastMove&&e.highlight.lastMove)for(const h of e.lastMove)Ss(a,h,"last-move");if(e.check&&e.highlight.check&&Ss(a,e.check,"check"),e.selected&&(Ss(a,e.selected,"selected"),e.movable.showDests)){const h=(t=e.movable.dests)==null?void 0:t.get(e.selected);if(h)for(const b of h)Ss(a,b,"move-dest"+(e.pieces.has(b)?" oc":""));const f=((n=e.premovable.customDests)==null?void 0:n.get(e.selected))??e.premovable.dests;if(f)for(const b of f)Ss(a,b,"premove-dest"+(e.pieces.has(b)?" oc":""))}const o=e.premovable.current;if(o)for(const h of o)Ss(a,h,"current-premove");else e.predroppable.current&&Ss(a,e.predroppable.current.key,"current-premove");const l=e.exploding;if(l)for(const h of l.keys)Ss(a,h,"exploding"+l.stage);return e.highlight.custom&&e.highlight.custom.forEach((h,f)=>{Ss(a,f,h)}),a}function Ss(e,t,n){const a=e.get(t);a?e.set(t,`${a} ${n}`):e.set(t,n)}function lu(e,t,n){const a=e.get(t);a?a.push(n):e.set(t,[n])}function z8(e,t,n){const a=new Map,o=[];for(const f of e)a.set(f.hash,!1);let l=t.firstElementChild,h;for(;l;)h=l.getAttribute("cgHash"),a.has(h)?a.set(h,!0):o.push(l),l=l.nextElementSibling;for(const f of o)t.removeChild(f);for(const f of e)a.get(f.hash)||t.appendChild(n(f))}function H8(e,t){const a=e.drawable.autoShapes.filter(o=>o.piece).map(o=>({shape:o,hash:G8(o),current:!1}));z8(a,t,o=>U8(e,o,e.dom.bounds()))}function V8(e){var t;const n=Xi(e),a=d0(e.dom.bounds());let o=(t=e.dom.elements.autoPieces)==null?void 0:t.firstChild;for(;o;)l3(o,a($r(o.cgKey),n),o.cgScale),o=o.nextSibling}function U8(e,{shape:t,hash:n},a){var o,l,h;const f=t.orig,b=(o=t.piece)==null?void 0:o.role,S=(l=t.piece)==null?void 0:l.color,M=(h=t.piece)==null?void 0:h.scale,C=Ms("piece",`${b} ${S}`);return C.setAttribute("cgHash",n),C.cgKey=f,C.cgScale=M,l3(C,d0(a)($r(f),Xi(e)),M),C}const G8=e=>{var t,n,a;return[e.orig,(t=e.piece)==null?void 0:t.role,(n=e.piece)==null?void 0:n.color,(a=e.piece)==null?void 0:a.scale].join(",")};function Y8(e,t){const n=g8();k3(n,t||{});function a(){const o="dom"in n?n.dom.unbind:void 0,l=N8(e,n),h=P7(()=>l.board.getBoundingClientRect()),f=M=>{B8(S),l.autoPieces&&H8(S,l.autoPieces),!M&&l.svg&&m8(S,l.svg,l.customSvg)},b=()=>{$g(S),q8(S),l.autoPieces&&V8(S)},S=n;return S.dom={elements:l,bounds:h,redraw:W8(f),redrawNow:f,unbind:o},S.drawable.prevSvgHash="",$g(S),f(!1),O8(S),o||(S.dom.unbind=D8(S,b)),S.events.insert&&S.events.insert(l),S}return p8(a(),a)}function W8(e){let t=!1;return()=>{t||(t=!0,requestAnimationFrame(()=>{e(),t=!1}))}}/**
30
+ * @license
31
+ * Copyright (c) 2025, Jeff Hlywa (jhlywa@gmail.com)
32
+ * All rights reserved.
33
+ *
34
+ * Redistribution and use in source and binary forms, with or without
35
+ * modification, are permitted provided that the following conditions are met:
36
+ *
37
+ * 1. Redistributions of source code must retain the above copyright notice,
38
+ * this list of conditions and the following disclaimer.
39
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
40
+ * this list of conditions and the following disclaimer in the documentation
41
+ * and/or other materials provided with the distribution.
42
+ *
43
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
44
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
47
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
48
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
49
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
50
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
51
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
53
+ * POSSIBILITY OF SUCH DAMAGE.
54
+ */const Ti="w",gn="b",yi="p",cd="n",dl="b",n0="r",Zs="q",ci="k",cu="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";class ll{constructor(t,n){rt(this,"color"),rt(this,"from"),rt(this,"to"),rt(this,"piece"),rt(this,"captured"),rt(this,"promotion"),rt(this,"flags"),rt(this,"san"),rt(this,"lan"),rt(this,"before"),rt(this,"after");const{color:a,piece:o,from:l,to:h,flags:f,captured:b,promotion:S}=n,M=Pi(l),C=Pi(h);this.color=a,this.piece=o,this.from=M,this.to=C,this.san=t._moveToSan(n,t._moves({legal:!0})),this.lan=M+C,this.before=t.fen(),t._makeMove(n),this.after=t.fen(),t._undoMove(),this.flags="";for(const y in ar)ar[y]&f&&(this.flags+=Ma[y]);b&&(this.captured=b),S&&(this.promotion=S,this.lan+=S)}isCapture(){return this.flags.indexOf(Ma.CAPTURE)>-1}isPromotion(){return this.flags.indexOf(Ma.PROMOTION)>-1}isEnPassant(){return this.flags.indexOf(Ma.EP_CAPTURE)>-1}isKingsideCastle(){return this.flags.indexOf(Ma.KSIDE_CASTLE)>-1}isQueensideCastle(){return this.flags.indexOf(Ma.QSIDE_CASTLE)>-1}isBigPawn(){return this.flags.indexOf(Ma.BIG_PAWN)>-1}}const $i=-1,Ma={NORMAL:"n",CAPTURE:"c",BIG_PAWN:"b",EP_CAPTURE:"e",PROMOTION:"p",KSIDE_CASTLE:"k",QSIDE_CASTLE:"q"},$8=["a8","b8","c8","d8","e8","f8","g8","h8","a7","b7","c7","d7","e7","f7","g7","h7","a6","b6","c6","d6","e6","f6","g6","h6","a5","b5","c5","d5","e5","f5","g5","h5","a4","b4","c4","d4","e4","f4","g4","h4","a3","b3","c3","d3","e3","f3","g3","h3","a2","b2","c2","d2","e2","f2","g2","h2","a1","b1","c1","d1","e1","f1","g1","h1"],ar={NORMAL:1,CAPTURE:2,BIG_PAWN:4,EP_CAPTURE:8,PROMOTION:16,KSIDE_CASTLE:32,QSIDE_CASTLE:64},er={a8:0,b8:1,c8:2,d8:3,e8:4,f8:5,g8:6,h8:7,a7:16,b7:17,c7:18,d7:19,e7:20,f7:21,g7:22,h7:23,a6:32,b6:33,c6:34,d6:35,e6:36,f6:37,g6:38,h6:39,a5:48,b5:49,c5:50,d5:51,e5:52,f5:53,g5:54,h5:55,a4:64,b4:65,c4:66,d4:67,e4:68,f4:69,g4:70,h4:71,a3:80,b3:81,c3:82,d3:83,e3:84,f3:85,g3:86,h3:87,a2:96,b2:97,c2:98,d2:99,e2:100,f2:101,g2:102,h2:103,a1:112,b1:113,c1:114,d1:115,e1:116,f1:117,g1:118,h1:119},uu={b:[16,32,17,15],w:[-16,-32,-17,-15]},jg={n:[-18,-33,-31,-14,18,33,31,14],b:[-17,-15,17,15],r:[-16,1,16,-1],q:[-17,-16,-15,1,17,16,15,-1],k:[-17,-16,-15,1,17,16,15,-1]},K8=[20,0,0,0,0,0,0,24,0,0,0,0,0,0,20,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,24,24,24,24,24,24,56,0,56,24,24,24,24,24,24,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,20,0,0,0,0,0,0,24,0,0,0,0,0,0,20],j8=[17,0,0,0,0,0,0,16,0,0,0,0,0,0,15,0,0,17,0,0,0,0,0,16,0,0,0,0,0,15,0,0,0,0,17,0,0,0,0,16,0,0,0,0,15,0,0,0,0,0,0,17,0,0,0,16,0,0,0,15,0,0,0,0,0,0,0,0,17,0,0,16,0,0,15,0,0,0,0,0,0,0,0,0,0,17,0,16,0,15,0,0,0,0,0,0,0,0,0,0,0,0,17,16,15,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-15,-16,-17,0,0,0,0,0,0,0,0,0,0,0,0,-15,0,-16,0,-17,0,0,0,0,0,0,0,0,0,0,-15,0,0,-16,0,0,-17,0,0,0,0,0,0,0,0,-15,0,0,0,-16,0,0,0,-17,0,0,0,0,0,0,-15,0,0,0,0,-16,0,0,0,0,-17,0,0,0,0,-15,0,0,0,0,0,-16,0,0,0,0,0,-17,0,0,-15,0,0,0,0,0,0,-16,0,0,0,0,0,0,-17],X8={p:1,n:2,b:4,r:8,q:16,k:32},Q8="pnbrqkPNBRQK",Xg=[cd,dl,n0,Zs],Z8=7,J8=6,eS=1,tS=0,cl={[ci]:ar.KSIDE_CASTLE,[Zs]:ar.QSIDE_CASTLE},js={w:[{square:er.a1,flag:ar.QSIDE_CASTLE},{square:er.h1,flag:ar.KSIDE_CASTLE}],b:[{square:er.a8,flag:ar.QSIDE_CASTLE},{square:er.h8,flag:ar.KSIDE_CASTLE}]},rS={b:eS,w:J8},iS=["1-0","0-1","1/2-1/2","*"];function Ia(e){return e>>4}function l0(e){return e&15}function B3(e){return"0123456789".indexOf(e)!==-1}function Pi(e){const t=l0(e),n=Ia(e);return"abcdefgh".substring(t,t+1)+"87654321".substring(n,n+1)}function e0(e){return e===Ti?gn:Ti}function nS(e){const t=e.split(/\s+/);if(t.length!==6)return{ok:!1,error:"Invalid FEN: must contain six space-delimited fields"};const n=parseInt(t[5],10);if(isNaN(n)||n<=0)return{ok:!1,error:"Invalid FEN: move number must be a positive integer"};const a=parseInt(t[4],10);if(isNaN(a)||a<0)return{ok:!1,error:"Invalid FEN: half move counter number must be a non-negative integer"};if(!/^(-|[abcdefgh][36])$/.test(t[3]))return{ok:!1,error:"Invalid FEN: en-passant square is invalid"};if(/[^kKqQ-]/.test(t[2]))return{ok:!1,error:"Invalid FEN: castling availability is invalid"};if(!/^(w|b)$/.test(t[1]))return{ok:!1,error:"Invalid FEN: side-to-move is invalid"};const o=t[0].split("/");if(o.length!==8)return{ok:!1,error:"Invalid FEN: piece data does not contain 8 '/'-delimited rows"};for(let h=0;h<o.length;h++){let f=0,b=!1;for(let S=0;S<o[h].length;S++)if(B3(o[h][S])){if(b)return{ok:!1,error:"Invalid FEN: piece data is invalid (consecutive number)"};f+=parseInt(o[h][S],10),b=!0}else{if(!/^[prnbqkPRNBQK]$/.test(o[h][S]))return{ok:!1,error:"Invalid FEN: piece data is invalid (invalid piece)"};f+=1,b=!1}if(f!==8)return{ok:!1,error:"Invalid FEN: piece data is invalid (too many squares in rank)"}}if(t[3][1]=="3"&&t[1]=="w"||t[3][1]=="6"&&t[1]=="b")return{ok:!1,error:"Invalid FEN: illegal en-passant square"};const l=[{color:"white",regex:/K/g},{color:"black",regex:/k/g}];for(const{color:h,regex:f}of l){if(!f.test(t[0]))return{ok:!1,error:`Invalid FEN: missing ${h} king`};if((t[0].match(f)||[]).length>1)return{ok:!1,error:`Invalid FEN: too many ${h} kings`}}return Array.from(o[0]+o[7]).some(h=>h.toUpperCase()==="P")?{ok:!1,error:"Invalid FEN: some pawns are on the edge rows"}:{ok:!0}}function sS(e,t){const n=e.from,a=e.to,o=e.piece;let l=0,h=0,f=0;for(let b=0,S=t.length;b<S;b++){const M=t[b].from,C=t[b].to,y=t[b].piece;o===y&&n!==M&&a===C&&(l++,Ia(n)===Ia(M)&&h++,l0(n)===l0(M)&&f++)}return l>0?h>0&&f>0?Pi(n):f>0?Pi(n).charAt(1):Pi(n).charAt(0):""}function Xs(e,t,n,a,o,l=void 0,h=ar.NORMAL){const f=Ia(a);if(o===yi&&(f===Z8||f===tS))for(let b=0;b<Xg.length;b++){const S=Xg[b];e.push({color:t,from:n,to:a,piece:o,captured:l,promotion:S,flags:h|ar.PROMOTION})}else e.push({color:t,from:n,to:a,piece:o,captured:l,flags:h})}function Qg(e){let t=e.charAt(0);return t>="a"&&t<="h"?e.match(/[a-h]\d.*[a-h]\d/)?void 0:yi:(t=t.toLowerCase(),t==="o"?ci:t)}function hu(e){return e.replace(/=/,"").replace(/[+#]?[?!]*$/,"")}function fu(e){return e.split(" ").slice(0,4).join(" ")}class aS{constructor(t=cu,{skipValidation:n=!1}={}){rt(this,"_board",new Array(128)),rt(this,"_turn",Ti),rt(this,"_header",{}),rt(this,"_kings",{w:$i,b:$i}),rt(this,"_epSquare",-1),rt(this,"_halfMoves",0),rt(this,"_moveNumber",0),rt(this,"_history",[]),rt(this,"_comments",{}),rt(this,"_castling",{w:0,b:0}),rt(this,"_positionCount",{}),this.load(t,{skipValidation:n})}clear({preserveHeaders:t=!1}={}){this._board=new Array(128),this._kings={w:$i,b:$i},this._turn=Ti,this._castling={w:0,b:0},this._epSquare=$i,this._halfMoves=0,this._moveNumber=1,this._history=[],this._comments={},this._header=t?this._header:{},this._positionCount={},delete this._header.SetUp,delete this._header.FEN}load(t,{skipValidation:n=!1,preserveHeaders:a=!1}={}){let o=t.split(/\s+/);if(o.length>=2&&o.length<6){const f=["-","-","0","1"];t=o.concat(f.slice(-(6-o.length))).join(" ")}if(o=t.split(/\s+/),!n){const{ok:f,error:b}=nS(t);if(!f)throw new Error(b)}const l=o[0];let h=0;this.clear({preserveHeaders:a});for(let f=0;f<l.length;f++){const b=l.charAt(f);if(b==="/")h+=8;else if(B3(b))h+=parseInt(b,10);else{const S=b<"a"?Ti:gn;this._put({type:b.toLowerCase(),color:S},Pi(h)),h++}}this._turn=o[1],o[2].indexOf("K")>-1&&(this._castling.w|=ar.KSIDE_CASTLE),o[2].indexOf("Q")>-1&&(this._castling.w|=ar.QSIDE_CASTLE),o[2].indexOf("k")>-1&&(this._castling.b|=ar.KSIDE_CASTLE),o[2].indexOf("q")>-1&&(this._castling.b|=ar.QSIDE_CASTLE),this._epSquare=o[3]==="-"?$i:er[o[3]],this._halfMoves=parseInt(o[4],10),this._moveNumber=parseInt(o[5],10),this._updateSetup(t),this._incPositionCount(t)}fen(){var t,n;let a=0,o="";for(let f=er.a8;f<=er.h1;f++){if(this._board[f]){a>0&&(o+=a,a=0);const{color:b,type:S}=this._board[f];o+=b===Ti?S.toUpperCase():S.toLowerCase()}else a++;f+1&136&&(a>0&&(o+=a),f!==er.h1&&(o+="/"),a=0,f+=8)}let l="";this._castling[Ti]&ar.KSIDE_CASTLE&&(l+="K"),this._castling[Ti]&ar.QSIDE_CASTLE&&(l+="Q"),this._castling[gn]&ar.KSIDE_CASTLE&&(l+="k"),this._castling[gn]&ar.QSIDE_CASTLE&&(l+="q"),l=l||"-";let h="-";if(this._epSquare!==$i){const f=this._epSquare+(this._turn===Ti?16:-16),b=[f+1,f-1];for(const S of b){if(S&136)continue;const M=this._turn;if(((t=this._board[S])==null?void 0:t.color)===M&&((n=this._board[S])==null?void 0:n.type)===yi){this._makeMove({color:M,from:S,to:this._epSquare,piece:yi,captured:yi,flags:ar.EP_CAPTURE});const C=!this._isKingAttacked(M);if(this._undoMove(),C){h=Pi(this._epSquare);break}}}}return[o,this._turn,l,h,this._halfMoves,this._moveNumber].join(" ")}_updateSetup(t){this._history.length>0||(t!==cu?(this._header.SetUp="1",this._header.FEN=t):(delete this._header.SetUp,delete this._header.FEN))}reset(){this.load(cu)}get(t){return this._board[er[t]]}put({type:t,color:n},a){return this._put({type:t,color:n},a)?(this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),!0):!1}_put({type:t,color:n},a){if(Q8.indexOf(t.toLowerCase())===-1||!(a in er))return!1;const o=er[a];if(t==ci&&!(this._kings[n]==$i||this._kings[n]==o))return!1;const l=this._board[o];return l&&l.type===ci&&(this._kings[l.color]=$i),this._board[o]={type:t,color:n},t===ci&&(this._kings[n]=o),!0}remove(t){const n=this.get(t);return delete this._board[er[t]],n&&n.type===ci&&(this._kings[n.color]=$i),this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),n}_updateCastlingRights(){var t,n,a,o,l,h,f,b,S,M,C,y;const g=((t=this._board[er.e1])==null?void 0:t.type)===ci&&((n=this._board[er.e1])==null?void 0:n.color)===Ti,w=((a=this._board[er.e8])==null?void 0:a.type)===ci&&((o=this._board[er.e8])==null?void 0:o.color)===gn;(!g||((l=this._board[er.a1])==null?void 0:l.type)!==n0||((h=this._board[er.a1])==null?void 0:h.color)!==Ti)&&(this._castling.w&=-65),(!g||((f=this._board[er.h1])==null?void 0:f.type)!==n0||((b=this._board[er.h1])==null?void 0:b.color)!==Ti)&&(this._castling.w&=-33),(!w||((S=this._board[er.a8])==null?void 0:S.type)!==n0||((M=this._board[er.a8])==null?void 0:M.color)!==gn)&&(this._castling.b&=-65),(!w||((C=this._board[er.h8])==null?void 0:C.type)!==n0||((y=this._board[er.h8])==null?void 0:y.color)!==gn)&&(this._castling.b&=-33)}_updateEnPassantSquare(){var t,n;if(this._epSquare===$i)return;const a=this._epSquare+(this._turn===Ti?-16:16),o=this._epSquare+(this._turn===Ti?16:-16),l=[o+1,o-1];if(this._board[a]!==null||this._board[this._epSquare]!==null||((t=this._board[o])==null?void 0:t.color)!==e0(this._turn)||((n=this._board[o])==null?void 0:n.type)!==yi){this._epSquare=$i;return}const h=f=>{var b,S;return!(f&136)&&((b=this._board[f])==null?void 0:b.color)===this._turn&&((S=this._board[f])==null?void 0:S.type)===yi};l.some(h)||(this._epSquare=$i)}_attacked(t,n,a){const o=[];for(let l=er.a8;l<=er.h1;l++){if(l&136){l+=7;continue}if(this._board[l]===void 0||this._board[l].color!==t)continue;const h=this._board[l],f=l-n;if(f===0)continue;const b=f+119;if(K8[b]&X8[h.type]){if(h.type===yi){if(f>0&&h.color===Ti||f<=0&&h.color===gn)if(a)o.push(Pi(l));else return!0;continue}if(h.type==="n"||h.type==="k")if(a){o.push(Pi(l));continue}else return!0;const S=j8[b];let M=l+S,C=!1;for(;M!==n;){if(this._board[M]!=null){C=!0;break}M+=S}if(!C)if(a){o.push(Pi(l));continue}else return!0}}return a?o:!1}attackers(t,n){return n?this._attacked(n,er[t],!0):this._attacked(this._turn,er[t],!0)}_isKingAttacked(t){const n=this._kings[t];return n===-1?!1:this._attacked(e0(t),n)}isAttacked(t,n){return this._attacked(n,er[t])}isCheck(){return this._isKingAttacked(this._turn)}inCheck(){return this.isCheck()}isCheckmate(){return this.isCheck()&&this._moves().length===0}isStalemate(){return!this.isCheck()&&this._moves().length===0}isInsufficientMaterial(){const t={b:0,n:0,r:0,q:0,k:0,p:0},n=[];let a=0,o=0;for(let l=er.a8;l<=er.h1;l++){if(o=(o+1)%2,l&136){l+=7;continue}const h=this._board[l];h&&(t[h.type]=h.type in t?t[h.type]+1:1,h.type===dl&&n.push(o),a++)}if(a===2)return!0;if(a===3&&(t[dl]===1||t[cd]===1))return!0;if(a===t[dl]+2){let l=0;const h=n.length;for(let f=0;f<h;f++)l+=n[f];if(l===0||l===h)return!0}return!1}isThreefoldRepetition(){return this._getPositionCount(this.fen())>=3}isDrawByFiftyMoves(){return this._halfMoves>=100}isDraw(){return this.isDrawByFiftyMoves()||this.isStalemate()||this.isInsufficientMaterial()||this.isThreefoldRepetition()}isGameOver(){return this.isCheckmate()||this.isStalemate()||this.isDraw()}moves({verbose:t=!1,square:n=void 0,piece:a=void 0}={}){const o=this._moves({square:n,piece:a});return t?o.map(l=>new ll(this,l)):o.map(l=>this._moveToSan(l,o))}_moves({legal:t=!0,piece:n=void 0,square:a=void 0}={}){var o;const l=a?a.toLowerCase():void 0,h=n?.toLowerCase(),f=[],b=this._turn,S=e0(b);let M=er.a8,C=er.h1,y=!1;if(l)if(l in er)M=C=er[l],y=!0;else return[];for(let w=M;w<=C;w++){if(w&136){w+=7;continue}if(!this._board[w]||this._board[w].color===S)continue;const{type:p}=this._board[w];let E;if(p===yi){if(h&&h!==p)continue;E=w+uu[b][0],this._board[E]||(Xs(f,b,w,E,yi),E=w+uu[b][1],rS[b]===Ia(w)&&!this._board[E]&&Xs(f,b,w,E,yi,void 0,ar.BIG_PAWN));for(let N=2;N<4;N++)E=w+uu[b][N],!(E&136)&&(((o=this._board[E])==null?void 0:o.color)===S?Xs(f,b,w,E,yi,this._board[E].type,ar.CAPTURE):E===this._epSquare&&Xs(f,b,w,E,yi,yi,ar.EP_CAPTURE))}else{if(h&&h!==p)continue;for(let N=0,I=jg[p].length;N<I;N++){const O=jg[p][N];for(E=w;E+=O,!(E&136);){if(!this._board[E])Xs(f,b,w,E,p);else{if(this._board[E].color===b)break;Xs(f,b,w,E,p,this._board[E].type,ar.CAPTURE);break}if(p===cd||p===ci)break}}}}if((h===void 0||h===ci)&&(!y||C===this._kings[b])){if(this._castling[b]&ar.KSIDE_CASTLE){const w=this._kings[b],p=w+2;!this._board[w+1]&&!this._board[p]&&!this._attacked(S,this._kings[b])&&!this._attacked(S,w+1)&&!this._attacked(S,p)&&Xs(f,b,this._kings[b],p,ci,void 0,ar.KSIDE_CASTLE)}if(this._castling[b]&ar.QSIDE_CASTLE){const w=this._kings[b],p=w-2;!this._board[w-1]&&!this._board[w-2]&&!this._board[w-3]&&!this._attacked(S,this._kings[b])&&!this._attacked(S,w-1)&&!this._attacked(S,p)&&Xs(f,b,this._kings[b],p,ci,void 0,ar.QSIDE_CASTLE)}}if(!t||this._kings[b]===-1)return f;const g=[];for(let w=0,p=f.length;w<p;w++)this._makeMove(f[w]),this._isKingAttacked(b)||g.push(f[w]),this._undoMove();return g}move(t,{strict:n=!1}={}){let a=null;if(typeof t=="string")a=this._moveFromSan(t,n);else if(typeof t=="object"){const l=this._moves();for(let h=0,f=l.length;h<f;h++)if(t.from===Pi(l[h].from)&&t.to===Pi(l[h].to)&&(!("promotion"in l[h])||t.promotion===l[h].promotion)){a=l[h];break}}if(!a)throw typeof t=="string"?new Error(`Invalid move: ${t}`):new Error(`Invalid move: ${JSON.stringify(t)}`);const o=new ll(this,a);return this._makeMove(a),this._incPositionCount(o.after),o}_push(t){this._history.push({move:t,kings:{b:this._kings.b,w:this._kings.w},turn:this._turn,castling:{b:this._castling.b,w:this._castling.w},epSquare:this._epSquare,halfMoves:this._halfMoves,moveNumber:this._moveNumber})}_makeMove(t){const n=this._turn,a=e0(n);if(this._push(t),this._board[t.to]=this._board[t.from],delete this._board[t.from],t.flags&ar.EP_CAPTURE&&(this._turn===gn?delete this._board[t.to-16]:delete this._board[t.to+16]),t.promotion&&(this._board[t.to]={type:t.promotion,color:n}),this._board[t.to].type===ci){if(this._kings[n]=t.to,t.flags&ar.KSIDE_CASTLE){const o=t.to-1,l=t.to+1;this._board[o]=this._board[l],delete this._board[l]}else if(t.flags&ar.QSIDE_CASTLE){const o=t.to+1,l=t.to-2;this._board[o]=this._board[l],delete this._board[l]}this._castling[n]=0}if(this._castling[n]){for(let o=0,l=js[n].length;o<l;o++)if(t.from===js[n][o].square&&this._castling[n]&js[n][o].flag){this._castling[n]^=js[n][o].flag;break}}if(this._castling[a]){for(let o=0,l=js[a].length;o<l;o++)if(t.to===js[a][o].square&&this._castling[a]&js[a][o].flag){this._castling[a]^=js[a][o].flag;break}}t.flags&ar.BIG_PAWN?n===gn?this._epSquare=t.to-16:this._epSquare=t.to+16:this._epSquare=$i,t.piece===yi?this._halfMoves=0:t.flags&(ar.CAPTURE|ar.EP_CAPTURE)?this._halfMoves=0:this._halfMoves++,n===gn&&this._moveNumber++,this._turn=a}undo(){const t=this._undoMove();if(t){const n=new ll(this,t);return this._decPositionCount(n.after),n}return null}_undoMove(){const t=this._history.pop();if(t===void 0)return null;const n=t.move;this._kings=t.kings,this._turn=t.turn,this._castling=t.castling,this._epSquare=t.epSquare,this._halfMoves=t.halfMoves,this._moveNumber=t.moveNumber;const a=this._turn,o=e0(a);if(this._board[n.from]=this._board[n.to],this._board[n.from].type=n.piece,delete this._board[n.to],n.captured)if(n.flags&ar.EP_CAPTURE){let l;a===gn?l=n.to-16:l=n.to+16,this._board[l]={type:yi,color:o}}else this._board[n.to]={type:n.captured,color:o};if(n.flags&(ar.KSIDE_CASTLE|ar.QSIDE_CASTLE)){let l,h;n.flags&ar.KSIDE_CASTLE?(l=n.to+1,h=n.to-1):(l=n.to-2,h=n.to+1),this._board[l]=this._board[h],delete this._board[h]}return n}pgn({newline:t=`
55
+ `,maxWidth:n=0}={}){const a=[];let o=!1;for(const y in this._header)a.push("["+y+' "'+this._header[y]+'"]'+t),o=!0;o&&this._history.length&&a.push(t);const l=y=>{const g=this._comments[this.fen()];if(typeof g<"u"){const w=y.length>0?" ":"";y=`${y}${w}{${g}}`}return y},h=[];for(;this._history.length>0;)h.push(this._undoMove());const f=[];let b="";for(h.length===0&&f.push(l(""));h.length>0;){b=l(b);const y=h.pop();if(!y)break;if(!this._history.length&&y.color==="b"){const g=`${this._moveNumber}. ...`;b=b?`${b} ${g}`:g}else y.color==="w"&&(b.length&&f.push(b),b=this._moveNumber+".");b=b+" "+this._moveToSan(y,this._moves({legal:!0})),this._makeMove(y)}if(b.length&&f.push(l(b)),typeof this._header.Result<"u"&&f.push(this._header.Result),n===0)return a.join("")+f.join(" ");const S=function(){return a.length>0&&a[a.length-1]===" "?(a.pop(),!0):!1},M=function(y,g){for(const w of g.split(" "))if(w){if(y+w.length>n){for(;S();)y--;a.push(t),y=0}a.push(w),y+=w.length,a.push(" "),y++}return S()&&y--,y};let C=0;for(let y=0;y<f.length;y++){if(C+f[y].length>n&&f[y].includes("{")){C=M(C,f[y]);continue}C+f[y].length>n&&y!==0?(a[a.length-1]===" "&&a.pop(),a.push(t),C=0):y!==0&&(a.push(" "),C++),a.push(f[y]),C+=f[y].length}return a.join("")}header(...t){for(let n=0;n<t.length;n+=2)typeof t[n]=="string"&&typeof t[n+1]=="string"&&(this._header[t[n]]=t[n+1]);return this._header}setHeader(t,n){return this._header[t]=n,this._header}removeHeader(t){return t in this._header?(delete this._header[t],!0):!1}getHeaders(){return this._header}loadPgn(t,{strict:n=!1,newlineChar:a=`\r?
56
+ `}={}){function o(O){return O.replace(/\\/g,"\\")}function l(O){const V={},U=O.split(new RegExp(o(a)));let D="",me="";for(let B=0;B<U.length;B++){const ie=/^\s*\[\s*([A-Za-z]+)\s*"(.*)"\s*\]\s*$/;D=U[B].replace(ie,"$1"),me=U[B].replace(ie,"$2"),D.trim().length>0&&(V[D]=me)}return V}t=t.trim();const f=new RegExp("^(\\[((?:"+o(a)+")|.)*\\])((?:\\s*"+o(a)+"){2}|(?:\\s*"+o(a)+")*$)").exec(t),b=f&&f.length>=2?f[1]:"";this.reset();const S=l(b);let M="";for(const O in S)O.toLowerCase()==="fen"&&(M=S[O]),this.header(O,S[O]);if(!n)M&&this.load(M,{preserveHeaders:!0});else if(S.SetUp==="1"){if(!("FEN"in S))throw new Error("Invalid PGN: FEN tag must be supplied with SetUp tag");this.load(S.FEN,{preserveHeaders:!0})}function C(O){return Array.from(O).map(function(V){return V.charCodeAt(0)<128?V.charCodeAt(0).toString(16):encodeURIComponent(V).replace(/%/g,"").toLowerCase()}).join("")}function y(O){return O.length==0?"":decodeURIComponent("%"+(O.match(/.{1,2}/g)||[]).join("%"))}const g=function(O){return O=O.replace(new RegExp(o(a),"g")," "),`{${C(O.slice(1,O.length-1))}}`},w=function(O){if(O.startsWith("{")&&O.endsWith("}"))return y(O.slice(1,O.length-1))};let p=t.replace(b,"").replace(new RegExp(`({[^}]*})+?|;([^${o(a)}]*)`,"g"),function(O,V,U){return V!==void 0?g(V):" "+g(`{${U.slice(1)}}`)}).replace(new RegExp(o(a),"g")," ");const E=/(\([^()]+\))+?/g;for(;E.test(p);)p=p.replace(E,"");p=p.replace(/\d+\.(\.\.)?/g,""),p=p.replace(/\.\.\./g,""),p=p.replace(/\$\d+/g,"");let N=p.trim().split(new RegExp(/\s+/));N=N.filter(O=>O!=="");let I="";for(let O=0;O<N.length;O++){const V=w(N[O]);if(V!==void 0){this._comments[this.fen()]=V;continue}const U=this._moveFromSan(N[O],n);if(U==null)if(iS.indexOf(N[O])>-1)I=N[O];else throw new Error(`Invalid move in PGN: ${N[O]}`);else I="",this._makeMove(U),this._incPositionCount(this.fen())}I&&Object.keys(this._header).length&&!this._header.Result&&this.header("Result",I)}_moveToSan(t,n){let a="";if(t.flags&ar.KSIDE_CASTLE)a="O-O";else if(t.flags&ar.QSIDE_CASTLE)a="O-O-O";else{if(t.piece!==yi){const o=sS(t,n);a+=t.piece.toUpperCase()+o}t.flags&(ar.CAPTURE|ar.EP_CAPTURE)&&(t.piece===yi&&(a+=Pi(t.from)[0]),a+="x"),a+=Pi(t.to),t.promotion&&(a+="="+t.promotion.toUpperCase())}return this._makeMove(t),this.isCheck()&&(this.isCheckmate()?a+="#":a+="+"),this._undoMove(),a}_moveFromSan(t,n=!1){const a=hu(t);let o=Qg(a),l=this._moves({legal:!0,piece:o});for(let y=0,g=l.length;y<g;y++)if(a===hu(this._moveToSan(l[y],l)))return l[y];if(n)return null;let h,f,b,S,M,C=!1;if(f=a.match(/([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/),f?(h=f[1],b=f[2],S=f[3],M=f[4],b.length==1&&(C=!0)):(f=a.match(/([pnbrqkPNBRQK])?([a-h]?[1-8]?)x?-?([a-h][1-8])([qrbnQRBN])?/),f&&(h=f[1],b=f[2],S=f[3],M=f[4],b.length==1&&(C=!0))),o=Qg(a),l=this._moves({legal:!0,piece:h||o}),!S)return null;for(let y=0,g=l.length;y<g;y++)if(b){if((!h||h.toLowerCase()==l[y].piece)&&er[b]==l[y].from&&er[S]==l[y].to&&(!M||M.toLowerCase()==l[y].promotion))return l[y];if(C){const w=Pi(l[y].from);if((!h||h.toLowerCase()==l[y].piece)&&er[S]==l[y].to&&(b==w[0]||b==w[1])&&(!M||M.toLowerCase()==l[y].promotion))return l[y]}}else if(a===hu(this._moveToSan(l[y],l)).replace("x",""))return l[y];return null}ascii(){let t=` +------------------------+
57
+ `;for(let n=er.a8;n<=er.h1;n++){if(l0(n)===0&&(t+=" "+"87654321"[Ia(n)]+" |"),this._board[n]){const a=this._board[n].type,l=this._board[n].color===Ti?a.toUpperCase():a.toLowerCase();t+=" "+l+" "}else t+=" . ";n+1&136&&(t+=`|
58
+ `,n+=8)}return t+=` +------------------------+
59
+ `,t+=" a b c d e f g h",t}perft(t){const n=this._moves({legal:!1});let a=0;const o=this._turn;for(let l=0,h=n.length;l<h;l++)this._makeMove(n[l]),this._isKingAttacked(o)||(t-1>0?a+=this.perft(t-1):a++),this._undoMove();return a}turn(){return this._turn}board(){const t=[];let n=[];for(let a=er.a8;a<=er.h1;a++)this._board[a]==null?n.push(null):n.push({square:Pi(a),type:this._board[a].type,color:this._board[a].color}),a+1&136&&(t.push(n),n=[],a+=8);return t}squareColor(t){if(t in er){const n=er[t];return(Ia(n)+l0(n))%2===0?"light":"dark"}return null}history({verbose:t=!1}={}){const n=[],a=[];for(;this._history.length>0;)n.push(this._undoMove());for(;;){const o=n.pop();if(!o)break;t?a.push(new ll(this,o)):a.push(this._moveToSan(o,this._moves())),this._makeMove(o)}return a}_getPositionCount(t){const n=fu(t);return this._positionCount[n]||0}_incPositionCount(t){const n=fu(t);this._positionCount[n]===void 0&&(this._positionCount[n]=0),this._positionCount[n]+=1}_decPositionCount(t){const n=fu(t);this._positionCount[n]===1?delete this._positionCount[n]:this._positionCount[n]-=1}_pruneComments(){const t=[],n={},a=o=>{o in this._comments&&(n[o]=this._comments[o])};for(;this._history.length>0;)t.push(this._undoMove());for(a(this.fen());;){const o=t.pop();if(!o)break;this._makeMove(o),a(this.fen())}this._comments=n}getComment(){return this._comments[this.fen()]}setComment(t){this._comments[this.fen()]=t.replace("{","[").replace("}","]")}deleteComment(){return this.removeComment()}removeComment(){const t=this._comments[this.fen()];return delete this._comments[this.fen()],t}getComments(){return this._pruneComments(),Object.keys(this._comments).map(t=>({fen:t,comment:this._comments[t]}))}deleteComments(){return this.removeComments()}removeComments(){return this._pruneComments(),Object.keys(this._comments).map(t=>{const n=this._comments[t];return delete this._comments[t],{fen:t,comment:n}})}setCastlingRights(t,n){for(const o of[ci,Zs])n[o]!==void 0&&(n[o]?this._castling[t]|=cl[o]:this._castling[t]&=~cl[o]);this._updateCastlingRights();const a=this.getCastlingRights(t);return(n[ci]===void 0||n[ci]===a[ci])&&(n[Zs]===void 0||n[Zs]===a[Zs])}getCastlingRights(t){return{[ci]:(this._castling[t]&cl[ci])!==0,[Zs]:(this._castling[t]&cl[Zs])!==0}}moveNumber(){return this._moveNumber}}const oS=e=>{if(e.length<4||e.length>5)throw new Error(`Invalid UCI move format: ${e}`);return{from:e.substring(0,2),to:e.substring(2,4),promotion:e.length===5?e[4]:void 0}},Zg=e=>{const t=new Map;return $8.forEach(n=>{const a=e.moves({square:n,verbose:!0});a.length&&t.set(n,a.map(o=>o.to))}),t},lS=e=>e==="cg-white"?"cg-black":"cg-white",du=e=>e.turn()==="w"?"cg-white":"cg-black",cS=Vr({name:"PuzzleView",props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"PuzzleView"),a=ii(n),o=Lt(null),l=Lt(),h=Lt(),f=Lt("cg-white"),b=Lt(!1),S=Lt(null),M=300,C=[{value:"q",name:"Queen",whiteSymbol:"♕",blackSymbol:"♛"},{value:"r",name:"Rook",whiteSymbol:"♖",blackSymbol:"♜"},{value:"b",name:"Bishop",whiteSymbol:"♗",blackSymbol:"♝"},{value:"n",name:"Knight",whiteSymbol:"♘",blackSymbol:"♞"}],y=Sr(()=>{const I=["a","b","c","d","e","f","g","h"];return f.value==="cg-white"?I:I.reverse()}),g=I=>I?["q","r","b","n"].includes(I):!1,w=(I,O,V)=>{var U;if(g(V))return!1;const D=(U=l.value)==null?void 0:U.get(I);return D?.type==="p"&&(O[1]==="8"||O[1]==="1")},p=()=>{!l.value||!h.value||h.value.set({fen:l.value.fen(),turnColor:du(l.value),movable:{color:du(l.value),dests:Zg(l.value)}})},E=I=>{if(I!=="q"&&I!=="r"&&I!=="b"&&I!=="n"){n.logger.error(`Invalid promotion piece: ${I}`);return}S.value&&(n.logger.log(`promoting to ${I}`),b.value=!1,N(S.value.from,S.value.to,I))},N=(I,O,V)=>{var U,D,me,B,ie;if(!((U=a.question.value)!=null&&U.moves.length))throw new Error("No moves");if(w(I,O,V)){S.value={from:I,to:O},b.value=!0;return}const he=a.question.value.moves[0],ae=g(V)?`${I}${O}${V}`:`${I}${O}`;he===ae?((D=l.value)==null||D.move({from:I,to:O,promotion:g(V)?V:void 0}),p(),a.question.value.moves.shift(),a.question.value.moves.length===0?a.submitAnswer(""):window.setTimeout(()=>{var fe;if(!a.question.value)return;const le=a.question.value.moves.shift(),Y=oS(le);(fe=l.value)==null||fe.move(Y),p()},M)):((me=l.value)==null||me.move({from:I,to:O,promotion:V}),(B=l.value)!=null&&B.isCheckmate()?a.submitAnswer(ud.CHECKMATE):(ie=l.value)==null||ie.undo(),a.submitAnswer(I+O+V),p())};return Nn(()=>{if(!o.value)return;a.question.value=new ud(e.data),l.value=new aS(a.question.value.fen),f.value=lS(du(l.value)),h.value=Y8(o.value,{movable:{free:!1,showDests:!0,dests:Zg(l.value),events:{after:N}},draggable:{showGhost:!0},fen:l.value.fen(),orientation:f.value,coordinates:!1,animation:{duration:M,enabled:!0}});const I=a.question.value.moves.shift();h.value.move(I.substring(0,2),I.substring(2)),l.value.move({from:I.substring(0,2),to:I.substring(2)}),p()}),ql(()=>{var I;(I=h.value)==null||I.destroy(),l.value=void 0}),{boardElement:o,playerColor:f,files:y,showPromotionDialog:b,promotionPieces:C,handlePromotion:E,...n,...a}}}),uS={"data-viewable":"PuzzleView"},hS={class:"text-h5"},fS={class:"puzzle-board-wrapper"},dS={class:"puzzle-ranks-labels"},pS={class:"puzzle-board-and-files"},gS={id:"cg",ref:"boardElement"},vS={class:"puzzle-files-labels"},mS={key:0,class:"puzzle-promotion-dialog"},_S=["onClick"];function bS(e,t,n,a,o,l){return St(),Pt("div",uS,[ht("p",hS," Make the best move for "+ir(e.playerColor==="cg-white"?"White ♖♘♗♕♔♗♘♖":"Black ♜♞♝♚♛♝♞♜")+": ",1),ht("div",fS,[ht("div",dS,[(St(),Pt(qr,null,An(8,h=>ht("div",{key:h},ir(e.playerColor==="cg-white"?9-h:h),1)),64))]),ht("div",pS,[ht("div",gS,null,512),ht("div",vS,[(St(!0),Pt(qr,null,An(e.files,h=>(St(),Pt("div",{key:h},ir(h),1))),128))])])]),e.showPromotionDialog?(St(),Pt("div",mS,[(St(!0),Pt(qr,null,An(e.promotionPieces,h=>(St(),Pt("button",{key:h.value,onClick:f=>e.handlePromotion(h.value)},ir(e.playerColor==="cg-white"?h.whiteSymbol:h.blackSymbol)+" "+ir(h.name),9,_S))),128))])):Or("",!0)])}const yS=Ur(cS,[["render",bS]]),p0=class pl extends fi{constructor(t){super(t),rt(this,"fen"),rt(this,"id"),rt(this,"moves"),rt(this,"rating"),rt(this,"themes"),rt(this,"checkMove",(f,b)=>(alert("checkMove"),console.log("checkMove",f,b),console.log("this.moves[0]",this.moves[0]),this.moves[0]===b));const[n,a,o,l,,,,h]=t[0].puzzleData.split(",");this.id=n,this.fen=a,this.moves=o.split(" "),this.rating=parseInt(l,10),this.themes=h.split(" ")}evaluate(t,n){return{isCorrect:this.isCorrect(t),performance:this.displayedSkill(t,n)}}displayedSkill(t,n){return this.isCorrect(t)?n<5e3?1:1-Math.min(1,(n-5e3)/1e4):0}dataShapes(){return pl.dataShapes}views(){return pl.views}isCorrect(t){const n=this.moves.length===0;return t===pl.CHECKMATE||n}};rt(p0,"dataShapes",[{name:di.CHESS_puzzle,fields:[{name:"puzzleData",type:br.CHESS_PUZZLE,validator:{instructions:"insert a valid fen string",test:function(e){return console.log(`running puzzle validator on ${e}`),e?e.split(",").length!=10?{status:ur.error,msg:"puzzleData must have 8 comma-separated fields"}:{status:ur.ok,msg:""}:{status:ur.error,msg:"no defined input"}}},tagger:()=>["test"]}]}]);rt(p0,"views",[yS]);rt(p0,"acceptsUserData",!0);rt(p0,"CHECKMATE","CHECKMATE");let ud=p0;const q3=new Ns("chess",[ud]),wS=Vr({name:"AudioParseView",components:{AudioAutoPlayer:zd},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"AudioParseView"),a=ii(n),o=Lt("");a.question.value=new F3(e.data);const l=Sr(()=>a.question.value);return{...n,...a,answer:o,question:l,submit:()=>{l.value}}}}),SS={"data-viewable":"AudioParseView"};function xS(e,t,n,a,o,l){const h=hr("AudioAutoPlayer");return St(),Pt("div",SS,[e.question?(St(),Pt(qr,{key:0},[xr(h,{src:e.getURL("audio")},null,8,["src"]),t[0]||(t[0]=ht("br",null,null,-1)),t[1]||(t[1]=ht("br",null,null,-1)),Qr(" "+ir(e.question.text),1)],64)):Or("",!0)])}const CS=Ur(wS,[["render",xS]]),Qd=class hd extends fi{constructor(t){super(t),rt(this,"audio"),rt(this,"text"),this.audio=t[0].audio,this.text=t[0].text}isCorrect(t){throw new Error(`isCorrect() not implemented - cannor parse ${t}`)}dataShapes(){return hd.dataShapes}views(){return hd.views}};rt(Qd,"dataShapes",[{name:di.FRENCH_AudioParse,fields:[{name:"audio",type:br.IMAGE},{name:"text",type:br.STRING,validator:{test:e=>{const t=e.length<45;return{msg:t?"":"It's too long!",status:t?ur.ok:ur.error}}}}]}]);rt(Qd,"views",[CS]);let F3=Qd;const kS=Vr({name:"IdentifyVocab",components:{},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"IdentifyVocab"),a=ii(n);a.question.value=new z3(e.data);const o=Sr(()=>a.question.value);return{...n,...a,question:o}}}),MS={"data-viewable":"IdentifyVocab"};function ES(e,t,n,a,o,l){return St(),Pt("div",MS,[e.question?(St(),Pt(qr,{key:0},[Qr(" This is a vocabulary question. ")],64)):Or("",!0)])}const AS=Ur(kS,[["render",ES]]),TS=[{name:"word",type:br.STRING,validator:i3.NonEmptyString},{name:"image",type:br.IMAGE},{name:"audio",type:br.AUDIO}],Zd=class fd extends fi{isCorrect(t){throw new Error(`isCorrect() not implemented. Cannot parse ${t}`)}dataShapes(){return fd.dataShapes}views(){return fd.views}};rt(Zd,"dataShapes",[{fields:TS,name:di.FRENCH_Vocab}]);rt(Zd,"views",[AS]);let z3=Zd;const H3=new Ns("french",[F3,z3]),PS=Vr({name:"AdditionHorizontal",components:{UserInputNumber:Ra},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"AdditionHorizontal"),a=ii(n),o=Lt("");a.question.value=new Jd(e.data);const l=Sr(()=>a.question.value);return{...n,...a,answer:o,question:l,submit:()=>{if(l.value){const f=l.value.isCorrect(parseInt(o.value,10));alert(f)}}}}}),IS={"data-viewable":"AdditionHorizontal"};function NS(e,t,n,a,o,l){const h=hr("UserInputNumber");return St(),Pt("div",IS,[e.question?(St(),Pt(qr,{key:0},[Qr(ir(e.question.a)+" + "+ir(e.question.b)+" = ",1),xr(h,{modelValue:e.answer,"onUpdate:modelValue":t[0]||(t[0]=f=>e.answer=f)},null,8,["modelValue"])],64)):Or("",!0)])}const LS=Ur(PS,[["render",NS]]),OS=Vr({name:"VerbalAddition",components:{UserInputNumber:Ra},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"VerbalAddition"),a=ii(n),o=Lt("");a.question.value=new Jd(e.data);const l=Sr(()=>a.question.value);return{...n,...a,answer:o,question:l,submit:()=>{if(l.value){const f=l.value.isCorrect(parseInt(o.value,10));alert(f)}}}}}),DS={"data-viewable":"VerbalAddition"};function RS(e,t,n,a,o,l){const h=hr("UserInputNumber");return St(),Pt("div",DS,[e.question?(St(),Pt(qr,{key:0},[Qr(ir(e.question.a)+" plus "+ir(e.question.b)+" is ",1),xr(h,{modelValue:e.answer,"onUpdate:modelValue":t[0]||(t[0]=f=>e.answer=f)},null,8,["modelValue"])],64)):Or("",!0)])}const BS=Ur(OS,[["render",RS]]),qS=[{name:"a",type:br.INT},{name:"b",type:br.INT}],FS=function(){const e=[];for(let t=0;t<10;t++)for(let n=0;n<10;n++)e.push({a:t,b:n});return e},g0=class dd extends fi{constructor(t){super(t),rt(this,"a"),rt(this,"b"),this.a=t[0].a,this.b=t[0].b}isCorrect(t){return 1*this.a+this.b===t}dataShapes(){return dd.dataShapes}views(){return dd.views}};rt(g0,"dataShapes",[{name:di.MATH_SingleDigitAddition,fields:qS}]);rt(g0,"views",[LS,BS]);rt(g0,"seedData",FS());rt(g0,"acceptsUserData",!1);let Jd=g0;const zS=Vr({name:"DivisionHorizontal",components:{UserInputNumber:Ra},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"DivisionHorizontal"),a=ii(n),o=Lt("");a.question.value=new V3(e.data);const l=Sr(()=>a.question.value);return{...n,...a,answer:o,question:l,submit:()=>{if(l.value){const f=l.value.isCorrect(parseInt(o.value,10));alert(f)}}}}}),HS={"data-viewable":"DivisionHorizontal"};function VS(e,t,n,a,o,l){const h=hr("UserInputNumber");return St(),Pt("div",HS,[e.question?(St(),Pt(qr,{key:0},[Qr(ir(e.question.a*e.question.b)+" ÷ "+ir(e.question.b)+" = ",1),xr(h,{modelValue:e.answer,"onUpdate:modelValue":t[0]||(t[0]=f=>e.answer=f)},null,8,["modelValue"])],64)):Or("",!0)])}const US=Ur(zS,[["render",VS]]),GS=[{name:"a",type:br.INT},{name:"b",type:br.INT,validator:{instructions:"An integer between 1 and 10, inclusive.",test:e=>{const t=parseInt(e,10);return 0<t&&t<11?{status:ur.ok,msg:""}:t===0?{status:ur.error,msg:"Thou shalt not divide by zero."}:{status:ur.error,msg:"Single digit division problem divisors must be between 1 and 10, inclusive."}}}}],e1=class pd extends fi{constructor(t){super(t),rt(this,"a"),rt(this,"b"),this.a=t[0].a,this.b=t[0].b}isCorrect(t){return this.a*this.b===t}dataShapes(){return pd.dataShapes}views(){return pd.views}};rt(e1,"dataShapes",[{name:di.MATH_SingleDigitDivision,fields:GS}]);rt(e1,"views",[US]);let V3=e1;const YS=Vr({name:"MultiplicationHorizontal",components:{UserInputNumber:Ra},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"MultiplicationHorizontal"),a=ii(n),o=Lt("");a.question.value=new r1(e.data);const l=Sr(()=>a.question.value);return{...n,...a,answer:o,question:l,submit:()=>{if(l.value){const f=l.value.isCorrect(parseInt(o.value,10));alert(f)}}}}}),WS={"data-viewable":"MultiplicationHorizontal"};function $S(e,t,n,a,o,l){const h=hr("UserInputNumber");return St(),Pt("div",WS,[e.question?(St(),Pt(qr,{key:0},[Qr(ir(e.question.a)+" × "+ir(e.question.b)+" = ",1),xr(h,{modelValue:e.answer,"onUpdate:modelValue":t[0]||(t[0]=f=>e.answer=f)},null,8,["modelValue"])],64)):Or("",!0)])}const KS=Ur(YS,[["render",$S]]),jS=Vr({name:"VerbalMultiplication",components:{UserInputNumber:Ra},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"VerbalMultiplication"),a=ii(n),o=Lt("");a.question.value=new r1(e.data);const l=Sr(()=>a.question.value);return{...n,...a,answer:o,question:l,submit:()=>{if(l.value){const f=l.value.isCorrect(parseInt(o.value,10));alert(f)}}}}}),XS={"data-viewable":"VerbalMultiplication"};function QS(e,t,n,a,o,l){const h=hr("UserInputNumber");return St(),Pt("div",XS,[e.question?(St(),Pt(qr,{key:0},[Qr(ir(e.question.a)+" times "+ir(e.question.b)+" is ",1),xr(h,{modelValue:e.answer,"onUpdate:modelValue":t[0]||(t[0]=f=>e.answer=f)},null,8,["modelValue"])],64)):Or("",!0)])}const ZS=Ur(jS,[["render",QS]]),Jg={instructions:"An integer between 0 and 10, inclusive.",test:e=>{const t=parseInt(e,10);return 0<=t&&t<=10?{status:ur.ok,msg:""}:{status:ur.error,msg:"Single digit multiplication problem inputs must be between 0 and 10, inclusive."}}},JS=[{name:"a",type:br.INT,validator:Jg},{name:"b",type:br.INT,validator:Jg}],t1=class gd extends fi{constructor(t){super(t),rt(this,"a"),rt(this,"b"),this.a=t[0].a,this.b=t[0].b}isCorrect(t){return this.a*this.b===t}dataShapes(){return gd.dataShapes}views(){return gd.views}};rt(t1,"dataShapes",[{name:di.MATH_SingleDigitMultiplication,fields:JS}]);rt(t1,"views",[ZS,KS]);let r1=t1;const ex=Vr({name:"TrueFalse",components:{TFSelect:n7},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"TrueFalse"),a=ii(n);a.question.value=new md(e.data);const o=Sr(()=>new md(e.data));return{question:o,submit:h=>{alert(o.value.isCorrect(h===0))}}}}),tx={"data-viewable":"TrueFalse"};function rx(e,t,n,a,o,l){const h=hr("TFSelect");return St(),Pt("div",tx,[Qr(ir(e.question.a)+" = "+ir(e.question.b)+" ",1),xr(h,{submit:e.submit},null,8,["submit"])])}const ix=Ur(ex,[["render",rx]]),nx=[{name:"a",type:br.STRING},{name:"b",type:br.STRING}],i1=class vd extends fi{constructor(t){super(t),rt(this,"a"),rt(this,"b"),this.a=t[0].a,this.b=t[0].b}isCorrect(t){return this.a===this.b===t}dataShapes(){return vd.dataShapes}views(){return vd.views}};rt(i1,"dataShapes",[{name:di.MATH_EqualityTest,fields:nx}]);rt(i1,"views",[ix]);let md=i1;const sx=Vr({name:"SolveView",components:{UserInputNumber:Ra},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"Solve"),a=ii(n),o=Lt(""),l=["a","b","d","A","z","B","d","y"],h=Lt(l[ks(0,l.length)]);a.question.value=new U3(e.data);const f=Sr(()=>a.question.value);return{...n,...a,answer:o,question:f,variable:h,submit:()=>{if(f.value){const S=f.value.isCorrect(parseInt(o.value,10));alert(S)}}}}}),ax={"data-viewable":"Solve"},ox={key:0},lx={key:1},cx={key:2},ux={key:3},hx={key:4};function fx(e,t,n,a,o,l){const h=hr("UserInputNumber");return St(),Pt("div",ax,[e.question?(St(),Pt(qr,{key:0},[t[1]||(t[1]=ht("h4",null,"Solve the Equation",-1)),t[2]||(t[2]=ht("br",null,null,-1)),t[3]||(t[3]=ht("br",null,null,-1)),e.question.operation.valueOf()==="ADDITION"?(St(),Pt("div",ox,ir(e.variable)+" - "+ir(e.question.a)+" = "+ir(e.question.b),1)):e.question.operation.valueOf()==="SUBTRACTION"?(St(),Pt("div",lx,ir(e.variable)+" + "+ir(e.question.a)+" = "+ir(e.question.b),1)):e.question.operation.valueOf()==="MULTIPLICATION"?(St(),Pt("div",cx,ir(e.variable)+" ÷ "+ir(e.question.a)+" = "+ir(e.question.b),1)):e.question.operation.valueOf()==="DIVISION"?(St(),Pt("div",ux,ir(e.variable)+" * "+ir(e.question.a)+" = "+ir(e.question.b*e.question.a),1)):(St(),Pt("div",hx,"No operation!? (This should never show)")),t[4]||(t[4]=ht("br",null,null,-1)),t[5]||(t[5]=ht("br",null,null,-1)),Qr(" "+ir(e.variable)+" = ",1),xr(h,{modelValue:e.answer,"onUpdate:modelValue":t[0]||(t[0]=f=>e.answer=f)},null,8,["modelValue"])],64)):Or("",!0)])}const dx=Ur(sx,[["render",fx]]),ev={instructions:"An integer between 0 and 10, inclusive.",test:e=>{const t=parseInt(e,10);return 0<=t&&t<=100?{status:ur.ok,msg:""}:{status:ur.error,msg:"Single-step equation problem inputs must be between 0 and 100, inclusive."}}},px={test:e=>e==="ADDITION"||e==="SUBTRACTION"||e==="MULTIPLICATION"||e==="DIVISION"?{status:ur.ok,msg:""}:{status:ur.error,msg:"Operation must be ADDITION, SUBTRACTION, MULTIPLICATION, or DIVISION"}},gx=[{name:"a",type:br.INT,validator:ev},{name:"b",type:br.INT,validator:ev},{name:"operation",type:br.STRING,validator:px}],n1=class _d extends fi{constructor(t){super(t),rt(this,"a"),rt(this,"b"),rt(this,"operation"),this.a=t[0].a,this.b=t[0].b,this.operation=t[0].operation}answer(){let t=0;return this.operation==="ADDITION"?t=this.a+this.b:this.operation==="SUBTRACTION"?t=this.b-this.a:this.operation==="MULTIPLICATION"?t=this.a*this.b:this.operation==="DIVISION"&&(t=this.b),t7(`The answer is ${t}
60
+ The operation is ${this.operation.valueOf()}
61
+ this.a = ${this.a}
62
+ this.b = ${this.b}
63
+ `),t}isCorrect(t){return t===this.answer()}dataShapes(){return _d.dataShapes}views(){return _d.views}};rt(n1,"dataShapes",[{name:di.MATH_OneStepEquation,fields:gx}]);rt(n1,"views",[dx]);let U3=n1;const vx=Vr({name:"AngleCategorizeV",components:{RadioMultipleChoice:Bl},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"AngleCategorizeV"),a=ii(n),o=Lt(null);a.question.value=new G3(e.data);const l=Sr(()=>a.question.value),h=Sr(()=>{if(!l.value)return 0;const f=l.value.angleCategory;if(f===co.ACUTE)return ks(10,83);if(f===co.RIGHT)return 90;if(f===co.OBTUSE)return ks(97,173);if(f===co.STRAIGHT)return 180;if(f===co.REFLEX)return ks(190,350);throw new Error("Unknown Angle type on AngleCategorize question")});return Nn(()=>{if(!o.value)return;const f=o.value.width,b=o.value.height,S=o.value.getContext("2d");if(!S)return;const M=ks(0,360),C=M+h.value;S.moveTo(f/2,b/2);const y=f/2+f*Math.cos(M/360*2*Math.PI),g=b/2+f*Math.sin(M/360*2*Math.PI);S.lineTo(y,g),S.stroke(),S.moveTo(f/2,b/2);const w=f/2+f*Math.cos(C/360*2*Math.PI),p=b/2+f*Math.sin(C/360*2*Math.PI);S.lineTo(w,p),S.stroke(),S.moveTo(f/2,b/2),S.beginPath(),S.arc(f/2,b/2,25,M/360*2*Math.PI,C/360*2*Math.PI),S.stroke()}),{...n,...a,canvasRef:o,question:l}}}),mx={"data-viewable":"AngleCategorizeV"},_x={ref:"canvasRef",width:"300",height:"300"};function bx(e,t,n,a,o,l){const h=hr("radio-multiple-choice");return St(),Pt("div",mx,[e.question?(St(),Pt(qr,{key:0},[t[0]||(t[0]=ht("h2",null,"What kind of angle is this?",-1)),ht("canvas",_x,null,512),xr(h,{"choice-list":e.question.answers},null,8,["choice-list"])],64)):Or("",!0)])}const yx=Ur(vx,[["render",bx],["__scopeId","data-v-57f16e4a"]]),wx={instructions:'Must be "ACUTE", "RIGHT", "OBTUSE", "STRAIGHT", or "REFLEX".',test:e=>e==="ACUTE"||e==="OBTUSE"||e==="REFLEX"||e==="RIGHT"||e==="STRAIGHT"?{status:ur.ok,msg:""}:{status:ur.error,msg:'Must be "ACUTE", "RIGHT", "OBTUSE", "STRAIGHT", or "REFLEX".'}};var co=(e=>(e.ACUTE="ACUTE",e.RIGHT="RIGHT",e.OBTUSE="OBTUSE",e.STRAIGHT="STRAIGHT",e.REFLEX="REFLEX",e))(co||{});const Sx=[{name:"Category",type:br.STRING,validator:wx}],s1=class bd extends fi{constructor(t){super(t),rt(this,"angleCategory"),rt(this,"answers"),this.angleCategory=t[0].Category,this.answers=po.shuffle(["ACUTE","OBTUSE","REFLEX","RIGHT","STRAIGHT"])}isCorrect(t){return this.angleCategory.valueOf()===t.choiceList[t.selection]}dataShapes(){return bd.dataShapes}views(){return bd.views}};rt(s1,"dataShapes",[{name:di.MATH_AngleCategorize,fields:Sx}]);rt(s1,"views",[yx]);let G3=s1;function xx(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gl={exports:{}};const Cx={},kx=Object.freeze(Object.defineProperty({__proto__:null,default:Cx},Symbol.toStringTag,{value:"Module"})),tv=v7(kx);var s0={exports:{}},Mx=s0.exports,rv;function Ex(){return rv||(rv=1,function(e,t){(function(n,a){a(t)})(Mx,function(n){var a=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],o=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],l="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",h="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",f={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},b="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",S={5:b,"5module":b+" export import",6:b+" const class extends export import super"},M=/^in(stanceof)?$/,C=new RegExp("["+h+"]"),y=new RegExp("["+h+l+"]");function g(d,P){for(var J=65536,pe=0;pe<P.length;pe+=2){if(J+=P[pe],J>d)return!1;if(J+=P[pe+1],J>=d)return!0}return!1}function w(d,P){return d<65?d===36:d<91?!0:d<97?d===95:d<123?!0:d<=65535?d>=170&&C.test(String.fromCharCode(d)):P===!1?!1:g(d,o)}function p(d,P){return d<48?d===36:d<58?!0:d<65?!1:d<91?!0:d<97?d===95:d<123?!0:d<=65535?d>=170&&y.test(String.fromCharCode(d)):P===!1?!1:g(d,o)||g(d,a)}var E=function(P,J){J===void 0&&(J={}),this.label=P,this.keyword=J.keyword,this.beforeExpr=!!J.beforeExpr,this.startsExpr=!!J.startsExpr,this.isLoop=!!J.isLoop,this.isAssign=!!J.isAssign,this.prefix=!!J.prefix,this.postfix=!!J.postfix,this.binop=J.binop||null,this.updateContext=null};function N(d,P){return new E(d,{beforeExpr:!0,binop:P})}var I={beforeExpr:!0},O={startsExpr:!0},V={};function U(d,P){return P===void 0&&(P={}),P.keyword=d,V[d]=new E(d,P)}var D={num:new E("num",O),regexp:new E("regexp",O),string:new E("string",O),name:new E("name",O),privateId:new E("privateId",O),eof:new E("eof"),bracketL:new E("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new E("]"),braceL:new E("{",{beforeExpr:!0,startsExpr:!0}),braceR:new E("}"),parenL:new E("(",{beforeExpr:!0,startsExpr:!0}),parenR:new E(")"),comma:new E(",",I),semi:new E(";",I),colon:new E(":",I),dot:new E("."),question:new E("?",I),questionDot:new E("?."),arrow:new E("=>",I),template:new E("template"),invalidTemplate:new E("invalidTemplate"),ellipsis:new E("...",I),backQuote:new E("`",O),dollarBraceL:new E("${",{beforeExpr:!0,startsExpr:!0}),eq:new E("=",{beforeExpr:!0,isAssign:!0}),assign:new E("_=",{beforeExpr:!0,isAssign:!0}),incDec:new E("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new E("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:N("||",1),logicalAND:N("&&",2),bitwiseOR:N("|",3),bitwiseXOR:N("^",4),bitwiseAND:N("&",5),equality:N("==/!=/===/!==",6),relational:N("</>/<=/>=",7),bitShift:N("<</>>/>>>",8),plusMin:new E("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:N("%",10),star:N("*",10),slash:N("/",10),starstar:new E("**",{beforeExpr:!0}),coalesce:N("??",1),_break:U("break"),_case:U("case",I),_catch:U("catch"),_continue:U("continue"),_debugger:U("debugger"),_default:U("default",I),_do:U("do",{isLoop:!0,beforeExpr:!0}),_else:U("else",I),_finally:U("finally"),_for:U("for",{isLoop:!0}),_function:U("function",O),_if:U("if"),_return:U("return",I),_switch:U("switch"),_throw:U("throw",I),_try:U("try"),_var:U("var"),_const:U("const"),_while:U("while",{isLoop:!0}),_with:U("with"),_new:U("new",{beforeExpr:!0,startsExpr:!0}),_this:U("this",O),_super:U("super",O),_class:U("class",O),_extends:U("extends",I),_export:U("export"),_import:U("import",O),_null:U("null",O),_true:U("true",O),_false:U("false",O),_in:U("in",{beforeExpr:!0,binop:7}),_instanceof:U("instanceof",{beforeExpr:!0,binop:7}),_typeof:U("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:U("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:U("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},me=/\r\n?|\n|\u2028|\u2029/,B=new RegExp(me.source,"g");function ie(d){return d===10||d===13||d===8232||d===8233}function he(d,P,J){J===void 0&&(J=d.length);for(var pe=P;pe<J;pe++){var Ee=d.charCodeAt(pe);if(ie(Ee))return pe<J-1&&Ee===13&&d.charCodeAt(pe+1)===10?pe+2:pe+1}return-1}var ae=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,fe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,le=Object.prototype,Y=le.hasOwnProperty,$=le.toString,ne=Object.hasOwn||function(d,P){return Y.call(d,P)},we=Array.isArray||function(d){return $.call(d)==="[object Array]"},ye=Object.create(null);function F(d){return ye[d]||(ye[d]=new RegExp("^(?:"+d.replace(/ /g,"|")+")$"))}function H(d){return d<=65535?String.fromCharCode(d):(d-=65536,String.fromCharCode((d>>10)+55296,(d&1023)+56320))}var W=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,_e=function(P,J){this.line=P,this.column=J};_e.prototype.offset=function(P){return new _e(this.line,this.column+P)};var Te=function(P,J,pe){this.start=J,this.end=pe,P.sourceFile!==null&&(this.source=P.sourceFile)};function Re(d,P){for(var J=1,pe=0;;){var Ee=he(d,pe,P);if(Ee<0)return new _e(J,P-pe);++J,pe=Ee}}var Ie={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},st=!1;function wt(d){var P={};for(var J in Ie)P[J]=d&&ne(d,J)?d[J]:Ie[J];if(P.ecmaVersion==="latest"?P.ecmaVersion=1e8:P.ecmaVersion==null?(!st&&typeof console=="object"&&console.warn&&(st=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
64
+ Defaulting to 2020, but this will stop working in the future.`)),P.ecmaVersion=11):P.ecmaVersion>=2015&&(P.ecmaVersion-=2009),P.allowReserved==null&&(P.allowReserved=P.ecmaVersion<5),(!d||d.allowHashBang==null)&&(P.allowHashBang=P.ecmaVersion>=14),we(P.onToken)){var pe=P.onToken;P.onToken=function(Ee){return pe.push(Ee)}}return we(P.onComment)&&(P.onComment=Ze(P,P.onComment)),P}function Ze(d,P){return function(J,pe,Ee,We,Ke,pt){var yt={type:J?"Block":"Line",value:pe,start:Ee,end:We};d.locations&&(yt.loc=new Te(this,Ke,pt)),d.ranges&&(yt.range=[Ee,We]),P.push(yt)}}var dt=1,bt=2,et=4,Nt=8,xt=16,at=32,rr=64,Xt=128,Ht=256,nr=dt|bt|Ht;function Ar(d,P){return bt|(d?et:0)|(P?Nt:0)}var fr=0,qe=1,je=2,Fe=3,Ue=4,Qe=5,r=function(P,J,pe){this.options=P=wt(P),this.sourceFile=P.sourceFile,this.keywords=F(S[P.ecmaVersion>=6?6:P.sourceType==="module"?"5module":5]);var Ee="";P.allowReserved!==!0&&(Ee=f[P.ecmaVersion>=6?6:P.ecmaVersion===5?5:3],P.sourceType==="module"&&(Ee+=" await")),this.reservedWords=F(Ee);var We=(Ee?Ee+" ":"")+f.strict;this.reservedWordsStrict=F(We),this.reservedWordsStrictBind=F(We+" "+f.strictBind),this.input=String(J),this.containsEsc=!1,pe?(this.pos=pe,this.lineStart=this.input.lastIndexOf(`
65
+ `,pe-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(me).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=D.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=P.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&P.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(dt),this.regexpState=null,this.privateNameStack=[]},c={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};r.prototype.parse=function(){var P=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(P)},c.inFunction.get=function(){return(this.currentVarScope().flags&bt)>0},c.inGenerator.get=function(){return(this.currentVarScope().flags&Nt)>0&&!this.currentVarScope().inClassFieldInit},c.inAsync.get=function(){return(this.currentVarScope().flags&et)>0&&!this.currentVarScope().inClassFieldInit},c.canAwait.get=function(){for(var d=this.scopeStack.length-1;d>=0;d--){var P=this.scopeStack[d];if(P.inClassFieldInit||P.flags&Ht)return!1;if(P.flags&bt)return(P.flags&et)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},c.allowSuper.get=function(){var d=this.currentThisScope(),P=d.flags,J=d.inClassFieldInit;return(P&rr)>0||J||this.options.allowSuperOutsideMethod},c.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Xt)>0},c.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},c.allowNewDotTarget.get=function(){var d=this.currentThisScope(),P=d.flags,J=d.inClassFieldInit;return(P&(bt|Ht))>0||J},c.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ht)>0},r.extend=function(){for(var P=[],J=arguments.length;J--;)P[J]=arguments[J];for(var pe=this,Ee=0;Ee<P.length;Ee++)pe=P[Ee](pe);return pe},r.parse=function(P,J){return new this(J,P).parse()},r.parseExpressionAt=function(P,J,pe){var Ee=new this(pe,P,J);return Ee.nextToken(),Ee.parseExpression()},r.tokenizer=function(P,J){return new this(J,P)},Object.defineProperties(r.prototype,c);var m=r.prototype,x=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;m.strictDirective=function(d){if(this.options.ecmaVersion<5)return!1;for(;;){fe.lastIndex=d,d+=fe.exec(this.input)[0].length;var P=x.exec(this.input.slice(d));if(!P)return!1;if((P[1]||P[2])==="use strict"){fe.lastIndex=d+P[0].length;var J=fe.exec(this.input),pe=J.index+J[0].length,Ee=this.input.charAt(pe);return Ee===";"||Ee==="}"||me.test(J[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Ee)||Ee==="!"&&this.input.charAt(pe+1)==="=")}d+=P[0].length,fe.lastIndex=d,d+=fe.exec(this.input)[0].length,this.input[d]===";"&&d++}},m.eat=function(d){return this.type===d?(this.next(),!0):!1},m.isContextual=function(d){return this.type===D.name&&this.value===d&&!this.containsEsc},m.eatContextual=function(d){return this.isContextual(d)?(this.next(),!0):!1},m.expectContextual=function(d){this.eatContextual(d)||this.unexpected()},m.canInsertSemicolon=function(){return this.type===D.eof||this.type===D.braceR||me.test(this.input.slice(this.lastTokEnd,this.start))},m.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},m.semicolon=function(){!this.eat(D.semi)&&!this.insertSemicolon()&&this.unexpected()},m.afterTrailingComma=function(d,P){if(this.type===d)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),P||this.next(),!0},m.expect=function(d){this.eat(d)||this.unexpected()},m.unexpected=function(d){this.raise(d??this.start,"Unexpected token")};var k=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};m.checkPatternErrors=function(d,P){if(d){d.trailingComma>-1&&this.raiseRecoverable(d.trailingComma,"Comma is not permitted after the rest element");var J=P?d.parenthesizedAssign:d.parenthesizedBind;J>-1&&this.raiseRecoverable(J,P?"Assigning to rvalue":"Parenthesized pattern")}},m.checkExpressionErrors=function(d,P){if(!d)return!1;var J=d.shorthandAssign,pe=d.doubleProto;if(!P)return J>=0||pe>=0;J>=0&&this.raise(J,"Shorthand property assignments are valid only in destructuring patterns"),pe>=0&&this.raiseRecoverable(pe,"Redefinition of __proto__ property")},m.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},m.isSimpleAssignTarget=function(d){return d.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(d.expression):d.type==="Identifier"||d.type==="MemberExpression"};var T=r.prototype;T.parseTopLevel=function(d){var P=Object.create(null);for(d.body||(d.body=[]);this.type!==D.eof;){var J=this.parseStatement(null,!0,P);d.body.push(J)}if(this.inModule)for(var pe=0,Ee=Object.keys(this.undefinedExports);pe<Ee.length;pe+=1){var We=Ee[pe];this.raiseRecoverable(this.undefinedExports[We].start,"Export '"+We+"' is not defined")}return this.adaptDirectivePrologue(d.body),this.next(),d.sourceType=this.options.sourceType,this.finishNode(d,"Program")};var R={kind:"loop"},L={kind:"switch"};T.isLet=function(d){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;fe.lastIndex=this.pos;var P=fe.exec(this.input),J=this.pos+P[0].length,pe=this.input.charCodeAt(J);if(pe===91||pe===92)return!0;if(d)return!1;if(pe===123||pe>55295&&pe<56320)return!0;if(w(pe,!0)){for(var Ee=J+1;p(pe=this.input.charCodeAt(Ee),!0);)++Ee;if(pe===92||pe>55295&&pe<56320)return!0;var We=this.input.slice(J,Ee);if(!M.test(We))return!0}return!1},T.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;fe.lastIndex=this.pos;var d=fe.exec(this.input),P=this.pos+d[0].length,J;return!me.test(this.input.slice(this.pos,P))&&this.input.slice(P,P+8)==="function"&&(P+8===this.input.length||!(p(J=this.input.charCodeAt(P+8))||J>55295&&J<56320))},T.parseStatement=function(d,P,J){var pe=this.type,Ee=this.startNode(),We;switch(this.isLet(d)&&(pe=D._var,We="let"),pe){case D._break:case D._continue:return this.parseBreakContinueStatement(Ee,pe.keyword);case D._debugger:return this.parseDebuggerStatement(Ee);case D._do:return this.parseDoStatement(Ee);case D._for:return this.parseForStatement(Ee);case D._function:return d&&(this.strict||d!=="if"&&d!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(Ee,!1,!d);case D._class:return d&&this.unexpected(),this.parseClass(Ee,!0);case D._if:return this.parseIfStatement(Ee);case D._return:return this.parseReturnStatement(Ee);case D._switch:return this.parseSwitchStatement(Ee);case D._throw:return this.parseThrowStatement(Ee);case D._try:return this.parseTryStatement(Ee);case D._const:case D._var:return We=We||this.value,d&&We!=="var"&&this.unexpected(),this.parseVarStatement(Ee,We);case D._while:return this.parseWhileStatement(Ee);case D._with:return this.parseWithStatement(Ee);case D.braceL:return this.parseBlock(!0,Ee);case D.semi:return this.parseEmptyStatement(Ee);case D._export:case D._import:if(this.options.ecmaVersion>10&&pe===D._import){fe.lastIndex=this.pos;var Ke=fe.exec(this.input),pt=this.pos+Ke[0].length,yt=this.input.charCodeAt(pt);if(yt===40||yt===46)return this.parseExpressionStatement(Ee,this.parseExpression())}return this.options.allowImportExportEverywhere||(P||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),pe===D._import?this.parseImport(Ee):this.parseExport(Ee,J);default:if(this.isAsyncFunction())return d&&this.unexpected(),this.next(),this.parseFunctionStatement(Ee,!0,!d);var Zt=this.value,Gt=this.parseExpression();return pe===D.name&&Gt.type==="Identifier"&&this.eat(D.colon)?this.parseLabeledStatement(Ee,Zt,Gt,d):this.parseExpressionStatement(Ee,Gt)}},T.parseBreakContinueStatement=function(d,P){var J=P==="break";this.next(),this.eat(D.semi)||this.insertSemicolon()?d.label=null:this.type!==D.name?this.unexpected():(d.label=this.parseIdent(),this.semicolon());for(var pe=0;pe<this.labels.length;++pe){var Ee=this.labels[pe];if((d.label==null||Ee.name===d.label.name)&&(Ee.kind!=null&&(J||Ee.kind==="loop")||d.label&&J))break}return pe===this.labels.length&&this.raise(d.start,"Unsyntactic "+P),this.finishNode(d,J?"BreakStatement":"ContinueStatement")},T.parseDebuggerStatement=function(d){return this.next(),this.semicolon(),this.finishNode(d,"DebuggerStatement")},T.parseDoStatement=function(d){return this.next(),this.labels.push(R),d.body=this.parseStatement("do"),this.labels.pop(),this.expect(D._while),d.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(D.semi):this.semicolon(),this.finishNode(d,"DoWhileStatement")},T.parseForStatement=function(d){this.next();var P=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(R),this.enterScope(0),this.expect(D.parenL),this.type===D.semi)return P>-1&&this.unexpected(P),this.parseFor(d,null);var J=this.isLet();if(this.type===D._var||this.type===D._const||J){var pe=this.startNode(),Ee=J?"let":this.value;return this.next(),this.parseVar(pe,!0,Ee),this.finishNode(pe,"VariableDeclaration"),(this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&pe.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===D._in?P>-1&&this.unexpected(P):d.await=P>-1),this.parseForIn(d,pe)):(P>-1&&this.unexpected(P),this.parseFor(d,pe))}var We=this.isContextual("let"),Ke=!1,pt=this.containsEsc,yt=new k,Zt=this.start,Gt=P>-1?this.parseExprSubscripts(yt,"await"):this.parseExpression(!0,yt);return this.type===D._in||(Ke=this.options.ecmaVersion>=6&&this.isContextual("of"))?(P>-1?(this.type===D._in&&this.unexpected(P),d.await=!0):Ke&&this.options.ecmaVersion>=8&&(Gt.start===Zt&&!pt&&Gt.type==="Identifier"&&Gt.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(d.await=!1)),We&&Ke&&this.raise(Gt.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Gt,!1,yt),this.checkLValPattern(Gt),this.parseForIn(d,Gt)):(this.checkExpressionErrors(yt,!0),P>-1&&this.unexpected(P),this.parseFor(d,Gt))},T.parseFunctionStatement=function(d,P,J){return this.next(),this.parseFunction(d,z|(J?0:X),!1,P)},T.parseIfStatement=function(d){return this.next(),d.test=this.parseParenExpression(),d.consequent=this.parseStatement("if"),d.alternate=this.eat(D._else)?this.parseStatement("if"):null,this.finishNode(d,"IfStatement")},T.parseReturnStatement=function(d){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(D.semi)||this.insertSemicolon()?d.argument=null:(d.argument=this.parseExpression(),this.semicolon()),this.finishNode(d,"ReturnStatement")},T.parseSwitchStatement=function(d){this.next(),d.discriminant=this.parseParenExpression(),d.cases=[],this.expect(D.braceL),this.labels.push(L),this.enterScope(0);for(var P,J=!1;this.type!==D.braceR;)if(this.type===D._case||this.type===D._default){var pe=this.type===D._case;P&&this.finishNode(P,"SwitchCase"),d.cases.push(P=this.startNode()),P.consequent=[],this.next(),pe?P.test=this.parseExpression():(J&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),J=!0,P.test=null),this.expect(D.colon)}else P||this.unexpected(),P.consequent.push(this.parseStatement(null));return this.exitScope(),P&&this.finishNode(P,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(d,"SwitchStatement")},T.parseThrowStatement=function(d){return this.next(),me.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),d.argument=this.parseExpression(),this.semicolon(),this.finishNode(d,"ThrowStatement")};var q=[];T.parseCatchClauseParam=function(){var d=this.parseBindingAtom(),P=d.type==="Identifier";return this.enterScope(P?at:0),this.checkLValPattern(d,P?Ue:je),this.expect(D.parenR),d},T.parseTryStatement=function(d){if(this.next(),d.block=this.parseBlock(),d.handler=null,this.type===D._catch){var P=this.startNode();this.next(),this.eat(D.parenL)?P.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),P.param=null,this.enterScope(0)),P.body=this.parseBlock(!1),this.exitScope(),d.handler=this.finishNode(P,"CatchClause")}return d.finalizer=this.eat(D._finally)?this.parseBlock():null,!d.handler&&!d.finalizer&&this.raise(d.start,"Missing catch or finally clause"),this.finishNode(d,"TryStatement")},T.parseVarStatement=function(d,P,J){return this.next(),this.parseVar(d,!1,P,J),this.semicolon(),this.finishNode(d,"VariableDeclaration")},T.parseWhileStatement=function(d){return this.next(),d.test=this.parseParenExpression(),this.labels.push(R),d.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(d,"WhileStatement")},T.parseWithStatement=function(d){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),d.object=this.parseParenExpression(),d.body=this.parseStatement("with"),this.finishNode(d,"WithStatement")},T.parseEmptyStatement=function(d){return this.next(),this.finishNode(d,"EmptyStatement")},T.parseLabeledStatement=function(d,P,J,pe){for(var Ee=0,We=this.labels;Ee<We.length;Ee+=1){var Ke=We[Ee];Ke.name===P&&this.raise(J.start,"Label '"+P+"' is already declared")}for(var pt=this.type.isLoop?"loop":this.type===D._switch?"switch":null,yt=this.labels.length-1;yt>=0;yt--){var Zt=this.labels[yt];if(Zt.statementStart===d.start)Zt.statementStart=this.start,Zt.kind=pt;else break}return this.labels.push({name:P,kind:pt,statementStart:this.start}),d.body=this.parseStatement(pe?pe.indexOf("label")===-1?pe+"label":pe:"label"),this.labels.pop(),d.label=J,this.finishNode(d,"LabeledStatement")},T.parseExpressionStatement=function(d,P){return d.expression=P,this.semicolon(),this.finishNode(d,"ExpressionStatement")},T.parseBlock=function(d,P,J){for(d===void 0&&(d=!0),P===void 0&&(P=this.startNode()),P.body=[],this.expect(D.braceL),d&&this.enterScope(0);this.type!==D.braceR;){var pe=this.parseStatement(null);P.body.push(pe)}return J&&(this.strict=!1),this.next(),d&&this.exitScope(),this.finishNode(P,"BlockStatement")},T.parseFor=function(d,P){return d.init=P,this.expect(D.semi),d.test=this.type===D.semi?null:this.parseExpression(),this.expect(D.semi),d.update=this.type===D.parenR?null:this.parseExpression(),this.expect(D.parenR),d.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(d,"ForStatement")},T.parseForIn=function(d,P){var J=this.type===D._in;return this.next(),P.type==="VariableDeclaration"&&P.declarations[0].init!=null&&(!J||this.options.ecmaVersion<8||this.strict||P.kind!=="var"||P.declarations[0].id.type!=="Identifier")&&this.raise(P.start,(J?"for-in":"for-of")+" loop variable declaration may not have an initializer"),d.left=P,d.right=J?this.parseExpression():this.parseMaybeAssign(),this.expect(D.parenR),d.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(d,J?"ForInStatement":"ForOfStatement")},T.parseVar=function(d,P,J,pe){for(d.declarations=[],d.kind=J;;){var Ee=this.startNode();if(this.parseVarId(Ee,J),this.eat(D.eq)?Ee.init=this.parseMaybeAssign(P):!pe&&J==="const"&&!(this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!pe&&Ee.id.type!=="Identifier"&&!(P&&(this.type===D._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):Ee.init=null,d.declarations.push(this.finishNode(Ee,"VariableDeclarator")),!this.eat(D.comma))break}return d},T.parseVarId=function(d,P){d.id=this.parseBindingAtom(),this.checkLValPattern(d.id,P==="var"?qe:je,!1)};var z=1,X=2,Z=4;T.parseFunction=function(d,P,J,pe,Ee){this.initFunction(d),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!pe)&&(this.type===D.star&&P&X&&this.unexpected(),d.generator=this.eat(D.star)),this.options.ecmaVersion>=8&&(d.async=!!pe),P&z&&(d.id=P&Z&&this.type!==D.name?null:this.parseIdent(),d.id&&!(P&X)&&this.checkLValSimple(d.id,this.strict||d.generator||d.async?this.treatFunctionsAsVar?qe:je:Fe));var We=this.yieldPos,Ke=this.awaitPos,pt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ar(d.async,d.generator)),P&z||(d.id=this.type===D.name?this.parseIdent():null),this.parseFunctionParams(d),this.parseFunctionBody(d,J,!1,Ee),this.yieldPos=We,this.awaitPos=Ke,this.awaitIdentPos=pt,this.finishNode(d,P&z?"FunctionDeclaration":"FunctionExpression")},T.parseFunctionParams=function(d){this.expect(D.parenL),d.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},T.parseClass=function(d,P){this.next();var J=this.strict;this.strict=!0,this.parseClassId(d,P),this.parseClassSuper(d);var pe=this.enterClassBody(),Ee=this.startNode(),We=!1;for(Ee.body=[],this.expect(D.braceL);this.type!==D.braceR;){var Ke=this.parseClassElement(d.superClass!==null);Ke&&(Ee.body.push(Ke),Ke.type==="MethodDefinition"&&Ke.kind==="constructor"?(We&&this.raiseRecoverable(Ke.start,"Duplicate constructor in the same class"),We=!0):Ke.key&&Ke.key.type==="PrivateIdentifier"&&Q(pe,Ke)&&this.raiseRecoverable(Ke.key.start,"Identifier '#"+Ke.key.name+"' has already been declared"))}return this.strict=J,this.next(),d.body=this.finishNode(Ee,"ClassBody"),this.exitClassBody(),this.finishNode(d,P?"ClassDeclaration":"ClassExpression")},T.parseClassElement=function(d){if(this.eat(D.semi))return null;var P=this.options.ecmaVersion,J=this.startNode(),pe="",Ee=!1,We=!1,Ke="method",pt=!1;if(this.eatContextual("static")){if(P>=13&&this.eat(D.braceL))return this.parseClassStaticBlock(J),J;this.isClassElementNameStart()||this.type===D.star?pt=!0:pe="static"}if(J.static=pt,!pe&&P>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===D.star)&&!this.canInsertSemicolon()?We=!0:pe="async"),!pe&&(P>=9||!We)&&this.eat(D.star)&&(Ee=!0),!pe&&!We&&!Ee){var yt=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?Ke=yt:pe=yt)}if(pe?(J.computed=!1,J.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),J.key.name=pe,this.finishNode(J.key,"Identifier")):this.parseClassElementName(J),P<13||this.type===D.parenL||Ke!=="method"||Ee||We){var Zt=!J.static&&j(J,"constructor"),Gt=Zt&&d;Zt&&Ke!=="method"&&this.raise(J.key.start,"Constructor can't have get/set modifier"),J.kind=Zt?"constructor":Ke,this.parseClassMethod(J,Ee,We,Gt)}else this.parseClassField(J);return J},T.isClassElementNameStart=function(){return this.type===D.name||this.type===D.privateId||this.type===D.num||this.type===D.string||this.type===D.bracketL||this.type.keyword},T.parseClassElementName=function(d){this.type===D.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),d.computed=!1,d.key=this.parsePrivateIdent()):this.parsePropertyName(d)},T.parseClassMethod=function(d,P,J,pe){var Ee=d.key;d.kind==="constructor"?(P&&this.raise(Ee.start,"Constructor can't be a generator"),J&&this.raise(Ee.start,"Constructor can't be an async method")):d.static&&j(d,"prototype")&&this.raise(Ee.start,"Classes may not have a static property named prototype");var We=d.value=this.parseMethod(P,J,pe);return d.kind==="get"&&We.params.length!==0&&this.raiseRecoverable(We.start,"getter should have no params"),d.kind==="set"&&We.params.length!==1&&this.raiseRecoverable(We.start,"setter should have exactly one param"),d.kind==="set"&&We.params[0].type==="RestElement"&&this.raiseRecoverable(We.params[0].start,"Setter cannot use rest params"),this.finishNode(d,"MethodDefinition")},T.parseClassField=function(d){if(j(d,"constructor")?this.raise(d.key.start,"Classes can't have a field named 'constructor'"):d.static&&j(d,"prototype")&&this.raise(d.key.start,"Classes can't have a static field named 'prototype'"),this.eat(D.eq)){var P=this.currentThisScope(),J=P.inClassFieldInit;P.inClassFieldInit=!0,d.value=this.parseMaybeAssign(),P.inClassFieldInit=J}else d.value=null;return this.semicolon(),this.finishNode(d,"PropertyDefinition")},T.parseClassStaticBlock=function(d){d.body=[];var P=this.labels;for(this.labels=[],this.enterScope(Ht|rr);this.type!==D.braceR;){var J=this.parseStatement(null);d.body.push(J)}return this.next(),this.exitScope(),this.labels=P,this.finishNode(d,"StaticBlock")},T.parseClassId=function(d,P){this.type===D.name?(d.id=this.parseIdent(),P&&this.checkLValSimple(d.id,je,!1)):(P===!0&&this.unexpected(),d.id=null)},T.parseClassSuper=function(d){d.superClass=this.eat(D._extends)?this.parseExprSubscripts(null,!1):null},T.enterClassBody=function(){var d={declared:Object.create(null),used:[]};return this.privateNameStack.push(d),d.declared},T.exitClassBody=function(){var d=this.privateNameStack.pop(),P=d.declared,J=d.used;if(this.options.checkPrivateFields)for(var pe=this.privateNameStack.length,Ee=pe===0?null:this.privateNameStack[pe-1],We=0;We<J.length;++We){var Ke=J[We];ne(P,Ke.name)||(Ee?Ee.used.push(Ke):this.raiseRecoverable(Ke.start,"Private field '#"+Ke.name+"' must be declared in an enclosing class"))}};function Q(d,P){var J=P.key.name,pe=d[J],Ee="true";return P.type==="MethodDefinition"&&(P.kind==="get"||P.kind==="set")&&(Ee=(P.static?"s":"i")+P.kind),pe==="iget"&&Ee==="iset"||pe==="iset"&&Ee==="iget"||pe==="sget"&&Ee==="sset"||pe==="sset"&&Ee==="sget"?(d[J]="true",!1):pe?!0:(d[J]=Ee,!1)}function j(d,P){var J=d.computed,pe=d.key;return!J&&(pe.type==="Identifier"&&pe.name===P||pe.type==="Literal"&&pe.value===P)}T.parseExportAllDeclaration=function(d,P){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(d.exported=this.parseModuleExportName(),this.checkExport(P,d.exported,this.lastTokStart)):d.exported=null),this.expectContextual("from"),this.type!==D.string&&this.unexpected(),d.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(d.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(d,"ExportAllDeclaration")},T.parseExport=function(d,P){if(this.next(),this.eat(D.star))return this.parseExportAllDeclaration(d,P);if(this.eat(D._default))return this.checkExport(P,"default",this.lastTokStart),d.declaration=this.parseExportDefaultDeclaration(),this.finishNode(d,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())d.declaration=this.parseExportDeclaration(d),d.declaration.type==="VariableDeclaration"?this.checkVariableExport(P,d.declaration.declarations):this.checkExport(P,d.declaration.id,d.declaration.id.start),d.specifiers=[],d.source=null;else{if(d.declaration=null,d.specifiers=this.parseExportSpecifiers(P),this.eatContextual("from"))this.type!==D.string&&this.unexpected(),d.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(d.attributes=this.parseWithClause());else{for(var J=0,pe=d.specifiers;J<pe.length;J+=1){var Ee=pe[J];this.checkUnreserved(Ee.local),this.checkLocalExport(Ee.local),Ee.local.type==="Literal"&&this.raise(Ee.local.start,"A string literal cannot be used as an exported binding without `from`.")}d.source=null}this.semicolon()}return this.finishNode(d,"ExportNamedDeclaration")},T.parseExportDeclaration=function(d){return this.parseStatement(null)},T.parseExportDefaultDeclaration=function(){var d;if(this.type===D._function||(d=this.isAsyncFunction())){var P=this.startNode();return this.next(),d&&this.next(),this.parseFunction(P,z|Z,!1,d)}else if(this.type===D._class){var J=this.startNode();return this.parseClass(J,"nullableID")}else{var pe=this.parseMaybeAssign();return this.semicolon(),pe}},T.checkExport=function(d,P,J){d&&(typeof P!="string"&&(P=P.type==="Identifier"?P.name:P.value),ne(d,P)&&this.raiseRecoverable(J,"Duplicate export '"+P+"'"),d[P]=!0)},T.checkPatternExport=function(d,P){var J=P.type;if(J==="Identifier")this.checkExport(d,P,P.start);else if(J==="ObjectPattern")for(var pe=0,Ee=P.properties;pe<Ee.length;pe+=1){var We=Ee[pe];this.checkPatternExport(d,We)}else if(J==="ArrayPattern")for(var Ke=0,pt=P.elements;Ke<pt.length;Ke+=1){var yt=pt[Ke];yt&&this.checkPatternExport(d,yt)}else J==="Property"?this.checkPatternExport(d,P.value):J==="AssignmentPattern"?this.checkPatternExport(d,P.left):J==="RestElement"&&this.checkPatternExport(d,P.argument)},T.checkVariableExport=function(d,P){if(d)for(var J=0,pe=P;J<pe.length;J+=1){var Ee=pe[J];this.checkPatternExport(d,Ee.id)}},T.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},T.parseExportSpecifier=function(d){var P=this.startNode();return P.local=this.parseModuleExportName(),P.exported=this.eatContextual("as")?this.parseModuleExportName():P.local,this.checkExport(d,P.exported,P.exported.start),this.finishNode(P,"ExportSpecifier")},T.parseExportSpecifiers=function(d){var P=[],J=!0;for(this.expect(D.braceL);!this.eat(D.braceR);){if(J)J=!1;else if(this.expect(D.comma),this.afterTrailingComma(D.braceR))break;P.push(this.parseExportSpecifier(d))}return P},T.parseImport=function(d){return this.next(),this.type===D.string?(d.specifiers=q,d.source=this.parseExprAtom()):(d.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),d.source=this.type===D.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(d.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(d,"ImportDeclaration")},T.parseImportSpecifier=function(){var d=this.startNode();return d.imported=this.parseModuleExportName(),this.eatContextual("as")?d.local=this.parseIdent():(this.checkUnreserved(d.imported),d.local=d.imported),this.checkLValSimple(d.local,je),this.finishNode(d,"ImportSpecifier")},T.parseImportDefaultSpecifier=function(){var d=this.startNode();return d.local=this.parseIdent(),this.checkLValSimple(d.local,je),this.finishNode(d,"ImportDefaultSpecifier")},T.parseImportNamespaceSpecifier=function(){var d=this.startNode();return this.next(),this.expectContextual("as"),d.local=this.parseIdent(),this.checkLValSimple(d.local,je),this.finishNode(d,"ImportNamespaceSpecifier")},T.parseImportSpecifiers=function(){var d=[],P=!0;if(this.type===D.name&&(d.push(this.parseImportDefaultSpecifier()),!this.eat(D.comma)))return d;if(this.type===D.star)return d.push(this.parseImportNamespaceSpecifier()),d;for(this.expect(D.braceL);!this.eat(D.braceR);){if(P)P=!1;else if(this.expect(D.comma),this.afterTrailingComma(D.braceR))break;d.push(this.parseImportSpecifier())}return d},T.parseWithClause=function(){var d=[];if(!this.eat(D._with))return d;this.expect(D.braceL);for(var P={},J=!0;!this.eat(D.braceR);){if(J)J=!1;else if(this.expect(D.comma),this.afterTrailingComma(D.braceR))break;var pe=this.parseImportAttribute(),Ee=pe.key.type==="Identifier"?pe.key.name:pe.key.value;ne(P,Ee)&&this.raiseRecoverable(pe.key.start,"Duplicate attribute key '"+Ee+"'"),P[Ee]=!0,d.push(pe)}return d},T.parseImportAttribute=function(){var d=this.startNode();return d.key=this.type===D.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(D.colon),this.type!==D.string&&this.unexpected(),d.value=this.parseExprAtom(),this.finishNode(d,"ImportAttribute")},T.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===D.string){var d=this.parseLiteral(this.value);return W.test(d.value)&&this.raise(d.start,"An export name cannot include a lone surrogate."),d}return this.parseIdent(!0)},T.adaptDirectivePrologue=function(d){for(var P=0;P<d.length&&this.isDirectiveCandidate(d[P]);++P)d[P].directive=d[P].expression.raw.slice(1,-1)},T.isDirectiveCandidate=function(d){return this.options.ecmaVersion>=5&&d.type==="ExpressionStatement"&&d.expression.type==="Literal"&&typeof d.expression.value=="string"&&(this.input[d.start]==='"'||this.input[d.start]==="'")};var ce=r.prototype;ce.toAssignable=function(d,P,J){if(this.options.ecmaVersion>=6&&d)switch(d.type){case"Identifier":this.inAsync&&d.name==="await"&&this.raise(d.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":d.type="ObjectPattern",J&&this.checkPatternErrors(J,!0);for(var pe=0,Ee=d.properties;pe<Ee.length;pe+=1){var We=Ee[pe];this.toAssignable(We,P),We.type==="RestElement"&&(We.argument.type==="ArrayPattern"||We.argument.type==="ObjectPattern")&&this.raise(We.argument.start,"Unexpected token")}break;case"Property":d.kind!=="init"&&this.raise(d.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(d.value,P);break;case"ArrayExpression":d.type="ArrayPattern",J&&this.checkPatternErrors(J,!0),this.toAssignableList(d.elements,P);break;case"SpreadElement":d.type="RestElement",this.toAssignable(d.argument,P),d.argument.type==="AssignmentPattern"&&this.raise(d.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":d.operator!=="="&&this.raise(d.left.end,"Only '=' operator can be used for specifying default value."),d.type="AssignmentPattern",delete d.operator,this.toAssignable(d.left,P);break;case"ParenthesizedExpression":this.toAssignable(d.expression,P,J);break;case"ChainExpression":this.raiseRecoverable(d.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!P)break;default:this.raise(d.start,"Assigning to rvalue")}else J&&this.checkPatternErrors(J,!0);return d},ce.toAssignableList=function(d,P){for(var J=d.length,pe=0;pe<J;pe++){var Ee=d[pe];Ee&&this.toAssignable(Ee,P)}if(J){var We=d[J-1];this.options.ecmaVersion===6&&P&&We&&We.type==="RestElement"&&We.argument.type!=="Identifier"&&this.unexpected(We.argument.start)}return d},ce.parseSpread=function(d){var P=this.startNode();return this.next(),P.argument=this.parseMaybeAssign(!1,d),this.finishNode(P,"SpreadElement")},ce.parseRestBinding=function(){var d=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==D.name&&this.unexpected(),d.argument=this.parseBindingAtom(),this.finishNode(d,"RestElement")},ce.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case D.bracketL:var d=this.startNode();return this.next(),d.elements=this.parseBindingList(D.bracketR,!0,!0),this.finishNode(d,"ArrayPattern");case D.braceL:return this.parseObj(!0)}return this.parseIdent()},ce.parseBindingList=function(d,P,J,pe){for(var Ee=[],We=!0;!this.eat(d);)if(We?We=!1:this.expect(D.comma),P&&this.type===D.comma)Ee.push(null);else{if(J&&this.afterTrailingComma(d))break;if(this.type===D.ellipsis){var Ke=this.parseRestBinding();this.parseBindingListItem(Ke),Ee.push(Ke),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(d);break}else Ee.push(this.parseAssignableListItem(pe))}return Ee},ce.parseAssignableListItem=function(d){var P=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(P),P},ce.parseBindingListItem=function(d){return d},ce.parseMaybeDefault=function(d,P,J){if(J=J||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(D.eq))return J;var pe=this.startNodeAt(d,P);return pe.left=J,pe.right=this.parseMaybeAssign(),this.finishNode(pe,"AssignmentPattern")},ce.checkLValSimple=function(d,P,J){P===void 0&&(P=fr);var pe=P!==fr;switch(d.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(d.name)&&this.raiseRecoverable(d.start,(pe?"Binding ":"Assigning to ")+d.name+" in strict mode"),pe&&(P===je&&d.name==="let"&&this.raiseRecoverable(d.start,"let is disallowed as a lexically bound name"),J&&(ne(J,d.name)&&this.raiseRecoverable(d.start,"Argument name clash"),J[d.name]=!0),P!==Qe&&this.declareName(d.name,P,d.start));break;case"ChainExpression":this.raiseRecoverable(d.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":pe&&this.raiseRecoverable(d.start,"Binding member expression");break;case"ParenthesizedExpression":return pe&&this.raiseRecoverable(d.start,"Binding parenthesized expression"),this.checkLValSimple(d.expression,P,J);default:this.raise(d.start,(pe?"Binding":"Assigning to")+" rvalue")}},ce.checkLValPattern=function(d,P,J){switch(P===void 0&&(P=fr),d.type){case"ObjectPattern":for(var pe=0,Ee=d.properties;pe<Ee.length;pe+=1){var We=Ee[pe];this.checkLValInnerPattern(We,P,J)}break;case"ArrayPattern":for(var Ke=0,pt=d.elements;Ke<pt.length;Ke+=1){var yt=pt[Ke];yt&&this.checkLValInnerPattern(yt,P,J)}break;default:this.checkLValSimple(d,P,J)}},ce.checkLValInnerPattern=function(d,P,J){switch(P===void 0&&(P=fr),d.type){case"Property":this.checkLValInnerPattern(d.value,P,J);break;case"AssignmentPattern":this.checkLValPattern(d.left,P,J);break;case"RestElement":this.checkLValPattern(d.argument,P,J);break;default:this.checkLValPattern(d,P,J)}};var te=function(P,J,pe,Ee,We){this.token=P,this.isExpr=!!J,this.preserveSpace=!!pe,this.override=Ee,this.generator=!!We},oe={b_stat:new te("{",!1),b_expr:new te("{",!0),b_tmpl:new te("${",!1),p_stat:new te("(",!1),p_expr:new te("(",!0),q_tmpl:new te("`",!0,!0,function(d){return d.tryReadTemplateToken()}),f_stat:new te("function",!1),f_expr:new te("function",!0),f_expr_gen:new te("function",!0,!1,null,!0),f_gen:new te("function",!1,!1,null,!0)},ee=r.prototype;ee.initialContext=function(){return[oe.b_stat]},ee.curContext=function(){return this.context[this.context.length-1]},ee.braceIsBlock=function(d){var P=this.curContext();return P===oe.f_expr||P===oe.f_stat?!0:d===D.colon&&(P===oe.b_stat||P===oe.b_expr)?!P.isExpr:d===D._return||d===D.name&&this.exprAllowed?me.test(this.input.slice(this.lastTokEnd,this.start)):d===D._else||d===D.semi||d===D.eof||d===D.parenR||d===D.arrow?!0:d===D.braceL?P===oe.b_stat:d===D._var||d===D._const||d===D.name?!1:!this.exprAllowed},ee.inGeneratorContext=function(){for(var d=this.context.length-1;d>=1;d--){var P=this.context[d];if(P.token==="function")return P.generator}return!1},ee.updateContext=function(d){var P,J=this.type;J.keyword&&d===D.dot?this.exprAllowed=!1:(P=J.updateContext)?P.call(this,d):this.exprAllowed=J.beforeExpr},ee.overrideContext=function(d){this.curContext()!==d&&(this.context[this.context.length-1]=d)},D.parenR.updateContext=D.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var d=this.context.pop();d===oe.b_stat&&this.curContext().token==="function"&&(d=this.context.pop()),this.exprAllowed=!d.isExpr},D.braceL.updateContext=function(d){this.context.push(this.braceIsBlock(d)?oe.b_stat:oe.b_expr),this.exprAllowed=!0},D.dollarBraceL.updateContext=function(){this.context.push(oe.b_tmpl),this.exprAllowed=!0},D.parenL.updateContext=function(d){var P=d===D._if||d===D._for||d===D._with||d===D._while;this.context.push(P?oe.p_stat:oe.p_expr),this.exprAllowed=!0},D.incDec.updateContext=function(){},D._function.updateContext=D._class.updateContext=function(d){d.beforeExpr&&d!==D._else&&!(d===D.semi&&this.curContext()!==oe.p_stat)&&!(d===D._return&&me.test(this.input.slice(this.lastTokEnd,this.start)))&&!((d===D.colon||d===D.braceL)&&this.curContext()===oe.b_stat)?this.context.push(oe.f_expr):this.context.push(oe.f_stat),this.exprAllowed=!1},D.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},D.backQuote.updateContext=function(){this.curContext()===oe.q_tmpl?this.context.pop():this.context.push(oe.q_tmpl),this.exprAllowed=!1},D.star.updateContext=function(d){if(d===D._function){var P=this.context.length-1;this.context[P]===oe.f_expr?this.context[P]=oe.f_expr_gen:this.context[P]=oe.f_gen}this.exprAllowed=!0},D.name.updateContext=function(d){var P=!1;this.options.ecmaVersion>=6&&d!==D.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(P=!0),this.exprAllowed=P};var re=r.prototype;re.checkPropClash=function(d,P,J){if(!(this.options.ecmaVersion>=9&&d.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(d.computed||d.method||d.shorthand))){var pe=d.key,Ee;switch(pe.type){case"Identifier":Ee=pe.name;break;case"Literal":Ee=String(pe.value);break;default:return}var We=d.kind;if(this.options.ecmaVersion>=6){Ee==="__proto__"&&We==="init"&&(P.proto&&(J?J.doubleProto<0&&(J.doubleProto=pe.start):this.raiseRecoverable(pe.start,"Redefinition of __proto__ property")),P.proto=!0);return}Ee="$"+Ee;var Ke=P[Ee];if(Ke){var pt;We==="init"?pt=this.strict&&Ke.init||Ke.get||Ke.set:pt=Ke.init||Ke[We],pt&&this.raiseRecoverable(pe.start,"Redefinition of property")}else Ke=P[Ee]={init:!1,get:!1,set:!1};Ke[We]=!0}},re.parseExpression=function(d,P){var J=this.start,pe=this.startLoc,Ee=this.parseMaybeAssign(d,P);if(this.type===D.comma){var We=this.startNodeAt(J,pe);for(We.expressions=[Ee];this.eat(D.comma);)We.expressions.push(this.parseMaybeAssign(d,P));return this.finishNode(We,"SequenceExpression")}return Ee},re.parseMaybeAssign=function(d,P,J){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(d);this.exprAllowed=!1}var pe=!1,Ee=-1,We=-1,Ke=-1;P?(Ee=P.parenthesizedAssign,We=P.trailingComma,Ke=P.doubleProto,P.parenthesizedAssign=P.trailingComma=-1):(P=new k,pe=!0);var pt=this.start,yt=this.startLoc;(this.type===D.parenL||this.type===D.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=d==="await");var Zt=this.parseMaybeConditional(d,P);if(J&&(Zt=J.call(this,Zt,pt,yt)),this.type.isAssign){var Gt=this.startNodeAt(pt,yt);return Gt.operator=this.value,this.type===D.eq&&(Zt=this.toAssignable(Zt,!1,P)),pe||(P.parenthesizedAssign=P.trailingComma=P.doubleProto=-1),P.shorthandAssign>=Zt.start&&(P.shorthandAssign=-1),this.type===D.eq?this.checkLValPattern(Zt):this.checkLValSimple(Zt),Gt.left=Zt,this.next(),Gt.right=this.parseMaybeAssign(d),Ke>-1&&(P.doubleProto=Ke),this.finishNode(Gt,"AssignmentExpression")}else pe&&this.checkExpressionErrors(P,!0);return Ee>-1&&(P.parenthesizedAssign=Ee),We>-1&&(P.trailingComma=We),Zt},re.parseMaybeConditional=function(d,P){var J=this.start,pe=this.startLoc,Ee=this.parseExprOps(d,P);if(this.checkExpressionErrors(P))return Ee;if(this.eat(D.question)){var We=this.startNodeAt(J,pe);return We.test=Ee,We.consequent=this.parseMaybeAssign(),this.expect(D.colon),We.alternate=this.parseMaybeAssign(d),this.finishNode(We,"ConditionalExpression")}return Ee},re.parseExprOps=function(d,P){var J=this.start,pe=this.startLoc,Ee=this.parseMaybeUnary(P,!1,!1,d);return this.checkExpressionErrors(P)||Ee.start===J&&Ee.type==="ArrowFunctionExpression"?Ee:this.parseExprOp(Ee,J,pe,-1,d)},re.parseExprOp=function(d,P,J,pe,Ee){var We=this.type.binop;if(We!=null&&(!Ee||this.type!==D._in)&&We>pe){var Ke=this.type===D.logicalOR||this.type===D.logicalAND,pt=this.type===D.coalesce;pt&&(We=D.logicalAND.binop);var yt=this.value;this.next();var Zt=this.start,Gt=this.startLoc,jt=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Ee),Zt,Gt,We,Ee),gr=this.buildBinary(P,J,d,jt,yt,Ke||pt);return(Ke&&this.type===D.coalesce||pt&&(this.type===D.logicalOR||this.type===D.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(gr,P,J,pe,Ee)}return d},re.buildBinary=function(d,P,J,pe,Ee,We){pe.type==="PrivateIdentifier"&&this.raise(pe.start,"Private identifier can only be left side of binary expression");var Ke=this.startNodeAt(d,P);return Ke.left=J,Ke.operator=Ee,Ke.right=pe,this.finishNode(Ke,We?"LogicalExpression":"BinaryExpression")},re.parseMaybeUnary=function(d,P,J,pe){var Ee=this.start,We=this.startLoc,Ke;if(this.isContextual("await")&&this.canAwait)Ke=this.parseAwait(pe),P=!0;else if(this.type.prefix){var pt=this.startNode(),yt=this.type===D.incDec;pt.operator=this.value,pt.prefix=!0,this.next(),pt.argument=this.parseMaybeUnary(null,!0,yt,pe),this.checkExpressionErrors(d,!0),yt?this.checkLValSimple(pt.argument):this.strict&&pt.operator==="delete"&&K(pt.argument)?this.raiseRecoverable(pt.start,"Deleting local variable in strict mode"):pt.operator==="delete"&&se(pt.argument)?this.raiseRecoverable(pt.start,"Private fields can not be deleted"):P=!0,Ke=this.finishNode(pt,yt?"UpdateExpression":"UnaryExpression")}else if(!P&&this.type===D.privateId)(pe||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),Ke=this.parsePrivateIdent(),this.type!==D._in&&this.unexpected();else{if(Ke=this.parseExprSubscripts(d,pe),this.checkExpressionErrors(d))return Ke;for(;this.type.postfix&&!this.canInsertSemicolon();){var Zt=this.startNodeAt(Ee,We);Zt.operator=this.value,Zt.prefix=!1,Zt.argument=Ke,this.checkLValSimple(Ke),this.next(),Ke=this.finishNode(Zt,"UpdateExpression")}}if(!J&&this.eat(D.starstar))if(P)this.unexpected(this.lastTokStart);else return this.buildBinary(Ee,We,Ke,this.parseMaybeUnary(null,!1,!1,pe),"**",!1);else return Ke};function K(d){return d.type==="Identifier"||d.type==="ParenthesizedExpression"&&K(d.expression)}function se(d){return d.type==="MemberExpression"&&d.property.type==="PrivateIdentifier"||d.type==="ChainExpression"&&se(d.expression)||d.type==="ParenthesizedExpression"&&se(d.expression)}re.parseExprSubscripts=function(d,P){var J=this.start,pe=this.startLoc,Ee=this.parseExprAtom(d,P);if(Ee.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Ee;var We=this.parseSubscripts(Ee,J,pe,!1,P);return d&&We.type==="MemberExpression"&&(d.parenthesizedAssign>=We.start&&(d.parenthesizedAssign=-1),d.parenthesizedBind>=We.start&&(d.parenthesizedBind=-1),d.trailingComma>=We.start&&(d.trailingComma=-1)),We},re.parseSubscripts=function(d,P,J,pe,Ee){for(var We=this.options.ecmaVersion>=8&&d.type==="Identifier"&&d.name==="async"&&this.lastTokEnd===d.end&&!this.canInsertSemicolon()&&d.end-d.start===5&&this.potentialArrowAt===d.start,Ke=!1;;){var pt=this.parseSubscript(d,P,J,pe,We,Ke,Ee);if(pt.optional&&(Ke=!0),pt===d||pt.type==="ArrowFunctionExpression"){if(Ke){var yt=this.startNodeAt(P,J);yt.expression=pt,pt=this.finishNode(yt,"ChainExpression")}return pt}d=pt}},re.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(D.arrow)},re.parseSubscriptAsyncArrow=function(d,P,J,pe){return this.parseArrowExpression(this.startNodeAt(d,P),J,!0,pe)},re.parseSubscript=function(d,P,J,pe,Ee,We,Ke){var pt=this.options.ecmaVersion>=11,yt=pt&&this.eat(D.questionDot);pe&&yt&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var Zt=this.eat(D.bracketL);if(Zt||yt&&this.type!==D.parenL&&this.type!==D.backQuote||this.eat(D.dot)){var Gt=this.startNodeAt(P,J);Gt.object=d,Zt?(Gt.property=this.parseExpression(),this.expect(D.bracketR)):this.type===D.privateId&&d.type!=="Super"?Gt.property=this.parsePrivateIdent():Gt.property=this.parseIdent(this.options.allowReserved!=="never"),Gt.computed=!!Zt,pt&&(Gt.optional=yt),d=this.finishNode(Gt,"MemberExpression")}else if(!pe&&this.eat(D.parenL)){var jt=new k,gr=this.yieldPos,is=this.awaitPos,Bn=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var ns=this.parseExprList(D.parenR,this.options.ecmaVersion>=8,!1,jt);if(Ee&&!yt&&this.shouldParseAsyncArrow())return this.checkPatternErrors(jt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=gr,this.awaitPos=is,this.awaitIdentPos=Bn,this.parseSubscriptAsyncArrow(P,J,ns,Ke);this.checkExpressionErrors(jt,!0),this.yieldPos=gr||this.yieldPos,this.awaitPos=is||this.awaitPos,this.awaitIdentPos=Bn||this.awaitIdentPos;var Hi=this.startNodeAt(P,J);Hi.callee=d,Hi.arguments=ns,pt&&(Hi.optional=yt),d=this.finishNode(Hi,"CallExpression")}else if(this.type===D.backQuote){(yt||We)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var qn=this.startNodeAt(P,J);qn.tag=d,qn.quasi=this.parseTemplate({isTagged:!0}),d=this.finishNode(qn,"TaggedTemplateExpression")}return d},re.parseExprAtom=function(d,P,J){this.type===D.slash&&this.readRegexp();var pe,Ee=this.potentialArrowAt===this.start;switch(this.type){case D._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),pe=this.startNode(),this.next(),this.type===D.parenL&&!this.allowDirectSuper&&this.raise(pe.start,"super() call outside constructor of a subclass"),this.type!==D.dot&&this.type!==D.bracketL&&this.type!==D.parenL&&this.unexpected(),this.finishNode(pe,"Super");case D._this:return pe=this.startNode(),this.next(),this.finishNode(pe,"ThisExpression");case D.name:var We=this.start,Ke=this.startLoc,pt=this.containsEsc,yt=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!pt&&yt.name==="async"&&!this.canInsertSemicolon()&&this.eat(D._function))return this.overrideContext(oe.f_expr),this.parseFunction(this.startNodeAt(We,Ke),0,!1,!0,P);if(Ee&&!this.canInsertSemicolon()){if(this.eat(D.arrow))return this.parseArrowExpression(this.startNodeAt(We,Ke),[yt],!1,P);if(this.options.ecmaVersion>=8&&yt.name==="async"&&this.type===D.name&&!pt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return yt=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(D.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(We,Ke),[yt],!0,P)}return yt;case D.regexp:var Zt=this.value;return pe=this.parseLiteral(Zt.value),pe.regex={pattern:Zt.pattern,flags:Zt.flags},pe;case D.num:case D.string:return this.parseLiteral(this.value);case D._null:case D._true:case D._false:return pe=this.startNode(),pe.value=this.type===D._null?null:this.type===D._true,pe.raw=this.type.keyword,this.next(),this.finishNode(pe,"Literal");case D.parenL:var Gt=this.start,jt=this.parseParenAndDistinguishExpression(Ee,P);return d&&(d.parenthesizedAssign<0&&!this.isSimpleAssignTarget(jt)&&(d.parenthesizedAssign=Gt),d.parenthesizedBind<0&&(d.parenthesizedBind=Gt)),jt;case D.bracketL:return pe=this.startNode(),this.next(),pe.elements=this.parseExprList(D.bracketR,!0,!0,d),this.finishNode(pe,"ArrayExpression");case D.braceL:return this.overrideContext(oe.b_expr),this.parseObj(!1,d);case D._function:return pe=this.startNode(),this.next(),this.parseFunction(pe,0);case D._class:return this.parseClass(this.startNode(),!1);case D._new:return this.parseNew();case D.backQuote:return this.parseTemplate();case D._import:return this.options.ecmaVersion>=11?this.parseExprImport(J):this.unexpected();default:return this.parseExprAtomDefault()}},re.parseExprAtomDefault=function(){this.unexpected()},re.parseExprImport=function(d){var P=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===D.parenL&&!d)return this.parseDynamicImport(P);if(this.type===D.dot){var J=this.startNodeAt(P.start,P.loc&&P.loc.start);return J.name="import",P.meta=this.finishNode(J,"Identifier"),this.parseImportMeta(P)}else this.unexpected()},re.parseDynamicImport=function(d){if(this.next(),d.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(D.parenR)?d.options=null:(this.expect(D.comma),this.afterTrailingComma(D.parenR)?d.options=null:(d.options=this.parseMaybeAssign(),this.eat(D.parenR)||(this.expect(D.comma),this.afterTrailingComma(D.parenR)||this.unexpected())));else if(!this.eat(D.parenR)){var P=this.start;this.eat(D.comma)&&this.eat(D.parenR)?this.raiseRecoverable(P,"Trailing comma is not allowed in import()"):this.unexpected(P)}return this.finishNode(d,"ImportExpression")},re.parseImportMeta=function(d){this.next();var P=this.containsEsc;return d.property=this.parseIdent(!0),d.property.name!=="meta"&&this.raiseRecoverable(d.property.start,"The only valid meta property for import is 'import.meta'"),P&&this.raiseRecoverable(d.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(d.start,"Cannot use 'import.meta' outside a module"),this.finishNode(d,"MetaProperty")},re.parseLiteral=function(d){var P=this.startNode();return P.value=d,P.raw=this.input.slice(this.start,this.end),P.raw.charCodeAt(P.raw.length-1)===110&&(P.bigint=P.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(P,"Literal")},re.parseParenExpression=function(){this.expect(D.parenL);var d=this.parseExpression();return this.expect(D.parenR),d},re.shouldParseArrow=function(d){return!this.canInsertSemicolon()},re.parseParenAndDistinguishExpression=function(d,P){var J=this.start,pe=this.startLoc,Ee,We=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Ke=this.start,pt=this.startLoc,yt=[],Zt=!0,Gt=!1,jt=new k,gr=this.yieldPos,is=this.awaitPos,Bn;for(this.yieldPos=0,this.awaitPos=0;this.type!==D.parenR;)if(Zt?Zt=!1:this.expect(D.comma),We&&this.afterTrailingComma(D.parenR,!0)){Gt=!0;break}else if(this.type===D.ellipsis){Bn=this.start,yt.push(this.parseParenItem(this.parseRestBinding())),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else yt.push(this.parseMaybeAssign(!1,jt,this.parseParenItem));var ns=this.lastTokEnd,Hi=this.lastTokEndLoc;if(this.expect(D.parenR),d&&this.shouldParseArrow(yt)&&this.eat(D.arrow))return this.checkPatternErrors(jt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=gr,this.awaitPos=is,this.parseParenArrowList(J,pe,yt,P);(!yt.length||Gt)&&this.unexpected(this.lastTokStart),Bn&&this.unexpected(Bn),this.checkExpressionErrors(jt,!0),this.yieldPos=gr||this.yieldPos,this.awaitPos=is||this.awaitPos,yt.length>1?(Ee=this.startNodeAt(Ke,pt),Ee.expressions=yt,this.finishNodeAt(Ee,"SequenceExpression",ns,Hi)):Ee=yt[0]}else Ee=this.parseParenExpression();if(this.options.preserveParens){var qn=this.startNodeAt(J,pe);return qn.expression=Ee,this.finishNode(qn,"ParenthesizedExpression")}else return Ee},re.parseParenItem=function(d){return d},re.parseParenArrowList=function(d,P,J,pe){return this.parseArrowExpression(this.startNodeAt(d,P),J,!1,pe)};var de=[];re.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var d=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===D.dot){var P=this.startNodeAt(d.start,d.loc&&d.loc.start);P.name="new",d.meta=this.finishNode(P,"Identifier"),this.next();var J=this.containsEsc;return d.property=this.parseIdent(!0),d.property.name!=="target"&&this.raiseRecoverable(d.property.start,"The only valid meta property for new is 'new.target'"),J&&this.raiseRecoverable(d.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(d.start,"'new.target' can only be used in functions and class static block"),this.finishNode(d,"MetaProperty")}var pe=this.start,Ee=this.startLoc;return d.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),pe,Ee,!0,!1),this.eat(D.parenL)?d.arguments=this.parseExprList(D.parenR,this.options.ecmaVersion>=8,!1):d.arguments=de,this.finishNode(d,"NewExpression")},re.parseTemplateElement=function(d){var P=d.isTagged,J=this.startNode();return this.type===D.invalidTemplate?(P||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),J.value={raw:this.value.replace(/\r\n?/g,`
66
+ `),cooked:null}):J.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
67
+ `),cooked:this.value},this.next(),J.tail=this.type===D.backQuote,this.finishNode(J,"TemplateElement")},re.parseTemplate=function(d){d===void 0&&(d={});var P=d.isTagged;P===void 0&&(P=!1);var J=this.startNode();this.next(),J.expressions=[];var pe=this.parseTemplateElement({isTagged:P});for(J.quasis=[pe];!pe.tail;)this.type===D.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(D.dollarBraceL),J.expressions.push(this.parseExpression()),this.expect(D.braceR),J.quasis.push(pe=this.parseTemplateElement({isTagged:P}));return this.next(),this.finishNode(J,"TemplateLiteral")},re.isAsyncProp=function(d){return!d.computed&&d.key.type==="Identifier"&&d.key.name==="async"&&(this.type===D.name||this.type===D.num||this.type===D.string||this.type===D.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===D.star)&&!me.test(this.input.slice(this.lastTokEnd,this.start))},re.parseObj=function(d,P){var J=this.startNode(),pe=!0,Ee={};for(J.properties=[],this.next();!this.eat(D.braceR);){if(pe)pe=!1;else if(this.expect(D.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(D.braceR))break;var We=this.parseProperty(d,P);d||this.checkPropClash(We,Ee,P),J.properties.push(We)}return this.finishNode(J,d?"ObjectPattern":"ObjectExpression")},re.parseProperty=function(d,P){var J=this.startNode(),pe,Ee,We,Ke;if(this.options.ecmaVersion>=9&&this.eat(D.ellipsis))return d?(J.argument=this.parseIdent(!1),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(J,"RestElement")):(J.argument=this.parseMaybeAssign(!1,P),this.type===D.comma&&P&&P.trailingComma<0&&(P.trailingComma=this.start),this.finishNode(J,"SpreadElement"));this.options.ecmaVersion>=6&&(J.method=!1,J.shorthand=!1,(d||P)&&(We=this.start,Ke=this.startLoc),d||(pe=this.eat(D.star)));var pt=this.containsEsc;return this.parsePropertyName(J),!d&&!pt&&this.options.ecmaVersion>=8&&!pe&&this.isAsyncProp(J)?(Ee=!0,pe=this.options.ecmaVersion>=9&&this.eat(D.star),this.parsePropertyName(J)):Ee=!1,this.parsePropertyValue(J,d,pe,Ee,We,Ke,P,pt),this.finishNode(J,"Property")},re.parseGetterSetter=function(d){d.kind=d.key.name,this.parsePropertyName(d),d.value=this.parseMethod(!1);var P=d.kind==="get"?0:1;if(d.value.params.length!==P){var J=d.value.start;d.kind==="get"?this.raiseRecoverable(J,"getter should have no params"):this.raiseRecoverable(J,"setter should have exactly one param")}else d.kind==="set"&&d.value.params[0].type==="RestElement"&&this.raiseRecoverable(d.value.params[0].start,"Setter cannot use rest params")},re.parsePropertyValue=function(d,P,J,pe,Ee,We,Ke,pt){(J||pe)&&this.type===D.colon&&this.unexpected(),this.eat(D.colon)?(d.value=P?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Ke),d.kind="init"):this.options.ecmaVersion>=6&&this.type===D.parenL?(P&&this.unexpected(),d.kind="init",d.method=!0,d.value=this.parseMethod(J,pe)):!P&&!pt&&this.options.ecmaVersion>=5&&!d.computed&&d.key.type==="Identifier"&&(d.key.name==="get"||d.key.name==="set")&&this.type!==D.comma&&this.type!==D.braceR&&this.type!==D.eq?((J||pe)&&this.unexpected(),this.parseGetterSetter(d)):this.options.ecmaVersion>=6&&!d.computed&&d.key.type==="Identifier"?((J||pe)&&this.unexpected(),this.checkUnreserved(d.key),d.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=Ee),d.kind="init",P?d.value=this.parseMaybeDefault(Ee,We,this.copyNode(d.key)):this.type===D.eq&&Ke?(Ke.shorthandAssign<0&&(Ke.shorthandAssign=this.start),d.value=this.parseMaybeDefault(Ee,We,this.copyNode(d.key))):d.value=this.copyNode(d.key),d.shorthand=!0):this.unexpected()},re.parsePropertyName=function(d){if(this.options.ecmaVersion>=6){if(this.eat(D.bracketL))return d.computed=!0,d.key=this.parseMaybeAssign(),this.expect(D.bracketR),d.key;d.computed=!1}return d.key=this.type===D.num||this.type===D.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},re.initFunction=function(d){d.id=null,this.options.ecmaVersion>=6&&(d.generator=d.expression=!1),this.options.ecmaVersion>=8&&(d.async=!1)},re.parseMethod=function(d,P,J){var pe=this.startNode(),Ee=this.yieldPos,We=this.awaitPos,Ke=this.awaitIdentPos;return this.initFunction(pe),this.options.ecmaVersion>=6&&(pe.generator=d),this.options.ecmaVersion>=8&&(pe.async=!!P),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ar(P,pe.generator)|rr|(J?Xt:0)),this.expect(D.parenL),pe.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(pe,!1,!0,!1),this.yieldPos=Ee,this.awaitPos=We,this.awaitIdentPos=Ke,this.finishNode(pe,"FunctionExpression")},re.parseArrowExpression=function(d,P,J,pe){var Ee=this.yieldPos,We=this.awaitPos,Ke=this.awaitIdentPos;return this.enterScope(Ar(J,!1)|xt),this.initFunction(d),this.options.ecmaVersion>=8&&(d.async=!!J),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,d.params=this.toAssignableList(P,!0),this.parseFunctionBody(d,!0,!1,pe),this.yieldPos=Ee,this.awaitPos=We,this.awaitIdentPos=Ke,this.finishNode(d,"ArrowFunctionExpression")},re.parseFunctionBody=function(d,P,J,pe){var Ee=P&&this.type!==D.braceL,We=this.strict,Ke=!1;if(Ee)d.body=this.parseMaybeAssign(pe),d.expression=!0,this.checkParams(d,!1);else{var pt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(d.params);(!We||pt)&&(Ke=this.strictDirective(this.end),Ke&&pt&&this.raiseRecoverable(d.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var yt=this.labels;this.labels=[],Ke&&(this.strict=!0),this.checkParams(d,!We&&!Ke&&!P&&!J&&this.isSimpleParamList(d.params)),this.strict&&d.id&&this.checkLValSimple(d.id,Qe),d.body=this.parseBlock(!1,void 0,Ke&&!We),d.expression=!1,this.adaptDirectivePrologue(d.body.body),this.labels=yt}this.exitScope()},re.isSimpleParamList=function(d){for(var P=0,J=d;P<J.length;P+=1){var pe=J[P];if(pe.type!=="Identifier")return!1}return!0},re.checkParams=function(d,P){for(var J=Object.create(null),pe=0,Ee=d.params;pe<Ee.length;pe+=1){var We=Ee[pe];this.checkLValInnerPattern(We,qe,P?null:J)}},re.parseExprList=function(d,P,J,pe){for(var Ee=[],We=!0;!this.eat(d);){if(We)We=!1;else if(this.expect(D.comma),P&&this.afterTrailingComma(d))break;var Ke=void 0;J&&this.type===D.comma?Ke=null:this.type===D.ellipsis?(Ke=this.parseSpread(pe),pe&&this.type===D.comma&&pe.trailingComma<0&&(pe.trailingComma=this.start)):Ke=this.parseMaybeAssign(!1,pe),Ee.push(Ke)}return Ee},re.checkUnreserved=function(d){var P=d.start,J=d.end,pe=d.name;if(this.inGenerator&&pe==="yield"&&this.raiseRecoverable(P,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&pe==="await"&&this.raiseRecoverable(P,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&pe==="arguments"&&this.raiseRecoverable(P,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(pe==="arguments"||pe==="await")&&this.raise(P,"Cannot use "+pe+" in class static initialization block"),this.keywords.test(pe)&&this.raise(P,"Unexpected keyword '"+pe+"'"),!(this.options.ecmaVersion<6&&this.input.slice(P,J).indexOf("\\")!==-1)){var Ee=this.strict?this.reservedWordsStrict:this.reservedWords;Ee.test(pe)&&(!this.inAsync&&pe==="await"&&this.raiseRecoverable(P,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(P,"The keyword '"+pe+"' is reserved"))}},re.parseIdent=function(d){var P=this.parseIdentNode();return this.next(!!d),this.finishNode(P,"Identifier"),d||(this.checkUnreserved(P),P.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=P.start)),P},re.parseIdentNode=function(){var d=this.startNode();return this.type===D.name?d.name=this.value:this.type.keyword?(d.name=this.type.keyword,(d.name==="class"||d.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=D.name):this.unexpected(),d},re.parsePrivateIdent=function(){var d=this.startNode();return this.type===D.privateId?d.name=this.value:this.unexpected(),this.next(),this.finishNode(d,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(d.start,"Private field '#"+d.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(d)),d},re.parseYield=function(d){this.yieldPos||(this.yieldPos=this.start);var P=this.startNode();return this.next(),this.type===D.semi||this.canInsertSemicolon()||this.type!==D.star&&!this.type.startsExpr?(P.delegate=!1,P.argument=null):(P.delegate=this.eat(D.star),P.argument=this.parseMaybeAssign(d)),this.finishNode(P,"YieldExpression")},re.parseAwait=function(d){this.awaitPos||(this.awaitPos=this.start);var P=this.startNode();return this.next(),P.argument=this.parseMaybeUnary(null,!0,!1,d),this.finishNode(P,"AwaitExpression")};var ve=r.prototype;ve.raise=function(d,P){var J=Re(this.input,d);P+=" ("+J.line+":"+J.column+")";var pe=new SyntaxError(P);throw pe.pos=d,pe.loc=J,pe.raisedAt=this.pos,pe},ve.raiseRecoverable=ve.raise,ve.curPosition=function(){if(this.options.locations)return new _e(this.curLine,this.pos-this.lineStart)};var ue=r.prototype,Ce=function(P){this.flags=P,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};ue.enterScope=function(d){this.scopeStack.push(new Ce(d))},ue.exitScope=function(){this.scopeStack.pop()},ue.treatFunctionsAsVarInScope=function(d){return d.flags&bt||!this.inModule&&d.flags&dt},ue.declareName=function(d,P,J){var pe=!1;if(P===je){var Ee=this.currentScope();pe=Ee.lexical.indexOf(d)>-1||Ee.functions.indexOf(d)>-1||Ee.var.indexOf(d)>-1,Ee.lexical.push(d),this.inModule&&Ee.flags&dt&&delete this.undefinedExports[d]}else if(P===Ue){var We=this.currentScope();We.lexical.push(d)}else if(P===Fe){var Ke=this.currentScope();this.treatFunctionsAsVar?pe=Ke.lexical.indexOf(d)>-1:pe=Ke.lexical.indexOf(d)>-1||Ke.var.indexOf(d)>-1,Ke.functions.push(d)}else for(var pt=this.scopeStack.length-1;pt>=0;--pt){var yt=this.scopeStack[pt];if(yt.lexical.indexOf(d)>-1&&!(yt.flags&at&&yt.lexical[0]===d)||!this.treatFunctionsAsVarInScope(yt)&&yt.functions.indexOf(d)>-1){pe=!0;break}if(yt.var.push(d),this.inModule&&yt.flags&dt&&delete this.undefinedExports[d],yt.flags&nr)break}pe&&this.raiseRecoverable(J,"Identifier '"+d+"' has already been declared")},ue.checkLocalExport=function(d){this.scopeStack[0].lexical.indexOf(d.name)===-1&&this.scopeStack[0].var.indexOf(d.name)===-1&&(this.undefinedExports[d.name]=d)},ue.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ue.currentVarScope=function(){for(var d=this.scopeStack.length-1;;d--){var P=this.scopeStack[d];if(P.flags&nr)return P}},ue.currentThisScope=function(){for(var d=this.scopeStack.length-1;;d--){var P=this.scopeStack[d];if(P.flags&nr&&!(P.flags&xt))return P}};var Me=function(P,J,pe){this.type="",this.start=J,this.end=0,P.options.locations&&(this.loc=new Te(P,pe)),P.options.directSourceFile&&(this.sourceFile=P.options.directSourceFile),P.options.ranges&&(this.range=[J,0])},Ae=r.prototype;Ae.startNode=function(){return new Me(this,this.start,this.startLoc)},Ae.startNodeAt=function(d,P){return new Me(this,d,P)};function Oe(d,P,J,pe){return d.type=P,d.end=J,this.options.locations&&(d.loc.end=pe),this.options.ranges&&(d.range[1]=J),d}Ae.finishNode=function(d,P){return Oe.call(this,d,P,this.lastTokEnd,this.lastTokEndLoc)},Ae.finishNodeAt=function(d,P,J,pe){return Oe.call(this,d,P,J,pe)},Ae.copyNode=function(d){var P=new Me(this,d.start,this.startLoc);for(var J in d)P[J]=d[J];return P};var ke="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Le="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",De=Le+" Extended_Pictographic",ze=De,He=ze+" EBase EComp EMod EPres ExtPict",$e=He,ct=$e,ft={9:Le,10:De,11:ze,12:He,13:$e,14:ct},vt="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",kt={9:"",10:"",11:"",12:"",13:"",14:vt},tt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",nt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",_t=nt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Et=_t+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Mt=Et+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Dt=Mt+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Rt=Dt+" "+ke,Ft={9:nt,10:_t,11:Et,12:Mt,13:Dt,14:Rt},$t={};function Vt(d){var P=$t[d]={binary:F(ft[d]+" "+tt),binaryOfStrings:F(kt[d]),nonBinary:{General_Category:F(tt),Script:F(Ft[d])}};P.nonBinary.Script_Extensions=P.nonBinary.Script,P.nonBinary.gc=P.nonBinary.General_Category,P.nonBinary.sc=P.nonBinary.Script,P.nonBinary.scx=P.nonBinary.Script_Extensions}for(var Rr=0,Br=[9,10,11,12,13,14];Rr<Br.length;Rr+=1){var Kr=Br[Rr];Vt(Kr)}var mt=r.prototype,pr=function(P,J){this.parent=P,this.base=J||this};pr.prototype.separatedFrom=function(P){for(var J=this;J;J=J.parent)for(var pe=P;pe;pe=pe.parent)if(J.base===pe.base&&J!==pe)return!0;return!1},pr.prototype.sibling=function(){return new pr(this.parent,this.base)};var wr=function(P){this.parser=P,this.validFlags="gim"+(P.options.ecmaVersion>=6?"uy":"")+(P.options.ecmaVersion>=9?"s":"")+(P.options.ecmaVersion>=13?"d":"")+(P.options.ecmaVersion>=15?"v":""),this.unicodeProperties=$t[P.options.ecmaVersion>=14?14:P.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};wr.prototype.reset=function(P,J,pe){var Ee=pe.indexOf("v")!==-1,We=pe.indexOf("u")!==-1;this.start=P|0,this.source=J+"",this.flags=pe,Ee&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=We&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=We&&this.parser.options.ecmaVersion>=9)},wr.prototype.raise=function(P){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+P)},wr.prototype.at=function(P,J){J===void 0&&(J=!1);var pe=this.source,Ee=pe.length;if(P>=Ee)return-1;var We=pe.charCodeAt(P);if(!(J||this.switchU)||We<=55295||We>=57344||P+1>=Ee)return We;var Ke=pe.charCodeAt(P+1);return Ke>=56320&&Ke<=57343?(We<<10)+Ke-56613888:We},wr.prototype.nextIndex=function(P,J){J===void 0&&(J=!1);var pe=this.source,Ee=pe.length;if(P>=Ee)return Ee;var We=pe.charCodeAt(P),Ke;return!(J||this.switchU)||We<=55295||We>=57344||P+1>=Ee||(Ke=pe.charCodeAt(P+1))<56320||Ke>57343?P+1:P+2},wr.prototype.current=function(P){return P===void 0&&(P=!1),this.at(this.pos,P)},wr.prototype.lookahead=function(P){return P===void 0&&(P=!1),this.at(this.nextIndex(this.pos,P),P)},wr.prototype.advance=function(P){P===void 0&&(P=!1),this.pos=this.nextIndex(this.pos,P)},wr.prototype.eat=function(P,J){return J===void 0&&(J=!1),this.current(J)===P?(this.advance(J),!0):!1},wr.prototype.eatChars=function(P,J){J===void 0&&(J=!1);for(var pe=this.pos,Ee=0,We=P;Ee<We.length;Ee+=1){var Ke=We[Ee],pt=this.at(pe,J);if(pt===-1||pt!==Ke)return!1;pe=this.nextIndex(pe,J)}return this.pos=pe,!0},mt.validateRegExpFlags=function(d){for(var P=d.validFlags,J=d.flags,pe=!1,Ee=!1,We=0;We<J.length;We++){var Ke=J.charAt(We);P.indexOf(Ke)===-1&&this.raise(d.start,"Invalid regular expression flag"),J.indexOf(Ke,We+1)>-1&&this.raise(d.start,"Duplicate regular expression flag"),Ke==="u"&&(pe=!0),Ke==="v"&&(Ee=!0)}this.options.ecmaVersion>=15&&pe&&Ee&&this.raise(d.start,"Invalid regular expression flag")};function pi(d){for(var P in d)return!0;return!1}mt.validateRegExpPattern=function(d){this.regexp_pattern(d),!d.switchN&&this.options.ecmaVersion>=9&&pi(d.groupNames)&&(d.switchN=!0,this.regexp_pattern(d))},mt.regexp_pattern=function(d){d.pos=0,d.lastIntValue=0,d.lastStringValue="",d.lastAssertionIsQuantifiable=!1,d.numCapturingParens=0,d.maxBackReference=0,d.groupNames=Object.create(null),d.backReferenceNames.length=0,d.branchID=null,this.regexp_disjunction(d),d.pos!==d.source.length&&(d.eat(41)&&d.raise("Unmatched ')'"),(d.eat(93)||d.eat(125))&&d.raise("Lone quantifier brackets")),d.maxBackReference>d.numCapturingParens&&d.raise("Invalid escape");for(var P=0,J=d.backReferenceNames;P<J.length;P+=1){var pe=J[P];d.groupNames[pe]||d.raise("Invalid named capture referenced")}},mt.regexp_disjunction=function(d){var P=this.options.ecmaVersion>=16;for(P&&(d.branchID=new pr(d.branchID,null)),this.regexp_alternative(d);d.eat(124);)P&&(d.branchID=d.branchID.sibling()),this.regexp_alternative(d);P&&(d.branchID=d.branchID.parent),this.regexp_eatQuantifier(d,!0)&&d.raise("Nothing to repeat"),d.eat(123)&&d.raise("Lone quantifier brackets")},mt.regexp_alternative=function(d){for(;d.pos<d.source.length&&this.regexp_eatTerm(d););},mt.regexp_eatTerm=function(d){return this.regexp_eatAssertion(d)?(d.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(d)&&d.switchU&&d.raise("Invalid quantifier"),!0):(d.switchU?this.regexp_eatAtom(d):this.regexp_eatExtendedAtom(d))?(this.regexp_eatQuantifier(d),!0):!1},mt.regexp_eatAssertion=function(d){var P=d.pos;if(d.lastAssertionIsQuantifiable=!1,d.eat(94)||d.eat(36))return!0;if(d.eat(92)){if(d.eat(66)||d.eat(98))return!0;d.pos=P}if(d.eat(40)&&d.eat(63)){var J=!1;if(this.options.ecmaVersion>=9&&(J=d.eat(60)),d.eat(61)||d.eat(33))return this.regexp_disjunction(d),d.eat(41)||d.raise("Unterminated group"),d.lastAssertionIsQuantifiable=!J,!0}return d.pos=P,!1},mt.regexp_eatQuantifier=function(d,P){return P===void 0&&(P=!1),this.regexp_eatQuantifierPrefix(d,P)?(d.eat(63),!0):!1},mt.regexp_eatQuantifierPrefix=function(d,P){return d.eat(42)||d.eat(43)||d.eat(63)||this.regexp_eatBracedQuantifier(d,P)},mt.regexp_eatBracedQuantifier=function(d,P){var J=d.pos;if(d.eat(123)){var pe=0,Ee=-1;if(this.regexp_eatDecimalDigits(d)&&(pe=d.lastIntValue,d.eat(44)&&this.regexp_eatDecimalDigits(d)&&(Ee=d.lastIntValue),d.eat(125)))return Ee!==-1&&Ee<pe&&!P&&d.raise("numbers out of order in {} quantifier"),!0;d.switchU&&!P&&d.raise("Incomplete quantifier"),d.pos=J}return!1},mt.regexp_eatAtom=function(d){return this.regexp_eatPatternCharacters(d)||d.eat(46)||this.regexp_eatReverseSolidusAtomEscape(d)||this.regexp_eatCharacterClass(d)||this.regexp_eatUncapturingGroup(d)||this.regexp_eatCapturingGroup(d)},mt.regexp_eatReverseSolidusAtomEscape=function(d){var P=d.pos;if(d.eat(92)){if(this.regexp_eatAtomEscape(d))return!0;d.pos=P}return!1},mt.regexp_eatUncapturingGroup=function(d){var P=d.pos;if(d.eat(40)){if(d.eat(63)){if(this.options.ecmaVersion>=16){var J=this.regexp_eatModifiers(d),pe=d.eat(45);if(J||pe){for(var Ee=0;Ee<J.length;Ee++){var We=J.charAt(Ee);J.indexOf(We,Ee+1)>-1&&d.raise("Duplicate regular expression modifiers")}if(pe){var Ke=this.regexp_eatModifiers(d);!J&&!Ke&&d.current()===58&&d.raise("Invalid regular expression modifiers");for(var pt=0;pt<Ke.length;pt++){var yt=Ke.charAt(pt);(Ke.indexOf(yt,pt+1)>-1||J.indexOf(yt)>-1)&&d.raise("Duplicate regular expression modifiers")}}}}if(d.eat(58)){if(this.regexp_disjunction(d),d.eat(41))return!0;d.raise("Unterminated group")}}d.pos=P}return!1},mt.regexp_eatCapturingGroup=function(d){if(d.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(d):d.current()===63&&d.raise("Invalid group"),this.regexp_disjunction(d),d.eat(41))return d.numCapturingParens+=1,!0;d.raise("Unterminated group")}return!1},mt.regexp_eatModifiers=function(d){for(var P="",J=0;(J=d.current())!==-1&&Gr(J);)P+=H(J),d.advance();return P};function Gr(d){return d===105||d===109||d===115}mt.regexp_eatExtendedAtom=function(d){return d.eat(46)||this.regexp_eatReverseSolidusAtomEscape(d)||this.regexp_eatCharacterClass(d)||this.regexp_eatUncapturingGroup(d)||this.regexp_eatCapturingGroup(d)||this.regexp_eatInvalidBracedQuantifier(d)||this.regexp_eatExtendedPatternCharacter(d)},mt.regexp_eatInvalidBracedQuantifier=function(d){return this.regexp_eatBracedQuantifier(d,!0)&&d.raise("Nothing to repeat"),!1},mt.regexp_eatSyntaxCharacter=function(d){var P=d.current();return gi(P)?(d.lastIntValue=P,d.advance(),!0):!1};function gi(d){return d===36||d>=40&&d<=43||d===46||d===63||d>=91&&d<=94||d>=123&&d<=125}mt.regexp_eatPatternCharacters=function(d){for(var P=d.pos,J=0;(J=d.current())!==-1&&!gi(J);)d.advance();return d.pos!==P},mt.regexp_eatExtendedPatternCharacter=function(d){var P=d.current();return P!==-1&&P!==36&&!(P>=40&&P<=43)&&P!==46&&P!==63&&P!==91&&P!==94&&P!==124?(d.advance(),!0):!1},mt.regexp_groupSpecifier=function(d){if(d.eat(63)){this.regexp_eatGroupName(d)||d.raise("Invalid group");var P=this.options.ecmaVersion>=16,J=d.groupNames[d.lastStringValue];if(J)if(P)for(var pe=0,Ee=J;pe<Ee.length;pe+=1){var We=Ee[pe];We.separatedFrom(d.branchID)||d.raise("Duplicate capture group name")}else d.raise("Duplicate capture group name");P?(J||(d.groupNames[d.lastStringValue]=[])).push(d.branchID):d.groupNames[d.lastStringValue]=!0}},mt.regexp_eatGroupName=function(d){if(d.lastStringValue="",d.eat(60)){if(this.regexp_eatRegExpIdentifierName(d)&&d.eat(62))return!0;d.raise("Invalid capture group name")}return!1},mt.regexp_eatRegExpIdentifierName=function(d){if(d.lastStringValue="",this.regexp_eatRegExpIdentifierStart(d)){for(d.lastStringValue+=H(d.lastIntValue);this.regexp_eatRegExpIdentifierPart(d);)d.lastStringValue+=H(d.lastIntValue);return!0}return!1},mt.regexp_eatRegExpIdentifierStart=function(d){var P=d.pos,J=this.options.ecmaVersion>=11,pe=d.current(J);return d.advance(J),pe===92&&this.regexp_eatRegExpUnicodeEscapeSequence(d,J)&&(pe=d.lastIntValue),Zi(pe)?(d.lastIntValue=pe,!0):(d.pos=P,!1)};function Zi(d){return w(d,!0)||d===36||d===95}mt.regexp_eatRegExpIdentifierPart=function(d){var P=d.pos,J=this.options.ecmaVersion>=11,pe=d.current(J);return d.advance(J),pe===92&&this.regexp_eatRegExpUnicodeEscapeSequence(d,J)&&(pe=d.lastIntValue),xi(pe)?(d.lastIntValue=pe,!0):(d.pos=P,!1)};function xi(d){return p(d,!0)||d===36||d===95||d===8204||d===8205}mt.regexp_eatAtomEscape=function(d){return this.regexp_eatBackReference(d)||this.regexp_eatCharacterClassEscape(d)||this.regexp_eatCharacterEscape(d)||d.switchN&&this.regexp_eatKGroupName(d)?!0:(d.switchU&&(d.current()===99&&d.raise("Invalid unicode escape"),d.raise("Invalid escape")),!1)},mt.regexp_eatBackReference=function(d){var P=d.pos;if(this.regexp_eatDecimalEscape(d)){var J=d.lastIntValue;if(d.switchU)return J>d.maxBackReference&&(d.maxBackReference=J),!0;if(J<=d.numCapturingParens)return!0;d.pos=P}return!1},mt.regexp_eatKGroupName=function(d){if(d.eat(107)){if(this.regexp_eatGroupName(d))return d.backReferenceNames.push(d.lastStringValue),!0;d.raise("Invalid named reference")}return!1},mt.regexp_eatCharacterEscape=function(d){return this.regexp_eatControlEscape(d)||this.regexp_eatCControlLetter(d)||this.regexp_eatZero(d)||this.regexp_eatHexEscapeSequence(d)||this.regexp_eatRegExpUnicodeEscapeSequence(d,!1)||!d.switchU&&this.regexp_eatLegacyOctalEscapeSequence(d)||this.regexp_eatIdentityEscape(d)},mt.regexp_eatCControlLetter=function(d){var P=d.pos;if(d.eat(99)){if(this.regexp_eatControlLetter(d))return!0;d.pos=P}return!1},mt.regexp_eatZero=function(d){return d.current()===48&&!Ji(d.lookahead())?(d.lastIntValue=0,d.advance(),!0):!1},mt.regexp_eatControlEscape=function(d){var P=d.current();return P===116?(d.lastIntValue=9,d.advance(),!0):P===110?(d.lastIntValue=10,d.advance(),!0):P===118?(d.lastIntValue=11,d.advance(),!0):P===102?(d.lastIntValue=12,d.advance(),!0):P===114?(d.lastIntValue=13,d.advance(),!0):!1},mt.regexp_eatControlLetter=function(d){var P=d.current();return vi(P)?(d.lastIntValue=P%32,d.advance(),!0):!1};function vi(d){return d>=65&&d<=90||d>=97&&d<=122}mt.regexp_eatRegExpUnicodeEscapeSequence=function(d,P){P===void 0&&(P=!1);var J=d.pos,pe=P||d.switchU;if(d.eat(117)){if(this.regexp_eatFixedHexDigits(d,4)){var Ee=d.lastIntValue;if(pe&&Ee>=55296&&Ee<=56319){var We=d.pos;if(d.eat(92)&&d.eat(117)&&this.regexp_eatFixedHexDigits(d,4)){var Ke=d.lastIntValue;if(Ke>=56320&&Ke<=57343)return d.lastIntValue=(Ee-55296)*1024+(Ke-56320)+65536,!0}d.pos=We,d.lastIntValue=Ee}return!0}if(pe&&d.eat(123)&&this.regexp_eatHexDigits(d)&&d.eat(125)&&mi(d.lastIntValue))return!0;pe&&d.raise("Invalid unicode escape"),d.pos=J}return!1};function mi(d){return d>=0&&d<=1114111}mt.regexp_eatIdentityEscape=function(d){if(d.switchU)return this.regexp_eatSyntaxCharacter(d)?!0:d.eat(47)?(d.lastIntValue=47,!0):!1;var P=d.current();return P!==99&&(!d.switchN||P!==107)?(d.lastIntValue=P,d.advance(),!0):!1},mt.regexp_eatDecimalEscape=function(d){d.lastIntValue=0;var P=d.current();if(P>=49&&P<=57){do d.lastIntValue=10*d.lastIntValue+(P-48),d.advance();while((P=d.current())>=48&&P<=57);return!0}return!1};var si=0,Yr=1,Lr=2;mt.regexp_eatCharacterClassEscape=function(d){var P=d.current();if(Rs(P))return d.lastIntValue=-1,d.advance(),Yr;var J=!1;if(d.switchU&&this.options.ecmaVersion>=9&&((J=P===80)||P===112)){d.lastIntValue=-1,d.advance();var pe;if(d.eat(123)&&(pe=this.regexp_eatUnicodePropertyValueExpression(d))&&d.eat(125))return J&&pe===Lr&&d.raise("Invalid property name"),pe;d.raise("Invalid property name")}return si};function Rs(d){return d===100||d===68||d===115||d===83||d===119||d===87}mt.regexp_eatUnicodePropertyValueExpression=function(d){var P=d.pos;if(this.regexp_eatUnicodePropertyName(d)&&d.eat(61)){var J=d.lastStringValue;if(this.regexp_eatUnicodePropertyValue(d)){var pe=d.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(d,J,pe),Yr}}if(d.pos=P,this.regexp_eatLoneUnicodePropertyNameOrValue(d)){var Ee=d.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(d,Ee)}return si},mt.regexp_validateUnicodePropertyNameAndValue=function(d,P,J){ne(d.unicodeProperties.nonBinary,P)||d.raise("Invalid property name"),d.unicodeProperties.nonBinary[P].test(J)||d.raise("Invalid property value")},mt.regexp_validateUnicodePropertyNameOrValue=function(d,P){if(d.unicodeProperties.binary.test(P))return Yr;if(d.switchV&&d.unicodeProperties.binaryOfStrings.test(P))return Lr;d.raise("Invalid property name")},mt.regexp_eatUnicodePropertyName=function(d){var P=0;for(d.lastStringValue="";Bs(P=d.current());)d.lastStringValue+=H(P),d.advance();return d.lastStringValue!==""};function Bs(d){return vi(d)||d===95}mt.regexp_eatUnicodePropertyValue=function(d){var P=0;for(d.lastStringValue="";aa(P=d.current());)d.lastStringValue+=H(P),d.advance();return d.lastStringValue!==""};function aa(d){return Bs(d)||Ji(d)}mt.regexp_eatLoneUnicodePropertyNameOrValue=function(d){return this.regexp_eatUnicodePropertyValue(d)},mt.regexp_eatCharacterClass=function(d){if(d.eat(91)){var P=d.eat(94),J=this.regexp_classContents(d);return d.eat(93)||d.raise("Unterminated character class"),P&&J===Lr&&d.raise("Negated character class may contain strings"),!0}return!1},mt.regexp_classContents=function(d){return d.current()===93?Yr:d.switchV?this.regexp_classSetExpression(d):(this.regexp_nonEmptyClassRanges(d),Yr)},mt.regexp_nonEmptyClassRanges=function(d){for(;this.regexp_eatClassAtom(d);){var P=d.lastIntValue;if(d.eat(45)&&this.regexp_eatClassAtom(d)){var J=d.lastIntValue;d.switchU&&(P===-1||J===-1)&&d.raise("Invalid character class"),P!==-1&&J!==-1&&P>J&&d.raise("Range out of order in character class")}}},mt.regexp_eatClassAtom=function(d){var P=d.pos;if(d.eat(92)){if(this.regexp_eatClassEscape(d))return!0;if(d.switchU){var J=d.current();(J===99||Dn(J))&&d.raise("Invalid class escape"),d.raise("Invalid escape")}d.pos=P}var pe=d.current();return pe!==93?(d.lastIntValue=pe,d.advance(),!0):!1},mt.regexp_eatClassEscape=function(d){var P=d.pos;if(d.eat(98))return d.lastIntValue=8,!0;if(d.switchU&&d.eat(45))return d.lastIntValue=45,!0;if(!d.switchU&&d.eat(99)){if(this.regexp_eatClassControlLetter(d))return!0;d.pos=P}return this.regexp_eatCharacterClassEscape(d)||this.regexp_eatCharacterEscape(d)},mt.regexp_classSetExpression=function(d){var P=Yr,J;if(!this.regexp_eatClassSetRange(d))if(J=this.regexp_eatClassSetOperand(d)){J===Lr&&(P=Lr);for(var pe=d.pos;d.eatChars([38,38]);){if(d.current()!==38&&(J=this.regexp_eatClassSetOperand(d))){J!==Lr&&(P=Yr);continue}d.raise("Invalid character in character class")}if(pe!==d.pos)return P;for(;d.eatChars([45,45]);)this.regexp_eatClassSetOperand(d)||d.raise("Invalid character in character class");if(pe!==d.pos)return P}else d.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(d)){if(J=this.regexp_eatClassSetOperand(d),!J)return P;J===Lr&&(P=Lr)}},mt.regexp_eatClassSetRange=function(d){var P=d.pos;if(this.regexp_eatClassSetCharacter(d)){var J=d.lastIntValue;if(d.eat(45)&&this.regexp_eatClassSetCharacter(d)){var pe=d.lastIntValue;return J!==-1&&pe!==-1&&J>pe&&d.raise("Range out of order in character class"),!0}d.pos=P}return!1},mt.regexp_eatClassSetOperand=function(d){return this.regexp_eatClassSetCharacter(d)?Yr:this.regexp_eatClassStringDisjunction(d)||this.regexp_eatNestedClass(d)},mt.regexp_eatNestedClass=function(d){var P=d.pos;if(d.eat(91)){var J=d.eat(94),pe=this.regexp_classContents(d);if(d.eat(93))return J&&pe===Lr&&d.raise("Negated character class may contain strings"),pe;d.pos=P}if(d.eat(92)){var Ee=this.regexp_eatCharacterClassEscape(d);if(Ee)return Ee;d.pos=P}return null},mt.regexp_eatClassStringDisjunction=function(d){var P=d.pos;if(d.eatChars([92,113])){if(d.eat(123)){var J=this.regexp_classStringDisjunctionContents(d);if(d.eat(125))return J}else d.raise("Invalid escape");d.pos=P}return null},mt.regexp_classStringDisjunctionContents=function(d){for(var P=this.regexp_classString(d);d.eat(124);)this.regexp_classString(d)===Lr&&(P=Lr);return P},mt.regexp_classString=function(d){for(var P=0;this.regexp_eatClassSetCharacter(d);)P++;return P===1?Yr:Lr},mt.regexp_eatClassSetCharacter=function(d){var P=d.pos;if(d.eat(92))return this.regexp_eatCharacterEscape(d)||this.regexp_eatClassSetReservedPunctuator(d)?!0:d.eat(98)?(d.lastIntValue=8,!0):(d.pos=P,!1);var J=d.current();return J<0||J===d.lookahead()&&qs(J)||Ha(J)?!1:(d.advance(),d.lastIntValue=J,!0)};function qs(d){return d===33||d>=35&&d<=38||d>=42&&d<=44||d===46||d>=58&&d<=64||d===94||d===96||d===126}function Ha(d){return d===40||d===41||d===45||d===47||d>=91&&d<=93||d>=123&&d<=125}mt.regexp_eatClassSetReservedPunctuator=function(d){var P=d.current();return oa(P)?(d.lastIntValue=P,d.advance(),!0):!1};function oa(d){return d===33||d===35||d===37||d===38||d===44||d===45||d>=58&&d<=62||d===64||d===96||d===126}mt.regexp_eatClassControlLetter=function(d){var P=d.current();return Ji(P)||P===95?(d.lastIntValue=P%32,d.advance(),!0):!1},mt.regexp_eatHexEscapeSequence=function(d){var P=d.pos;if(d.eat(120)){if(this.regexp_eatFixedHexDigits(d,2))return!0;d.switchU&&d.raise("Invalid escape"),d.pos=P}return!1},mt.regexp_eatDecimalDigits=function(d){var P=d.pos,J=0;for(d.lastIntValue=0;Ji(J=d.current());)d.lastIntValue=10*d.lastIntValue+(J-48),d.advance();return d.pos!==P};function Ji(d){return d>=48&&d<=57}mt.regexp_eatHexDigits=function(d){var P=d.pos,J=0;for(d.lastIntValue=0;On(J=d.current());)d.lastIntValue=16*d.lastIntValue+Fi(J),d.advance();return d.pos!==P};function On(d){return d>=48&&d<=57||d>=65&&d<=70||d>=97&&d<=102}function Fi(d){return d>=65&&d<=70?10+(d-65):d>=97&&d<=102?10+(d-97):d-48}mt.regexp_eatLegacyOctalEscapeSequence=function(d){if(this.regexp_eatOctalDigit(d)){var P=d.lastIntValue;if(this.regexp_eatOctalDigit(d)){var J=d.lastIntValue;P<=3&&this.regexp_eatOctalDigit(d)?d.lastIntValue=P*64+J*8+d.lastIntValue:d.lastIntValue=P*8+J}else d.lastIntValue=P;return!0}return!1},mt.regexp_eatOctalDigit=function(d){var P=d.current();return Dn(P)?(d.lastIntValue=P-48,d.advance(),!0):(d.lastIntValue=0,!1)};function Dn(d){return d>=48&&d<=55}mt.regexp_eatFixedHexDigits=function(d,P){var J=d.pos;d.lastIntValue=0;for(var pe=0;pe<P;++pe){var Ee=d.current();if(!On(Ee))return d.pos=J,!1;d.lastIntValue=16*d.lastIntValue+Fi(Ee),d.advance()}return!0};var zi=function(P){this.type=P.type,this.value=P.value,this.start=P.start,this.end=P.end,P.options.locations&&(this.loc=new Te(P,P.startLoc,P.endLoc)),P.options.ranges&&(this.range=[P.start,P.end])},Qt=r.prototype;Qt.next=function(d){!d&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new zi(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Qt.getToken=function(){return this.next(),new zi(this)},typeof Symbol<"u"&&(Qt[Symbol.iterator]=function(){var d=this;return{next:function(){var P=d.getToken();return{done:P.type===D.eof,value:P}}}}),Qt.nextToken=function(){var d=this.curContext();if((!d||!d.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(D.eof);if(d.override)return d.override(this);this.readToken(this.fullCharCodeAtPos())},Qt.readToken=function(d){return w(d,this.options.ecmaVersion>=6)||d===92?this.readWord():this.getTokenFromCode(d)},Qt.fullCharCodeAtPos=function(){var d=this.input.charCodeAt(this.pos);if(d<=55295||d>=56320)return d;var P=this.input.charCodeAt(this.pos+1);return P<=56319||P>=57344?d:(d<<10)+P-56613888},Qt.skipBlockComment=function(){var d=this.options.onComment&&this.curPosition(),P=this.pos,J=this.input.indexOf("*/",this.pos+=2);if(J===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=J+2,this.options.locations)for(var pe=void 0,Ee=P;(pe=he(this.input,Ee,this.pos))>-1;)++this.curLine,Ee=this.lineStart=pe;this.options.onComment&&this.options.onComment(!0,this.input.slice(P+2,J),P,this.pos,d,this.curPosition())},Qt.skipLineComment=function(d){for(var P=this.pos,J=this.options.onComment&&this.curPosition(),pe=this.input.charCodeAt(this.pos+=d);this.pos<this.input.length&&!ie(pe);)pe=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(P+d,this.pos),P,this.pos,J,this.curPosition())},Qt.skipSpace=function(){e:for(;this.pos<this.input.length;){var d=this.input.charCodeAt(this.pos);switch(d){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(d>8&&d<14||d>=5760&&ae.test(String.fromCharCode(d)))++this.pos;else break e}}},Qt.finishToken=function(d,P){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var J=this.type;this.type=d,this.value=P,this.updateContext(J)},Qt.readToken_dot=function(){var d=this.input.charCodeAt(this.pos+1);if(d>=48&&d<=57)return this.readNumber(!0);var P=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&d===46&&P===46?(this.pos+=3,this.finishToken(D.ellipsis)):(++this.pos,this.finishToken(D.dot))},Qt.readToken_slash=function(){var d=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):d===61?this.finishOp(D.assign,2):this.finishOp(D.slash,1)},Qt.readToken_mult_modulo_exp=function(d){var P=this.input.charCodeAt(this.pos+1),J=1,pe=d===42?D.star:D.modulo;return this.options.ecmaVersion>=7&&d===42&&P===42&&(++J,pe=D.starstar,P=this.input.charCodeAt(this.pos+2)),P===61?this.finishOp(D.assign,J+1):this.finishOp(pe,J)},Qt.readToken_pipe_amp=function(d){var P=this.input.charCodeAt(this.pos+1);if(P===d){if(this.options.ecmaVersion>=12){var J=this.input.charCodeAt(this.pos+2);if(J===61)return this.finishOp(D.assign,3)}return this.finishOp(d===124?D.logicalOR:D.logicalAND,2)}return P===61?this.finishOp(D.assign,2):this.finishOp(d===124?D.bitwiseOR:D.bitwiseAND,1)},Qt.readToken_caret=function(){var d=this.input.charCodeAt(this.pos+1);return d===61?this.finishOp(D.assign,2):this.finishOp(D.bitwiseXOR,1)},Qt.readToken_plus_min=function(d){var P=this.input.charCodeAt(this.pos+1);return P===d?P===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||me.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(D.incDec,2):P===61?this.finishOp(D.assign,2):this.finishOp(D.plusMin,1)},Qt.readToken_lt_gt=function(d){var P=this.input.charCodeAt(this.pos+1),J=1;return P===d?(J=d===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+J)===61?this.finishOp(D.assign,J+1):this.finishOp(D.bitShift,J)):P===33&&d===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(P===61&&(J=2),this.finishOp(D.relational,J))},Qt.readToken_eq_excl=function(d){var P=this.input.charCodeAt(this.pos+1);return P===61?this.finishOp(D.equality,this.input.charCodeAt(this.pos+2)===61?3:2):d===61&&P===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(D.arrow)):this.finishOp(d===61?D.eq:D.prefix,1)},Qt.readToken_question=function(){var d=this.options.ecmaVersion;if(d>=11){var P=this.input.charCodeAt(this.pos+1);if(P===46){var J=this.input.charCodeAt(this.pos+2);if(J<48||J>57)return this.finishOp(D.questionDot,2)}if(P===63){if(d>=12){var pe=this.input.charCodeAt(this.pos+2);if(pe===61)return this.finishOp(D.assign,3)}return this.finishOp(D.coalesce,2)}}return this.finishOp(D.question,1)},Qt.readToken_numberSign=function(){var d=this.options.ecmaVersion,P=35;if(d>=13&&(++this.pos,P=this.fullCharCodeAtPos(),w(P,!0)||P===92))return this.finishToken(D.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+H(P)+"'")},Qt.getTokenFromCode=function(d){switch(d){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(D.parenL);case 41:return++this.pos,this.finishToken(D.parenR);case 59:return++this.pos,this.finishToken(D.semi);case 44:return++this.pos,this.finishToken(D.comma);case 91:return++this.pos,this.finishToken(D.bracketL);case 93:return++this.pos,this.finishToken(D.bracketR);case 123:return++this.pos,this.finishToken(D.braceL);case 125:return++this.pos,this.finishToken(D.braceR);case 58:return++this.pos,this.finishToken(D.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(D.backQuote);case 48:var P=this.input.charCodeAt(this.pos+1);if(P===120||P===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(P===111||P===79)return this.readRadixNumber(8);if(P===98||P===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(d);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(d);case 124:case 38:return this.readToken_pipe_amp(d);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(d);case 60:case 62:return this.readToken_lt_gt(d);case 61:case 33:return this.readToken_eq_excl(d);case 63:return this.readToken_question();case 126:return this.finishOp(D.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+H(d)+"'")},Qt.finishOp=function(d,P){var J=this.input.slice(this.pos,this.pos+P);return this.pos+=P,this.finishToken(d,J)},Qt.readRegexp=function(){for(var d,P,J=this.pos;;){this.pos>=this.input.length&&this.raise(J,"Unterminated regular expression");var pe=this.input.charAt(this.pos);if(me.test(pe)&&this.raise(J,"Unterminated regular expression"),d)d=!1;else{if(pe==="[")P=!0;else if(pe==="]"&&P)P=!1;else if(pe==="/"&&!P)break;d=pe==="\\"}++this.pos}var Ee=this.input.slice(J,this.pos);++this.pos;var We=this.pos,Ke=this.readWord1();this.containsEsc&&this.unexpected(We);var pt=this.regexpState||(this.regexpState=new wr(this));pt.reset(J,Ee,Ke),this.validateRegExpFlags(pt),this.validateRegExpPattern(pt);var yt=null;try{yt=new RegExp(Ee,Ke)}catch{}return this.finishToken(D.regexp,{pattern:Ee,flags:Ke,value:yt})},Qt.readInt=function(d,P,J){for(var pe=this.options.ecmaVersion>=12&&P===void 0,Ee=J&&this.input.charCodeAt(this.pos)===48,We=this.pos,Ke=0,pt=0,yt=0,Zt=P??1/0;yt<Zt;++yt,++this.pos){var Gt=this.input.charCodeAt(this.pos),jt=void 0;if(pe&&Gt===95){Ee&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),pt===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),yt===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),pt=Gt;continue}if(Gt>=97?jt=Gt-97+10:Gt>=65?jt=Gt-65+10:Gt>=48&&Gt<=57?jt=Gt-48:jt=1/0,jt>=d)break;pt=Gt,Ke=Ke*d+jt}return pe&&pt===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===We||P!=null&&this.pos-We!==P?null:Ke};function Ni(d,P){return P?parseInt(d,8):parseFloat(d.replace(/_/g,""))}function wi(d){return typeof BigInt!="function"?null:BigInt(d.replace(/_/g,""))}Qt.readRadixNumber=function(d){var P=this.pos;this.pos+=2;var J=this.readInt(d);return J==null&&this.raise(this.start+2,"Expected number in radix "+d),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(J=wi(this.input.slice(P,this.pos)),++this.pos):w(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(D.num,J)},Qt.readNumber=function(d){var P=this.pos;!d&&this.readInt(10,void 0,!0)===null&&this.raise(P,"Invalid number");var J=this.pos-P>=2&&this.input.charCodeAt(P)===48;J&&this.strict&&this.raise(P,"Invalid number");var pe=this.input.charCodeAt(this.pos);if(!J&&!d&&this.options.ecmaVersion>=11&&pe===110){var Ee=wi(this.input.slice(P,this.pos));return++this.pos,w(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(D.num,Ee)}J&&/[89]/.test(this.input.slice(P,this.pos))&&(J=!1),pe===46&&!J&&(++this.pos,this.readInt(10),pe=this.input.charCodeAt(this.pos)),(pe===69||pe===101)&&!J&&(pe=this.input.charCodeAt(++this.pos),(pe===43||pe===45)&&++this.pos,this.readInt(10)===null&&this.raise(P,"Invalid number")),w(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var We=Ni(this.input.slice(P,this.pos),J);return this.finishToken(D.num,We)},Qt.readCodePoint=function(){var d=this.input.charCodeAt(this.pos),P;if(d===123){this.options.ecmaVersion<6&&this.unexpected();var J=++this.pos;P=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,P>1114111&&this.invalidStringToken(J,"Code point out of bounds")}else P=this.readHexChar(4);return P},Qt.readString=function(d){for(var P="",J=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var pe=this.input.charCodeAt(this.pos);if(pe===d)break;pe===92?(P+=this.input.slice(J,this.pos),P+=this.readEscapedChar(!1),J=this.pos):pe===8232||pe===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(ie(pe)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return P+=this.input.slice(J,this.pos++),this.finishToken(D.string,P)};var Li={};Qt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(d){if(d===Li)this.readInvalidTemplateToken();else throw d}this.inTemplateElement=!1},Qt.invalidStringToken=function(d,P){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Li;this.raise(d,P)},Qt.readTmplToken=function(){for(var d="",P=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var J=this.input.charCodeAt(this.pos);if(J===96||J===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===D.template||this.type===D.invalidTemplate)?J===36?(this.pos+=2,this.finishToken(D.dollarBraceL)):(++this.pos,this.finishToken(D.backQuote)):(d+=this.input.slice(P,this.pos),this.finishToken(D.template,d));if(J===92)d+=this.input.slice(P,this.pos),d+=this.readEscapedChar(!0),P=this.pos;else if(ie(J)){switch(d+=this.input.slice(P,this.pos),++this.pos,J){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:d+=`
68
+ `;break;default:d+=String.fromCharCode(J);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),P=this.pos}else++this.pos}},Qt.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(D.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
69
+ `&&++this.pos;case`
70
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},Qt.readEscapedChar=function(d){var P=this.input.charCodeAt(++this.pos);switch(++this.pos,P){case 110:return`
71
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return H(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),d){var J=this.pos-1;this.invalidStringToken(J,"Invalid escape sequence in template string")}default:if(P>=48&&P<=55){var pe=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Ee=parseInt(pe,8);return Ee>255&&(pe=pe.slice(0,-1),Ee=parseInt(pe,8)),this.pos+=pe.length-1,P=this.input.charCodeAt(this.pos),(pe!=="0"||P===56||P===57)&&(this.strict||d)&&this.invalidStringToken(this.pos-1-pe.length,d?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(Ee)}return ie(P)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(P)}},Qt.readHexChar=function(d){var P=this.pos,J=this.readInt(16,d);return J===null&&this.invalidStringToken(P,"Bad character escape sequence"),J},Qt.readWord1=function(){this.containsEsc=!1;for(var d="",P=!0,J=this.pos,pe=this.options.ecmaVersion>=6;this.pos<this.input.length;){var Ee=this.fullCharCodeAtPos();if(p(Ee,pe))this.pos+=Ee<=65535?1:2;else if(Ee===92){this.containsEsc=!0,d+=this.input.slice(J,this.pos);var We=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var Ke=this.readCodePoint();(P?w:p)(Ke,pe)||this.invalidStringToken(We,"Invalid Unicode escape"),d+=H(Ke),J=this.pos}else break;P=!1}return d+this.input.slice(J,this.pos)},Qt.readWord=function(){var d=this.readWord1(),P=D.name;return this.keywords.test(d)&&(P=V[d]),this.finishToken(P,d)};var Ci="8.14.0";r.acorn={Parser:r,version:Ci,defaultOptions:Ie,Position:_e,SourceLocation:Te,getLineInfo:Re,Node:Me,TokenType:E,tokTypes:D,keywordTypes:V,TokContext:te,tokContexts:oe,isIdentifierChar:p,isIdentifierStart:w,Token:zi,isNewLine:ie,lineBreak:me,lineBreakG:B,nonASCIIwhitespace:ae};function Rn(d,P){return r.parse(d,P)}function la(d,P,J){return r.parseExpressionAt(d,P,J)}function ca(d,P){return r.tokenizer(d,P)}n.Node=Me,n.Parser=r,n.Position=_e,n.SourceLocation=Te,n.TokContext=te,n.Token=zi,n.TokenType=E,n.defaultOptions=Ie,n.getLineInfo=Re,n.isIdentifierChar=p,n.isIdentifierStart=w,n.isNewLine=ie,n.keywordTypes=V,n.lineBreak=me,n.lineBreakG=B,n.nonASCIIwhitespace=ae,n.parse=Rn,n.parseExpressionAt=la,n.tokContexts=oe,n.tokTypes=D,n.tokenizer=ca,n.version=Ci})}(s0,s0.exports)),s0.exports}/*!
72
+ * Paper.js v0.12.18 - The Swiss Army Knife of Vector Graphics Scripting.
73
+ * http://paperjs.org/
74
+ *
75
+ * Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
76
+ * http://juerglehni.com/ & https://puckey.studio/
77
+ *
78
+ * Distributed under the MIT license. See LICENSE file for details.
79
+ *
80
+ * All rights reserved.
81
+ *
82
+ * Date: Wed Jul 17 14:57:24 2024 +0200
83
+ *
84
+ ***
85
+ *
86
+ * Straps.js - Class inheritance library with support for bean-style accessors
87
+ *
88
+ * Copyright (c) 2006 - 2020 Jürg Lehni
89
+ * http://juerglehni.com/
90
+ *
91
+ * Distributed under the MIT license.
92
+ *
93
+ ***
94
+ *
95
+ * Acorn.js
96
+ * https://marijnhaverbeke.nl/acorn/
97
+ *
98
+ * Acorn is a tiny, fast JavaScript parser written in JavaScript,
99
+ * created by Marijn Haverbeke and released under an MIT license.
100
+ *
101
+ */var Ax=gl.exports,iv;function Tx(){return iv||(iv=1,function(e){(function(t,n){t=t||tv;var a=t.window,o=t.document,l=new function(){var r=/^(statics|enumerable|beans|preserve)$/,c=[],m=c.slice,x=Object.create,k=Object.getOwnPropertyDescriptor,T=Object.defineProperty,R=c.forEach||function(Q,j){for(var ce=0,te=this.length;ce<te;ce++)Q.call(j,this[ce],ce,this)},L=function(Q,j){for(var ce in this)this.hasOwnProperty(ce)&&Q.call(j,this[ce],ce,this)},q=Object.assign||function(Q){for(var j=1,ce=arguments.length;j<ce;j++){var te=arguments[j];for(var oe in te)te.hasOwnProperty(oe)&&(Q[oe]=te[oe])}return Q},z=function(Q,j,ce){if(Q){var te=k(Q,"length");(te&&typeof te.value=="number"?R:L).call(Q,j,ce=ce||Q)}return ce};function X(Q,j,ce,te,oe){var ee={};function re(ue,Ce){Ce=Ce||(Ce=k(j,ue))&&(Ce.get?Ce:Ce.value),typeof Ce=="string"&&Ce[0]==="#"&&(Ce=Q[Ce.substring(1)]||Ce);var Me=typeof Ce=="function",Ae=Ce,Oe=oe||Me&&!Ce.base?Ce&&Ce.get?ue in Q:Q[ue]:null,ke;(!oe||!Oe)&&(Me&&Oe&&(Ce.base=Oe),Me&&te!==!1&&(ke=ue.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(ee[ke[3].toLowerCase()+ke[4]]=ke[2]),(!Ae||Me||!Ae.get||typeof Ae.get!="function"||!Z.isPlainObject(Ae))&&(Ae={value:Ae,writable:!0}),(k(Q,ue)||{configurable:!0}).configurable&&(Ae.configurable=!0,Ae.enumerable=ce??!ke),T(Q,ue,Ae))}if(j){for(var K in j)j.hasOwnProperty(K)&&!r.test(K)&&re(K);for(var K in ee){var se=ee[K],de=Q["set"+se],ve=Q["get"+se]||de&&Q["is"+se];ve&&(te===!0||ve.length===0)&&re(K,{get:ve,set:de})}}return Q}function Z(){for(var Q=0,j=arguments.length;Q<j;Q++){var ce=arguments[Q];ce&&q(this,ce)}return this}return X(Z,{inject:function(Q){if(Q){var j=Q.statics===!0?Q:Q.statics,ce=Q.beans,te=Q.preserve;j!==Q&&X(this.prototype,Q,Q.enumerable,ce,te),X(this,j,null,ce,te)}for(var oe=1,ee=arguments.length;oe<ee;oe++)this.inject(arguments[oe]);return this},extend:function(){for(var Q=this,j,ce,te=0,oe,ee=arguments.length;te<ee&&!(j&&ce);te++)oe=arguments[te],j=j||oe.initialize,ce=ce||oe.prototype;return j=j||function(){Q.apply(this,arguments)},ce=j.prototype=ce||x(this.prototype),T(ce,"constructor",{value:j,writable:!0,configurable:!0}),X(j,this),arguments.length&&this.inject.apply(j,arguments),j.base=Q,j}}).inject({enumerable:!1,initialize:Z,set:Z,inject:function(){for(var Q=0,j=arguments.length;Q<j;Q++){var ce=arguments[Q];ce&&X(this,ce,ce.enumerable,ce.beans,ce.preserve)}return this},extend:function(){var Q=x(this);return Q.inject.apply(Q,arguments)},each:function(Q,j){return z(this,Q,j)},clone:function(){return new this.constructor(this)},statics:{set:q,each:z,create:x,define:T,describe:k,clone:function(Q){return q(new Q.constructor,Q)},isPlainObject:function(Q){var j=Q!=null&&Q.constructor;return j&&(j===Object||j===Z||j.name==="Object")},pick:function(Q,j){return Q!==n?Q:j},slice:function(Q,j,ce){return m.call(Q,j,ce)}}})};e.exports=l,l.inject({enumerable:!1,toString:function(){return this._id!=null?(this._class||"Object")+(this._name?" '"+this._name+"'":" @"+this._id):"{ "+l.each(this,function(r,c){if(!/^_/.test(c)){var m=typeof r;this.push(c+": "+(m==="number"?M.instance.number(r):m==="string"?"'"+r+"'":r))}},[]).join(", ")+" }"},getClassName:function(){return this._class||""},importJSON:function(r){return l.importJSON(r,this)},exportJSON:function(r){return l.exportJSON(this,r)},toJSON:function(){return l.serialize(this)},set:function(r,c){return r&&l.filter(this,r,c,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function r(){var c=r.base.apply(this,arguments),m=c.prototype._class;return m&&!l.exports[m]&&(l.exports[m]=c),c},equals:function(r,c){if(r===c)return!0;if(r&&r.equals)return r.equals(c);if(c&&c.equals)return c.equals(r);if(r&&c&&typeof r=="object"&&typeof c=="object"){if(Array.isArray(r)&&Array.isArray(c)){var m=r.length;if(m!==c.length)return!1;for(;m--;)if(!l.equals(r[m],c[m]))return!1}else{var x=Object.keys(r),m=x.length;if(m!==Object.keys(c).length)return!1;for(;m--;){var k=x[m];if(!(c.hasOwnProperty(k)&&l.equals(r[k],c[k])))return!1}}return!0}return!1},read:function(r,c,m,x){if(this===l){var k=this.peek(r,c);return r.__index++,k}var T=this.prototype,R=T._readIndex,L=c||R&&r.__index||0,q=r.length,z=r[L];if(x=x||q-L,z instanceof this||m&&m.readNull&&z==null&&x<=1)return R&&(r.__index=L+1),z&&m&&m.clone?z.clone():z;if(z=l.create(T),R&&(z.__read=!0),z=z.initialize.apply(z,L>0||L+x<q?l.slice(r,L,L+x):r)||z,R){r.__index=L+z.__read;var X=z.__filtered;X&&(r.__filtered=X,z.__filtered=n),z.__read=n}return z},peek:function(r,c){return r[r.__index=c||r.__index||0]},remain:function(r){return r.length-(r.__index||0)},readList:function(r,c,m,x){for(var k=[],T,R=c||0,L=x?R+x:r.length,q=R;q<L;q++)k.push(Array.isArray(T=r[q])?this.read(T,0,m):this.read(r,q,m,1));return k},readNamed:function(r,c,m,x,k){var T=this.getNamed(r,c),R=T!==n;if(R){var L=r.__filtered;if(!L){var q=this.getSource(r);L=r.__filtered=l.create(q),L.__unfiltered=q}L[c]=n}return this.read(R?[T]:r,m,x,k)},readSupported:function(r,c){var m=this.getSource(r),x=this,k=!1;return m&&Object.keys(m).forEach(function(T){if(T in c){var R=x.readNamed(r,T);R!==n&&(c[T]=R),k=!0}}),k},getSource:function(r){var c=r.__source;if(c===n){var m=r.length===1&&r[0];c=r.__source=m&&l.isPlainObject(m)?m:null}return c},getNamed:function(r,c){var m=this.getSource(r);if(m)return c?m[c]:r.__filtered||m},hasNamed:function(r,c){return!!this.getNamed(r,c)},filter:function(r,c,m,x){var k;function T(X){if(!(m&&X in m)&&!(k&&X in k)){var Z=c[X];Z!==n&&(r[X]=Z)}}if(x){for(var R={},L=0,q,z=x.length;L<z;L++)(q=x[L])in c&&(T(q),R[q]=!0);k=R}return Object.keys(c.__unfiltered||c).forEach(T),r},isPlainValue:function(r,c){return l.isPlainObject(r)||Array.isArray(r)||c&&typeof r=="string"},serialize:function(r,c,m,x){c=c||{};var k=!x,T;if(k&&(c.formatter=new M(c.precision),x={length:0,definitions:{},references:{},add:function(Z,Q){var j="#"+Z._id,ce=this.references[j];if(!ce){this.length++;var te=Q.call(Z),oe=Z._class;oe&&te[0]!==oe&&te.unshift(oe),this.definitions[j]=te,ce=this.references[j]=[j]}return ce}}),r&&r._serialize){T=r._serialize(c,x);var R=r._class;R&&!r._compactSerialize&&(k||!m)&&T[0]!==R&&T.unshift(R)}else if(Array.isArray(r)){T=[];for(var L=0,q=r.length;L<q;L++)T[L]=l.serialize(r[L],c,m,x)}else if(l.isPlainObject(r)){T={};for(var z=Object.keys(r),L=0,q=z.length;L<q;L++){var X=z[L];T[X]=l.serialize(r[X],c,m,x)}}else typeof r=="number"?T=c.formatter.number(r,c.precision):T=r;return k&&x.length>0?[["dictionary",x.definitions],T]:T},deserialize:function(r,c,m,x,k){var T=r,R=!m,L=R&&r&&r.length&&r[0][0]==="dictionary";if(m=m||{},Array.isArray(r)){var q=r[0],z=q==="dictionary";if(r.length==1&&/^#/.test(q))return m.dictionary[q];q=l.exports[q],T=[];for(var X=q?1:0,Z=r.length;X<Z;X++)T.push(l.deserialize(r[X],c,m,z,L));if(q){var Q=T;c?T=c(q,Q,R||k):T=new q(Q)}}else if(l.isPlainObject(r)){T={},x&&(m.dictionary=T);for(var j in r)T[j]=l.deserialize(r[j],c,m)}return L?T[1]:T},exportJSON:function(r,c){var m=l.serialize(r,c);return c&&c.asString==!1?m:JSON.stringify(m)},importJSON:function(r,c){return l.deserialize(typeof r=="string"?JSON.parse(r):r,function(m,x,k){var T=k&&c&&c.constructor===m,R=T?c:l.create(m.prototype);if(x.length===1&&R instanceof D&&(T||!(R instanceof B))){var L=x[0];l.isPlainObject(L)&&(L.insert=!1,T&&(x=x.concat([D.INSERT])))}return(T?R.set:m).apply(R,x),T&&(c=null),R})},push:function(r,c){var m=c.length;if(m<4096)r.push.apply(r,c);else{var x=r.length;r.length+=m;for(var k=0;k<m;k++)r[x+k]=c[k]}return r},splice:function(r,c,m,x){var k=c&&c.length,T=m===n;m=T?r.length:m,m>r.length&&(m=r.length);for(var R=0;R<k;R++)c[R]._index=m+R;if(T)return l.push(r,c),[];var L=[m,x];c&&l.push(L,c);for(var q=r.splice.apply(r,L),R=0,z=q.length;R<z;R++)q[R]._index=n;for(var R=m+k,z=r.length;R<z;R++)r[R]._index=R;return q},capitalize:function(r){return r.replace(/\b[a-z]/g,function(c){return c.toUpperCase()})},camelize:function(r){return r.replace(/-(.)/g,function(c,m){return m.toUpperCase()})},hyphenate:function(r){return r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}}});var h={on:function(r,c){if(typeof r!="string")l.each(r,function(T,R){this.on(R,T)},this);else{var m=this._eventTypes,x=m&&m[r],k=this._callbacks=this._callbacks||{};k=k[r]=k[r]||[],k.indexOf(c)===-1&&(k.push(c),x&&x.install&&k.length===1&&x.install.call(this,r))}return this},off:function(r,c){if(typeof r!="string"){l.each(r,function(R,L){this.off(L,R)},this);return}var m=this._eventTypes,x=m&&m[r],k=this._callbacks&&this._callbacks[r],T;return k&&(!c||(T=k.indexOf(c))!==-1&&k.length===1?(x&&x.uninstall&&x.uninstall.call(this,r),delete this._callbacks[r]):T!==-1&&k.splice(T,1)),this},once:function(r,c){return this.on(r,function m(){c.apply(this,arguments),this.off(r,m)})},emit:function(r,c){var m=this._callbacks&&this._callbacks[r];if(!m)return!1;var x=l.slice(arguments,1),k=c&&c.target&&!c.currentTarget;m=m.slice(),k&&(c.currentTarget=this);for(var T=0,R=m.length;T<R;T++)if(m[T].apply(this,x)==!1){c&&c.stop&&c.stop();break}return k&&delete c.currentTarget,!0},responds:function(r){return!!(this._callbacks&&this._callbacks[r])},attach:"#on",detach:"#off",fire:"#emit",_installEvents:function(r){var c=this._eventTypes,m=this._callbacks,x=r?"install":"uninstall";if(c){for(var k in m)if(m[k].length>0){var T=c[k],R=T&&T[x];R&&R.call(this,k)}}},statics:{inject:function r(c){var m=c._events;if(m){var x={};l.each(m,function(k,T){var R=typeof k=="string",L=R?k:T,q=l.capitalize(L),z=L.substring(2).toLowerCase();x[z]=R?{}:k,L="_"+L,c["get"+q]=function(){return this[L]},c["set"+q]=function(X){var Z=this[L];Z&&this.off(z,Z),X&&this.on(z,X),this[L]=X}}),c._eventTypes=x}return r.base.apply(this,arguments)}}},f=l.extend({_class:"PaperScope",initialize:function r(){Qe=this,this.settings=new l({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=r._id++,r._scopes[this._id]=this;var c=r.prototype;if(!this.support){var m=qe.getContext(1,1)||{};c.support={nativeDash:"setLineDash"in m||"mozDash"in m,nativeBlendModes:je.nativeModes},qe.release(m)}if(!this.agent){var x=t.navigator.userAgent.toLowerCase(),k=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(x)||[])[0],T=k==="darwin"?"mac":k,R=c.agent=c.browser={platform:T};T&&(R[T]=!0),x.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node|jsdom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,function(L,q,z,X,Z){if(!R.chrome){var Q=q==="opera"?X:/^(node|trident)$/.test(q)?Z:z;R.version=Q,R.versionNumber=parseFloat(Q),q={trident:"msie",jsdom:"node"}[q]||q,R.name=q,R[q]=!0}}),R.chrome&&delete R.webkit,R.atom&&delete R.chrome}},version:"0.12.18",getView:function(){var r=this.project;return r&&r._view},getPaper:function(){return this},execute:function(r,c){var m=Qe.PaperScript.execute(r,this,c);return et.updateFocus(),m},install:function(r){var c=this;l.each(["project","view","tool"],function(x){l.define(r,x,{configurable:!0,get:function(){return c[x]}})});for(var m in this)!/^_/.test(m)&&this[m]&&(r[m]=this[m])},setup:function(r){return Qe=this,this.project=new U(r),this},createCanvas:function(r,c){return qe.getCanvas(r,c)},activate:function(){Qe=this},clear:function(){for(var r=this.projects,c=this.tools,m=r.length-1;m>=0;m--)r[m].remove();for(var m=c.length-1;m>=0;m--)c[m].remove()},remove:function(){this.clear(),delete f._scopes[this._id]},statics:new function(){function r(c){return c+="Attribute",function(m,x){return m[c](x)||m[c]("data-paper-"+x)}}return{_scopes:{},_id:0,get:function(c){return this._scopes[c]||null},getAttribute:r("get"),hasAttribute:r("has")}}}),b=l.extend(h,{initialize:function(r){this._scope=Qe,this._index=this._scope[this._list].push(this)-1,(r||!this._scope[this._reference])&&this.activate()},activate:function(){if(!this._scope)return!1;var r=this._scope[this._reference];return r&&r!==this&&r.emit("deactivate"),this._scope[this._reference]=this,this.emit("activate",r),!0},isActive:function(){return this._scope[this._reference]===this},remove:function(){return this._index==null?!1:(l.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),this._scope=null,!0)},getView:function(){return this._scope.getView()}}),S={findItemBoundsCollisions:function(r,c,m){function x(R){for(var L=new Array(R.length),q=0;q<R.length;q++){var z=R[q].getBounds();L[q]=[z.left,z.top,z.right,z.bottom]}return L}var k=x(r),T=!c||c===r?k:x(c);return this.findBoundsCollisions(k,T,m||0)},findCurveBoundsCollisions:function(r,c,m,x){function k(Q){for(var j=Math.min,ce=Math.max,te=new Array(Q.length),oe=0;oe<Q.length;oe++){var ee=Q[oe];te[oe]=[j(ee[0],ee[2],ee[4],ee[6]),j(ee[1],ee[3],ee[5],ee[7]),ce(ee[0],ee[2],ee[4],ee[6]),ce(ee[1],ee[3],ee[5],ee[7])]}return te}var T=k(r),R=!c||c===r?T:k(c);if(x){for(var L=this.findBoundsCollisions(T,R,m||0,!1,!0),q=this.findBoundsCollisions(T,R,m||0,!0,!0),z=[],X=0,Z=L.length;X<Z;X++)z[X]={hor:L[X],ver:q[X]};return z}return this.findBoundsCollisions(T,R,m||0)},findBoundsCollisions:function(r,c,m,x,k){var T=!c||r===c,R=T?r:r.concat(c),L=r.length,q=R.length;function z(ft,vt,kt){for(var tt=0,nt=ft.length;tt<nt;){var _t=nt+tt>>>1;R[ft[_t]][vt]<kt?tt=_t+1:nt=_t}return tt-1}for(var X=x?1:0,Z=X+2,Q=x?0:1,j=Q+2,ce=new Array(q),te=0;te<q;te++)ce[te]=te;ce.sort(function(ft,vt){return R[ft][X]-R[vt][X]});for(var oe=[],ee=new Array(L),te=0;te<q;te++){var re=ce[te],K=R[re],se=T?re:re-L,de=re<L,ve=T||!de,ue=de?[]:null;if(oe.length){var Ce=z(oe,Z,K[X]-m)+1;if(oe.splice(0,Ce),T&&k){ue=ue.concat(oe);for(var Me=0;Me<oe.length;Me++){var Ae=oe[Me];ee[Ae].push(se)}}else for(var Oe=K[j],ke=K[Q],Me=0;Me<oe.length;Me++){var Ae=oe[Me],Le=R[Ae],De=Ae<L,ze=T||Ae>=L;(k||(de&&ze||ve&&De)&&Oe>=Le[Q]-m&&ke<=Le[j]+m)&&(de&&ze&&ue.push(T?Ae:Ae-L),ve&&De&&ee[Ae].push(se))}}if(de&&(r===c&&ue.push(re),ee[re]=ue),oe.length){var He=K[Z],$e=z(oe,Z,He);oe.splice($e+1,0,re)}else oe.push(re)}for(var te=0;te<ee.length;te++){var ct=ee[te];ct&&ct.sort(function(vt,kt){return vt-kt})}return ee}},M=l.extend({initialize:function(r){this.precision=l.pick(r,5),this.multiplier=Math.pow(10,this.precision)},number:function(r){return this.precision<16?Math.round(r*this.multiplier)/this.multiplier:r},pair:function(r,c,m){return this.number(r)+(m||",")+this.number(c)},point:function(r,c){return this.number(r.x)+(c||",")+this.number(r.y)},size:function(r,c){return this.number(r.width)+(c||",")+this.number(r.height)},rectangle:function(r,c){return this.point(r,c)+(c||",")+this.size(r,c)}});M.instance=new M;var C=new function(){var r=[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],c=[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]],m=Math.abs,x=Math.sqrt,k=Math.pow,T=Math.log2||function(Z){return Math.log(Z)*Math.LOG2E},R=1e-12,L=112e-18;function q(Z,Q,j){return Z<Q?Q:Z>j?j:Z}function z(Z,Q,j){function ce(Ce){var Me=Ce*134217729,Ae=Ce-Me,Oe=Ae+Me,ke=Ce-Oe;return[Oe,ke]}var te=Q*Q-Z*j,oe=Q*Q+Z*j;if(m(te)*3<oe){var ee=ce(Z),re=ce(Q),K=ce(j),se=Q*Q,de=re[0]*re[0]-se+2*re[0]*re[1]+re[1]*re[1],ve=Z*j,ue=ee[0]*K[0]-ve+ee[0]*K[1]+ee[1]*K[0]+ee[1]*K[1];te=se-ve+(de-ue)}return te}function X(){var Z=Math.max.apply(Math,arguments);return Z&&(Z<1e-8||Z>1e8)?k(2,-Math.round(T(Z))):0}return{EPSILON:R,MACHINE_EPSILON:L,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,ANGULAR_EPSILON:1e-5,KAPPA:4*(x(2)-1)/3,isZero:function(Z){return Z>=-1e-12&&Z<=R},isMachineZero:function(Z){return Z>=-112e-18&&Z<=L},clamp:q,integrate:function(Z,Q,j,ce){for(var te=r[ce-2],oe=c[ce-2],ee=(j-Q)*.5,re=ee+Q,K=0,se=ce+1>>1,de=ce&1?oe[K++]*Z(re):0;K<se;){var ve=ee*te[K];de+=oe[K++]*(Z(re+ve)+Z(re-ve))}return ee*de},findRoot:function(Z,Q,j,ce,te,oe,ee){for(var re=0;re<oe;re++){var K=Z(j),se=K/Q(j),de=j-se;if(m(se)<ee){j=de;break}K>0?(te=j,j=de<=ce?(ce+te)*.5:de):(ce=j,j=de>=te?(ce+te)*.5:de)}return q(j,ce,te)},solveQuadratic:function(Z,Q,j,ce,te,oe){var ee,re=1/0;if(m(Z)<R){if(m(Q)<R)return m(j)<R?-1:0;ee=-j/Q}else{Q*=-.5;var K=z(Z,Q,j);if(K&&m(K)<L){var se=X(m(Z),m(Q),m(j));se&&(Z*=se,Q*=se,j*=se,K=z(Z,Q,j))}if(K>=-112e-18){var de=K<0?0:x(K),ve=Q+(Q<0?-de:de);ve===0?(ee=j/Z,re=-ee):(ee=ve/Z,re=j/ve)}}var ue=0,Ce=te==null,Me=te-R,Ae=oe+R;return isFinite(ee)&&(Ce||ee>Me&&ee<Ae)&&(ce[ue++]=Ce?ee:q(ee,te,oe)),re!==ee&&isFinite(re)&&(Ce||re>Me&&re<Ae)&&(ce[ue++]=Ce?re:q(re,te,oe)),ue},solveCubic:function(Z,Q,j,ce,te,oe,ee){var re=X(m(Z),m(Q),m(j),m(ce)),K,se,de,ve,ue;re&&(Z*=re,Q*=re,j*=re,ce*=re);function Ce($e){K=$e;var ct=Z*K;se=ct+Q,de=se*K+j,ve=(ct+se)*K+de,ue=de*K+ce}if(m(Z)<R)Z=Q,se=j,de=ce,K=1/0;else if(m(ce)<R)se=Q,de=j,K=0;else{Ce(-(Q/Z)/3);var Me=ue/Z,Ae=k(m(Me),1/3),Oe=Me<0?-1:1,ke=-ve/Z,Le=ke>0?1.324717957244746*Math.max(Ae,x(ke)):Ae,De=K-Oe*Le;if(De!==K){do Ce(De),De=ve===0?K:K-ue/ve/(1+L);while(Oe*De>Oe*K);m(Z)*K*K>m(ce/K)&&(de=-ce/K,se=(de-j)/K)}}var ze=C.solveQuadratic(Z,se,de,te,oe,ee),He=oe==null;return isFinite(K)&&(ze===0||ze>0&&K!==te[0]&&K!==te[1])&&(He||K>oe-R&&K<ee+R)&&(te[ze++]=He?K:q(K,oe,ee)),ze}}},y={_id:1,_pools:{},get:function(r){if(r){var c=this._pools[r];return c||(c=this._pools[r]={_id:1}),c._id++}else return this._id++}},g=l.extend({_class:"Point",_readIndex:!0,initialize:function(c,m){var x=typeof c,k=this.__read,T=0;if(x==="number"){var R=typeof m=="number";this._set(c,R?m:c),k&&(T=R?2:1)}else if(x==="undefined"||c===null)this._set(0,0),k&&(T=c===null?1:0);else{var L=x==="string"?c.split(/[\s,]+/)||[]:c;T=1,Array.isArray(L)?this._set(+L[0],+(L.length>1?L[1]:L[0])):"x"in L?this._set(L.x||0,L.y||0):"width"in L?this._set(L.width||0,L.height||0):"angle"in L?(this._set(L.length||0,0),this.setAngle(L.angle||0)):(this._set(0,0),T=0)}return k&&(this.__read=T),this},set:"#initialize",_set:function(r,c){return this.x=r,this.y=c,this},equals:function(r){return this===r||r&&(this.x===r.x&&this.y===r.y||Array.isArray(r)&&this.x===r[0]&&this.y===r[1])||!1},clone:function(){return new g(this.x,this.y)},toString:function(){var r=M.instance;return"{ x: "+r.number(this.x)+", y: "+r.number(this.y)+" }"},_serialize:function(r){var c=r.formatter;return[c.number(this.x),c.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(r){if(this.isZero()){var c=this._angle||0;this._set(Math.cos(c)*r,Math.sin(c)*r)}else{var m=r/this.getLength();C.isZero(m)&&this.getAngle(),this._set(this.x*m,this.y*m)}},getAngle:function(){return this.getAngleInRadians.apply(this,arguments)*180/Math.PI},setAngle:function(r){this.setAngleInRadians.call(this,r*Math.PI/180)},getAngleInDegrees:"#getAngle",setAngleInDegrees:"#setAngle",getAngleInRadians:function(){if(arguments.length){var r=g.read(arguments),c=this.getLength()*r.getLength();if(C.isZero(c))return NaN;var m=this.dot(r)/c;return Math.acos(m<-1?-1:m>1?1:m)}else return this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(r){if(this._angle=r,!this.isZero()){var c=this.getLength();this._set(Math.cos(r)*c,Math.sin(r)*c)}},getQuadrant:function(){return this.x>=0?this.y>=0?1:4:this.y>=0?2:3}},{beans:!1,getDirectedAngle:function(){var r=g.read(arguments);return Math.atan2(this.cross(r),this.dot(r))*180/Math.PI},getDistance:function(){var r=arguments,c=g.read(r),m=c.x-this.x,x=c.y-this.y,k=m*m+x*x,T=l.read(r);return T?k:Math.sqrt(k)},normalize:function(r){r===n&&(r=1);var c=this.getLength(),m=c!==0?r/c:0,x=new g(this.x*m,this.y*m);return m>=0&&(x._angle=this._angle),x},rotate:function(r,c){if(r===0)return this.clone();r=r*Math.PI/180;var m=c?this.subtract(c):this,x=Math.sin(r),k=Math.cos(r);return m=new g(m.x*k-m.y*x,m.x*x+m.y*k),c?m.add(c):m},transform:function(r){return r?r._transformPoint(this):this},add:function(){var r=g.read(arguments);return new g(this.x+r.x,this.y+r.y)},subtract:function(){var r=g.read(arguments);return new g(this.x-r.x,this.y-r.y)},multiply:function(){var r=g.read(arguments);return new g(this.x*r.x,this.y*r.y)},divide:function(){var r=g.read(arguments);return new g(this.x/r.x,this.y/r.y)},modulo:function(){var r=g.read(arguments);return new g(this.x%r.x,this.y%r.y)},negate:function(){return new g(-this.x,-this.y)},isInside:function(){return N.read(arguments).contains(this)},isClose:function(){var r=arguments,c=g.read(r),m=l.read(r);return this.getDistance(c)<=m},isCollinear:function(){var r=g.read(arguments);return g.isCollinear(this.x,this.y,r.x,r.y)},isColinear:"#isCollinear",isOrthogonal:function(){var r=g.read(arguments);return g.isOrthogonal(this.x,this.y,r.x,r.y)},isZero:function(){var r=C.isZero;return r(this.x)&&r(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(r){return this.x*(r>1&&r<4?-1:1)>=0&&this.y*(r>2?-1:1)>=0},dot:function(){var r=g.read(arguments);return this.x*r.x+this.y*r.y},cross:function(){var r=g.read(arguments);return this.x*r.y-this.y*r.x},project:function(){var r=g.read(arguments),c=r.isZero()?0:this.dot(r)/r.dot(r);return new g(r.x*c,r.y*c)},statics:{min:function(){var r=arguments,c=g.read(r),m=g.read(r);return new g(Math.min(c.x,m.x),Math.min(c.y,m.y))},max:function(){var r=arguments,c=g.read(r),m=g.read(r);return new g(Math.max(c.x,m.x),Math.max(c.y,m.y))},random:function(){return new g(Math.random(),Math.random())},isCollinear:function(r,c,m,x){return Math.abs(r*x-c*m)<=Math.sqrt((r*r+c*c)*(m*m+x*x))*1e-8},isOrthogonal:function(r,c,m,x){return Math.abs(r*m+c*x)<=Math.sqrt((r*r+c*c)*(m*m+x*x))*1e-8}}},l.each(["round","ceil","floor","abs"],function(r){var c=Math[r];this[r]=function(){return new g(c(this.x),c(this.y))}},{})),w=g.extend({initialize:function(c,m,x,k){this._x=c,this._y=m,this._owner=x,this._setter=k},_set:function(r,c,m){return this._x=r,this._y=c,m||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(r){this._x=r,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(r){this._y=r,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(r){this._owner._changeSelection(this._getSelection(),r)},_getSelection:function(){return this._setter==="setPosition"?4:0}}),p=l.extend({_class:"Size",_readIndex:!0,initialize:function(c,m){var x=typeof c,k=this.__read,T=0;if(x==="number"){var R=typeof m=="number";this._set(c,R?m:c),k&&(T=R?2:1)}else if(x==="undefined"||c===null)this._set(0,0),k&&(T=c===null?1:0);else{var L=x==="string"?c.split(/[\s,]+/)||[]:c;T=1,Array.isArray(L)?this._set(+L[0],+(L.length>1?L[1]:L[0])):"width"in L?this._set(L.width||0,L.height||0):"x"in L?this._set(L.x||0,L.y||0):(this._set(0,0),T=0)}return k&&(this.__read=T),this},set:"#initialize",_set:function(r,c){return this.width=r,this.height=c,this},equals:function(r){return r===this||r&&(this.width===r.width&&this.height===r.height||Array.isArray(r)&&this.width===r[0]&&this.height===r[1])||!1},clone:function(){return new p(this.width,this.height)},toString:function(){var r=M.instance;return"{ width: "+r.number(this.width)+", height: "+r.number(this.height)+" }"},_serialize:function(r){var c=r.formatter;return[c.number(this.width),c.number(this.height)]},add:function(){var r=p.read(arguments);return new p(this.width+r.width,this.height+r.height)},subtract:function(){var r=p.read(arguments);return new p(this.width-r.width,this.height-r.height)},multiply:function(){var r=p.read(arguments);return new p(this.width*r.width,this.height*r.height)},divide:function(){var r=p.read(arguments);return new p(this.width/r.width,this.height/r.height)},modulo:function(){var r=p.read(arguments);return new p(this.width%r.width,this.height%r.height)},negate:function(){return new p(-this.width,-this.height)},isZero:function(){var r=C.isZero;return r(this.width)&&r(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(r,c){return new p(Math.min(r.width,c.width),Math.min(r.height,c.height))},max:function(r,c){return new p(Math.max(r.width,c.width),Math.max(r.height,c.height))},random:function(){return new p(Math.random(),Math.random())}}},l.each(["round","ceil","floor","abs"],function(r){var c=Math[r];this[r]=function(){return new p(c(this.width),c(this.height))}},{})),E=p.extend({initialize:function(c,m,x,k){this._width=c,this._height=m,this._owner=x,this._setter=k},_set:function(r,c,m){return this._width=r,this._height=c,m||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(r){this._width=r,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(r){this._height=r,this._owner[this._setter](this)}}),N=l.extend({_class:"Rectangle",_readIndex:!0,beans:!0,initialize:function(c,m,x,k){var T=arguments,R=typeof c,L;if(R==="number"?(this._set(c,m,x,k),L=4):R==="undefined"||c===null?(this._set(0,0,0,0),L=c===null?1:0):T.length===1&&(Array.isArray(c)?(this._set.apply(this,c),L=1):c.x!==n||c.width!==n?(this._set(c.x||0,c.y||0,c.width||0,c.height||0),L=1):c.from===n&&c.to===n&&(this._set(0,0,0,0),l.readSupported(T,this)&&(L=1))),L===n){var q=g.readNamed(T,"from"),z=l.peek(T),X=q.x,Z=q.y,Q,j;if(z&&z.x!==n||l.hasNamed(T,"to")){var ce=g.readNamed(T,"to");Q=ce.x-X,j=ce.y-Z,Q<0&&(X=ce.x,Q=-Q),j<0&&(Z=ce.y,j=-j)}else{var te=p.read(T);Q=te.width,j=te.height}this._set(X,Z,Q,j),L=T.__index}var oe=T.__filtered;return oe&&(this.__filtered=oe),this.__read&&(this.__read=L),this},set:"#initialize",_set:function(r,c,m,x){return this.x=r,this.y=c,this.width=m,this.height=x,this},clone:function(){return new N(this.x,this.y,this.width,this.height)},equals:function(r){var c=l.isPlainValue(r)?N.read(arguments):r;return c===this||c&&this.x===c.x&&this.y===c.y&&this.width===c.width&&this.height===c.height||!1},toString:function(){var r=M.instance;return"{ x: "+r.number(this.x)+", y: "+r.number(this.y)+", width: "+r.number(this.width)+", height: "+r.number(this.height)+" }"},_serialize:function(r){var c=r.formatter;return[c.number(this.x),c.number(this.y),c.number(this.width),c.number(this.height)]},getPoint:function(r){var c=r?g:w;return new c(this.x,this.y,this,"setPoint")},setPoint:function(){var r=g.read(arguments);this.x=r.x,this.y=r.y},getSize:function(r){var c=r?p:E;return new c(this.width,this.height,this,"setSize")},_fw:1,_fh:1,setSize:function(){var r=p.read(arguments),c=this._sx,m=this._sy,x=r.width,k=r.height;c&&(this.x+=(this.width-x)*c),m&&(this.y+=(this.height-k)*m),this.width=x,this.height=k,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(r){if(!this._fw){var c=r-this.x;this.width-=this._sx===.5?c*2:c}this.x=r,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(r){if(!this._fh){var c=r-this.y;this.height-=this._sy===.5?c*2:c}this.y=r,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(r){if(!this._fw){var c=r-this.x;this.width=this._sx===.5?c*2:c}this.x=r-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(r){if(!this._fh){var c=r-this.y;this.height=this._sy===.5?c*2:c}this.y=r-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(r){this._fw||this._sx===.5?this.x=r-this.width/2:(this._sx&&(this.x+=(r-this.x)*2*this._sx),this.width=(r-this.x)*2),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(r){this._fh||this._sy===.5?this.y=r-this.height/2:(this._sy&&(this.y+=(r-this.y)*2*this._sy),this.height=(r-this.y)*2),this._sy=.5,this._fh=0},getCenter:function(r){var c=r?g:w;return new c(this.getCenterX(),this.getCenterY(),this,"setCenter")},setCenter:function(){var r=g.read(arguments);return this.setCenterX(r.x),this.setCenterY(r.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return this.width===0||this.height===0},contains:function(r){return r&&r.width!==n||(Array.isArray(r)?r:arguments).length===4?this._containsRectangle(N.read(arguments)):this._containsPoint(g.read(arguments))},_containsPoint:function(r){var c=r.x,m=r.y;return c>=this.x&&m>=this.y&&c<=this.x+this.width&&m<=this.y+this.height},_containsRectangle:function(r){var c=r.x,m=r.y;return c>=this.x&&m>=this.y&&c+r.width<=this.x+this.width&&m+r.height<=this.y+this.height},intersects:function(){var r=N.read(arguments),c=l.read(arguments)||0;return r.x+r.width>this.x-c&&r.y+r.height>this.y-c&&r.x<this.x+this.width+c&&r.y<this.y+this.height+c},intersect:function(){var r=N.read(arguments),c=Math.max(this.x,r.x),m=Math.max(this.y,r.y),x=Math.min(this.x+this.width,r.x+r.width),k=Math.min(this.y+this.height,r.y+r.height);return new N(c,m,x-c,k-m)},unite:function(){var r=N.read(arguments),c=Math.min(this.x,r.x),m=Math.min(this.y,r.y),x=Math.max(this.x+this.width,r.x+r.width),k=Math.max(this.y+this.height,r.y+r.height);return new N(c,m,x-c,k-m)},include:function(){var r=g.read(arguments),c=Math.min(this.x,r.x),m=Math.min(this.y,r.y),x=Math.max(this.x+this.width,r.x),k=Math.max(this.y+this.height,r.y);return new N(c,m,x-c,k-m)},expand:function(){var r=p.read(arguments),c=r.width,m=r.height;return new N(this.x-c/2,this.y-m/2,this.width+c,this.height+m)},scale:function(r,c){return this.expand(this.width*r-this.width,this.height*(c===n?r:c)-this.height)}},l.each([["Top","Left"],["Top","Right"],["Bottom","Left"],["Bottom","Right"],["Left","Center"],["Top","Center"],["Right","Center"],["Bottom","Center"]],function(r,c){var m=r.join(""),x=/^[RL]/.test(m);c>=4&&(r[1]+=x?"Y":"X");var k=r[x?0:1],T=r[x?1:0],R="get"+k,L="get"+T,q="set"+k,z="set"+T,X="get"+m,Z="set"+m;this[X]=function(Q){var j=Q?g:w;return new j(this[R](),this[L](),this,Z)},this[Z]=function(){var Q=g.read(arguments);this[q](Q.x),this[z](Q.y)}},{beans:!0})),I=N.extend({initialize:function(c,m,x,k,T,R){this._set(c,m,x,k,!0),this._owner=T,this._setter=R},_set:function(r,c,m,x,k){return this._x=r,this._y=c,this._width=m,this._height=x,k||this._owner[this._setter](this),this}},new function(){var r=N.prototype;return l.each(["x","y","width","height"],function(c){var m=l.capitalize(c),x="_"+c;this["get"+m]=function(){return this[x]},this["set"+m]=function(k){this[x]=k,this._dontNotify||this._owner[this._setter](this)}},l.each(["Point","Size","Center","Left","Top","Right","Bottom","CenterX","CenterY","TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],function(c){var m="set"+c;this[m]=function(){this._dontNotify=!0,r[m].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}},{isSelected:function(){return!!(this._owner._selection&2)},setSelected:function(c){var m=this._owner;m._changeSelection&&m._changeSelection(2,c)}}))}),O=l.extend({_class:"Matrix",initialize:function r(c,m){var x=arguments,k=x.length,T=!0;if(k>=6?this._set.apply(this,x):k===1||k===2?c instanceof r?this._set(c._a,c._b,c._c,c._d,c._tx,c._ty,m):Array.isArray(c)?this._set.apply(this,m?c.concat([m]):c):T=!1:k?T=!1:this.reset(),!T)throw new Error("Unsupported matrix parameters");return this},set:"#initialize",_set:function(r,c,m,x,k,T,R){return this._a=r,this._b=c,this._c=m,this._d=x,this._tx=k,this._ty=T,R||this._changed(),this},_serialize:function(r,c){return l.serialize(this.getValues(),r,!0,c)},_changed:function(){var r=this._owner;r&&(r._applyMatrix?r.transform(null,!0):r._changed(25))},clone:function(){return new O(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(r){return r===this||r&&this._a===r._a&&this._b===r._b&&this._c===r._c&&this._d===r._d&&this._tx===r._tx&&this._ty===r._ty},toString:function(){var r=M.instance;return"[["+[r.number(this._a),r.number(this._c),r.number(this._tx)].join(", ")+"], ["+[r.number(this._b),r.number(this._d),r.number(this._ty)].join(", ")+"]]"},reset:function(r){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,r||this._changed(),this},apply:function(r,c){var m=this._owner;return m?(m.transform(null,l.pick(r,!0),c),this.isIdentity()):!1},translate:function(){var r=g.read(arguments),c=r.x,m=r.y;return this._tx+=c*this._a+m*this._c,this._ty+=c*this._b+m*this._d,this._changed(),this},scale:function(){var r=arguments,c=g.read(r),m=g.read(r,0,{readNull:!0});return m&&this.translate(m),this._a*=c.x,this._b*=c.x,this._c*=c.y,this._d*=c.y,m&&this.translate(m.negate()),this._changed(),this},rotate:function(r){r*=Math.PI/180;var c=g.read(arguments,1),m=c.x,x=c.y,k=Math.cos(r),T=Math.sin(r),R=m-m*k+x*T,L=x-m*T-x*k,q=this._a,z=this._b,X=this._c,Z=this._d;return this._a=k*q+T*X,this._b=k*z+T*Z,this._c=-T*q+k*X,this._d=-T*z+k*Z,this._tx+=R*q+L*X,this._ty+=R*z+L*Z,this._changed(),this},shear:function(){var r=arguments,c=g.read(r),m=g.read(r,0,{readNull:!0});m&&this.translate(m);var x=this._a,k=this._b;return this._a+=c.y*this._c,this._b+=c.y*this._d,this._c+=c.x*x,this._d+=c.x*k,m&&this.translate(m.negate()),this._changed(),this},skew:function(){var r=arguments,c=g.read(r),m=g.read(r,0,{readNull:!0}),x=Math.PI/180,k=new g(Math.tan(c.x*x),Math.tan(c.y*x));return this.shear(k,m)},append:function(r,c){if(r){var m=this._a,x=this._b,k=this._c,T=this._d,R=r._a,L=r._c,q=r._b,z=r._d,X=r._tx,Z=r._ty;this._a=R*m+q*k,this._c=L*m+z*k,this._b=R*x+q*T,this._d=L*x+z*T,this._tx+=X*m+Z*k,this._ty+=X*x+Z*T,c||this._changed()}return this},prepend:function(r,c){if(r){var m=this._a,x=this._b,k=this._c,T=this._d,R=this._tx,L=this._ty,q=r._a,z=r._c,X=r._b,Z=r._d,Q=r._tx,j=r._ty;this._a=q*m+z*x,this._c=q*k+z*T,this._b=X*m+Z*x,this._d=X*k+Z*T,this._tx=q*R+z*L+Q,this._ty=X*R+Z*L+j,c||this._changed()}return this},appended:function(r){return this.clone().append(r)},prepended:function(r){return this.clone().prepend(r)},invert:function(){var r=this._a,c=this._b,m=this._c,x=this._d,k=this._tx,T=this._ty,R=r*x-c*m,L=null;return R&&!isNaN(R)&&isFinite(k)&&isFinite(T)&&(this._a=x/R,this._b=-c/R,this._c=-m/R,this._d=r/R,this._tx=(m*T-x*k)/R,this._ty=(c*k-r*T)/R,L=this),L},inverted:function(){return this.clone().invert()},concatenate:"#append",preConcatenate:"#prepend",chain:"#appended",_shiftless:function(){return new O(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return this._a===1&&this._b===0&&this._c===0&&this._d===1&&this._tx===0&&this._ty===0},isInvertible:function(){var r=this._a*this._d-this._c*this._b;return r&&!isNaN(r)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(r,c,m){return arguments.length<3?this._transformPoint(g.read(arguments)):this._transformCoordinates(r,c,m)},_transformPoint:function(r,c,m){var x=r.x,k=r.y;return c||(c=new g),c._set(x*this._a+k*this._c+this._tx,x*this._b+k*this._d+this._ty,m)},_transformCoordinates:function(r,c,m){for(var x=0,k=2*m;x<k;x+=2){var T=r[x],R=r[x+1];c[x]=T*this._a+R*this._c+this._tx,c[x+1]=T*this._b+R*this._d+this._ty}return c},_transformCorners:function(r){var c=r.x,m=r.y,x=c+r.width,k=m+r.height,T=[c,m,x,m,x,k,c,k];return this._transformCoordinates(T,T,4)},_transformBounds:function(r,c,m){for(var x=this._transformCorners(r),k=x.slice(0,2),T=k.slice(),R=2;R<8;R++){var L=x[R],q=R&1;L<k[q]?k[q]=L:L>T[q]&&(T[q]=L)}return c||(c=new N),c._set(k[0],k[1],T[0]-k[0],T[1]-k[1],m)},inverseTransform:function(){return this._inverseTransform(g.read(arguments))},_inverseTransform:function(r,c,m){var x=this._a,k=this._b,T=this._c,R=this._d,L=this._tx,q=this._ty,z=x*R-k*T,X=null;if(z&&!isNaN(z)&&isFinite(L)&&isFinite(q)){var Z=r.x-this._tx,Q=r.y-this._ty;c||(c=new g),X=c._set((Z*R-Q*T)/z,(Q*x-Z*k)/z,m)}return X},decompose:function(){var r=this._a,c=this._b,m=this._c,x=this._d,k=r*x-c*m,T=Math.sqrt,R=Math.atan2,L=180/Math.PI,q,z,X;if(r!==0||c!==0){var Z=T(r*r+c*c);q=Math.acos(r/Z)*(c>0?1:-1),z=[Z,k/Z],X=[R(r*m+c*x,Z*Z),0]}else if(m!==0||x!==0){var Q=T(m*m+x*x);q=Math.asin(m/Q)*(x>0?1:-1),z=[k/Q,Q],X=[0,R(r*m+c*x,Q*Q)]}else q=0,X=z=[0,0];return{translation:this.getTranslation(),rotation:q*L,scaling:new g(z),skewing:new g(X[0]*L,X[1]*L)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new g(this._tx,this._ty)},getScaling:function(){return this.decompose().scaling},getRotation:function(){return this.decompose().rotation},applyToContext:function(r){this.isIdentity()||r.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},l.each(["a","b","c","d","tx","ty"],function(r){var c=l.capitalize(r),m="_"+r;this["get"+c]=function(){return this[m]},this["set"+c]=function(x){this[m]=x,this._changed()}},{})),V=l.extend({_class:"Line",initialize:function(c,m,x,k,T){var R=!1;arguments.length>=4?(this._px=c,this._py=m,this._vx=x,this._vy=k,R=T):(this._px=c.x,this._py=c.y,this._vx=m.x,this._vy=m.y,R=x),R||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new g(this._px,this._py)},getVector:function(){return new g(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(r,c){return V.intersect(this._px,this._py,this._vx,this._vy,r._px,r._py,r._vx,r._vy,!0,c)},getSide:function(r,c){return V.getSide(this._px,this._py,this._vx,this._vy,r.x,r.y,!0,c)},getDistance:function(r){return Math.abs(this.getSignedDistance(r))},getSignedDistance:function(r){return V.getSignedDistance(this._px,this._py,this._vx,this._vy,r.x,r.y,!0)},isCollinear:function(r){return g.isCollinear(this._vx,this._vy,r._vx,r._vy)},isOrthogonal:function(r){return g.isOrthogonal(this._vx,this._vy,r._vx,r._vy)},statics:{intersect:function(r,c,m,x,k,T,R,L,q,z){q||(m-=r,x-=c,R-=k,L-=T);var X=m*L-x*R;if(!C.isMachineZero(X)){var Z=r-k,Q=c-T,j=(R*Q-L*Z)/X,ce=(m*Q-x*Z)/X,te=1e-12,oe=-te,ee=1+te;if(z||oe<j&&j<ee&&oe<ce&&ce<ee)return z||(j=j<=0?0:j>=1?1:j),new g(r+j*m,c+j*x)}},getSide:function(r,c,m,x,k,T,R,L){R||(m-=r,x-=c);var q=k-r,z=T-c,X=q*x-z*m;return!L&&C.isMachineZero(X)&&(X=(q*m+q*m)/(m*m+x*x),X>=0&&X<=1&&(X=0)),X<0?-1:X>0?1:0},getSignedDistance:function(r,c,m,x,k,T,R){return R||(m-=r,x-=c),m===0?x>0?k-r:r-k:x===0?m<0?T-c:c-T:((k-r)*x-(T-c)*m)/(x>m?x*Math.sqrt(1+m*m/(x*x)):m*Math.sqrt(1+x*x/(m*m)))},getDistance:function(r,c,m,x,k,T,R){return Math.abs(V.getSignedDistance(r,c,m,x,k,T,R))}}}),U=b.extend({_class:"Project",_list:"projects",_reference:"project",_compactSerialize:!0,initialize:function(c){b.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new Ze(null,null,this),this._view=et.create(this,c||qe.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(r,c){return l.serialize(this._children,r,!0,c)},_changed:function(r,c){if(r&1){var m=this._view;m&&(m._needsUpdate=!0,!m._requested&&m._autoUpdate&&m.requestUpdate())}var x=this._changes;if(x&&c){var k=this._changesById,T=c._id,R=k[T];R?R.flags|=r:x.push(k[T]={item:c,flags:r})}},clear:function(){for(var r=this._children,c=r.length-1;c>=0;c--)r[c].remove()},isEmpty:function(){return!this._children.length},remove:function r(){return r.base.call(this)?(this._view&&this._view.remove(),!0):!1},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(r){this._currentStyle.set(r)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new B({project:this,insert:!0})},getSymbolDefinitions:function(){var r=[],c={};return this.getItems({class:ae,match:function(m){var x=m._definition,k=x._id;return c[k]||(c[k]=!0,r.push(x)),!1}}),r},getSymbols:"getSymbolDefinitions",getSelectedItems:function(){var r=this._selectionItems,c=[];for(var m in r){var x=r[m],k=x._selection;k&1&&x.isInserted()?c.push(x):k||this._updateSelection(x)}return c},_updateSelection:function(r){var c=r._id,m=this._selectionItems;r._selection?m[c]!==r&&(this._selectionCount++,m[c]=r):m[c]===r&&(this._selectionCount--,delete m[c])},selectAll:function(){for(var r=this._children,c=0,m=r.length;c<m;c++)r[c].setFullySelected(!0)},deselectAll:function(){var r=this._selectionItems;for(var c in r)r[c].setFullySelected(!1)},addLayer:function(r){return this.insertLayer(n,r)},insertLayer:function(r,c){if(c instanceof B){c._remove(!1,!0),l.splice(this._children,[c],r,0),c._setProject(this,!0);var m=c._name;m&&c.setName(m),this._changes&&c._changed(5),this._activeLayer||(this._activeLayer=c)}else c=null;return c},_insertItem:function(r,c,m){return c=this.insertLayer(r,c)||(this._activeLayer||this._insertItem(n,new B(D.NO_INSERT),!0)).insertChild(r,c),m&&c.activate&&c.activate(),c},getItems:function(r){return D._getItems(this,r)},getItem:function(r){return D._getItems(this,r,null,null,!0)[0]||null},importJSON:function(r){this.activate();var c=this._activeLayer;return l.importJSON(r,c&&c.isEmpty()&&c)},removeOn:function(r){var c=this._removeSets;if(c){r==="mouseup"&&(c.mousedrag=null);var m=c[r];if(m){for(var x in m){var k=m[x];for(var T in c){var R=c[T];R&&R!=m&&delete R[k._id]}k.remove()}c[r]=null}}},draw:function(r,c,m){this._updateVersion++,r.save(),c.applyToContext(r);for(var x=this._children,k=new l({offset:new g(0,0),pixelRatio:m,viewMatrix:c.isIdentity()?null:c,matrices:[new O],updateMatrix:!0}),T=0,R=x.length;T<R;T++)x[T].draw(r,k);if(r.restore(),this._selectionCount>0){r.save(),r.strokeWidth=1;var L=this._selectionItems,q=this._scope.settings.handleSize,z=this._updateVersion;for(var X in L)L[X]._drawSelection(r,c,q,L,z);r.restore()}}}),D=l.extend(h,{statics:{extend:function r(c){return c._serializeFields&&(c._serializeFields=l.set({},this.prototype._serializeFields,c._serializeFields)),r.base.apply(this,arguments)},INSERT:{insert:!0},NO_INSERT:{insert:!1}},_class:"Item",_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:"normal",_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new O,pivot:null,visible:!0,blendMode:"normal",opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:["applyMatrix"]},new function(){var r=["onMouseDown","onMouseUp","onMouseDrag","onClick","onDoubleClick","onMouseMove","onMouseEnter","onMouseLeave"];return l.each(r,function(c){this._events[c]={install:function(m){this.getView()._countItemEvent(m,1)},uninstall:function(m){this.getView()._countItemEvent(m,-1)}}},{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:r}})},{initialize:function(){},_initialize:function(r,c){var m=r&&l.isPlainObject(r),x=m&&r.internal===!0,k=this._matrix=new O,T=m&&r.project||Qe.project,R=Qe.settings;return this._id=x?null:y.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&R.applyMatrix,c&&k.translate(c),k._owner=this,this._style=new Ze(T._currentStyle,this,T),x||m&&r.insert==!1||!R.insertItems&&!(m&&r.insert==!0)?this._setProject(T):(m&&r.parent||T)._insertItem(n,this,!0),m&&r!==D.NO_INSERT&&r!==D.INSERT&&this.set(r,{internal:!0,insert:!0,project:!0,parent:!0}),m},_serialize:function(r,c){var m={},x=this;function k(T){for(var R in T){var L=x[R];l.equals(L,R==="leading"?T.fontSize*1.2:T[R])||(m[R]=l.serialize(L,r,R!=="data",c))}}return k(this._serializeFields),this instanceof me||k(this._style._defaults),[this._class,m]},_changed:function(r){var c=this._symbol,m=this._parent||c,x=this._project;r&8&&(this._bounds=this._position=this._decomposed=n),r&16&&(this._globalMatrix=n),m&&r&72&&D._clearBoundsCache(m),r&2&&D._clearBoundsCache(this),x&&x._changed(r,this),c&&c._changed(r)},getId:function(){return this._id},getName:function(){return this._name},setName:function(r){if(this._name&&this._removeNamed(),r===+r+"")throw new Error("Names consisting only of numbers are not supported.");var c=this._getOwner();if(r&&c){var m=c._children,x=c._namedChildren;(x[r]=x[r]||[]).push(this),r in m||(m[r]=this)}this._name=r||n,this._changed(256)},getStyle:function(){return this._style},setStyle:function(r){this.getStyle().set(r)}},l.each(["locked","visible","blendMode","opacity","guide"],function(r){var c=l.capitalize(r),m="_"+r,x={locked:256,visible:265};this["get"+c]=function(){return this[m]},this["set"+c]=function(k){k!=this[m]&&(this[m]=k,this._changed(x[r]||257))}},{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(r){if(r!==this._selection){this._selection=r;var c=this._project;c&&(c._updateSelection(this),this._changed(257))}},_changeSelection:function(r,c){var m=this._selection;this.setSelection(c?m|r:m&~r)},isSelected:function(){if(this._selectChildren){for(var r=this._children,c=0,m=r.length;c<m;c++)if(r[c].isSelected())return!0}return!!(this._selection&1)},setSelected:function(r){if(this._selectChildren)for(var c=this._children,m=0,x=c.length;m<x;m++)c[m].setSelected(r);this._changeSelection(1,r)},isFullySelected:function(){var r=this._children,c=!!(this._selection&1);if(r&&c){for(var m=0,x=r.length;m<x;m++)if(!r[m].isFullySelected())return!1;return!0}return c},setFullySelected:function(r){var c=this._children;if(c)for(var m=0,x=c.length;m<x;m++)c[m].setFullySelected(r);this._changeSelection(1,r)},isClipMask:function(){return this._clipMask},setClipMask:function(r){this._clipMask!=(r=!!r)&&(this._clipMask=r,r&&(this.setFillColor(null),this.setStrokeColor(null)),this._changed(257),this._parent&&this._parent._changed(2048))},getData:function(){return this._data||(this._data={}),this._data},setData:function(r){this._data=r},getPosition:function(r){var c=r?g:w,m=this._position||(this._position=this._getPositionFromBounds());return new c(m.x,m.y,this,"setPosition")},setPosition:function(){this.translate(g.read(arguments).subtract(this.getPosition(!0)))},_getPositionFromBounds:function(r){return this._pivot?this._matrix._transformPoint(this._pivot):(r||this.getBounds()).getCenter(!0)},getPivot:function(){var r=this._pivot;return r?new w(r.x,r.y,this,"setPivot"):null},setPivot:function(){this._pivot=g.read(arguments,0,{clone:!0,readNull:!0}),this._position=n}},l.each({getStrokeBounds:{stroke:!0},getHandleBounds:{handle:!0},getInternalBounds:{internal:!0}},function(r,c){this[c]=function(m){return this.getBounds(m,r)}},{beans:!0,getBounds:function(r,c){var m=c||r instanceof O,x=l.set({},m?c:r,this._boundsOptions);(!x.stroke||this.getStrokeScaling())&&(x.cacheItem=this);var k=this._getCachedBounds(m&&r,x).rect;return arguments.length?k:new I(k.x,k.y,k.width,k.height,this,"setBounds")},setBounds:function(){var r=N.read(arguments),c=this.getBounds(),m=this._matrix,x=new O,k=r.getCenter();x.translate(k),(r.width!=c.width||r.height!=c.height)&&(m.isInvertible()||(m.set(m._backup||new O().translate(m.getTranslation())),c=this.getBounds()),x.scale(c.width!==0?r.width/c.width:0,c.height!==0?r.height/c.height:0)),k=c.getCenter(),x.translate(-k.x,-k.y),this.transform(x)},_getBounds:function(r,c){var m=this._children;return!m||!m.length?new N:(D._updateBoundsCache(this,c.cacheItem),D._getBounds(m,r,c))},_getBoundsCacheKey:function(r,c){return[r.stroke?1:0,r.handle?1:0,c?1:0].join("")},_getCachedBounds:function(r,c,m){r=r&&r._orNullIfIdentity();var x=c.internal&&!m,k=c.cacheItem,T=x?null:this._matrix._orNullIfIdentity(),R=k&&(!r||r.equals(T))&&this._getBoundsCacheKey(c,x),L=this._bounds;if(D._updateBoundsCache(this._parent||this._symbol,k),R&&L&&R in L){var q=L[R];return{rect:q.rect.clone(),nonscaling:q.nonscaling}}var z=this._getBounds(r||T,c),X=z.rect||z,Z=this._style,Q=z.nonscaling||Z.hasStroke()&&!Z.getStrokeScaling();if(R){L||(this._bounds=L={});var q=L[R]={rect:X.clone(),nonscaling:Q,internal:x}}return{rect:X,nonscaling:Q}},_getStrokeMatrix:function(r,c){var m=this.getStrokeScaling()?null:c&&c.internal?this:this._parent||this._symbol&&this._symbol._item,x=m?m.getViewMatrix().invert():r;return x&&x._shiftless()},statics:{_updateBoundsCache:function(r,c){if(r&&c){var m=c._id,x=r._boundsCache=r._boundsCache||{ids:{},list:[]};x.ids[m]||(x.list.push(c),x.ids[m]=c)}},_clearBoundsCache:function(r){var c=r._boundsCache;if(c){r._bounds=r._position=r._boundsCache=n;for(var m=0,x=c.list,k=x.length;m<k;m++){var T=x[m];T!==r&&(T._bounds=T._position=n,T._boundsCache&&D._clearBoundsCache(T))}}},_getBounds:function(r,c,m){var x=1/0,k=-x,T=x,R=k,L=!1;m=m||{};for(var q=0,z=r.length;q<z;q++){var X=r[q];if(X._visible&&!X.isEmpty(!0)){var Z=X._getCachedBounds(c&&c.appended(X._matrix),m,!0),Q=Z.rect;x=Math.min(Q.x,x),T=Math.min(Q.y,T),k=Math.max(Q.x+Q.width,k),R=Math.max(Q.y+Q.height,R),Z.nonscaling&&(L=!0)}}return{rect:isFinite(x)?new N(x,T,k-x,R-T):new N,nonscaling:L}}}}),{beans:!0,_decompose:function(){return this._applyMatrix?null:this._decomposed||(this._decomposed=this._matrix.decompose())},getRotation:function(){var r=this._decompose();return r?r.rotation:0},setRotation:function(r){var c=this.getRotation();if(c!=null&&r!=null){var m=this._decomposed;this.rotate(r-c),m&&(m.rotation=r,this._decomposed=m)}},getScaling:function(){var r=this._decompose(),c=r&&r.scaling;return new w(c?c.x:1,c?c.y:1,this,"setScaling")},setScaling:function(){var r=this.getScaling(),c=g.read(arguments,0,{clone:!0,readNull:!0});if(r&&c&&!r.equals(c)){var m=this.getRotation(),x=this._decomposed,k=new O,T=C.isZero;if(T(r.x)||T(r.y))k.translate(x.translation),m&&k.rotate(m),k.scale(c.x,c.y),this._matrix.set(k);else{var R=this.getPosition(!0);k.translate(R),m&&k.rotate(m),k.scale(c.x/r.x,c.y/r.y),m&&k.rotate(-m),k.translate(R.negate()),this.transform(k)}x&&(x.scaling=c,this._decomposed=x)}},getMatrix:function(){return this._matrix},setMatrix:function(){var r=this._matrix;r.set.apply(r,arguments)},getGlobalMatrix:function(r){var c=this._globalMatrix;if(c)for(var m=this._parent,x=[];m;){if(!m._globalMatrix){c=null;for(var k=0,T=x.length;k<T;k++)x[k]._globalMatrix=null;break}x.push(m),m=m._parent}if(!c){c=this._globalMatrix=this._matrix.clone();var m=this._parent;m&&c.prepend(m.getGlobalMatrix(!0))}return r?c:c.clone()},getViewMatrix:function(){return this.getGlobalMatrix().prepend(this.getView()._matrix)},getApplyMatrix:function(){return this._applyMatrix},setApplyMatrix:function(r){(this._applyMatrix=this._canApplyMatrix&&!!r)&&this.transform(null,!0)},getTransformContent:"#getApplyMatrix",setTransformContent:"#setApplyMatrix"},{getProject:function(){return this._project},_setProject:function(r,c){if(this._project!==r){this._project&&this._installEvents(!1),this._project=r;for(var m=this._children,x=0,k=m&&m.length;x<k;x++)m[x]._setProject(r);c=!0}c&&this._installEvents(!0)},getView:function(){return this._project._view},_installEvents:function r(c){r.base.call(this,c);for(var m=this._children,x=0,k=m&&m.length;x<k;x++)m[x]._installEvents(c)},getLayer:function(){for(var r=this;r=r._parent;)if(r instanceof B)return r;return null},getParent:function(){return this._parent},setParent:function(r){return r.addChild(this)},_getOwner:"#getParent",getChildren:function(){return this._children},setChildren:function(r){this.removeChildren(),this.addChildren(r)},getFirstChild:function(){return this._children&&this._children[0]||null},getLastChild:function(){return this._children&&this._children[this._children.length-1]||null},getNextSibling:function(){var r=this._getOwner();return r&&r._children[this._index+1]||null},getPreviousSibling:function(){var r=this._getOwner();return r&&r._children[this._index-1]||null},getIndex:function(){return this._index},setIndex:function(r){var c=this._parent,m=c&&c._children;m&&c.insertChildren(r in m?r:n,[this])},equals:function(r){return r===this||r&&this._class===r._class&&this._style.equals(r._style)&&this._matrix.equals(r._matrix)&&this._locked===r._locked&&this._visible===r._visible&&this._blendMode===r._blendMode&&this._opacity===r._opacity&&this._clipMask===r._clipMask&&this._guide===r._guide&&this._equals(r)||!1},_equals:function(r){return l.equals(this._children,r._children)},clone:function(r){var c=new this.constructor(D.NO_INSERT),m=this._children,x=l.pick(r?r.insert:n,r===n||r===!0),k=l.pick(r?r.deep:n,!0);m&&c.copyAttributes(this),(!m||k)&&c.copyContent(this),m||c.copyAttributes(this),x&&c.insertAbove(this);var T=this._name,R=this._parent;if(T&&R){for(var m=R._children,L=T,q=1;m[T];)T=L+" "+q++;T!==L&&c.setName(T)}return c},copyContent:function(r){for(var c=r._children,m=0,x=c&&c.length;m<x;m++)this.addChild(c[m].clone(!1),!0)},copyAttributes:function(r,c){this.setStyle(r._style);for(var m=["_locked","_visible","_blendMode","_opacity","_clipMask","_guide"],x=0,k=m.length;x<k;x++){var T=m[x];r.hasOwnProperty(T)&&(this[T]=r[T])}c||this._matrix.set(r._matrix,!0),this.setApplyMatrix(r._applyMatrix),this.setPivot(r._pivot),this.setSelection(r._selection);var R=r._data,L=r._name;this._data=R?l.clone(R):null,L&&this.setName(L)},rasterize:function(r,c){var m,x,k;l.isPlainObject(r)?(m=r.resolution,x=r.insert,k=r.raster):(m=r,x=c),k||(k=new he(D.NO_INSERT));var T=this.getStrokeBounds(),R=(m||this.getView().getResolution())/72,L=T.getTopLeft().floor(),q=T.getBottomRight().ceil(),z=new p(q.subtract(L)),X=z.multiply(R);if(k.setSize(X,!0),!X.isZero()){var Z=k.getContext(!0),Q=new O().scale(R).translate(L.negate());Z.save(),Q.applyToContext(Z),this.draw(Z,new l({matrices:[Q]})),Z.restore()}return k._matrix.set(new O().translate(L.add(z.divide(2))).scale(1/R)),(x===n||x)&&k.insertAbove(this),k},contains:function(){var r=this._matrix;return r.isInvertible()&&!!this._contains(r._inverseTransform(g.read(arguments)))},_contains:function(r){var c=this._children;if(c){for(var m=c.length-1;m>=0;m--)if(c[m].contains(r))return!0;return!1}return r.isInside(this.getInternalBounds())},isInside:function(){return N.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new F.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(r,c){return r instanceof D?this._asPathItem().getIntersections(r._asPathItem(),null,c,!0).length>0:!1}},new function(){function r(){var x=arguments;return this._hitTest(g.read(x),le.getOptions(x))}function c(){var x=arguments,k=g.read(x),T=le.getOptions(x),R=[];return this._hitTest(k,new l({all:R},T)),R}function m(x,k,T,R){var L=this._children;if(L)for(var q=L.length-1;q>=0;q--){var z=L[q],X=z!==R&&z._hitTest(x,k,T);if(X&&!k.all)return X}return null}return U.inject({hitTest:r,hitTestAll:c,_hitTest:m}),{hitTest:r,hitTestAll:c,_hitTestChildren:m}},{_hitTest:function(r,c,m){if(this._locked||!this._visible||this._guide&&!c.guides||this.isEmpty())return null;var x=this._matrix,k=m?m.appended(x):this.getGlobalMatrix().prepend(this.getView()._matrix),T=Math.max(c.tolerance,1e-12),R=c._tolerancePadding=new p(F._getStrokePadding(T,x._shiftless().invert()));if(r=x._inverseTransform(r),!r||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(R.multiply(2))._containsPoint(r))return null;var L=!(c.guides&&!this._guide||c.selected&&!this.isSelected()||c.type&&c.type!==l.hyphenate(this._class)||c.class&&!(this instanceof c.class)),q=c.match,z=this,X,Z;function Q(K){return K&&q&&!q(K)&&(K=null),K&&c.all&&c.all.push(K),K}function j(K,se){var de=se?X["get"+se]():z.getPosition();if(r.subtract(de).divide(R).length<=1)return new le(K,z,{name:se?l.hyphenate(se):K,point:de})}var ce=c.position,te=c.center,oe=c.bounds;if(L&&this._parent&&(ce||te||oe)){if((te||oe)&&(X=this.getInternalBounds()),Z=ce&&j("position")||te&&j("center","Center"),!Z&&oe)for(var ee=["TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],re=0;re<8&&!Z;re++)Z=j("bounds",ee[re]);Z=Q(Z)}return Z||(Z=this._hitTestChildren(r,c,k)||L&&Q(this._hitTestSelf(r,c,k,this.getStrokeScaling()?null:k._shiftless().invert()))||null),Z&&Z.point&&(Z.point=x.transform(Z.point)),Z},_hitTestSelf:function(r,c){if(c.fill&&this.hasFill()&&this._contains(r))return new le("fill",this)},matches:function(r,c){function m(R,L){for(var q in R)if(R.hasOwnProperty(q)){var z=R[q],X=L[q];if(l.isPlainObject(z)&&l.isPlainObject(X)){if(!m(z,X))return!1}else if(!l.equals(z,X))return!1}return!0}var x=typeof r;if(x==="object"){for(var k in r)if(r.hasOwnProperty(k)&&!this.matches(k,r[k]))return!1;return!0}else{if(x==="function")return r(this);if(r==="match")return c(this);var T=/^(empty|editable)$/.test(r)?this["is"+l.capitalize(r)]():r==="type"?l.hyphenate(this._class):this[r];if(r==="class"){if(typeof c=="function")return this instanceof c;T=this._class}if(typeof c=="function")return!!c(T);if(c){if(c.test)return c.test(T);if(l.isPlainObject(c))return m(c,T)}return l.equals(T,c)}},getItems:function(r){return D._getItems(this,r,this._matrix)},getItem:function(r){return D._getItems(this,r,this._matrix,null,!0)[0]||null},statics:{_getItems:function r(c,m,x,k,T){if(!k){var R=typeof m=="object"&&m,L=R&&R.overlapping,q=R&&R.inside,z=L||q,Q=z&&N.read([z]);k={items:[],recursive:R&&R.recursive!==!1,inside:!!q,overlapping:!!L,rect:Q,path:L&&new F.Rectangle({rectangle:Q,insert:!1})},R&&(m=l.filter({},m,{recursive:!0,inside:!0,overlapping:!0}))}var X=c._children,Z=k.items,Q=k.rect;x=Q&&(x||new O);for(var j=0,ce=X&&X.length;j<ce;j++){var te=X[j],oe=x&&x.appended(te._matrix),ee=!0;if(Q){var z=te.getBounds(oe);if(!Q.intersects(z))continue;Q.contains(z)||k.overlapping&&(z.contains(Q)||k.path.intersects(te,oe))||(ee=!1)}if(ee&&te.matches(m)&&(Z.push(te),T)||(k.recursive!==!1&&r(te,m,oe,k,T),T&&Z.length>0))break}return Z}}},{importJSON:function(r){var c=l.importJSON(r,this);return c!==this?this.addChild(c):c},addChild:function(r){return this.insertChild(n,r)},insertChild:function(r,c){var m=c?this.insertChildren(r,[c]):null;return m&&m[0]},addChildren:function(r){return this.insertChildren(this._children.length,r)},insertChildren:function(r,c){var m=this._children;if(m&&c&&c.length>0){c=l.slice(c);for(var x={},k=c.length-1;k>=0;k--){var T=c[k],R=T&&T._id;!T||x[R]?c.splice(k,1):(T._remove(!1,!0),x[R]=!0)}l.splice(m,c,r,0);for(var L=this._project,q=L._changes,k=0,z=c.length;k<z;k++){var T=c[k],X=T._name;T._parent=this,T._setProject(L,!0),X&&T.setName(X),q&&T._changed(5)}this._changed(11)}else c=null;return c},_insertItem:"#insertChild",_insertAt:function(r,c){var m=r&&r._getOwner(),x=r!==this&&m?this:null;return x&&(x._remove(!1,!0),m._insertItem(r._index+c,x)),x},insertAbove:function(r){return this._insertAt(r,1)},insertBelow:function(r){return this._insertAt(r,0)},sendToBack:function(){var r=this._getOwner();return r?r._insertItem(0,this):null},bringToFront:function(){var r=this._getOwner();return r?r._insertItem(n,this):null},appendTop:"#addChild",appendBottom:function(r){return this.insertChild(0,r)},moveAbove:"#insertAbove",moveBelow:"#insertBelow",addTo:function(r){return r._insertItem(n,this)},copyTo:function(r){return this.clone(!1).addTo(r)},reduce:function(r){var c=this._children;if(c&&c.length===1){var m=c[0].reduce(r);return this._parent?(m.insertAbove(this),this.remove()):m.remove(),m}return this},_removeNamed:function(){var r=this._getOwner();if(r){var c=r._children,m=r._namedChildren,x=this._name,k=m[x],T=k?k.indexOf(this):-1;T!==-1&&(c[x]==this&&delete c[x],k.splice(T,1),k.length?c[x]=k[0]:delete m[x])}},_remove:function(r,c){var m=this._getOwner(),x=this._project,k=this._index;return this._style&&this._style._dispose(),m?(this._name&&this._removeNamed(),k!=null&&(x._activeLayer===this&&(x._activeLayer=this.getNextSibling()||this.getPreviousSibling()),l.splice(m._children,null,k,1)),this._installEvents(!1),r&&x._changes&&this._changed(5),c&&m._changed(11,this),this._parent=null,!0):!1},remove:function(){return this._remove(!0,!0)},replaceWith:function(r){var c=r&&r.insertBelow(this);return c&&this.remove(),c},removeChildren:function(r,c){if(!this._children)return null;r=r||0,c=l.pick(c,this._children.length);for(var m=l.splice(this._children,null,r,c-r),x=m.length-1;x>=0;x--)m[x]._remove(!0,!1);return m.length>0&&this._changed(11),m},clear:"#removeChildren",reverseChildren:function(){if(this._children){this._children.reverse();for(var r=0,c=this._children.length;r<c;r++)this._children[r]._index=r;this._changed(11)}},isEmpty:function(r){var c=this._children,m=c?c.length:0;if(r){for(var x=0;x<m;x++)if(!c[x].isEmpty(r))return!1;return!0}return!m},isEditable:function(){for(var r=this;r;){if(!r._visible||r._locked)return!1;r=r._parent}return!0},hasFill:function(){return this.getStyle().hasFill()},hasStroke:function(){return this.getStyle().hasStroke()},hasShadow:function(){return this.getStyle().hasShadow()},_getOrder:function(r){function c(R){var L=[];do L.unshift(R);while(R=R._parent);return L}for(var m=c(this),x=c(r),k=0,T=Math.min(m.length,x.length);k<T;k++)if(m[k]!=x[k])return m[k]._index<x[k]._index?1:-1;return 0},hasChildren:function(){return this._children&&this._children.length>0},isInserted:function(){return this._parent?this._parent.isInserted():!1},isAbove:function(r){return this._getOrder(r)===-1},isBelow:function(r){return this._getOrder(r)===1},isParent:function(r){return this._parent===r},isChild:function(r){return r&&r._parent===this},isDescendant:function(r){for(var c=this;c=c._parent;)if(c===r)return!0;return!1},isAncestor:function(r){return r?r.isDescendant(this):!1},isSibling:function(r){return this._parent===r._parent},isGroupedWith:function(r){for(var c=this._parent;c;){if(c._parent&&/^(Group|Layer|CompoundPath)$/.test(c._class)&&r.isDescendant(c))return!0;c=c._parent}return!1}},l.each(["rotate","scale","shear","skew"],function(r){var c=r==="rotate";this[r]=function(){var m=arguments,x=(c?l:g).read(m),k=g.read(m,0,{readNull:!0});return this.transform(new O()[r](x,k||this.getPosition(!0)))}},{translate:function(){var r=new O;return this.transform(r.translate.apply(r,arguments))},transform:function(r,c,m){var x=this._matrix,k=r&&!r.isIdentity(),T=m&&this._canApplyMatrix||this._applyMatrix&&(k||!x.isIdentity()||c&&this._children);if(!k&&!T)return this;if(k){!r.isInvertible()&&x.isInvertible()&&(x._backup=x.getValues()),x.prepend(r,!0);var R=this._style,L=R.getFillColor(!0),q=R.getStrokeColor(!0);L&&L.transform(r),q&&q.transform(r)}if(T&&(T=this._transformContent(x,c,m))){var z=this._pivot;z&&x._transformPoint(z,z,!0),x.reset(!0),m&&this._canApplyMatrix&&(this._applyMatrix=!0)}var X=this._bounds,Z=this._position;(k||T)&&this._changed(25);var Q=k&&X&&r.decompose();if(Q&&Q.skewing.isZero()&&Q.rotation%90===0){for(var j in X){var ce=X[j];if(ce.nonscaling)delete X[j];else if(T||!ce.internal){var te=ce.rect;r._transformBounds(te,te)}}this._bounds=X;var oe=X[this._getBoundsCacheKey(this._boundsOptions||{})];oe&&(this._position=this._getPositionFromBounds(oe.rect))}else k&&Z&&this._pivot&&(this._position=r._transformPoint(Z,Z));return this},_transformContent:function(r,c,m){var x=this._children;if(x){for(var k=0,T=x.length;k<T;k++)x[k].transform(r,c,m);return!0}},globalToLocal:function(){return this.getGlobalMatrix(!0)._inverseTransform(g.read(arguments))},localToGlobal:function(){return this.getGlobalMatrix(!0)._transformPoint(g.read(arguments))},parentToLocal:function(){return this._matrix._inverseTransform(g.read(arguments))},localToParent:function(){return this._matrix._transformPoint(g.read(arguments))},fitBounds:function(r,c){r=N.read(arguments);var m=this.getBounds(),x=m.height/m.width,k=r.height/r.width,T=(c?x>k:x<k)?r.width/m.width:r.height/m.height,R=new N(new g,new p(m.width*T,m.height*T));R.setCenter(r.getCenter()),this.setBounds(R)}}),{_setStyles:function(r,c,m){var x=this._style,k=this._matrix;if(x.hasFill()&&(r.fillStyle=x.getFillColor().toCanvasStyle(r,k)),x.hasStroke()){r.strokeStyle=x.getStrokeColor().toCanvasStyle(r,k),r.lineWidth=x.getStrokeWidth();var T=x.getStrokeJoin(),R=x.getStrokeCap(),L=x.getMiterLimit();if(T&&(r.lineJoin=T),R&&(r.lineCap=R),L&&(r.miterLimit=L),Qe.support.nativeDash){var q=x.getDashArray(),z=x.getDashOffset();q&&q.length&&("setLineDash"in r?(r.setLineDash(q),r.lineDashOffset=z):(r.mozDash=q,r.mozDashOffset=z))}}if(x.hasShadow()){var X=c.pixelRatio||1,Z=m._shiftless().prepend(new O().scale(X,X)),Q=Z.transform(new g(x.getShadowBlur(),0)),j=Z.transform(this.getShadowOffset());r.shadowColor=x.getShadowColor().toCanvasStyle(r),r.shadowBlur=Q.getLength(),r.shadowOffsetX=j.x,r.shadowOffsetY=j.y}},draw:function(r,c,m){if(this._updateVersion=this._project._updateVersion,!(!this._visible||this._opacity===0)){var x=c.matrices,k=c.viewMatrix,T=this._matrix,R=x[x.length-1].appended(T);if(R.isInvertible()){k=k?k.appended(R):R,x.push(R),c.updateMatrix&&(this._globalMatrix=R);var L=this._blendMode,q=C.clamp(this._opacity,0,1),z=L==="normal",X=je.nativeModes[L],Z=z&&q===1||c.dontStart||c.clip||(X||z&&q<1)&&this._canComposite(),Q=c.pixelRatio||1,j,ce,te;if(!Z){var oe=this.getStrokeBounds(k);if(!oe.width||!oe.height){x.pop();return}te=c.offset,ce=c.offset=oe.getTopLeft().floor(),j=r,r=qe.getContext(oe.getSize().ceil().add(1).multiply(Q)),Q!==1&&r.scale(Q,Q)}r.save();var ee=m?m.appended(T):this._canScaleStroke&&!this.getStrokeScaling(!0)&&k,re=!Z&&c.clipItem,K=!ee||re;if(Z?(r.globalAlpha=q,X&&(r.globalCompositeOperation=L)):K&&r.translate(-ce.x,-ce.y),K&&(Z?T:k).applyToContext(r),re&&c.clipItem.draw(r,c.extend({clip:!0})),ee){r.setTransform(Q,0,0,Q,0,0);var se=c.offset;se&&r.translate(-se.x,-se.y)}this._draw(r,c,k,ee),r.restore(),x.pop(),c.clip&&!c.dontFinish&&r.clip(this.getFillRule()),Z||(je.process(L,r,j,q,ce.subtract(te).multiply(Q)),qe.release(r),c.offset=te)}}},_isUpdated:function(r){var c=this._parent;if(c instanceof H)return c._isUpdated(r);var m=this._updateVersion===r;return!m&&c&&c._visible&&c._isUpdated(r)&&(this._updateVersion=r,m=!0),m},_drawSelection:function(r,c,m,x,k){var T=this._selection,R=T&1,L=T&2||R&&this._selectBounds,q=T&4;if(this._drawSelected||(R=!1),(R||L||q)&&this._isUpdated(k)){var z,X=this.getSelectedColor(!0)||(z=this.getLayer())&&z.getSelectedColor(!0),Z=c.appended(this.getGlobalMatrix(!0)),Q=m/2;if(r.strokeStyle=r.fillStyle=X?X.toCanvasStyle(r):"#009dec",R&&this._drawSelected(r,Z,x),q){var j=this.getPosition(!0),ce=this._parent,te=ce?ce.localToGlobal(j):j,oe=te.x,ee=te.y;r.beginPath(),r.arc(oe,ee,Q,0,Math.PI*2,!0),r.stroke();for(var re=[[0,-1],[1,0],[0,1],[-1,0]],K=Q,se=m+1,de=0;de<4;de++){var ve=re[de],ue=ve[0],Ce=ve[1];r.moveTo(oe+ue*K,ee+Ce*K),r.lineTo(oe+ue*se,ee+Ce*se),r.stroke()}}if(L){var Me=Z._transformCorners(this.getInternalBounds());r.beginPath();for(var de=0;de<8;de++)r[de?"lineTo":"moveTo"](Me[de],Me[++de]);r.closePath(),r.stroke();for(var de=0;de<8;de++)r.fillRect(Me[de]-Q,Me[++de]-Q,m,m)}}},_canComposite:function(){return!1}},l.each(["down","drag","up","move"],function(r){this["removeOn"+l.capitalize(r)]=function(){var c={};return c[r]=!0,this.removeOn(c)}},{removeOn:function(r){for(var c in r)if(r[c]){var m="mouse"+c,x=this._project,k=x._removeSets=x._removeSets||{};k[m]=k[m]||{},k[m][this._id]=this}return this}}),{tween:function(r,c,m){m||(m=c,c=r,r=null,m||(m=c,c=null));var x=m&&m.easing,k=m&&m.start,T=m!=null&&(typeof m=="number"?m:m.duration),R=new Ar(this,r,c,T,x,k);function L(q){R._handleFrame(q.time*1e3),R.running||this.off("frame",L)}return T&&this.on("frame",L),R},tweenTo:function(r,c){return this.tween(null,r,c)},tweenFrom:function(r,c){return this.tween(r,null,c)}}),me=D.extend({_class:"Group",_selectBounds:!1,_selectChildren:!0,_serializeFields:{children:[]},initialize:function(c){this._children=[],this._namedChildren={},this._initialize(c)||this.addChildren(Array.isArray(c)?c:arguments)},_changed:function r(c){r.base.call(this,c),c&2050&&(this._clipItem=n)},_getClipItem:function(){var r=this._clipItem;if(r===n){r=null;for(var c=this._children,m=0,x=c.length;m<x;m++)if(c[m]._clipMask){r=c[m];break}this._clipItem=r}return r},isClipped:function(){return!!this._getClipItem()},setClipped:function(r){var c=this.getFirstChild();c&&c.setClipMask(r)},_getBounds:function r(c,m){var x=this._getClipItem();return x?x._getCachedBounds(x._matrix.prepended(c),l.set({},m,{stroke:!1})):r.base.call(this,c,m)},_hitTestChildren:function r(c,m,x){var k=this._getClipItem();return(!k||k.contains(c))&&r.base.call(this,c,m,x,k)},_draw:function(r,c){var m=c.clip,x=!m&&this._getClipItem();c=c.extend({clipItem:x,clip:!1}),m?(r.beginPath(),c.dontStart=c.dontFinish=!0):x&&x.draw(r,c.extend({clip:!0}));for(var k=this._children,T=0,R=k.length;T<R;T++){var L=k[T];L!==x&&L.draw(r,c)}}}),B=me.extend({_class:"Layer",initialize:function(){me.apply(this,arguments)},_getOwner:function(){return this._parent||this._index!=null&&this._project},isInserted:function r(){return this._parent?r.base.call(this):this._index!=null},activate:function(){this._project._activeLayer=this},_hitTestSelf:function(){}}),ie=D.extend({_class:"Shape",_applyMatrix:!1,_canApplyMatrix:!1,_canScaleStroke:!0,_serializeFields:{type:null,size:null,radius:null},initialize:function(c,m){this._initialize(c,m)},_equals:function(r){return this._type===r._type&&this._size.equals(r._size)&&l.equals(this._radius,r._radius)},copyContent:function(r){this.setType(r._type),this.setSize(r._size),this.setRadius(r._radius)},getType:function(){return this._type},setType:function(r){this._type=r},getShape:"#getType",setShape:"#setType",getSize:function(){var r=this._size;return new E(r.width,r.height,this,"setSize")},setSize:function(){var r=p.read(arguments);if(!this._size)this._size=r.clone();else if(!this._size.equals(r)){var c=this._type,m=r.width,x=r.height;c==="rectangle"?this._radius.set(p.min(this._radius,r.divide(2).abs())):c==="circle"?(m=x=(m+x)/2,this._radius=m/2):c==="ellipse"&&this._radius._set(m/2,x/2),this._size._set(m,x),this._changed(9)}},getRadius:function(){var r=this._radius;return this._type==="circle"?r:new E(r.width,r.height,this,"setRadius")},setRadius:function(r){var c=this._type;if(c==="circle"){if(r===this._radius)return;var m=r*2;this._radius=r,this._size._set(m,m)}else if(r=p.read(arguments),!this._radius)this._radius=r.clone();else{if(this._radius.equals(r))return;if(this._radius.set(r),c==="rectangle"){var m=p.max(this._size,r.multiply(2));this._size.set(m)}else c==="ellipse"&&this._size._set(r.width*2,r.height*2)}this._changed(9)},isEmpty:function(){return!1},toPath:function(r){var c=new F[l.capitalize(this._type)]({center:new g,size:this._size,radius:this._radius,insert:!1});return c.copyAttributes(this),Qe.settings.applyMatrix&&c.setApplyMatrix(!0),(r===n||r)&&c.insertAbove(this),c},toShape:"#clone",_asPathItem:function(){return this.toPath(!1)},_draw:function(r,c,m,x){var k=this._style,T=k.hasFill(),R=k.hasStroke(),L=c.dontFinish||c.clip,q=!x;if(T||R||L){var z=this._type,X=this._radius,Z=z==="circle";if(c.dontStart||r.beginPath(),q&&Z)r.arc(0,0,X,0,Math.PI*2,!0);else{var Q=Z?X:X.width,j=Z?X:X.height,ce=this._size,te=ce.width,oe=ce.height;if(q&&z==="rectangle"&&Q===0&&j===0)r.rect(-te/2,-oe/2,te,oe);else{var ee=te/2,re=oe/2,K=1-.5522847498307936,se=Q*K,de=j*K,ve=[-ee,-re+j,-ee,-re+de,-ee+se,-re,-ee+Q,-re,ee-Q,-re,ee-se,-re,ee,-re+de,ee,-re+j,ee,re-j,ee,re-de,ee-se,re,ee-Q,re,-ee+Q,re,-ee+se,re,-ee,re-de,-ee,re-j];x&&x.transform(ve,ve,32),r.moveTo(ve[0],ve[1]),r.bezierCurveTo(ve[2],ve[3],ve[4],ve[5],ve[6],ve[7]),ee!==Q&&r.lineTo(ve[8],ve[9]),r.bezierCurveTo(ve[10],ve[11],ve[12],ve[13],ve[14],ve[15]),re!==j&&r.lineTo(ve[16],ve[17]),r.bezierCurveTo(ve[18],ve[19],ve[20],ve[21],ve[22],ve[23]),ee!==Q&&r.lineTo(ve[24],ve[25]),r.bezierCurveTo(ve[26],ve[27],ve[28],ve[29],ve[30],ve[31])}}r.closePath()}!L&&(T||R)&&(this._setStyles(r,c,m),T&&(r.fill(k.getFillRule()),r.shadowColor="rgba(0,0,0,0)"),R&&r.stroke())},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_getBounds:function(r,c){var m=new N(this._size).setCenter(0,0),x=this._style,k=c.stroke&&x.hasStroke()&&x.getStrokeWidth();return r&&(m=r._transformBounds(m)),k?m.expand(F._getStrokePadding(k,this._getStrokeMatrix(r,c))):m}},new function(){function r(m,x,k){var T=m._radius;if(!T.isZero())for(var R=m._size.divide(2),L=1;L<=4;L++){var q=new g(L>1&&L<4?-1:1,L>2?-1:1),z=q.multiply(R),X=z.subtract(q.multiply(T)),Z=new N(k?z.add(q.multiply(k)):z,X);if(Z.contains(x))return{point:X,quadrant:L}}}function c(m,x,k,T){var R=m.divide(x);return(!T||R.isInQuadrant(T))&&R.subtract(R.normalize()).multiply(x).divide(k).length<=1}return{_contains:function m(x){if(this._type==="rectangle"){var k=r(this,x);return k?x.subtract(k.point).divide(this._radius).getLength()<=1:m.base.call(this,x)}else return x.divide(this.size).getLength()<=.5},_hitTestSelf:function m(x,k,T,R){var L=!1,q=this._style,z=k.stroke&&q.hasStroke(),X=k.fill&&q.hasFill();if(z||X){var Z=this._type,Q=this._radius,j=z?q.getStrokeWidth()/2:0,ce=k._tolerancePadding.add(F._getStrokePadding(j,!q.getStrokeScaling()&&R));if(Z==="rectangle"){var te=ce.multiply(2),oe=r(this,x,te);if(oe)L=c(x.subtract(oe.point),Q,ce,oe.quadrant);else{var ee=new N(this._size).setCenter(0,0),re=ee.expand(te),K=ee.expand(te.negate());L=re._containsPoint(x)&&!K._containsPoint(x)}}else L=c(x,Q,ce)}return L?new le(z?"stroke":"fill",this):m.base.apply(this,arguments)}}},{statics:new function(){function r(c,m,x,k,T){var R=l.create(ie.prototype);return R._type=c,R._size=x,R._radius=k,R._initialize(l.getNamed(T),m),R}return{Circle:function(){var c=arguments,m=g.readNamed(c,"center"),x=l.readNamed(c,"radius");return r("circle",m,new p(x*2),x,c)},Rectangle:function(){var c=arguments,m=N.readNamed(c,"rectangle"),x=p.min(p.readNamed(c,"radius"),m.getSize(!0).divide(2));return r("rectangle",m.getCenter(!0),m.getSize(!0),x,c)},Ellipse:function(){var c=arguments,m=ie._readEllipse(c),x=m.radius;return r("ellipse",m.center,x.multiply(2),x,c)},_readEllipse:function(c){var m,x;if(l.hasNamed(c,"radius"))m=g.readNamed(c,"center"),x=p.readNamed(c,"radius");else{var k=N.readNamed(c,"rectangle");m=k.getCenter(!0),x=k.getSize(!0).divide(2)}return{center:m,radius:x}}}}}),he=D.extend({_class:"Raster",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:["crossOrigin"],_smoothing:"low",beans:!0,initialize:function(c,m){if(!this._initialize(c,m!==n&&g.read(arguments))){var x,k=typeof c,T=k==="string"?o.getElementById(c):k==="object"?c:null;if(T&&T!==D.NO_INSERT){if(T.getContext||T.naturalHeight!=null)x=T;else if(T){var R=p.read(arguments);R.isZero()||(x=qe.getCanvas(R))}}x?this.setImage(x):this.setSource(c)}this._size||(this._size=new p,this._loaded=!1)},_equals:function(r){return this.getSource()===r.getSource()},copyContent:function(r){var c=r._image,m=r._canvas;if(c)this._setImage(c);else if(m){var x=qe.getCanvas(r._size);x.getContext("2d").drawImage(m,0,0),this._setImage(x)}this._crossOrigin=r._crossOrigin},getSize:function(){var r=this._size;return new E(r?r.width:0,r?r.height:0,this,"setSize")},setSize:function(r,c){var m=p.read(arguments);if(m.equals(this._size))c&&this.clear();else if(m.width>0&&m.height>0){var x=!c&&this.getElement();this._setImage(qe.getCanvas(m)),x&&this.getContext(!0).drawImage(x,0,0,m.width,m.height)}else this._canvas&&qe.release(this._canvas),this._size=m.clone()},getWidth:function(){return this._size?this._size.width:0},setWidth:function(r){this.setSize(r,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(r){this.setSize(this.getWidth(),r)},getLoaded:function(){return this._loaded},isEmpty:function(){var r=this._size;return!r||r.width===0&&r.height===0},getResolution:function(){var r=this._matrix,c=new g(0,0).transform(r),m=new g(1,0).transform(r).subtract(c),x=new g(0,1).transform(r).subtract(c);return new p(72/m.getLength(),72/x.getLength())},getPpi:"#getResolution",getImage:function(){return this._image},setImage:function(r){var c=this;function m(x){var k=c.getView(),T=x&&x.type||"load";k&&c.responds(T)&&(Qe=k._scope,c.emit(T,new xt(x)))}this._setImage(r),this._loaded?setTimeout(m,0):r&&bt.add(r,{load:function(x){c._setImage(r),m(x)},error:m})},_setImage:function(r){this._canvas&&qe.release(this._canvas),r&&r.getContext?(this._image=null,this._canvas=r,this._loaded=!0):(this._image=r,this._canvas=null,this._loaded=!!(r&&r.src&&r.complete)),this._size=new p(r?r.naturalWidth||r.width:0,r?r.naturalHeight||r.height:0),this._context=null,this._changed(1033)},getCanvas:function(){if(!this._canvas){var r=qe.getContext(this._size);try{this._image&&r.drawImage(this._image,0,0),this._canvas=r.canvas}catch{qe.release(r)}}return this._canvas},setCanvas:"#setImage",getContext:function(r){return this._context||(this._context=this.getCanvas().getContext("2d")),r&&(this._image=null,this._changed(1025)),this._context},setContext:function(r){this._context=r},getSource:function(){var r=this._image;return r&&r.src||this.toDataURL()},setSource:function(r){var c=new t.Image,m=this._crossOrigin;m&&(c.crossOrigin=m),r&&(c.src=r),this.setImage(c)},getCrossOrigin:function(){var r=this._image;return r&&r.crossOrigin||this._crossOrigin||""},setCrossOrigin:function(r){this._crossOrigin=r;var c=this._image;c&&(c.crossOrigin=r)},getSmoothing:function(){return this._smoothing},setSmoothing:function(r){this._smoothing=typeof r=="string"?r:r?"low":"off",this._changed(257)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var r=N.read(arguments),c=qe.getContext(r.getSize());return c.drawImage(this.getCanvas(),r.x,r.y,r.width,r.height,0,0,r.width,r.height),c.canvas},getSubRaster:function(){var r=N.read(arguments),c=new he(D.NO_INSERT);return c._setImage(this.getSubCanvas(r)),c.translate(r.getCenter().subtract(this.getSize().divide(2))),c._matrix.prepend(this._matrix),c.insertAbove(this),c},toDataURL:function(){var r=this._image,c=r&&r.src;if(/^data:/.test(c))return c;var m=this.getCanvas();return m?m.toDataURL.apply(m,arguments):null},drawImage:function(r){var c=g.read(arguments,1);this.getContext(!0).drawImage(r,c.x,c.y)},getAverageColor:function(r){var c,m;if(r?r instanceof ye?(m=r,c=r.getBounds()):typeof r=="object"&&("width"in r?c=new N(r):"x"in r&&(c=new N(r.x-.5,r.y-.5,1,1))):c=this.getBounds(),!c)return null;var x=32,k=Math.min(c.width,x),T=Math.min(c.height,x),R=he._sampleContext;R?R.clearRect(0,0,x+1,x+1):R=he._sampleContext=qe.getContext(new p(x)),R.save();var L=new O().scale(k/c.width,T/c.height).translate(-c.x,-c.y);L.applyToContext(R),m&&m.draw(R,new l({clip:!0,matrices:[L]})),this._matrix.applyToContext(R);var q=this.getElement(),z=this._size;q&&R.drawImage(q,-z.width/2,-z.height/2),R.restore();for(var X=R.getImageData(.5,.5,Math.ceil(k),Math.ceil(T)).data,Z=[0,0,0],Q=0,j=0,ce=X.length;j<ce;j+=4){var te=X[j+3];Q+=te,te/=255,Z[0]+=X[j]*te,Z[1]+=X[j+1]*te,Z[2]+=X[j+2]*te}for(var j=0;j<3;j++)Z[j]/=Q;return Q?Ie.read(Z):null},getPixel:function(){var r=g.read(arguments),c=this.getContext().getImageData(r.x,r.y,1,1).data;return new Ie("rgb",[c[0]/255,c[1]/255,c[2]/255],c[3]/255)},setPixel:function(){var r=arguments,c=g.read(r),m=Ie.read(r),x=m._convert("rgb"),k=m._alpha,T=this.getContext(!0),R=T.createImageData(1,1),L=R.data;L[0]=x[0]*255,L[1]=x[1]*255,L[2]=x[2]*255,L[3]=k!=null?k*255:255,T.putImageData(R,c.x,c.y)},clear:function(){var r=this._size;this.getContext(!0).clearRect(0,0,r.width+1,r.height+1)},createImageData:function(){var r=p.read(arguments);return this.getContext().createImageData(r.width,r.height)},getImageData:function(){var r=N.read(arguments);return r.isEmpty()&&(r=new N(this._size)),this.getContext().getImageData(r.x,r.y,r.width,r.height)},putImageData:function(r){var c=g.read(arguments,1);this.getContext(!0).putImageData(r,c.x,c.y)},setImageData:function(r){this.setSize(r),this.getContext(!0).putImageData(r,0,0)},_getBounds:function(r,c){var m=new N(this._size).setCenter(0,0);return r?r._transformBounds(m):m},_hitTestSelf:function(r){if(this._contains(r)){var c=this;return new le("pixel",c,{offset:r.add(c._size.divide(2)).round(),color:{get:function(){return c.getPixel(this.offset)}}})}},_draw:function(r,c,m){var x=this.getElement();if(x&&x.width>0&&x.height>0){r.globalAlpha=C.clamp(this._opacity,0,1),this._setStyles(r,c,m);var k=this._smoothing,T=k==="off";dt.setPrefixed(r,T?"imageSmoothingEnabled":"imageSmoothingQuality",T?!1:k),r.drawImage(x,-this._size.width/2,-this._size.height/2)}},_canComposite:function(){return!0}}),ae=D.extend({_class:"SymbolItem",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(c,m){this._initialize(c,m!==n&&g.read(arguments,1))||this.setDefinition(c instanceof fe?c:new fe(c))},_equals:function(r){return this._definition===r._definition},copyContent:function(r){this.setDefinition(r._definition)},getDefinition:function(){return this._definition},setDefinition:function(r){this._definition=r,this._changed(9)},getSymbol:"#getDefinition",setSymbol:"#setDefinition",isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(r,c){var m=this._definition._item;return m._getCachedBounds(m._matrix.prepended(r),c)},_hitTestSelf:function(r,c,m){var x=c.extend({all:!1}),k=this._definition._item._hitTest(r,x,m);return k&&(k.item=this),k},_draw:function(r,c){this._definition._item.draw(r,c)}}),fe=l.extend({_class:"SymbolDefinition",initialize:function(c,m){this._id=y.get(),this.project=Qe.project,c&&this.setItem(c,m)},_serialize:function(r,c){return c.add(this,function(){return l.serialize([this._class,this._item],r,!1,c)})},_changed:function(r){r&8&&D._clearBoundsCache(this),r&1&&this.project._changed(r)},getItem:function(){return this._item},setItem:function(r,c){r._symbol&&(r=r.clone()),this._item&&(this._item._symbol=null),this._item=r,r.remove(),r.setSelected(!1),c||r.setPosition(new g),r._symbol=this,this._changed(9)},getDefinition:"#getItem",setDefinition:"#setItem",place:function(r){return new ae(this,r)},clone:function(){return new fe(this._item.clone(!1))},equals:function(r){return r===this||r&&this._item.equals(r._item)||!1}}),le=l.extend({_class:"HitResult",initialize:function(c,m,x){this.type=c,this.item=m,x&&this.inject(x)},statics:{getOptions:function(r){var c=r&&l.read(r);return new l({type:null,tolerance:Qe.settings.hitTolerance,fill:!c,stroke:!c,segments:!c,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},c)}}}),Y=l.extend({_class:"Segment",beans:!0,_selection:0,initialize:function(c,m,x,k,T,R){var L=arguments.length,q,z,X,Z;L>0&&(c==null||typeof c=="object"?L===1&&c&&"point"in c?(q=c.point,z=c.handleIn,X=c.handleOut,Z=c.selection):(q=c,z=m,X=x,Z=k):(q=[c,m],z=x!==n?[x,k]:null,X=T!==n?[T,R]:null)),new $(q,this,"_point"),new $(z,this,"_handleIn"),new $(X,this,"_handleOut"),Z&&this.setSelection(Z)},_serialize:function(r,c){var m=this._point,x=this._selection,k=x||this.hasHandles()?[m,this._handleIn,this._handleOut]:m;return x&&k.push(x),l.serialize(k,r,!0,c)},_changed:function(r){var c=this._path;if(c){var m=c._curves,x=this._index,k;m&&((!r||r===this._point||r===this._handleIn)&&(k=x>0?m[x-1]:c._closed?m[m.length-1]:null)&&k._changed(),(!r||r===this._point||r===this._handleOut)&&(k=m[x])&&k._changed()),c._changed(41)}},getPoint:function(){return this._point},setPoint:function(){this._point.set(g.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(g.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(g.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var r=this._handleIn,c=this._handleOut;return!r.isZero()&&!c.isZero()&&r.isCollinear(c)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(r){var c=this._selection,m=this._path;this._selection=r=r||0,m&&r!==c&&(m._updateSelection(this,c,r),m._changed(257))},_changeSelection:function(r,c){var m=this._selection;this.setSelection(c?m|r:m&~r)},isSelected:function(){return!!(this._selection&7)},setSelected:function(r){this._changeSelection(7,r)},getIndex:function(){return this._index!==n?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var r=this._path,c=this._index;return r?(c>0&&!r._closed&&c===r._segments.length-1&&c--,r.getCurves()[c]||null):null},getLocation:function(){var r=this.getCurve();return r?new we(r,this===r._segment1?0:1):null},getNext:function(){var r=this._path&&this._path._segments;return r&&(r[this._index+1]||this._path._closed&&r[0])||null},smooth:function(r,c,m){var x=r||{},k=x.type,T=x.factor,R=this.getPrevious(),L=this.getNext(),q=(R||this)._point,z=this._point,X=(L||this)._point,Z=q.getDistance(z),Q=z.getDistance(X);if(!k||k==="catmull-rom"){var j=T===n?.5:T,ce=Math.pow(Z,j),te=ce*ce,oe=Math.pow(Q,j),ee=oe*oe;if(!c&&R){var re=2*ee+3*oe*ce+te,K=3*oe*(oe+ce);this.setHandleIn(K!==0?new g((ee*q._x+re*z._x-te*X._x)/K-z._x,(ee*q._y+re*z._y-te*X._y)/K-z._y):new g)}if(!m&&L){var re=2*te+3*ce*oe+ee,K=3*ce*(ce+oe);this.setHandleOut(K!==0?new g((te*X._x+re*z._x-ee*q._x)/K-z._x,(te*X._y+re*z._y-ee*q._y)/K-z._y):new g)}}else if(k==="geometric"){if(R&&L){var se=q.subtract(X),de=T===n?.4:T,ve=de*Z/(Z+Q);c||this.setHandleIn(se.multiply(ve)),m||this.setHandleOut(se.multiply(ve-de))}}else throw new Error("Smoothing method '"+k+"' not supported.")},getPrevious:function(){var r=this._path&&this._path._segments;return r&&(r[this._index-1]||this._path._closed&&r[r.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var r=this._path;return r&&this._index===r._segments.length-1||!1},reverse:function(){var r=this._handleIn,c=this._handleOut,m=r.clone();r.set(c),c.set(m)},reversed:function(){return new Y(this._point,this._handleOut,this._handleIn)},remove:function(){return this._path?!!this._path.removeSegment(this._index):!1},clone:function(){return new Y(this._point,this._handleIn,this._handleOut)},equals:function(r){return r===this||r&&this._class===r._class&&this._point.equals(r._point)&&this._handleIn.equals(r._handleIn)&&this._handleOut.equals(r._handleOut)||!1},toString:function(){var r=["point: "+this._point];return this._handleIn.isZero()||r.push("handleIn: "+this._handleIn),this._handleOut.isZero()||r.push("handleOut: "+this._handleOut),"{ "+r.join(", ")+" }"},transform:function(r){this._transformCoordinates(r,new Array(6),!0),this._changed()},interpolate:function(r,c,m){var x=1-m,k=m,T=r._point,R=c._point,L=r._handleIn,q=c._handleIn,z=c._handleOut,X=r._handleOut;this._point._set(x*T._x+k*R._x,x*T._y+k*R._y,!0),this._handleIn._set(x*L._x+k*q._x,x*L._y+k*q._y,!0),this._handleOut._set(x*X._x+k*z._x,x*X._y+k*z._y,!0),this._changed()},_transformCoordinates:function(r,c,m){var x=this._point,k=!m||!this._handleIn.isZero()?this._handleIn:null,T=!m||!this._handleOut.isZero()?this._handleOut:null,R=x._x,L=x._y,q=2;return c[0]=R,c[1]=L,k&&(c[q++]=k._x+R,c[q++]=k._y+L),T&&(c[q++]=T._x+R,c[q++]=T._y+L),r&&(r._transformCoordinates(c,c,q/2),R=c[0],L=c[1],m?(x._x=R,x._y=L,q=2,k&&(k._x=c[q++]-R,k._y=c[q++]-L),T&&(T._x=c[q++]-R,T._y=c[q++]-L)):(k||(c[q++]=R,c[q++]=L),T||(c[q++]=R,c[q++]=L))),c}}),$=g.extend({initialize:function(c,m,x){var k,T,R;if(!c)k=T=0;else if((k=c[0])!==n)T=c[1];else{var L=c;(k=L.x)===n&&(L=g.read(arguments),k=L.x),T=L.y,R=L.selected}this._x=k,this._y=T,this._owner=m,m[x]=this,R&&this.setSelected(!0)},_set:function(r,c){return this._x=r,this._y=c,this._owner._changed(this),this},getX:function(){return this._x},setX:function(r){this._x=r,this._owner._changed(this)},getY:function(){return this._y},setY:function(r){this._y=r,this._owner._changed(this)},isZero:function(){var r=C.isZero;return r(this._x)&&r(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(r){this._owner._changeSelection(this._getSelection(),r)},_getSelection:function(){var r=this._owner;return this===r._point?1:this===r._handleIn?2:this===r._handleOut?4:0}}),ne=l.extend({_class:"Curve",beans:!0,initialize:function(c,m,x,k,T,R,L,q){var z=arguments.length,X,Z,Q,j,ce,te;z===3?(this._path=c,X=m,Z=x):z?z===1?"segment1"in c?(X=new Y(c.segment1),Z=new Y(c.segment2)):"point1"in c?(Q=c.point1,ce=c.handle1,te=c.handle2,j=c.point2):Array.isArray(c)&&(Q=[c[0],c[1]],j=[c[6],c[7]],ce=[c[2]-c[0],c[3]-c[1]],te=[c[4]-c[6],c[5]-c[7]]):z===2?(X=new Y(c),Z=new Y(m)):z===4?(Q=c,ce=m,te=x,j=k):z===8&&(Q=[c,m],j=[L,q],ce=[x-c,k-m],te=[T-L,R-q]):(X=new Y,Z=new Y),this._segment1=X||new Y(Q,null,ce),this._segment2=Z||new Y(j,te,null)},_serialize:function(r,c){return l.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],r,!0,c)},_changed:function(){this._length=this._bounds=n},clone:function(){return new ne(this._segment1,this._segment2)},toString:function(){var r=["point1: "+this._segment1._point];return this._segment1._handleOut.isZero()||r.push("handle1: "+this._segment1._handleOut),this._segment2._handleIn.isZero()||r.push("handle2: "+this._segment2._handleIn),r.push("point2: "+this._segment2._point),"{ "+r.join(", ")+" }"},classify:function(){return ne.classify(this.getValues())},remove:function(){var r=!1;if(this._path){var c=this._segment2,m=c._handleOut;r=c.remove(),r&&this._segment1._handleOut.set(m)}return r},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(g.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(g.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(g.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(g.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var r=this._path&&this._path._curves;return r&&(r[this._segment1._index+1]||this._path._closed&&r[0])||null},getPrevious:function(){var r=this._path&&this._path._curves;return r&&(r[this._segment1._index-1]||this._path._closed&&r[r.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var r=this._path;return r&&this._segment1._index===r._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(r){this.getPoint1().setSelected(r),this.getHandle1().setSelected(r),this.getHandle2().setSelected(r),this.getPoint2().setSelected(r)},getValues:function(r){return ne.getValues(this._segment1,this._segment2,r)},getPoints:function(){for(var r=this.getValues(),c=[],m=0;m<8;m+=2)c.push(new g(r[m],r[m+1]));return c}},{getLength:function(){return this._length==null&&(this._length=ne.getLength(this.getValues(),0,1)),this._length},getArea:function(){return ne.getArea(this.getValues())},getLine:function(){return new V(this._segment1._point,this._segment2._point)},getPart:function(r,c){return new ne(ne.getPart(this.getValues(),r,c))},getPartLength:function(r,c){return ne.getLength(this.getValues(),r,c)},divideAt:function(r){return this.divideAtTime(r&&r.curve===this?r.time:this.getTimeAt(r))},divideAtTime:function(r,c){var m=1e-8,x=1-m,k=null;if(r>=m&&r<=x){var T=ne.subdivide(this.getValues(),r),R=T[0],L=T[1],q=c||this.hasHandles(),z=this._segment1,X=this._segment2,Z=this._path;q&&(z._handleOut._set(R[2]-R[0],R[3]-R[1]),X._handleIn._set(L[4]-L[6],L[5]-L[7]));var Q=R[6],j=R[7],ce=new Y(new g(Q,j),q&&new g(R[4]-Q,R[5]-j),q&&new g(L[2]-Q,L[3]-j));Z?(Z.insert(z._index+1,ce),k=this.getNext()):(this._segment2=ce,this._changed(),k=new ne(ce,X))}return k},splitAt:function(r){var c=this._path;return c?c.splitAt(r):null},splitAtTime:function(r){return this.splitAt(this.getLocationAtTime(r))},divide:function(r,c){return this.divideAtTime(r===n?.5:c?r:this.getTimeAt(r))},split:function(r,c){return this.splitAtTime(r===n?.5:c?r:this.getTimeAt(r))},reversed:function(){return new ne(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(r,c,m,x){var k=r._point,T=r._handleOut,R=c._handleIn,L=c._point,q=k.x,z=k.y,X=L.x,Z=L.y,Q=x?[q,z,q,z,X,Z,X,Z]:[q,z,q+T._x,z+T._y,X+R._x,Z+R._y,X,Z];return m&&m._transformCoordinates(Q,Q,4),Q},subdivide:function(r,c){var m=r[0],x=r[1],k=r[2],T=r[3],R=r[4],L=r[5],q=r[6],z=r[7];c===n&&(c=.5);var X=1-c,Z=X*m+c*k,Q=X*x+c*T,j=X*k+c*R,ce=X*T+c*L,te=X*R+c*q,oe=X*L+c*z,ee=X*Z+c*j,re=X*Q+c*ce,K=X*j+c*te,se=X*ce+c*oe,de=X*ee+c*K,ve=X*re+c*se;return[[m,x,Z,Q,ee,re,de,ve],[de,ve,K,se,te,oe,q,z]]},getMonoCurves:function(r,c){var m=[],x=c?0:1,k=r[x+0],T=r[x+2],R=r[x+4],L=r[x+6];if(k>=T==T>=R&&T>=R==R>=L||ne.isStraight(r))m.push(r);else{var q=3*(T-R)-k+L,z=2*(k+R)-4*T,X=T-k,Z=1e-8,Q=1-Z,j=[],ce=C.solveQuadratic(q,z,X,j,Z,Q);if(!ce)m.push(r);else{j.sort();var te=j[0],oe=ne.subdivide(r,te);m.push(oe[0]),ce>1&&(te=(j[1]-te)/(1-te),oe=ne.subdivide(oe[1],te),m.push(oe[0])),m.push(oe[1])}}return m},solveCubic:function(r,c,m,x,k,T){var R=r[c],L=r[c+2],q=r[c+4],z=r[c+6],X=0;if(!(R<m&&z<m&&L<m&&q<m||R>m&&z>m&&L>m&&q>m)){var Z=3*(L-R),Q=3*(q-L)-Z,j=z-R-Z-Q;X=C.solveCubic(j,Q,Z,R-m,x,k,T)}return X},getTimeOf:function(r,c){var m=new g(r[0],r[1]),x=new g(r[6],r[7]),k=1e-12,T=1e-7,R=c.isClose(m,k)?0:c.isClose(x,k)?1:null;if(R===null)for(var L=[c.x,c.y],q=[],z=0;z<2;z++)for(var X=ne.solveCubic(r,z,L[z],q,0,1),Z=0;Z<X;Z++){var Q=q[Z];if(c.isClose(ne.getPoint(r,Q),T))return Q}return c.isClose(m,T)?0:c.isClose(x,T)?1:null},getNearestTime:function(r,c){if(ne.isStraight(r)){var m=r[0],x=r[1],k=r[6],T=r[7],R=k-m,L=T-x,q=R*R+L*L;if(q===0)return 0;var z=((c.x-m)*R+(c.y-x)*L)/q;return z<1e-12?0:z>.999999999999?1:ne.getTimeOf(r,new g(m+z*R,x+z*L))}var X=100,Z=1/0,Q=0;function j(oe){if(oe>=0&&oe<=1){var ee=c.getDistance(ne.getPoint(r,oe),!0);if(ee<Z)return Z=ee,Q=oe,!0}}for(var ce=0;ce<=X;ce++)j(ce/X);for(var te=1/(X*2);te>1e-8;)!j(Q-te)&&!j(Q+te)&&(te/=2);return Q},getPart:function(r,c,m){var x=c>m;if(x){var k=c;c=m,m=k}return c>0&&(r=ne.subdivide(r,c)[1]),m<1&&(r=ne.subdivide(r,(m-c)/(1-c))[0]),x?[r[6],r[7],r[4],r[5],r[2],r[3],r[0],r[1]]:r},isFlatEnough:function(r,c){var m=r[0],x=r[1],k=r[2],T=r[3],R=r[4],L=r[5],q=r[6],z=r[7],X=3*k-2*m-q,Z=3*T-2*x-z,Q=3*R-2*q-m,j=3*L-2*z-x;return Math.max(X*X,Q*Q)+Math.max(Z*Z,j*j)<=16*c*c},getArea:function(r){var c=r[0],m=r[1],x=r[2],k=r[3],T=r[4],R=r[5],L=r[6],q=r[7];return 3*((q-m)*(x+T)-(L-c)*(k+R)+k*(c-T)-x*(m-R)+q*(T+c/3)-L*(R+m/3))/20},getBounds:function(r){for(var c=r.slice(0,2),m=c.slice(),x=[0,0],k=0;k<2;k++)ne._addBounds(r[k],r[k+2],r[k+4],r[k+6],k,0,c,m,x);return new N(c[0],c[1],m[0]-c[0],m[1]-c[1])},_addBounds:function(r,c,m,x,k,T,R,L,q){function z(de,ve){var ue=de-ve,Ce=de+ve;ue<R[k]&&(R[k]=ue),Ce>L[k]&&(L[k]=Ce)}T/=2;var X=R[k]+T,Z=L[k]-T;if(r<X||c<X||m<X||x<X||r>Z||c>Z||m>Z||x>Z)if(c<r!=c<x&&m<r!=m<x)z(r,0),z(x,0);else{var Q=3*(c-m)-r+x,j=2*(r+m)-4*c,ce=c-r,te=C.solveQuadratic(Q,j,ce,q),oe=1e-8,ee=1-oe;z(x,0);for(var re=0;re<te;re++){var K=q[re],se=1-K;oe<=K&&K<=ee&&z(se*se*se*r+3*se*se*K*c+3*se*K*K*m+K*K*K*x,T)}}}}},l.each(["getBounds","getStrokeBounds","getHandleBounds"],function(r){this[r]=function(){this._bounds||(this._bounds={});var c=this._bounds[r];return c||(c=this._bounds[r]=F[r]([this._segment1,this._segment2],!1,this._path)),c.clone()}},{}),l.each({isStraight:function(r,c,m,x){if(c.isZero()&&m.isZero())return!0;var k=x.subtract(r);if(k.isZero())return!1;if(k.isCollinear(c)&&k.isCollinear(m)){var T=new V(r,x),R=1e-7;if(T.getDistance(r.add(c))<R&&T.getDistance(x.add(m))<R){var L=k.dot(k),q=k.dot(c)/L,z=k.dot(m)/L;return q>=0&&q<=1&&z<=0&&z>=-1}}return!1},isLinear:function(r,c,m,x){var k=x.subtract(r).divide(3);return c.equals(k)&&m.negate().equals(k)}},function(r,c){this[c]=function(m){var x=this._segment1,k=this._segment2;return r(x._point,x._handleOut,k._handleIn,k._point,m)},this.statics[c]=function(m,x){var k=m[0],T=m[1],R=m[6],L=m[7];return r(new g(k,T),new g(m[2]-k,m[3]-T),new g(m[4]-R,m[5]-L),new g(R,L),x)}},{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(r){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(r||0)},isCollinear:function(r){return r&&this.isStraight()&&r.isStraight()&&this.getLine().isCollinear(r.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(r,c){return this.getLocationAtTime(c?r:this.getTimeAt(r))},getLocationAtTime:function(r){return r!=null&&r>=0&&r<=1?new we(this,r):null},getTimeAt:function(r,c){return ne.getTimeAt(this.getValues(),r,c)},getParameterAt:"#getTimeAt",getTimesWithTangent:function(){var r=g.read(arguments);return r.isZero()?[]:ne.getTimesWithTangent(this.getValues(),r)},getOffsetAtTime:function(r){return this.getPartLength(0,r)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(g.read(arguments)))},getOffsetOf:function(){var r=this.getLocationOf.apply(this,arguments);return r?r.getOffset():null},getTimeOf:function(){return ne.getTimeOf(this.getValues(),g.read(arguments))},getParameterOf:"#getTimeOf",getNearestLocation:function(){var r=g.read(arguments),c=this.getValues(),m=ne.getNearestTime(c,r),x=ne.getPoint(c,m);return new we(this,m,x,null,r.getDistance(x))},getNearestPoint:function(){var r=this.getNearestLocation.apply(this,arguments);return r&&r.getPoint()}},new function(){var r=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return l.each(r,function(c){this[c+"At"]=function(m,x){var k=this.getValues();return ne[c](k,x?m:ne.getTimeAt(k,m))},this[c+"AtTime"]=function(m){return ne[c](this.getValues(),m)}},{statics:{_evaluateMethods:r}})},new function(){function r(x){var k=x[0],T=x[1],R=x[2],L=x[3],q=x[4],z=x[5],X=x[6],Z=x[7],Q=9*(R-q)+3*(X-k),j=6*(k+q)-12*R,ce=3*(R-k),te=9*(L-z)+3*(Z-T),oe=6*(T+z)-12*L,ee=3*(L-T);return function(re){var K=(Q*re+j)*re+ce,se=(te*re+oe)*re+ee;return Math.sqrt(K*K+se*se)}}function c(x,k){return Math.max(2,Math.min(16,Math.ceil(Math.abs(k-x)*32)))}function m(x,k,T,R){if(k==null||k<0||k>1)return null;var L=x[0],q=x[1],z=x[2],X=x[3],Z=x[4],Q=x[5],j=x[6],ce=x[7],te=C.isZero;te(z-L)&&te(X-q)&&(z=L,X=q),te(Z-j)&&te(Q-ce)&&(Z=j,Q=ce);var oe=3*(z-L),ee=3*(Z-z)-oe,re=j-L-oe-ee,K=3*(X-q),se=3*(Q-X)-K,de=ce-q-K-se,ve,ue;if(T===0)ve=k===0?L:k===1?j:((re*k+ee)*k+oe)*k+L,ue=k===0?q:k===1?ce:((de*k+se)*k+K)*k+q;else{var Ce=1e-8,Me=1-Ce;if(k<Ce?(ve=oe,ue=K):k>Me?(ve=3*(j-Z),ue=3*(ce-Q)):(ve=(3*re*k+2*ee)*k+oe,ue=(3*de*k+2*se)*k+K),R){ve===0&&ue===0&&(k<Ce||k>Me)&&(ve=Z-z,ue=Q-X);var Ae=Math.sqrt(ve*ve+ue*ue);Ae&&(ve/=Ae,ue/=Ae)}if(T===3){var Z=6*re*k+2*ee,Q=6*de*k+2*se,Oe=Math.pow(ve*ve+ue*ue,3/2);ve=Oe!==0?(ve*Q-ue*Z)/Oe:0,ue=0}}return T===2?new g(ue,-ve):new g(ve,ue)}return{statics:{classify:function(x){var k=x[0],T=x[1],R=x[2],L=x[3],q=x[4],z=x[5],X=x[6],Z=x[7],Q=k*(Z-z)+T*(q-X)+X*z-Z*q,j=R*(T-Z)+L*(X-k)+k*Z-T*X,ce=q*(L-T)+z*(k-R)+R*T-L*k,te=3*ce,oe=te-j,ee=oe-j+Q,re=Math.sqrt(ee*ee+oe*oe+te*te),K=re!==0?1/re:0,se=C.isZero,de="serpentine";ee*=K,oe*=K,te*=K;function ve(Ae,Oe,ke){var Le=Oe!==n,De=Le&&Oe>0&&Oe<1,ze=Le&&ke>0&&ke<1;return Le&&(!(De||ze)||Ae==="loop"&&!(De&&ze))&&(Ae="arch",De=ze=!1),{type:Ae,roots:De||ze?De&&ze?Oe<ke?[Oe,ke]:[ke,Oe]:[De?Oe:ke]:null}}if(se(ee))return se(oe)?ve(se(te)?"line":"quadratic"):ve(de,te/(3*oe));var ue=3*oe*oe-4*ee*te;if(se(ue))return ve("cusp",oe/(2*ee));var Ce=ue>0?Math.sqrt(ue/3):Math.sqrt(-ue),Me=2*ee;return ve(ue>0?de:"loop",(oe+Ce)/Me,(oe-Ce)/Me)},getLength:function(x,k,T,R){if(k===n&&(k=0),T===n&&(T=1),ne.isStraight(x)){var L=x;T<1&&(L=ne.subdivide(L,T)[0],k/=T),k>0&&(L=ne.subdivide(L,k)[1]);var q=L[6]-L[0],z=L[7]-L[1];return Math.sqrt(q*q+z*z)}return C.integrate(R||r(x),k,T,c(k,T))},getTimeAt:function(x,k,T){if(T===n&&(T=k<0?1:0),k===0)return T;var R=Math.abs,L=1e-12,q=k>0,z=q?T:0,X=q?1:T,Z=r(x),Q=ne.getLength(x,z,X,Z),j=R(k)-Q;if(R(j)<L)return q?X:z;if(j>L)return null;var ce=k/Q,te=0;function oe(ee){return te+=C.integrate(Z,T,ee,c(T,ee)),T=ee,te-k}return C.findRoot(oe,Z,T+ce,z,X,32,1e-12)},getPoint:function(x,k){return m(x,k,0,!1)},getTangent:function(x,k){return m(x,k,1,!0)},getWeightedTangent:function(x,k){return m(x,k,1,!1)},getNormal:function(x,k){return m(x,k,2,!0)},getWeightedNormal:function(x,k){return m(x,k,2,!1)},getCurvature:function(x,k){return m(x,k,3,!1).x},getPeaks:function(x){var k=x[0],T=x[1],R=x[2],L=x[3],q=x[4],z=x[5],X=x[6],Z=x[7],Q=-k+3*R-3*q+X,j=3*k-6*R+3*q,ce=-3*k+3*R,te=-T+3*L-3*z+Z,oe=3*T-6*L+3*z,ee=-3*T+3*L,re=1e-8,K=1-re,se=[];return C.solveCubic(9*(Q*Q+te*te),9*(Q*j+oe*te),2*(j*j+oe*oe)+3*(ce*Q+ee*te),ce*j+oe*ee,se,re,K),se.sort()}}}},new function(){function r(j,ce,te,oe,ee,re,K){var se=!K&&te.getPrevious()===ee,de=!K&&te!==ee&&te.getNext()===ee,ve=1e-8,ue=1-ve;if(oe!==null&&oe>=(se?ve:0)&&oe<=(de?ue:1)&&re!==null&&re>=(de?ve:0)&&re<=(se?ue:1)){var Ce=new we(te,oe,null,K),Me=new we(ee,re,null,K);Ce._intersection=Me,Me._intersection=Ce,(!ce||ce(Ce))&&we.insert(j,Ce,!0)}}function c(j,ce,te,oe,ee,re,K,se,de,ve,ue,Ce,Me){if(++de>=4096||++se>=40)return de;var Ae=1e-9,Oe=ce[0],ke=ce[1],Le=ce[6],De=ce[7],ze=V.getSignedDistance,He=ze(Oe,ke,Le,De,ce[2],ce[3]),$e=ze(Oe,ke,Le,De,ce[4],ce[5]),ct=He*$e>0?3/4:4/9,ft=ct*Math.min(0,He,$e),vt=ct*Math.max(0,He,$e),kt=ze(Oe,ke,Le,De,j[0],j[1]),tt=ze(Oe,ke,Le,De,j[2],j[3]),nt=ze(Oe,ke,Le,De,j[4],j[5]),_t=ze(Oe,ke,Le,De,j[6],j[7]),Et=m(kt,tt,nt,_t),Mt=Et[0],Dt=Et[1],Rt,Ft;if(He===0&&$e===0&&kt===0&&tt===0&&nt===0&&_t===0||(Rt=x(Mt,Dt,ft,vt))==null||(Ft=x(Mt.reverse(),Dt.reverse(),ft,vt))==null)return de;var $t=ve+(ue-ve)*Rt,Vt=ve+(ue-ve)*Ft;if(Math.max(Me-Ce,Vt-$t)<Ae){var Rr=($t+Vt)/2,Br=(Ce+Me)/2;r(ee,re,K?oe:te,K?Br:Rr,K?te:oe,K?Rr:Br)}else{j=ne.getPart(j,Rt,Ft);var Kr=Me-Ce;if(Ft-Rt>.8)if(Vt-$t>Kr){var mt=ne.subdivide(j,.5),Rr=($t+Vt)/2;de=c(ce,mt[0],oe,te,ee,re,!K,se,de,Ce,Me,$t,Rr),de=c(ce,mt[1],oe,te,ee,re,!K,se,de,Ce,Me,Rr,Vt)}else{var mt=ne.subdivide(ce,.5),Br=(Ce+Me)/2;de=c(mt[0],j,oe,te,ee,re,!K,se,de,Ce,Br,$t,Vt),de=c(mt[1],j,oe,te,ee,re,!K,se,de,Br,Me,$t,Vt)}else Kr===0||Kr>=Ae?de=c(ce,j,oe,te,ee,re,!K,se,de,Ce,Me,$t,Vt):de=c(j,ce,te,oe,ee,re,K,se,de,$t,Vt,Ce,Me)}return de}function m(j,ce,te,oe){var ee=[0,j],re=[1/3,ce],K=[2/3,te],se=[1,oe],de=ce-(2*j+oe)/3,ve=te-(j+2*oe)/3,ue;if(de*ve<0)ue=[[ee,re,se],[ee,K,se]];else{var Ce=de/ve;ue=[Ce>=2?[ee,re,se]:Ce<=.5?[ee,K,se]:[ee,re,K,se],[ee,se]]}return(de||ve)<0?ue.reverse():ue}function x(j,ce,te,oe){return j[0][1]<te?k(j,!0,te):ce[0][1]>oe?k(ce,!1,oe):j[0][0]}function k(j,ce,te){for(var oe=j[0][0],ee=j[0][1],re=1,K=j.length;re<K;re++){var se=j[re][0],de=j[re][1];if(ce?de>=te:de<=te)return de===te?se:oe+(te-ee)*(se-oe)/(de-ee);oe=se,ee=de}return null}function T(j,ce,te,oe,ee){var re=C.isZero;if(re(oe)&&re(ee)){var K=ne.getTimeOf(j,new g(ce,te));return K===null?[]:[K]}for(var se=Math.atan2(-ee,oe),de=Math.sin(se),ve=Math.cos(se),ue=[],Ce=[],Me=0;Me<8;Me+=2){var Ae=j[Me]-ce,Oe=j[Me+1]-te;ue.push(Ae*ve-Oe*de,Ae*de+Oe*ve)}return ne.solveCubic(ue,1,0,Ce,0,1),Ce}function R(j,ce,te,oe,ee,re,K){for(var se=ce[0],de=ce[1],ve=ce[6],ue=ce[7],Ce=T(j,se,de,ve-se,ue-de),Me=0,Ae=Ce.length;Me<Ae;Me++){var Oe=Ce[Me],ke=ne.getPoint(j,Oe),Le=ne.getTimeOf(ce,ke);Le!==null&&r(ee,re,K?oe:te,K?Le:Oe,K?te:oe,K?Oe:Le)}}function L(j,ce,te,oe,ee,re){var K=V.intersect(j[0],j[1],j[6],j[7],ce[0],ce[1],ce[6],ce[7]);K&&r(ee,re,te,ne.getTimeOf(j,K),oe,ne.getTimeOf(ce,K))}function q(j,ce,te,oe,ee,re){var K=1e-12,se=Math.min,de=Math.max;if(de(j[0],j[2],j[4],j[6])+K>se(ce[0],ce[2],ce[4],ce[6])&&se(j[0],j[2],j[4],j[6])-K<de(ce[0],ce[2],ce[4],ce[6])&&de(j[1],j[3],j[5],j[7])+K>se(ce[1],ce[3],ce[5],ce[7])&&se(j[1],j[3],j[5],j[7])-K<de(ce[1],ce[3],ce[5],ce[7])){var ve=Z(j,ce);if(ve)for(var ue=0;ue<2;ue++){var Ce=ve[ue];r(ee,re,te,Ce[0],oe,Ce[1],!0)}else{var Me=ne.isStraight(j),Ae=ne.isStraight(ce),Oe=Me&&Ae,ke=Me&&!Ae,Le=ee.length;if((Oe?L:Me||Ae?R:c)(ke?ce:j,ke?j:ce,ke?oe:te,ke?te:oe,ee,re,ke,0,0,0,1,0,1),!Oe||ee.length===Le)for(var ue=0;ue<4;ue++){var De=ue>>1,ze=ue&1,He=De*6,$e=ze*6,ct=new g(j[He],j[He+1]),ft=new g(ce[$e],ce[$e+1]);ct.isClose(ft,K)&&r(ee,re,te,De,oe,ze)}}}return ee}function z(j,ce,te,oe){var ee=ne.classify(j);if(ee.type==="loop"){var re=ee.roots;r(te,oe,ce,re[0],ce,re[1])}return te}function X(j,ce,te,oe,ee,re){var K=1e-7,se=!ce;se&&(ce=j);for(var de=j.length,ve=ce.length,ue=new Array(de),Ce=se?ue:new Array(ve),Me=[],Ae=0;Ae<de;Ae++)ue[Ae]=j[Ae].getValues(oe);if(!se)for(var Ae=0;Ae<ve;Ae++)Ce[Ae]=ce[Ae].getValues(ee);for(var Oe=S.findCurveBoundsCollisions(ue,Ce,K),ke=0;ke<de;ke++){var Le=j[ke],De=ue[ke];se&&z(De,Le,Me,te);var ze=Oe[ke];if(ze)for(var He=0;He<ze.length;He++){if(re&&Me.length)return Me;var $e=ze[He];if(!se||$e>ke){var ct=ce[$e],ft=Ce[$e];q(De,ft,Le,ct,Me,te)}}}return Me}function Z(j,ce){function te(_t){var Et=_t[6]-_t[0],Mt=_t[7]-_t[1];return Et*Et+Mt*Mt}var oe=Math.abs,ee=V.getDistance,re=1e-8,K=1e-7,se=ne.isStraight(j),de=ne.isStraight(ce),ve=se&&de,ue=te(j)<te(ce),Ce=ue?ce:j,Me=ue?j:ce,Ae=Ce[0],Oe=Ce[1],ke=Ce[6]-Ae,Le=Ce[7]-Oe;if(ee(Ae,Oe,ke,Le,Me[0],Me[1],!0)<K&&ee(Ae,Oe,ke,Le,Me[6],Me[7],!0)<K)!ve&&ee(Ae,Oe,ke,Le,Ce[2],Ce[3],!0)<K&&ee(Ae,Oe,ke,Le,Ce[4],Ce[5],!0)<K&&ee(Ae,Oe,ke,Le,Me[2],Me[3],!0)<K&&ee(Ae,Oe,ke,Le,Me[4],Me[5],!0)<K&&(se=de=ve=!0);else if(ve)return null;if(se^de)return null;for(var De=[j,ce],ze=[],He=0;He<4&&ze.length<2;He++){var $e=He&1,ct=$e^1,ft=He>>1,vt=ne.getTimeOf(De[$e],new g(De[ct][ft?6:0],De[ct][ft?7:1]));if(vt!=null){var kt=$e?[ft,vt]:[vt,ft];(!ze.length||oe(kt[0]-ze[0][0])>re&&oe(kt[1]-ze[0][1])>re)&&ze.push(kt)}if(He>2&&!ze.length)break}if(ze.length!==2)ze=null;else if(!ve){var tt=ne.getPart(j,ze[0][0],ze[1][0]),nt=ne.getPart(ce,ze[0][1],ze[1][1]);(oe(nt[2]-tt[2])>K||oe(nt[3]-tt[3])>K||oe(nt[4]-tt[4])>K||oe(nt[5]-tt[5])>K)&&(ze=null)}return ze}function Q(j,ce){var te=j[0],oe=j[1],ee=j[2],re=j[3],K=j[4],se=j[5],de=j[6],ve=j[7],ue=ce.normalize(),Ce=ue.x,Me=ue.y,Ae=3*de-9*K+9*ee-3*te,Oe=3*ve-9*se+9*re-3*oe,ke=6*K-12*ee+6*te,Le=6*se-12*re+6*oe,De=3*ee-3*te,ze=3*re-3*oe,He=2*Ae*Me-2*Oe*Ce,$e=[];if(Math.abs(He)<C.CURVETIME_EPSILON){var ct=Ae*ze-Oe*De,He=Ae*Le-Oe*ke;if(He!=0){var ft=-ct/He;ft>=0&&ft<=1&&$e.push(ft)}}else{var vt=(ke*ke-4*Ae*De)*Me*Me+(-2*ke*Le+4*Oe*De+4*Ae*ze)*Ce*Me+(Le*Le-4*Oe*ze)*Ce*Ce,kt=ke*Me-Le*Ce;if(vt>=0&&He!=0){var tt=Math.sqrt(vt),nt=-(kt+tt)/He,_t=(-kt+tt)/He;nt>=0&&nt<=1&&$e.push(nt),_t>=0&&_t<=1&&$e.push(_t)}}return $e}return{getIntersections:function(j){var ce=this.getValues(),te=j&&j!==this&&j.getValues();return te?q(ce,te,this,j,[]):z(ce,this,[])},statics:{getOverlaps:Z,getIntersections:X,getCurveLineIntersections:T,getTimesWithTangent:Q}}}),we=l.extend({_class:"CurveLocation",initialize:function(c,m,x,k,T){if(m>=.99999999){var R=c.getNext();R&&(m=0,c=R)}this._setCurve(c),this._time=m,this._point=x||c.getPointAtTime(m),this._overlap=k,this._distance=T,this._intersection=this._next=this._previous=null},_setPath:function(r){this._path=r,this._version=r?r._version:0},_setCurve:function(r){this._setPath(r._path),this._curve=r,this._segment=null,this._segment1=r._segment1,this._segment2=r._segment2},_setSegment:function(r){var c=r.getCurve();c?this._setCurve(c):(this._setPath(r._path),this._segment1=r,this._segment2=null),this._segment=r,this._time=r===this._segment1?0:1,this._point=r._point.clone()},getSegment:function(){var r=this._segment;if(!r){var c=this.getCurve(),m=this.getTime();m===0?r=c._segment1:m===1?r=c._segment2:m!=null&&(r=c.getPartLength(0,m)<c.getPartLength(m,1)?c._segment1:c._segment2),this._segment=r}return r},getCurve:function(){var r=this._path,c=this;r&&r._version!==this._version&&(this._time=this._offset=this._curveOffset=this._curve=null);function m(x){var k=x&&x.getCurve();if(k&&(c._time=k.getTimeOf(c._point))!=null)return c._setCurve(k),k}return this._curve||m(this._segment)||m(this._segment1)||m(this._segment2.getPrevious())},getPath:function(){var r=this.getCurve();return r&&r._path},getIndex:function(){var r=this.getCurve();return r&&r.getIndex()},getTime:function(){var r=this.getCurve(),c=this._time;return r&&c==null?this._time=r.getTimeOf(this._point):c},getParameter:"#getTime",getPoint:function(){return this._point},getOffset:function(){var r=this._offset;if(r==null){r=0;var c=this.getPath(),m=this.getIndex();if(c&&m!=null)for(var x=c.getCurves(),k=0;k<m;k++)r+=x[k].getLength();this._offset=r+=this.getCurveOffset()}return r},getCurveOffset:function(){var r=this._curveOffset;if(r==null){var c=this.getCurve(),m=this.getTime();this._curveOffset=r=m!=null&&c&&c.getPartLength(0,m)}return r},getIntersection:function(){return this._intersection},getDistance:function(){return this._distance},divide:function(){var r=this.getCurve(),c=r&&r.divideAtTime(this.getTime());return c&&this._setSegment(c._segment1),c},split:function(){var r=this.getCurve(),c=r._path,m=r&&r.splitAtTime(this.getTime());return m&&this._setSegment(c.getLastSegment()),m},equals:function(r,c){var m=this===r;if(!m&&r instanceof we){var x=this.getCurve(),k=r.getCurve(),T=x._path,R=k._path;if(T===R){var L=Math.abs,q=1e-7,z=L(this.getOffset()-r.getOffset()),X=!c&&this._intersection,Z=!c&&r._intersection;m=(z<q||T&&L(T.getLength()-z)<q)&&(!X&&!Z||X&&Z&&X.equals(Z,!0))}}return m},toString:function(){var r=[],c=this.getPoint(),m=M.instance;c&&r.push("point: "+c);var x=this.getIndex();x!=null&&r.push("index: "+x);var k=this.getTime();return k!=null&&r.push("time: "+m.number(k)),this._distance!=null&&r.push("distance: "+m.number(this._distance)),"{ "+r.join(", ")+" }"},isTouching:function(){var r=this._intersection;if(r&&this.getTangent().isCollinear(r.getTangent())){var c=this.getCurve(),m=r.getCurve();return!(c.isStraight()&&m.isStraight()&&c.getLine().intersect(m.getLine()))}return!1},isCrossing:function(){var r=this._intersection;if(!r)return!1;var c=this.getTime(),m=r.getTime(),x=1e-8,k=1-x,T=c>=x&&c<=k,R=m>=x&&m<=k;if(T&&R)return!this.isTouching();var L=this.getCurve(),q=L&&c<x?L.getPrevious():L,z=r.getCurve(),X=z&&m<x?z.getPrevious():z;if(c>k&&(L=L.getNext()),m>k&&(z=z.getNext()),!q||!L||!X||!z)return!1;var Z=[];function Q(Ce,Me){var Ae=Ce.getValues(),Oe=ne.classify(Ae).roots||ne.getPeaks(Ae),ke=Oe.length,Le=ne.getLength(Ae,Me&&ke?Oe[ke-1]:0,!Me&&ke?Oe[0]:1);Z.push(ke?Le:Le/32)}function j(Ce,Me,Ae){return Me<Ae?Ce>Me&&Ce<Ae:Ce>Me||Ce<Ae}T||(Q(q,!0),Q(L,!1)),R||(Q(X,!0),Q(z,!1));var ce=this.getPoint(),te=Math.min.apply(Math,Z),oe=T?L.getTangentAtTime(c):L.getPointAt(te).subtract(ce),ee=T?oe.negate():q.getPointAt(-te).subtract(ce),re=R?z.getTangentAtTime(m):z.getPointAt(te).subtract(ce),K=R?re.negate():X.getPointAt(-te).subtract(ce),se=ee.getAngle(),de=oe.getAngle(),ve=K.getAngle(),ue=re.getAngle();return!!(T?j(se,ve,ue)^j(de,ve,ue)&&j(se,ue,ve)^j(de,ue,ve):j(ve,se,de)^j(ue,se,de)&&j(ve,de,se)^j(ue,de,se))},hasOverlap:function(){return!!this._overlap}},l.each(ne._evaluateMethods,function(r){var c=r+"At";this[r]=function(){var m=this.getCurve(),x=this.getTime();return x!=null&&m&&m[c](x,!0)}},{preserve:!0}),new function(){function r(c,m,x){var k=c.length,T=0,R=k-1;function L(ce,te){for(var oe=ce+te;oe>=-1&&oe<=k;oe+=te){var ee=c[(oe%k+k)%k];if(!m.getPoint().isClose(ee.getPoint(),1e-7))break;if(m.equals(ee))return ee}return null}for(;T<=R;){var q=T+R>>>1,z=c[q],X;if(x&&(X=m.equals(z)?z:L(q,-1)||L(q,1)))return m._overlap&&(X._overlap=X._intersection._overlap=!0),X;var Z=m.getPath(),Q=z.getPath(),j=Z!==Q?Z._id-Q._id:m.getIndex()+m.getTime()-(z.getIndex()+z.getTime());j<0?R=q-1:T=q+1}return c.splice(T,0,m),m}return{statics:{insert:r,expand:function(c){for(var m=c.slice(),x=c.length-1;x>=0;x--)r(m,c[x]._intersection,!1);return m}}}}),ye=D.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(r){var c,m,x;if(l.isPlainObject(r)?(m=r.segments,c=r.pathData):Array.isArray(r)?m=r:typeof r=="string"&&(c=r),m){var k=m[0];x=k&&Array.isArray(k[0])}else c&&(x=(c.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(c));var T=x?H:F;return new T(r)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(r){this.isClockwise()!=(r=!!r)&&this.reverse()},setPathData:function(r){var c=r&&r.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/ig),m,x=!1,k,T,R=new g,L=new g;function q(K,se){var de=+m[K];return x&&(de+=R[se]),de}function z(K){return new g(q(K,"x"),q(K+1,"y"))}this.clear();for(var X=0,Z=c&&c.length;X<Z;X++){var Q=c[X],j=Q[0],ce=j.toLowerCase();m=Q.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g);var te=m&&m.length;switch(x=j===ce,k==="z"&&!/[mz]/.test(ce)&&this.moveTo(R),ce){case"m":case"l":for(var oe=ce==="m",ee=0;ee<te;ee+=2)this[oe?"moveTo":"lineTo"](R=z(ee)),oe&&(L=R,oe=!1);T=R;break;case"h":case"v":var re=ce==="h"?"x":"y";R=R.clone();for(var ee=0;ee<te;ee++)R[re]=q(ee,re),this.lineTo(R);T=R;break;case"c":for(var ee=0;ee<te;ee+=6)this.cubicCurveTo(z(ee),T=z(ee+2),R=z(ee+4));break;case"s":for(var ee=0;ee<te;ee+=4)this.cubicCurveTo(/[cs]/.test(k)?R.multiply(2).subtract(T):R,T=z(ee),R=z(ee+2)),k=ce;break;case"q":for(var ee=0;ee<te;ee+=4)this.quadraticCurveTo(T=z(ee),R=z(ee+2));break;case"t":for(var ee=0;ee<te;ee+=2)this.quadraticCurveTo(T=/[qt]/.test(k)?R.multiply(2).subtract(T):R,R=z(ee)),k=ce;break;case"a":for(var ee=0;ee<te;ee+=7)this.arcTo(R=z(ee+5),new p(+m[ee],+m[ee+1]),+m[ee+2],+m[ee+4],+m[ee+3]);break;case"z":this.closePath(1e-12),R=L;break}k=ce}},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_contains:function(r){var c=r.isInside(this.getBounds({internal:!0,handle:!0}))?this._getWinding(r):{};return c.onPath||!!(this.getFillRule()==="evenodd"?c.windingL&1||c.windingR&1:c.winding)},getIntersections:function(r,c,m,x){var k=this===r||!r,T=this._matrix._orNullIfIdentity(),R=k?T:(m||r._matrix)._orNullIfIdentity();return k||this.getBounds(T).intersects(r.getBounds(R),1e-12)?ne.getIntersections(this.getCurves(),!k&&r.getCurves(),c,T,R,x):[]},getCrossings:function(r){return this.getIntersections(r,function(c){return c.isCrossing()})},getNearestLocation:function(){for(var r=g.read(arguments),c=this.getCurves(),m=1/0,x=null,k=0,T=c.length;k<T;k++){var R=c[k].getNearestLocation(r);R._distance<m&&(m=R._distance,x=R)}return x},getNearestPoint:function(){var r=this.getNearestLocation.apply(this,arguments);return r&&r.getPoint()},interpolate:function(r,c,m){var x=!this._children,k=x?"_segments":"_children",T=r[k],R=c[k],L=this[k];if(!T||!R||T.length!==R.length)throw new Error("Invalid operands in interpolate() call: "+r+", "+c);var q=L.length,z=R.length;if(q<z)for(var X=x?Y:F,Z=q;Z<z;Z++)this.add(new X);else q>z&&this[x?"removeSegments":"removeChildren"](z,q);for(var Z=0;Z<z;Z++)L[Z].interpolate(T[Z],R[Z],m);x&&(this.setClosed(r._closed),this._changed(9))},compare:function(r){var c=!1;if(r){var m=this._children||[this],x=r._children?r._children.slice():[r],k=m.length,T=x.length,R=[],L=0;c=!0;for(var q=S.findItemBoundsCollisions(m,x,C.GEOMETRIC_EPSILON),z=k-1;z>=0&&c;z--){var X=m[z];c=!1;var Z=q[z];if(Z)for(var Q=Z.length-1;Q>=0&&!c;Q--)X.compare(x[Z[Q]])&&(R[Z[Q]]||(R[Z[Q]]=!0,L++),c=!0)}c=c&&L===T}return c}}),F=ye.extend({_class:"Path",_serializeFields:{segments:[],closed:!1},initialize:function(c){this._closed=!1,this._segments=[],this._version=0;var m=arguments,x=Array.isArray(c)?typeof c[0]=="object"?c:m:c&&c.size===n&&(c.x!==n||c.point!==n)?m:null;x&&x.length>0?this.setSegments(x):(this._curves=n,this._segmentSelection=0,!x&&typeof c=="string"&&(this.setPathData(c),c=null)),this._initialize(!x&&c)},_equals:function(r){return this._closed===r._closed&&l.equals(this._segments,r._segments)},copyContent:function(r){this.setSegments(r._segments),this._closed=r._closed},_changed:function r(c){if(r.base.call(this,c),c&8){if(this._length=this._area=n,c&32)this._version++;else if(this._curves)for(var m=0,x=this._curves.length;m<x;m++)this._curves[m]._changed()}else c&64&&(this._bounds=n)},getStyle:function(){var r=this._parent;return(r instanceof H?r:this)._style},getSegments:function(){return this._segments},setSegments:function(r){var c=this.isFullySelected(),m=r&&r.length;if(this._segments.length=0,this._segmentSelection=0,this._curves=n,m){var x=r[m-1];typeof x=="boolean"&&(this.setClosed(x),m--),this._add(Y.readList(r,0,{},m))}c&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var r=this._curves,c=this._segments;if(!r){var m=this._countCurves();r=this._curves=new Array(m);for(var x=0;x<m;x++)r[x]=new ne(this,c[x],c[x+1]||c[0])}return r},getFirstCurve:function(){return this.getCurves()[0]},getLastCurve:function(){var r=this.getCurves();return r[r.length-1]},isClosed:function(){return this._closed},setClosed:function(r){if(this._closed!=(r=!!r)){if(this._closed=r,this._curves){var c=this._curves.length=this._countCurves();r&&(this._curves[c-1]=new ne(this,this._segments[c-1],this._segments[0]))}this._changed(41)}}},{beans:!0,getPathData:function(r,c){var m=this._segments,x=m.length,k=new M(c),T=new Array(6),R=!0,L,q,z,X,Z,Q,j,ce,te=[];function oe(re,K){if(re._transformCoordinates(r,T),L=T[0],q=T[1],R)te.push("M"+k.pair(L,q)),R=!1;else if(Z=T[2],Q=T[3],Z===L&&Q===q&&j===z&&ce===X){if(!K){var se=L-z,de=q-X;te.push(se===0?"v"+k.number(de):de===0?"h"+k.number(se):"l"+k.pair(se,de))}}else te.push("c"+k.pair(j-z,ce-X)+" "+k.pair(Z-z,Q-X)+" "+k.pair(L-z,q-X));z=L,X=q,j=T[4],ce=T[5]}if(!x)return"";for(var ee=0;ee<x;ee++)oe(m[ee]);return this._closed&&x>0&&(oe(m[0],!0),te.push("z")),te.join("")},isEmpty:function(){return!this._segments.length},_transformContent:function(r){for(var c=this._segments,m=new Array(6),x=0,k=c.length;x<k;x++)c[x]._transformCoordinates(r,m,!0);return!0},_add:function(r,R){for(var m=this._segments,x=this._curves,k=r.length,T=R==null,R=T?m.length:R,L=0;L<k;L++){var q=r[L];q._path&&(q=r[L]=q.clone()),q._path=this,q._index=R+L,q._selection&&this._updateSelection(q,0,q._selection)}if(T)l.push(m,r);else{m.splice.apply(m,[R,0].concat(r));for(var L=R+k,z=m.length;L<z;L++)m[L]._index=L}if(x){var X=this._countCurves(),Z=R>0&&R+k-1===X?R-1:R,Q=Z,j=Math.min(Z+k,X);r._curves&&(x.splice.apply(x,[Z,0].concat(r._curves)),Q+=r._curves.length);for(var L=Q;L<j;L++)x.splice(L,0,new ne(this,null,null));this._adjustCurves(Z,j)}return this._changed(41),r},_adjustCurves:function(r,c){for(var m=this._segments,x=this._curves,k,T=r;T<c;T++)k=x[T],k._path=this,k._segment1=m[T],k._segment2=m[T+1]||m[0],k._changed();(k=x[this._closed&&!r?m.length-1:r-1])&&(k._segment2=m[r]||m[0],k._changed()),(k=x[c])&&(k._segment1=m[c],k._changed())},_countCurves:function(){var r=this._segments.length;return!this._closed&&r>0?r-1:r},add:function(r){var c=arguments;return c.length>1&&typeof r!="number"?this._add(Y.readList(c)):this._add([Y.read(c)])[0]},insert:function(r,c){var m=arguments;return m.length>2&&typeof c!="number"?this._add(Y.readList(m,1),r):this._add([Y.read(m,1)],r)[0]},addSegment:function(){return this._add([Y.read(arguments)])[0]},insertSegment:function(r){return this._add([Y.read(arguments,1)],r)[0]},addSegments:function(r){return this._add(Y.readList(r))},insertSegments:function(r,c){return this._add(Y.readList(c),r)},removeSegment:function(r){return this.removeSegments(r,r+1)[0]||null},removeSegments:function(r,c,m){r=r||0,c=l.pick(c,this._segments.length);var x=this._segments,k=this._curves,T=x.length,R=x.splice(r,c-r),L=R.length;if(!L)return R;for(var q=0;q<L;q++){var z=R[q];z._selection&&this._updateSelection(z,z._selection,0),z._index=z._path=null}for(var q=r,X=x.length;q<X;q++)x[q]._index=q;if(k){for(var Z=r>0&&c===T+(this._closed?1:0)?r-1:r,k=k.splice(Z,L),q=k.length-1;q>=0;q--)k[q]._path=null;m&&(R._curves=k.slice(1)),this._adjustCurves(Z,Z)}return this._changed(41),R},clear:"#removeSegments",hasHandles:function(){for(var r=this._segments,c=0,m=r.length;c<m;c++)if(r[c].hasHandles())return!0;return!1},clearHandles:function(){for(var r=this._segments,c=0,m=r.length;c<m;c++)r[c].clearHandles()},getLength:function(){if(this._length==null){for(var r=this.getCurves(),c=0,m=0,x=r.length;m<x;m++)c+=r[m].getLength();this._length=c}return this._length},getArea:function(){var r=this._area;if(r==null){var c=this._segments,m=this._closed;r=0;for(var x=0,k=c.length;x<k;x++){var T=x+1===k;r+=ne.getArea(ne.getValues(c[x],c[T?0:x+1],null,T&&!m))}this._area=r}return r},isFullySelected:function(){var r=this._segments.length;return this.isSelected()&&r>0&&this._segmentSelection===r*7},setFullySelected:function(r){r&&this._selectSegments(!0),this.setSelected(r)},setSelection:function r(c){c&1||this._selectSegments(!1),r.base.call(this,c)},_selectSegments:function(r){var c=this._segments,m=c.length,x=r?7:0;this._segmentSelection=x*m;for(var k=0;k<m;k++)c[k]._selection=x},_updateSelection:function(r,c,m){r._selection=m;var x=this._segmentSelection+=m-c;x>0&&this.setSelected(!0)},divideAt:function(r){var c=this.getLocationAt(r),m;return c&&(m=c.getCurve().divideAt(c.getCurveOffset()))?m._segment1:null},splitAt:function(r){var c=this.getLocationAt(r),m=c&&c.index,x=c&&c.time,k=1e-8,T=1-k;x>T&&(m++,x=0);var R=this.getCurves();if(m>=0&&m<R.length){x>=k&&R[m++].divideAtTime(x);var L=this.removeSegments(m,this._segments.length,!0),q;return this._closed?(this.setClosed(!1),q=this):(q=new F(D.NO_INSERT),q.insertAbove(this),q.copyAttributes(this)),q._add(L,0),this.addSegment(L[0]),q}return null},split:function(r,c){var m,x=c===n?r:(m=this.getCurves()[r])&&m.getLocationAtTime(c);return x!=null?this.splitAt(x):null},join:function(r,c){var m=c||0;if(r&&r!==this){var x=r._segments,k=this.getLastSegment(),T=r.getLastSegment();if(!T)return this;k&&k._point.isClose(T._point,m)&&r.reverse();var R=r.getFirstSegment();if(k&&k._point.isClose(R._point,m))k.setHandleOut(R._handleOut),this._add(x.slice(1));else{var L=this.getFirstSegment();L&&L._point.isClose(R._point,m)&&r.reverse(),T=r.getLastSegment(),L&&L._point.isClose(T._point,m)?(L.setHandleIn(T._handleIn),this._add(x.slice(0,x.length-1),0)):this._add(x.slice())}r._closed&&this._add([x[0]]),r.remove()}var q=this.getFirstSegment(),z=this.getLastSegment();return q!==z&&q._point.isClose(z._point,m)&&(q.setHandleIn(z._handleIn),z.remove(),this.setClosed(!0)),this},reduce:function(r){for(var c=this.getCurves(),m=r&&r.simplify,x=m?1e-7:0,k=c.length-1;k>=0;k--){var T=c[k];!T.hasHandles()&&(!T.hasLength(x)||m&&T.isCollinear(T.getNext()))&&T.remove()}return this},reverse:function(){this._segments.reverse();for(var r=0,c=this._segments.length;r<c;r++){var m=this._segments[r],x=m._handleIn;m._handleIn=m._handleOut,m._handleOut=x,m._index=r}this._curves=null,this._changed(9)},flatten:function(r){for(var c=new W(this,r||.25,256,!0),m=c.parts,x=m.length,k=[],T=0;T<x;T++)k.push(new Y(m[T].curve.slice(0,2)));!this._closed&&x>0&&k.push(new Y(m[x-1].curve.slice(6))),this.setSegments(k)},simplify:function(r){var c=new _e(this).fit(r||2.5);return c&&this.setSegments(c),!!c},smooth:function(r){var c=this,m=r||{},x=m.type||"asymmetric",k=this._segments,T=k.length,R=this._closed;function L(Mt,Dt){var Rt=Mt&&Mt.index;if(Rt!=null){var Ft=Mt.path;if(Ft&&Ft!==c)throw new Error(Mt._class+" "+Rt+" of "+Ft+" is not part of "+c);Dt&&Mt instanceof ne&&Rt++}else Rt=typeof Mt=="number"?Mt:Dt;return Math.min(Rt<0&&R?Rt%T:Rt<0?Rt+T:Rt,T-1)}var q=R&&m.from===n&&m.to===n,z=L(m.from,0),X=L(m.to,T-1);if(z>X)if(R)z-=T;else{var Z=z;z=X,X=Z}if(/^(?:asymmetric|continuous)$/.test(x)){var Q=x==="asymmetric",j=Math.min,ce=X-z+1,te=ce-1,oe=q?j(ce,4):1,ee=oe,re=oe,K=[];if(R||(ee=j(1,z),re=j(1,T-X-1)),te+=ee+re,te<=1)return;for(var se=0,de=z-ee;se<=te;se++,de++)K[se]=k[(de<0?de+T:de)%T]._point;for(var ve=K[0]._x+2*K[1]._x,ue=K[0]._y+2*K[1]._y,Ce=2,Me=te-1,Ae=[ve],Oe=[ue],ke=[Ce],Le=[],De=[],se=1;se<te;se++){var ze=se<Me,He=ze||Q?1:2,$e=ze?4:Q?2:7,ct=ze?4:Q?3:8,ft=ze?2:Q?0:1,vt=He/Ce;Ce=ke[se]=$e-vt,ve=Ae[se]=ct*K[se]._x+ft*K[se+1]._x-vt*ve,ue=Oe[se]=ct*K[se]._y+ft*K[se+1]._y-vt*ue}Le[Me]=Ae[Me]/ke[Me],De[Me]=Oe[Me]/ke[Me];for(var se=te-2;se>=0;se--)Le[se]=(Ae[se]-Le[se+1])/ke[se],De[se]=(Oe[se]-De[se+1])/ke[se];Le[te]=(3*K[te]._x-Le[Me])/2,De[te]=(3*K[te]._y-De[Me])/2;for(var se=ee,kt=te-re,de=z;se<=kt;se++,de++){var tt=k[de<0?de+T:de],nt=tt._point,_t=Le[se]-nt._x,Et=De[se]-nt._y;(q||se<kt)&&tt.setHandleOut(_t,Et),(q||se>ee)&&tt.setHandleIn(-_t,-Et)}}else for(var se=z;se<=X;se++)k[se<0?se+T:se].smooth(m,!q&&se===z,!q&&se===X)},toShape:function(r){if(!this._closed)return null;var c=this._segments,m,x,k,T;function R(Q,j){var ce=c[Q],te=ce.getNext(),oe=c[j],ee=oe.getNext();return ce._handleOut.isZero()&&te._handleIn.isZero()&&oe._handleOut.isZero()&&ee._handleIn.isZero()&&te._point.subtract(ce._point).isCollinear(ee._point.subtract(oe._point))}function L(Q){var j=c[Q],ce=j.getPrevious(),te=j.getNext();return ce._handleOut.isZero()&&j._handleIn.isZero()&&j._handleOut.isZero()&&te._handleIn.isZero()&&j._point.subtract(ce._point).isOrthogonal(te._point.subtract(j._point))}function q(Q){var j=c[Q],ce=j.getNext(),te=j._handleOut,oe=ce._handleIn,ee=.5522847498307936;if(te.isOrthogonal(oe)){var re=j._point,K=ce._point,se=new V(re,te,!0).intersect(new V(K,oe,!0),!0);return se&&C.isZero(te.getLength()/se.subtract(re).getLength()-ee)&&C.isZero(oe.getLength()/se.subtract(K).getLength()-ee)}return!1}function z(Q,j){return c[Q]._point.getDistance(c[j]._point)}if(!this.hasHandles()&&c.length===4&&R(0,2)&&R(1,3)&&L(1)?(m=ie.Rectangle,x=new p(z(0,3),z(0,1)),T=c[1]._point.add(c[2]._point).divide(2)):c.length===8&&q(0)&&q(2)&&q(4)&&q(6)&&R(1,5)&&R(3,7)?(m=ie.Rectangle,x=new p(z(1,6),z(0,3)),k=x.subtract(new p(z(0,7),z(1,2))).divide(2),T=c[3]._point.add(c[4]._point).divide(2)):c.length===4&&q(0)&&q(1)&&q(2)&&q(3)&&(C.isZero(z(0,2)-z(1,3))?(m=ie.Circle,k=z(0,2)/2):(m=ie.Ellipse,k=new p(z(2,0)/2,z(3,1)/2)),T=c[1]._point),m){var X=this.getPosition(!0),Z=new m({center:X,size:x,radius:k,insert:!1});return Z.copyAttributes(this,!0),Z._matrix.prepend(this._matrix),Z.rotate(T.subtract(X).getAngle()+90),(r===n||r)&&Z.insertAbove(this),Z}return null},toPath:"#clone",compare:function r(c){if(!c||c instanceof H)return r.base.call(this,c);var m=this.getCurves(),x=c.getCurves(),k=m.length,T=x.length;if(!k||!T)return k==T;for(var R=m[0].getValues(),L=[],q=0,z,X=0,Z,Q=0;Q<T;Q++){var oe=x[Q].getValues();L.push(oe);var j=ne.getOverlaps(R,oe);if(j){z=!Q&&j[0][0]>0?T-1:Q,Z=j[0][1];break}}for(var ce=Math.abs,te=1e-8,oe=L[z],ee;R&&oe;){var j=ne.getOverlaps(R,oe);if(j){var re=j[0][0];if(ce(re-X)<te){X=j[1][0],X===1&&(R=++q<k?m[q].getValues():null,X=0);var K=j[0][1];if(ce(K-Z)<te){if(ee||(ee=[z,K]),Z=j[1][1],Z===1&&(++z>=T&&(z=0),oe=L[z]||x[z].getValues(),Z=0),!R)return ee[0]===z&&ee[1]===Z;continue}}}break}return!1},_hitTestSelf:function(r,c,m,x){var k=this,T=this.getStyle(),R=this._segments,L=R.length,q=this._closed,z=c._tolerancePadding,X=z,Z,Q,j,ce,te,oe,ee=c.stroke&&T.hasStroke(),re=c.fill&&T.hasFill(),K=c.curves,se=ee?T.getStrokeWidth()/2:re&&c.tolerance>0||K?0:null;se!==null&&(se>0?(Z=T.getStrokeJoin(),Q=T.getStrokeCap(),j=T.getMiterLimit(),X=X.add(F._getStrokePadding(se,x))):Z=Q="round");function de(Le,De){return r.subtract(Le).divide(De).length<=1}function ve(Le,De,ze){if(!c.selected||De.isSelected()){var He=Le._point;if(De!==He&&(De=De.add(He)),de(De,X))return new le(ze,k,{segment:Le,point:De})}}function ue(Le,De){return(De||c.segments)&&ve(Le,Le._point,"segment")||!De&&c.handles&&(ve(Le,Le._handleIn,"handle-in")||ve(Le,Le._handleOut,"handle-out"))}function Ce(Le){ce.add(Le)}function Me(Le){var De=q||Le._index>0&&Le._index<L-1;if((De?Z:Q)==="round")return de(Le._point,X);if(ce=new F({internal:!0,closed:!0}),De?Le.isSmooth()||F._addBevelJoin(Le,Z,se,j,null,x,Ce,!0):Q==="square"&&F._addSquareCap(Le,Q,se,null,x,Ce,!0),!ce.isEmpty()){var ze;return ce.contains(r)||(ze=ce.getNearestLocation(r))&&de(ze.getPoint(),z)}}if(c.ends&&!c.segments&&!q){if(oe=ue(R[0],!0)||ue(R[L-1],!0))return oe}else if(c.segments||c.handles){for(var Ae=0;Ae<L;Ae++)if(oe=ue(R[Ae]))return oe}if(se!==null){if(te=this.getNearestLocation(r),te){var Oe=te.getTime();Oe===0||Oe===1&&L>1?Me(te.getSegment())||(te=null):de(te.getPoint(),X)||(te=null)}if(!te&&Z==="miter"&&L>1)for(var Ae=0;Ae<L;Ae++){var ke=R[Ae];if(r.getDistance(ke._point)<=j*se&&Me(ke)){te=ke.getLocation();break}}}return!te&&re&&this._contains(r)||te&&!ee&&!K?new le("fill",this):te?new le(ee?"stroke":"curve",this,{location:te,point:te.getPoint()}):null}},l.each(ne._evaluateMethods,function(r){this[r+"At"]=function(c){var m=this.getLocationAt(c);return m&&m[r]()}},{beans:!1,getLocationOf:function(){for(var r=g.read(arguments),c=this.getCurves(),m=0,x=c.length;m<x;m++){var k=c[m].getLocationOf(r);if(k)return k}return null},getOffsetOf:function(){var r=this.getLocationOf.apply(this,arguments);return r?r.getOffset():null},getLocationAt:function(r){if(typeof r=="number"){for(var c=this.getCurves(),m=0,x=0,k=c.length;x<k;x++){var T=m,R=c[x];if(m+=R.getLength(),m>r)return R.getLocationAt(r-T)}if(c.length>0&&r<=this.getLength())return new we(c[c.length-1],1)}else if(r&&r.getPath&&r.getPath()===this)return r;return null},getOffsetsWithTangent:function(){var r=g.read(arguments);if(r.isZero())return[];for(var c=[],m=0,x=this.getCurves(),k=0,T=x.length;k<T;k++){for(var R=x[k],L=R.getTimesWithTangent(r),q=0,z=L.length;q<z;q++){var X=m+R.getOffsetAtTime(L[q]);c.indexOf(X)<0&&c.push(X)}m+=R.length}return c}}),new function(){function r(m,x,k,T){if(T<=0)return;var R=T/2,L=T-2,q=R-1,z=new Array(6),X,Z;function Q(re){var K=z[re],se=z[re+1];(X!=K||Z!=se)&&(m.beginPath(),m.moveTo(X,Z),m.lineTo(K,se),m.stroke(),m.beginPath(),m.arc(K,se,R,0,Math.PI*2,!0),m.fill())}for(var j=0,ce=x.length;j<ce;j++){var te=x[j],oe=te._selection;if(te._transformCoordinates(k,z),X=z[0],Z=z[1],oe&2&&Q(2),oe&4&&Q(4),m.fillRect(X-R,Z-R,T,T),L>0&&!(oe&1)){var ee=m.fillStyle;m.fillStyle="#ffffff",m.fillRect(X-q,Z-q,L,L),m.fillStyle=ee}}}function c(m,x,k){var T=x._segments,R=T.length,L=new Array(6),q=!0,z,X,Z,Q,j,ce,te,oe;function ee(K){if(k)K._transformCoordinates(k,L),z=L[0],X=L[1];else{var se=K._point;z=se._x,X=se._y}if(q)m.moveTo(z,X),q=!1;else{if(k)j=L[2],ce=L[3];else{var de=K._handleIn;j=z+de._x,ce=X+de._y}j===z&&ce===X&&te===Z&&oe===Q?m.lineTo(z,X):m.bezierCurveTo(te,oe,j,ce,z,X)}if(Z=z,Q=X,k)te=L[4],oe=L[5];else{var de=K._handleOut;te=Z+de._x,oe=Q+de._y}}for(var re=0;re<R;re++)ee(T[re]);x._closed&&R>0&&ee(T[0])}return{_draw:function(m,x,k,T){var R=x.dontStart,L=x.dontFinish||x.clip,q=this.getStyle(),z=q.hasFill(),X=q.hasStroke(),Z=q.getDashArray(),Q=!Qe.support.nativeDash&&X&&Z&&Z.length;R||m.beginPath(),(z||X&&!Q||L)&&(c(m,this,T),this._closed&&m.closePath());function j(K){return Z[(K%Q+Q)%Q]}if(!L&&(z||X)&&(this._setStyles(m,x,k),z&&(m.fill(q.getFillRule()),m.shadowColor="rgba(0,0,0,0)"),X)){if(Q){R||m.beginPath();for(var ce=new W(this,.25,32,!1,T),te=ce.length,oe=-q.getDashOffset(),ee,re=0;oe>0;)oe-=j(re--)+j(re--);for(;oe<te;)ee=oe+j(re++),(oe>0||ee>0)&&ce.drawPart(m,Math.max(oe,0),Math.max(ee,0)),oe=ee+j(re++)}m.stroke()}},_drawSelected:function(m,x){m.beginPath(),c(m,this,x),m.stroke(),r(m,this._segments,x,Qe.settings.handleSize)}}},new function(){function r(c){var m=c._segments;if(!m.length)throw new Error("Use a moveTo() command first");return m[m.length-1]}return{moveTo:function(){var c=this._segments;c.length===1&&this.removeSegment(0),c.length||this._add([new Y(g.read(arguments))])},moveBy:function(){throw new Error("moveBy() is unsupported on Path items.")},lineTo:function(){this._add([new Y(g.read(arguments))])},cubicCurveTo:function(){var c=arguments,m=g.read(c),x=g.read(c),k=g.read(c),T=r(this);T.setHandleOut(m.subtract(T._point)),this._add([new Y(k,x.subtract(k))])},quadraticCurveTo:function(){var c=arguments,m=g.read(c),x=g.read(c),k=r(this)._point;this.cubicCurveTo(m.add(k.subtract(m).multiply(1/3)),m.add(x.subtract(m).multiply(1/3)),x)},curveTo:function(){var c=arguments,m=g.read(c),x=g.read(c),k=l.pick(l.read(c),.5),T=1-k,R=r(this)._point,L=m.subtract(R.multiply(T*T)).subtract(x.multiply(k*k)).divide(2*k*T);if(L.isNaN())throw new Error("Cannot put a curve through points with parameter = "+k);this.quadraticCurveTo(L,x)},arcTo:function(){var c=arguments,m=Math.abs,x=Math.sqrt,k=r(this),T=k._point,R=g.read(c),L,q=l.peek(c),z=l.pick(q,!0),X,Z,Q,j;if(typeof z=="boolean")var ce=T.add(R).divide(2),L=ce.add(ce.subtract(T).rotate(z?-90:90));else if(l.remain(c)<=2)L=R,R=g.read(c);else if(!T.equals(R)){var te=p.read(c),oe=C.isZero;if(oe(te.width)||oe(te.height))return this.lineTo(R);var ee=l.read(c),z=!!l.read(c),re=!!l.read(c),ce=T.add(R).divide(2),K=T.subtract(ce).rotate(-ee),se=K.x,de=K.y,ve=m(te.width),ue=m(te.height),Ce=ve*ve,Me=ue*ue,Ae=se*se,Oe=de*de,ke=x(Ae/Ce+Oe/Me);if(ke>1&&(ve*=ke,ue*=ke,Ce=ve*ve,Me=ue*ue),ke=(Ce*Me-Ce*Oe-Me*Ae)/(Ce*Oe+Me*Ae),m(ke)<1e-12&&(ke=0),ke<0)throw new Error("Cannot create an arc with the given arguments");X=new g(ve*de/ue,-ue*se/ve).multiply((re===z?-1:1)*x(ke)).rotate(ee).add(ce),j=new O().translate(X).rotate(ee).scale(ve,ue),Q=j._inverseTransform(T),Z=Q.getDirectedAngle(j._inverseTransform(R)),!z&&Z>0?Z-=360:z&&Z<0&&(Z+=360)}if(L){var Le=new V(T.add(L).divide(2),L.subtract(T).rotate(90),!0),De=new V(L.add(R).divide(2),R.subtract(L).rotate(90),!0),ze=new V(T,R),He=ze.getSide(L);if(X=Le.intersect(De,!0),!X){if(!He)return this.lineTo(R);throw new Error("Cannot create an arc with the given arguments")}Q=T.subtract(X),Z=Q.getDirectedAngle(R.subtract(X));var $e=ze.getSide(X,!0);$e===0?Z=He*m(Z):He===$e&&(Z+=Z<0?360:-360)}if(Z){for(var ct=1e-5,ft=m(Z),vt=ft>=360?4:Math.ceil((ft-ct)/90),kt=Z/vt,tt=kt*Math.PI/360,nt=4/3*Math.sin(tt)/(1+Math.cos(tt)),_t=[],Et=0;Et<=vt;Et++){var K=R,Mt=null;if(Et<vt&&(Mt=Q.rotate(90).multiply(nt),j?(K=j._transformPoint(Q),Mt=j._transformPoint(Q.add(Mt)).subtract(K)):K=X.add(Q)),!Et)k.setHandleOut(Mt);else{var Dt=Q.rotate(-90).multiply(nt);j&&(Dt=j._transformPoint(Q.add(Dt)).subtract(K)),_t.push(new Y(K,Dt,Mt))}Q=Q.rotate(kt)}this._add(_t)}},lineBy:function(){var c=g.read(arguments),m=r(this)._point;this.lineTo(m.add(c))},curveBy:function(){var c=arguments,m=g.read(c),x=g.read(c),k=l.read(c),T=r(this)._point;this.curveTo(T.add(m),T.add(x),k)},cubicCurveBy:function(){var c=arguments,m=g.read(c),x=g.read(c),k=g.read(c),T=r(this)._point;this.cubicCurveTo(T.add(m),T.add(x),T.add(k))},quadraticCurveBy:function(){var c=arguments,m=g.read(c),x=g.read(c),k=r(this)._point;this.quadraticCurveTo(k.add(m),k.add(x))},arcBy:function(){var c=arguments,m=r(this)._point,x=m.add(g.read(c)),k=l.pick(l.peek(c),!0);typeof k=="boolean"?this.arcTo(x,k):this.arcTo(x,m.add(g.read(c)))},closePath:function(c){this.setClosed(!0),this.join(this,c)}}},{_getBounds:function(r,c){var m=c.handle?"getHandleBounds":c.stroke?"getStrokeBounds":"getBounds";return F[m](this._segments,this._closed,this,r,c)},statics:{getBounds:function(r,c,m,x,k,T){var R=r[0];if(!R)return new N;var L=new Array(6),q=R._transformCoordinates(x,new Array(6)),z=q.slice(0,2),X=z.slice(),Z=new Array(2);function Q(te){te._transformCoordinates(x,L);for(var oe=0;oe<2;oe++)ne._addBounds(q[oe],q[oe+4],L[oe+2],L[oe],oe,T?T[oe]:0,z,X,Z);var ee=q;q=L,L=ee}for(var j=1,ce=r.length;j<ce;j++)Q(r[j]);return c&&Q(R),new N(z[0],z[1],X[0]-z[0],X[1]-z[1])},getStrokeBounds:function(r,c,m,x,k){var T=m.getStyle(),R=T.hasStroke(),L=T.getStrokeWidth(),q=R&&m._getStrokeMatrix(x,k),z=R&&F._getStrokePadding(L,q),X=F.getBounds(r,c,m,x,k,z);if(!R)return X;var Z=L/2,Q=T.getStrokeJoin(),j=T.getStrokeCap(),ce=T.getMiterLimit(),te=new N(new p(z));function oe(ve){X=X.include(ve)}function ee(ve){X=X.unite(te.setCenter(ve._point.transform(x)))}function re(ve,ue){ue==="round"||ve.isSmooth()?ee(ve):F._addBevelJoin(ve,ue,Z,ce,x,q,oe)}function K(ve,ue){ue==="round"?ee(ve):F._addSquareCap(ve,ue,Z,x,q,oe)}var se=r.length-(c?0:1);if(se>0){for(var de=1;de<se;de++)re(r[de],Q);c?re(r[0],Q):(K(r[0],j),K(r[r.length-1],j))}return X},_getStrokePadding:function(r,c){if(!c)return[r,r];var m=new g(r,0).transform(c),x=new g(0,r).transform(c),k=m.getAngleInRadians(),T=m.getLength(),R=x.getLength(),L=Math.sin(k),q=Math.cos(k),z=Math.tan(k),X=Math.atan2(R*z,T),Z=Math.atan2(R,z*T);return[Math.abs(T*Math.cos(X)*q+R*Math.sin(X)*L),Math.abs(R*Math.sin(Z)*q+T*Math.cos(Z)*L)]},_addBevelJoin:function(r,c,m,x,k,T,R,L){var q=r.getCurve(),z=q.getPrevious(),X=q.getPoint1().transform(k),Z=z.getNormalAtTime(1).multiply(m).transform(T),Q=q.getNormalAtTime(0).multiply(m).transform(T),j=Z.getDirectedAngle(Q);if((j<0||j>=180)&&(Z=Z.negate(),Q=Q.negate()),L&&R(X),R(X.add(Z)),c==="miter"){var ce=new V(X.add(Z),new g(-Z.y,Z.x),!0).intersect(new V(X.add(Q),new g(-Q.y,Q.x),!0),!0);ce&&X.getDistance(ce)<=x*m&&R(ce)}R(X.add(Q))},_addSquareCap:function(r,c,m,x,k,T,R){var L=r._point.transform(x),q=r.getLocation(),z=q.getNormal().multiply(q.getTime()===0?m:-m).transform(k);c==="square"&&(R&&(T(L.subtract(z)),T(L.add(z))),L=L.add(z.rotate(-90))),T(L.add(z)),T(L.subtract(z))},getHandleBounds:function(r,c,m,x,k){var T=m.getStyle(),R=k.stroke&&T.hasStroke(),L,q;if(R){var z=m._getStrokeMatrix(x,k),X=T.getStrokeWidth()/2,Z=X;T.getStrokeJoin()==="miter"&&(Z=X*T.getMiterLimit()),T.getStrokeCap()==="square"&&(Z=Math.max(Z,X*Math.SQRT2)),L=F._getStrokePadding(X,z),q=F._getStrokePadding(Z,z)}for(var Q=new Array(6),j=1/0,ce=-j,te=j,oe=ce,ee=0,re=r.length;ee<re;ee++){var K=r[ee];K._transformCoordinates(x,Q);for(var se=0;se<6;se+=2){var de=se?L:q,ve=de?de[0]:0,ue=de?de[1]:0,Ce=Q[se],Me=Q[se+1],Ae=Ce-ve,Oe=Ce+ve,ke=Me-ue,Le=Me+ue;Ae<j&&(j=Ae),Oe>ce&&(ce=Oe),ke<te&&(te=ke),Le>oe&&(oe=Le)}}return new N(j,te,ce-j,oe-te)}}});F.inject({statics:new function(){var r=.5522847498307936,c=[new Y([-1,0],[0,r],[0,-.5522847498307936]),new Y([0,-1],[-.5522847498307936,0],[r,0]),new Y([1,0],[0,-.5522847498307936],[0,r]),new Y([0,1],[r,0],[-.5522847498307936,0])];function m(k,T,R){var L=l.getNamed(R),q=new F(L&&(L.insert==!0?D.INSERT:L.insert==!1?D.NO_INSERT:null));return q._add(k),q._closed=T,q.set(L,D.INSERT)}function x(k,T,R){for(var L=new Array(4),q=0;q<4;q++){var z=c[q];L[q]=new Y(z._point.multiply(T).add(k),z._handleIn.multiply(T),z._handleOut.multiply(T))}return m(L,!0,R)}return{Line:function(){var k=arguments;return m([new Y(g.readNamed(k,"from")),new Y(g.readNamed(k,"to"))],!1,k)},Circle:function(){var k=arguments,T=g.readNamed(k,"center"),R=l.readNamed(k,"radius");return x(T,new p(R),k)},Rectangle:function(){var k=arguments,T=N.readNamed(k,"rectangle"),R=p.readNamed(k,"radius",0,{readNull:!0}),L=T.getBottomLeft(!0),q=T.getTopLeft(!0),z=T.getTopRight(!0),X=T.getBottomRight(!0),Z;if(!R||R.isZero())Z=[new Y(L),new Y(q),new Y(z),new Y(X)];else{R=p.min(R,T.getSize(!0).divide(2));var Q=R.width,j=R.height,ce=Q*r,te=j*r;Z=[new Y(L.add(Q,0),null,[-ce,0]),new Y(L.subtract(0,j),[0,te]),new Y(q.add(0,j),null,[0,-te]),new Y(q.add(Q,0),[-ce,0],null),new Y(z.subtract(Q,0),null,[ce,0]),new Y(z.add(0,j),[0,-te],null),new Y(X.subtract(0,j),null,[0,te]),new Y(X.subtract(Q,0),[ce,0])]}return m(Z,!0,k)},RoundRectangle:"#Rectangle",Ellipse:function(){var k=arguments,T=ie._readEllipse(k);return x(T.center,T.radius,k)},Oval:"#Ellipse",Arc:function(){var k=arguments,T=g.readNamed(k,"from"),R=g.readNamed(k,"through"),L=g.readNamed(k,"to"),q=l.getNamed(k),z=new F(q&&q.insert==!1&&D.NO_INSERT);return z.moveTo(T),z.arcTo(R,L),z.set(q)},RegularPolygon:function(){for(var k=arguments,T=g.readNamed(k,"center"),R=l.readNamed(k,"sides"),L=l.readNamed(k,"radius"),q=360/R,z=R%3===0,X=new g(0,z?-L:L),Z=z?-1:.5,Q=new Array(R),j=0;j<R;j++)Q[j]=new Y(T.add(X.rotate((j+Z)*q)));return m(Q,!0,k)},Star:function(){for(var k=arguments,T=g.readNamed(k,"center"),R=l.readNamed(k,"points")*2,L=l.readNamed(k,"radius1"),q=l.readNamed(k,"radius2"),z=360/R,X=new g(0,-1),Z=new Array(R),Q=0;Q<R;Q++)Z[Q]=new Y(T.add(X.rotate(z*Q).multiply(Q%2?q:L)));return m(Z,!0,k)}}}});var H=ye.extend({_class:"CompoundPath",_serializeFields:{children:[]},beans:!0,initialize:function(c){this._children=[],this._namedChildren={},this._initialize(c)||(typeof c=="string"?this.setPathData(c):this.addChildren(Array.isArray(c)?c:arguments))},insertChildren:function r(c,m){var x=m,k=x[0];k&&typeof k[0]=="number"&&(x=[x]);for(var T=m.length-1;T>=0;T--){var R=x[T];x===m&&!(R instanceof F)&&(x=l.slice(x)),Array.isArray(R)?x[T]=new F({segments:R,insert:!1}):R instanceof H&&(x.splice.apply(x,[T,1].concat(R.removeChildren())),R.remove())}return r.base.call(this,c,x)},reduce:function r(c){for(var m=this._children,x=m.length-1;x>=0;x--){var k=m[x].reduce(c);k.isEmpty()&&k.remove()}if(!m.length){var k=new F(D.NO_INSERT);return k.copyAttributes(this),k.insertAbove(this),this.remove(),k}return r.base.call(this)},isClosed:function(){for(var r=this._children,c=0,m=r.length;c<m;c++)if(!r[c]._closed)return!1;return!0},setClosed:function(r){for(var c=this._children,m=0,x=c.length;m<x;m++)c[m].setClosed(r)},getFirstSegment:function(){var r=this.getFirstChild();return r&&r.getFirstSegment()},getLastSegment:function(){var r=this.getLastChild();return r&&r.getLastSegment()},getCurves:function(){for(var r=this._children,c=[],m=0,x=r.length;m<x;m++)l.push(c,r[m].getCurves());return c},getFirstCurve:function(){var r=this.getFirstChild();return r&&r.getFirstCurve()},getLastCurve:function(){var r=this.getLastChild();return r&&r.getLastCurve()},getArea:function(){for(var r=this._children,c=0,m=0,x=r.length;m<x;m++)c+=r[m].getArea();return c},getLength:function(){for(var r=this._children,c=0,m=0,x=r.length;m<x;m++)c+=r[m].getLength();return c},getPathData:function(r,c){for(var m=this._children,x=[],k=0,T=m.length;k<T;k++){var R=m[k],L=R._matrix;x.push(R.getPathData(r&&!L.isIdentity()?r.appended(L):r,c))}return x.join("")},_hitTestChildren:function r(c,m,x){return r.base.call(this,c,m.class===F||m.type==="path"?m:l.set({},m,{fill:!1}),x)},_draw:function(r,c,m,x){var k=this._children;if(k.length){c=c.extend({dontStart:!0,dontFinish:!0}),r.beginPath();for(var T=0,R=k.length;T<R;T++)k[T].draw(r,c,x);if(!c.clip){this._setStyles(r,c,m);var L=this._style;L.hasFill()&&(r.fill(L.getFillRule()),r.shadowColor="rgba(0,0,0,0)"),L.hasStroke()&&r.stroke()}}},_drawSelected:function(r,c,m){for(var x=this._children,k=0,T=x.length;k<T;k++){var R=x[k],L=R._matrix;m[R._id]||R._drawSelected(r,L.isIdentity()?c:c.appended(L))}}},new function(){function r(c,m){var x=c._children;if(m&&!x.length)throw new Error("Use a moveTo() command first");return x[x.length-1]}return l.each(["lineTo","cubicCurveTo","quadraticCurveTo","curveTo","arcTo","lineBy","cubicCurveBy","quadraticCurveBy","curveBy","arcBy"],function(c){this[c]=function(){var m=r(this,!0);m[c].apply(m,arguments)}},{moveTo:function(){var c=r(this),m=c&&c.isEmpty()?c:new F(D.NO_INSERT);m!==c&&this.addChild(m),m.moveTo.apply(m,arguments)},moveBy:function(){var c=r(this,!0),m=c&&c.getLastSegment(),x=g.read(arguments);this.moveTo(m?x.add(m._point):x)},closePath:function(c){r(this,!0).closePath(c)}})},l.each(["reverse","flatten","simplify","smooth"],function(r){this[r]=function(c){for(var m=this._children,x,k=0,T=m.length;k<T;k++)x=m[k][r](c)||x;return x}},{}));ye.inject(new function(){var r=Math.min,c=Math.max,m=Math.abs,x={unite:{1:!0,2:!0},intersect:{2:!0},subtract:{1:!0},exclude:{1:!0,"-1":!0}};function k(ee){return ee._children||[ee]}function T(ee,re){var K=ee.clone(!1).reduce({simplify:!0}).transform(null,!0,!0);if(re){for(var se=k(K),de=0,ve=se.length;de<ve;de++){var ee=se[de];!ee._closed&&!ee.isEmpty()&&(ee.closePath(1e-12),ee.getFirstSegment().setHandleIn(0,0),ee.getLastSegment().setHandleOut(0,0))}K=K.resolveCrossings().reorient(K.getFillRule()==="nonzero",!0)}return K}function R(ee,re,K,se,de){var ve=new H(D.NO_INSERT);return ve.addChildren(ee,!0),ve=ve.reduce({simplify:re}),de&&de.insert==!1||ve.insertAbove(se&&K.isSibling(se)&&K.getIndex()<se.getIndex()?se:K),ve.copyAttributes(K,!0),ve}function L(ee){return ee.hasOverlap()||ee.isCrossing()}function q(ee,re,K,se){if(se&&(se.trace==!1||se.stroke)&&/^(subtract|intersect)$/.test(K))return z(ee,re,K);var de=T(ee,!0),ve=re&&ee!==re&&T(re,!0),ue=x[K];ue[K]=!0,ve&&(ue.subtract||ue.exclude)^(ve.isClockwise()^de.isClockwise())&&ve.reverse();var Ce=j(we.expand(de.getIntersections(ve,L))),Me=k(de),Ae=ve&&k(ve),Oe=[],ke=[],Le;function De(Mt){for(var Dt=0,Rt=Mt.length;Dt<Rt;Dt++){var Ft=Mt[Dt];l.push(Oe,Ft._segments),l.push(ke,Ft.getCurves()),Ft._overlapsOnly=!0}}function ze(Mt){for(var Dt=[],Rt=0,Ft=Mt&&Mt.length;Rt<Ft;Rt++)Dt.push(ke[Mt[Rt]]);return Dt}if(Ce.length){De(Me),Ae&&De(Ae);for(var He=new Array(ke.length),$e=0,ct=ke.length;$e<ct;$e++)He[$e]=ke[$e].getValues();for(var ft=S.findCurveBoundsCollisions(He,He,0,!0),vt={},$e=0;$e<ke.length;$e++){var kt=ke[$e],tt=kt._path._id,nt=vt[tt]=vt[tt]||{};nt[kt.getIndex()]={hor:ze(ft[$e].hor),ver:ze(ft[$e].ver)}}for(var $e=0,ct=Ce.length;$e<ct;$e++)te(Ce[$e]._segment,de,ve,vt,ue);for(var $e=0,ct=Oe.length;$e<ct;$e++){var _t=Oe[$e],Et=_t._intersection;_t._winding||te(_t,de,ve,vt,ue),Et&&Et._overlap||(_t._path._overlapsOnly=!1)}Le=oe(Oe,ue)}else Le=Q(Ae?Me.concat(Ae):Me.slice(),function(Mt){return!!ue[Mt]});return R(Le,!0,ee,re,se)}function z(ee,re,K){var se=T(ee),de=T(re),ve=se.getIntersections(de,L),ue=K==="subtract",Ce=K==="divide",Me={},Ae=[];function Oe(De){if(!Me[De._id]&&(Ce||de.contains(De.getPointAt(De.getLength()/2))^ue))return Ae.unshift(De),Me[De._id]=!0}for(var ke=ve.length-1;ke>=0;ke--){var Le=ve[ke].split();Le&&(Oe(Le)&&Le.getFirstSegment().setHandleIn(0,0),se.getLastSegment().setHandleOut(0,0))}return Oe(se),R(Ae,!1,ee,re)}function X(ee,re){for(var K=ee;K;){if(K===re)return;K=K._previous}for(;ee._next&&ee._next!==re;)ee=ee._next;if(!ee._next){for(;re._previous;)re=re._previous;ee._next=re,re._previous=ee}}function Z(ee){for(var re=ee.length-1;re>=0;re--)ee[re].clearHandles()}function Q(ee,re,K){var se=ee&&ee.length;if(se){var de=l.each(ee,function(ft,vt){this[ft._id]={container:null,winding:ft.isClockwise()?1:-1,index:vt}},{}),ve=ee.slice().sort(function(ft,vt){return m(vt.getArea())-m(ft.getArea())}),ue=ve[0],Ce=S.findItemBoundsCollisions(ve,null,C.GEOMETRIC_EPSILON);K==null&&(K=ue.isClockwise());for(var Me=0;Me<se;Me++){var Ae=ve[Me],Oe=de[Ae._id],ke=0,Le=Ce[Me];if(Le){for(var De=null,ze=Le.length-1;ze>=0;ze--)if(Le[ze]<Me){De=De||Ae.getInteriorPoint();var He=ve[Le[ze]];if(He.contains(De)){var $e=de[He._id];ke=$e.winding,Oe.winding+=ke,Oe.container=$e.exclude?$e.container:He;break}}}if(re(Oe.winding)===re(ke))Oe.exclude=!0,ee[Oe.index]=null;else{var ct=Oe.container;Ae.setClockwise(ct?!ct.isClockwise():K)}}}return ee}function j(ee,re,K){var se=re&&[],de=1e-8,ve=1-de,ue=!1,Ce=K||[],Me=K&&{},Ae,Oe,ke;function Le(Dt){return Dt._path._id+"."+Dt._segment1._index}for(var De=(K&&K.length)-1;De>=0;De--){var ze=K[De];ze._path&&(Me[Le(ze)]=!0)}for(var De=ee.length-1;De>=0;De--){var He=ee[De],$e=He._time,ct=$e,ft=re&&!re(He),ze=He._curve,vt;if(ze&&(ze!==Oe?(ue=!ze.hasHandles()||Me&&Me[Le(ze)],Ae=[],ke=null,Oe=ze):ke>=de&&($e/=ke)),ft){Ae&&Ae.push(He);continue}else re&&se.unshift(He);if(ke=ct,$e<de)vt=ze._segment1;else if($e>ve)vt=ze._segment2;else{var kt=ze.divideAtTime($e,!0);ue&&Ce.push(ze,kt),vt=kt._segment1;for(var tt=Ae.length-1;tt>=0;tt--){var nt=Ae[tt];nt._time=(nt._time-$e)/(1-$e)}}He._setSegment(vt);var _t=vt._intersection,Et=He._intersection;if(_t){X(_t,Et);for(var Mt=_t;Mt;)X(Mt._intersection,_t),Mt=Mt._next}else vt._intersection=Et}return K||Z(Ce),se||ee}function ce(ee,re,K,se,de){var ve=Array.isArray(re)?re:re[K?"hor":"ver"],ue=K?1:0,Ce=ue^1,Me=[ee.x,ee.y],Ae=Me[ue],Oe=Me[Ce],ke=1e-9,Le=1e-6,De=Ae-ke,ze=Ae+ke,He=0,$e=0,ct=0,ft=0,vt=!1,kt=!1,tt=1,nt=[],_t,Et;function Mt(pr){var wr=pr[Ce+0],pi=pr[Ce+6];if(!(Oe<r(wr,pi)||Oe>c(wr,pi))){var Gr=pr[ue+0],gi=pr[ue+2],Zi=pr[ue+4],xi=pr[ue+6];if(wr===pi){(Gr<ze&&xi>De||xi<ze&&Gr>De)&&(vt=!0);return}var vi=Oe===wr?0:Oe===pi||De>c(Gr,gi,Zi,xi)||ze<r(Gr,gi,Zi,xi)?1:ne.solveCubic(pr,Ce,Oe,nt,0,1)>0?nt[0]:1,mi=vi===0?Gr:vi===1?xi:ne.getPoint(pr,vi)[K?"y":"x"],si=wr>pi?1:-1,Yr=_t[Ce]>_t[Ce+6]?1:-1,Lr=_t[ue+6];return Oe!==wr?(mi<De?ct+=si:mi>ze?ft+=si:vt=!0,mi>Ae-Le&&mi<Ae+Le&&(tt/=2)):(si!==Yr?Gr<De?ct+=si:Gr>ze&&(ft+=si):Gr!=Lr&&(Lr<ze&&mi>ze?(ft+=si,vt=!0):Lr>De&&mi<De&&(ct+=si,vt=!0)),tt/=4),_t=pr,!de&&mi>De&&mi<ze&&ne.getTangent(pr,vi)[K?"x":"y"]===0&&ce(ee,re,!K,se,!0)}}function Dt(pr){var wr=pr[Ce+0],pi=pr[Ce+2],Gr=pr[Ce+4],gi=pr[Ce+6];if(Oe<=c(wr,pi,Gr,gi)&&Oe>=r(wr,pi,Gr,gi)){for(var Zi=pr[ue+0],xi=pr[ue+2],vi=pr[ue+4],mi=pr[ue+6],si=De>c(Zi,xi,vi,mi)||ze<r(Zi,xi,vi,mi)?[pr]:ne.getMonoCurves(pr,K),Yr,Lr=0,Rs=si.length;Lr<Rs;Lr++)if(Yr=Mt(si[Lr]))return Yr}}for(var Rt=0,Ft=ve.length;Rt<Ft;Rt++){var $t=ve[Rt],Vt=$t._path,Rr=$t.getValues(),Br;if((!Rt||ve[Rt-1]._path!==Vt)&&(_t=null,Vt._closed||(Et=ne.getValues(Vt.getLastCurve().getSegment2(),$t.getSegment1(),null,!se),Et[Ce]!==Et[Ce+6]&&(_t=Et)),!_t)){_t=Rr;for(var Kr=Vt.getLastCurve();Kr&&Kr!==$t;){var mt=Kr.getValues();if(mt[Ce]!==mt[Ce+6]){_t=mt;break}Kr=Kr.getPrevious()}}if(Br=Dt(Rr))return Br;if(Rt+1===Ft||ve[Rt+1]._path!==Vt){if(Et&&(Br=Dt(Et)))return Br;vt&&!ct&&!ft&&(ct=ft=Vt.isClockwise(se)^K?1:-1),He+=ct,$e+=ft,ct=ft=0,vt&&(kt=!0,vt=!1),Et=null}}return He=m(He),$e=m($e),{winding:c(He,$e),windingL:He,windingR:$e,quality:tt,onPath:kt}}function te(ee,re,K,se,de){var ve=[],ue=ee,Ce=0,ke;do{var Me=ee.getCurve();if(Me){var Ae=Me.getLength();ve.push({segment:ee,curve:Me,length:Ae}),Ce+=Ae}ee=ee.getNext()}while(ee&&!ee._intersection&&ee!==ue);for(var Oe=[.5,.25,.75],ke={winding:0,quality:-1},Le=.001,De=1-Le,ze=0;ze<Oe.length&&ke.quality<.5;ze++)for(var Ae=Ce*Oe[ze],He=0,$e=ve.length;He<$e;He++){var ct=ve[He],ft=ct.length;if(Ae<=ft){var Me=ct.curve,vt=Me._path,kt=vt._parent,tt=kt instanceof H?kt:vt,nt=C.clamp(Me.getTimeAt(Ae),Le,De),_t=Me.getPointAtTime(nt),Et=m(Me.getTangentAtTime(nt).y)<Math.SQRT1_2,Mt=null;if(de.subtract&&K){var Dt=tt===re?K:re,Rt=Dt._getWinding(_t,Et,!0);if(tt===re&&Rt.winding||tt===K&&!Rt.winding){if(Rt.quality<1)continue;Mt={winding:0,quality:1}}}Mt=Mt||ce(_t,se[vt._id][Me.getIndex()],Et,!0),Mt.quality>ke.quality&&(ke=Mt);break}Ae-=ft}for(var He=ve.length-1;He>=0;He--)ve[He].segment._winding=ke}function oe(ee,re){var K=[],se;function de(Ft){var $t;return!!(Ft&&!Ft._visited&&(!re||re[($t=Ft._winding||{}).winding]&&!(re.unite&&$t.winding===2&&$t.windingL&&$t.windingR)))}function ve(Ft){if(Ft){for(var $t=0,Vt=se.length;$t<Vt;$t++)if(Ft===se[$t])return!0}return!1}function ue(Ft){for(var $t=Ft._segments,Vt=0,Rr=$t.length;Vt<Rr;Vt++)$t[Vt]._visited=!0}function Ce(Ft,$t){var Vt=Ft._intersection,Rr=Vt,Br=[];$t&&(se=[Ft]);function Kr(mt,pr){for(;mt&&mt!==pr;){var wr=mt._segment,pi=wr&&wr._path;if(pi){var Gr=wr.getNext()||pi.getFirstSegment(),gi=Gr._intersection;wr!==Ft&&(ve(wr)||ve(Gr)||Gr&&de(wr)&&(de(Gr)||gi&&de(gi._segment)))&&Br.push(wr),$t&&se.push(wr)}mt=mt._next}}if(Vt){for(Kr(Vt);Vt&&Vt._previous;)Vt=Vt._previous;Kr(Vt,Rr)}return Br}ee.sort(function(Ft,$t){var Vt=Ft._intersection,Rr=$t._intersection,Br=!!(Vt&&Vt._overlap),Kr=!!(Rr&&Rr._overlap),mt=Ft._path,pr=$t._path;return Br^Kr?Br?1:-1:!Vt^!Rr?Vt?1:-1:mt!==pr?mt._id-pr._id:Ft._index-$t._index});for(var Me=0,Ae=ee.length;Me<Ae;Me++){var Oe=ee[Me],ke=de(Oe),Le=null,De=!1,ze=!0,He=[],$e,ct,ft;if(ke&&Oe._path._overlapsOnly){var vt=Oe._path,kt=Oe._intersection._segment._path;vt.compare(kt)&&(vt.getArea()&&K.push(vt.clone(!1)),ue(vt),ue(kt),ke=!1)}for(;ke;){var tt=!Le,nt=Ce(Oe,tt),_t=nt.shift(),De=!tt&&(ve(Oe)||ve(_t)),Et=!De&&_t;if(tt&&(Le=new F(D.NO_INSERT),$e=null),De){(Oe.isFirst()||Oe.isLast())&&(ze=Oe._path._closed),Oe._visited=!0;break}if(Et&&$e&&(He.push($e),$e=null),$e||(Et&&nt.push(Oe),$e={start:Le._segments.length,crossings:nt,visited:ct=[],handleIn:ft}),Et&&(Oe=_t),!de(Oe)){Le.removeSegments($e.start);for(var Mt=0,Dt=ct.length;Mt<Dt;Mt++)ct[Mt]._visited=!1;ct.length=0;do Oe=$e&&$e.crossings.shift(),(!Oe||!Oe._path)&&(Oe=null,$e=He.pop(),$e&&(ct=$e.visited,ft=$e.handleIn));while($e&&!de(Oe));if(!Oe)break}var Rt=Oe.getNext();Le.add(new Y(Oe._point,ft,Rt&&Oe._handleOut)),Oe._visited=!0,ct.push(Oe),Oe=Rt||Oe._path.getFirstSegment(),ft=Rt&&Rt._handleIn}De&&(ze&&(Le.getFirstSegment().setHandleIn(ft),Le.setClosed(ze)),Le.getArea()!==0&&K.push(Le))}return K}return{_getWinding:function(ee,re,K){return ce(ee,this.getCurves(),re,K)},unite:function(ee,re){return q(this,ee,"unite",re)},intersect:function(ee,re){return q(this,ee,"intersect",re)},subtract:function(ee,re){return q(this,ee,"subtract",re)},exclude:function(ee,re){return q(this,ee,"exclude",re)},divide:function(ee,re){return re&&(re.trace==!1||re.stroke)?z(this,ee,"divide"):R([this.subtract(ee,re),this.intersect(ee,re)],!0,this,ee,re)},resolveCrossings:function(){var ee=this._children,re=ee||[this];function K($e,ct){var ft=$e&&$e._intersection;return ft&&ft._overlap&&ft._path===ct}var se=!1,de=!1,ve=this.getIntersections(null,function($e){return $e.hasOverlap()&&(se=!0)||$e.isCrossing()&&(de=!0)}),ue=se&&de&&[];if(ve=we.expand(ve),se)for(var Ce=j(ve,function($e){return $e.hasOverlap()},ue),Me=Ce.length-1;Me>=0;Me--){var Ae=Ce[Me],Oe=Ae._path,ke=Ae._segment,Le=ke.getPrevious(),De=ke.getNext();K(Le,Oe)&&K(De,Oe)&&(ke.remove(),Le._handleOut._set(0,0),De._handleIn._set(0,0),Le!==ke&&!Le.getCurve().hasLength()&&(De._handleIn.set(Le._handleIn),Le.remove()))}de&&(j(ve,se&&function($e){var ct=$e.getCurve(),ft=$e.getSegment(),vt=$e._intersection,kt=vt._curve,tt=vt._segment;if(ct&&kt&&ct._path&&kt._path)return!0;ft&&(ft._intersection=null),tt&&(tt._intersection=null)},ue),ue&&Z(ue),re=oe(l.each(re,function($e){l.push(this,$e._segments)},[])));var ze=re.length,He;return ze>1&&ee?(re!==ee&&this.setChildren(re),He=this):ze===1&&!ee&&(re[0]!==this&&this.setSegments(re[0].removeSegments()),He=this),He||(He=new H(D.NO_INSERT),He.addChildren(re),He=He.reduce(),He.copyAttributes(this),this.replaceWith(He)),He},reorient:function(ee,re){var K=this._children;return K&&K.length?this.setChildren(Q(this.removeChildren(),function(se){return!!(ee?se:se&1)},re)):re!==n&&this.setClockwise(re),this},getInteriorPoint:function(){var ee=this.getBounds(),re=ee.getCenter(!0);if(!this.contains(re)){for(var K=this.getCurves(),se=re.y,de=[],ve=[],ue=0,Ce=K.length;ue<Ce;ue++){var Me=K[ue].getValues(),Ae=Me[1],Oe=Me[3],ke=Me[5],Le=Me[7];if(se>=r(Ae,Oe,ke,Le)&&se<=c(Ae,Oe,ke,Le))for(var De=ne.getMonoCurves(Me),ze=0,He=De.length;ze<He;ze++){var $e=De[ze],ct=$e[1],ft=$e[7];if(ct!==ft&&(se>=ct&&se<=ft||se>=ft&&se<=ct)){var vt=se===ct?$e[0]:se===ft?$e[6]:ne.solveCubic($e,1,se,ve,0,1)===1?ne.getPoint($e,ve[0]).x:($e[0]+$e[6])/2;de.push(vt)}}}de.length>1&&(de.sort(function(kt,tt){return kt-tt}),re.x=(de[0]+de[1])/2)}return re}}});var W=l.extend({_class:"PathFlattener",initialize:function(r,c,m,x,k){var T=[],R=[],L=0,q=1/(m||32),z=r._segments,X=z[0],Z;function Q(oe,ee){var re=ne.getValues(oe,ee,k);T.push(re),j(re,oe._index,0,1)}function j(oe,ee,re,K){if(K-re>q&&!(x&&ne.isStraight(oe))&&!ne.isFlatEnough(oe,c||.25)){var se=ne.subdivide(oe,.5),de=(re+K)/2;j(se[0],ee,re,de),j(se[1],ee,de,K)}else{var ve=oe[6]-oe[0],ue=oe[7]-oe[1],Ce=Math.sqrt(ve*ve+ue*ue);Ce>0&&(L+=Ce,R.push({offset:L,curve:oe,index:ee,time:K}))}}for(var ce=1,te=z.length;ce<te;ce++)Z=z[ce],Q(X,Z),X=Z;r._closed&&Q(Z||X,z[0]),this.curves=T,this.parts=R,this.length=L,this.index=0},_get:function(r){for(var c=this.parts,m=c.length,x,k=this.index;x=k,!(!k||c[--k].offset<r););for(;x<m;x++){var T=c[x];if(T.offset>=r){this.index=x;var R=c[x-1],L=R&&R.index===T.index?R.time:0,q=R?R.offset:0;return{index:T.index,time:L+(T.time-L)*(r-q)/(T.offset-q)}}}return{index:c[m-1].index,time:1}},drawPart:function(r,c,m){for(var x=this._get(c),k=this._get(m),T=x.index,R=k.index;T<=R;T++){var L=ne.getPart(this.curves[T],T===x.index?x.time:0,T===k.index?k.time:1);T===x.index&&r.moveTo(L[0],L[1]),r.bezierCurveTo.apply(r,L.slice(2))}}},l.each(ne._evaluateMethods,function(r){this[r+"At"]=function(c){var m=this._get(c);return ne[r](this.curves[m.index],m.time)}},{})),_e=l.extend({initialize:function(r){for(var c=this.points=[],m=r._segments,x=r._closed,k=0,T,R=m.length;k<R;k++){var L=m[k].point;(!T||!T.equals(L))&&c.push(T=L.clone())}x&&(c.unshift(c[c.length-1]),c.push(c[1])),this.closed=x},fit:function(r){var c=this.points,m=c.length,x=null;return m>0&&(x=[new Y(c[0])],m>1&&(this.fitCubic(x,r,0,m-1,c[1].subtract(c[0]),c[m-2].subtract(c[m-1])),this.closed&&(x.shift(),x.pop()))),x},fitCubic:function(r,c,m,x,k,T){var R=this.points;if(x-m===1){var L=R[m],q=R[x],z=L.getDistance(q)/3;this.addCurve(r,[L,L.add(k.normalize(z)),q.add(T.normalize(z)),q]);return}for(var X=this.chordLengthParameterize(m,x),Z=Math.max(c,c*c),Q,j=!0,ce=0;ce<=4;ce++){var te=this.generateBezier(m,x,X,k,T),oe=this.findMaxError(m,x,te,X);if(oe.error<c&&j){this.addCurve(r,te);return}if(Q=oe.index,oe.error>=Z)break;j=this.reparameterize(m,x,X,te),Z=oe.error}var ee=R[Q-1].subtract(R[Q+1]);this.fitCubic(r,c,m,Q,k,ee),this.fitCubic(r,c,Q,x,ee.negate(),T)},addCurve:function(r,c){var m=r[r.length-1];m.setHandleOut(c[1].subtract(c[0])),r.push(new Y(c[3],c[2].subtract(c[3])))},generateBezier:function(r,c,m,x,k){for(var T=1e-12,R=Math.abs,L=this.points,q=L[r],z=L[c],X=[[0,0],[0,0]],Z=[0,0],Q=0,j=c-r+1;Q<j;Q++){var ce=m[Q],te=1-ce,oe=3*ce*te,ee=te*te*te,re=oe*te,K=oe*ce,se=ce*ce*ce,de=x.normalize(re),ve=k.normalize(K),ue=L[r+Q].subtract(q.multiply(ee+re)).subtract(z.multiply(K+se));X[0][0]+=de.dot(de),X[0][1]+=de.dot(ve),X[1][0]=X[0][1],X[1][1]+=ve.dot(ve),Z[0]+=de.dot(ue),Z[1]+=ve.dot(ue)}var Ce=X[0][0]*X[1][1]-X[1][0]*X[0][1],Me,Ae;if(R(Ce)>T){var Oe=X[0][0]*Z[1]-X[1][0]*Z[0],ke=Z[0]*X[1][1]-Z[1]*X[0][1];Me=ke/Ce,Ae=Oe/Ce}else{var Le=X[0][0]+X[0][1],De=X[1][0]+X[1][1];Me=Ae=R(Le)>T?Z[0]/Le:R(De)>T?Z[1]/De:0}var ze=z.getDistance(q),He=T*ze,$e,ct;if(Me<He||Ae<He)Me=Ae=ze/3;else{var ft=z.subtract(q);$e=x.normalize(Me),ct=k.normalize(Ae),$e.dot(ft)-ct.dot(ft)>ze*ze&&(Me=Ae=ze/3,$e=ct=null)}return[q,q.add($e||x.normalize(Me)),z.add(ct||k.normalize(Ae)),z]},reparameterize:function(r,c,m,x){for(var k=r;k<=c;k++)m[k-r]=this.findRoot(x,this.points[k],m[k-r]);for(var k=1,T=m.length;k<T;k++)if(m[k]<=m[k-1])return!1;return!0},findRoot:function(r,c,m){for(var x=[],k=[],T=0;T<=2;T++)x[T]=r[T+1].subtract(r[T]).multiply(3);for(var T=0;T<=1;T++)k[T]=x[T+1].subtract(x[T]).multiply(2);var R=this.evaluate(3,r,m),L=this.evaluate(2,x,m),q=this.evaluate(1,k,m),z=R.subtract(c),X=L.dot(L)+z.dot(q);return C.isMachineZero(X)?m:m-z.dot(L)/X},evaluate:function(r,c,m){for(var x=c.slice(),k=1;k<=r;k++)for(var T=0;T<=r-k;T++)x[T]=x[T].multiply(1-m).add(x[T+1].multiply(m));return x[0]},chordLengthParameterize:function(r,c){for(var m=[0],x=r+1;x<=c;x++)m[x-r]=m[x-r-1]+this.points[x].getDistance(this.points[x-1]);for(var x=1,k=c-r;x<=k;x++)m[x]/=m[k];return m},findMaxError:function(r,c,m,x){for(var k=Math.floor((c-r+1)/2),T=0,R=r+1;R<c;R++){var L=this.evaluate(3,m,x[R-r]),q=L.subtract(this.points[R]),z=q.x*q.x+q.y*q.y;z>=T&&(T=z,k=R)}return{error:T,index:k}}}),Te=D.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(c){this._content="",this._lines=[];var m=c&&l.isPlainObject(c)&&c.x===n&&c.y===n;this._initialize(m&&c,!m&&g.read(arguments))},_equals:function(r){return this._content===r._content},copyContent:function(r){this.setContent(r._content)},getContent:function(){return this._content},setContent:function(r){this._content=""+r,this._lines=this._content.split(/\r\n|\n|\r/mg),this._changed(521)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),Re=Te.extend({_class:"PointText",initialize:function(){Te.apply(this,arguments)},getPoint:function(){var r=this._matrix.getTranslation();return new w(r.x,r.y,this,"setPoint")},setPoint:function(){var r=g.read(arguments);this.translate(r.subtract(this._matrix.getTranslation()))},_draw:function(r,c,m){if(this._content){this._setStyles(r,c,m);var x=this._lines,k=this._style,T=k.hasFill(),R=k.hasStroke(),L=k.getLeading(),q=r.shadowColor;r.font=k.getFontStyle(),r.textAlign=k.getJustification();for(var z=0,X=x.length;z<X;z++){r.shadowColor=q;var Z=x[z];T&&(r.fillText(Z,0,0),r.shadowColor="rgba(0,0,0,0)"),R&&r.strokeText(Z,0,0),r.translate(0,L)}}},_getBounds:function(r,c){var m=this._style,x=this._lines,k=x.length,T=m.getJustification(),R=m.getLeading(),L=this.getView().getTextWidth(m.getFontStyle(),x),q=0;T!=="left"&&(q-=L/(T==="center"?2:1));var z=new N(q,k?-.75*R:0,L,k*R);return r?r._transformBounds(z,z):z}}),Ie=l.extend(new function(){var r={gray:["gray"],rgb:["red","green","blue"],hsb:["hue","saturation","brightness"],hsl:["hue","saturation","lightness"],gradient:["gradient","origin","destination","highlight"]},c={},m={transparent:[0,0,0,0]},x;function k(L){var q=L.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i)||L.match(/^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i),z="rgb",X;if(q){var Z=q[4]?4:3;X=new Array(Z);for(var Q=0;Q<Z;Q++){var j=q[Q+1];X[Q]=parseInt(j.length==1?j+j:j,16)/255}}else if(q=L.match(/^(rgb|hsl)a?\((.*)\)$/)){z=q[1],X=q[2].trim().split(/[,\s]+/g);for(var ce=z==="hsl",Q=0,te=Math.min(X.length,4);Q<te;Q++){var oe=X[Q],j=parseFloat(oe);if(ce)if(Q===0){var ee=oe.match(/([a-z]*)$/)[1];j*={turn:360,rad:180/Math.PI,grad:.9}[ee]||1}else Q<3&&(j/=100);else Q<3&&(j/=/%$/.test(oe)?100:255);X[Q]=j}}else{var re=m[L];if(!re)if(a){x||(x=qe.getContext(1,1,{willReadFrequently:!0}),x.globalCompositeOperation="copy"),x.fillStyle="rgba(0,0,0,0)",x.fillStyle=L,x.fillRect(0,0,1,1);var K=x.getImageData(0,0,1,1).data;re=m[L]=[K[0]/255,K[1]/255,K[2]/255]}else re=[0,0,0];X=re.slice()}return[z,X]}var T=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]],R={"rgb-hsb":function(L,q,z){var X=Math.max(L,q,z),Z=Math.min(L,q,z),Q=X-Z,j=Q===0?0:(X==L?(q-z)/Q+(q<z?6:0):X==q?(z-L)/Q+2:(L-q)/Q+4)*60;return[j,X===0?0:Q/X,X]},"hsb-rgb":function(L,q,z){L=(L/60%6+6)%6;var Z=Math.floor(L),X=L-Z,Z=T[Z],Q=[z,z*(1-q),z*(1-q*X),z*(1-q*(1-X))];return[Q[Z[0]],Q[Z[1]],Q[Z[2]]]},"rgb-hsl":function(L,q,z){var X=Math.max(L,q,z),Z=Math.min(L,q,z),Q=X-Z,j=Q===0,ce=j?0:(X==L?(q-z)/Q+(q<z?6:0):X==q?(z-L)/Q+2:(L-q)/Q+4)*60,te=(X+Z)/2,oe=j?0:te<.5?Q/(X+Z):Q/(2-X-Z);return[ce,oe,te]},"hsl-rgb":function(L,q,z){if(L=(L/360%1+1)%1,q===0)return[z,z,z];for(var X=[L+1/3,L,L-1/3],Z=z<.5?z*(1+q):z+q-z*q,Q=2*z-Z,j=[],ce=0;ce<3;ce++){var te=X[ce];te<0&&(te+=1),te>1&&(te-=1),j[ce]=6*te<1?Q+(Z-Q)*6*te:2*te<1?Z:3*te<2?Q+(Z-Q)*(2/3-te)*6:Q}return j},"rgb-gray":function(L,q,z){return[L*.2989+q*.587+z*.114]},"gray-rgb":function(L){return[L,L,L]},"gray-hsb":function(L){return[0,0,L]},"gray-hsl":function(L){return[0,0,L]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return l.each(r,function(L,q){c[q]=[],l.each(L,function(z,X){var Z=l.capitalize(z),Q=/^(hue|saturation)$/.test(z),j=c[q][X]=q==="gradient"?z==="gradient"?function(ce){var te=this._components[0];return ce=st.read(Array.isArray(ce)?ce:arguments,0,{readNull:!0}),te!==ce&&(te&&te._removeOwner(this),ce&&ce._addOwner(this)),ce}:function(){return g.read(arguments,0,{readNull:z==="highlight",clone:!0})}:function(ce){return ce==null||isNaN(ce)?0:+ce};this["get"+Z]=function(){return this._type===q||Q&&/^hs[bl]$/.test(this._type)?this._components[X]:this._convert(q)[X]},this["set"+Z]=function(ce){this._type!==q&&!(Q&&/^hs[bl]$/.test(this._type))&&(this._components=this._convert(q),this._properties=r[q],this._type=q),this._components[X]=j.call(this,ce),this._changed()}},this)},{_class:"Color",_readIndex:!0,initialize:function L(q){var z=arguments,X=this.__read,Z=0,Q,j,ce,te;Array.isArray(q)&&(z=q,q=z[0]);var oe=q!=null&&typeof q;if(oe==="string"&&q in r&&(Q=q,q=z[1],Array.isArray(q)?(j=q,ce=z[2]):(X&&(Z=1),z=l.slice(z,1),oe=typeof q)),!j){if(te=oe==="number"?z:oe==="object"&&q.length!=null?q:null,te){Q||(Q=te.length>=3?"rgb":"gray");var ee=r[Q].length;ce=te[ee],X&&(Z+=te===arguments?ee+(ce!=null?1:0):1),te.length>ee&&(te=l.slice(te,0,ee))}else if(oe==="string"){var re=k(q);Q=re[0],j=re[1],j.length===4&&(ce=j[3],j.length--)}else if(oe==="object")if(q.constructor===L){if(Q=q._type,j=q._components.slice(),ce=q._alpha,Q==="gradient")for(var K=1,se=j.length;K<se;K++){var de=j[K];de&&(j[K]=de.clone())}}else if(q.constructor===st)Q="gradient",te=z;else{Q="hue"in q?"lightness"in q?"hsl":"hsb":"gradient"in q||"stops"in q||"radial"in q?"gradient":"gray"in q?"gray":"rgb";var ve=r[Q],ue=c[Q];this._components=j=[];for(var K=0,se=ve.length;K<se;K++){var Ce=q[ve[K]];Ce==null&&!K&&Q==="gradient"&&"stops"in q&&(Ce={stops:q.stops,radial:q.radial}),Ce=ue[K].call(this,Ce),Ce!=null&&(j[K]=Ce)}ce=q.alpha}X&&Q&&(Z=1)}if(this._type=Q||"rgb",!j){this._components=j=[];for(var ue=c[this._type],K=0,se=ue.length;K<se;K++){var Ce=ue[K].call(this,te&&te[K]);Ce!=null&&(j[K]=Ce)}}return this._components=j,this._properties=r[this._type],this._alpha=ce,X&&(this.__read=Z),this},set:"#initialize",_serialize:function(L,q){var z=this.getComponents();return l.serialize(/^(gray|rgb)$/.test(this._type)?z:[this._type].concat(z),L,!0,q)},_changed:function(){this._canvasStyle=null,this._owner&&(this._setter?this._owner[this._setter](this):this._owner._changed(129))},_convert:function(L){var q;return this._type===L?this._components.slice():(q=R[this._type+"-"+L])?q.apply(this,this._components):R["rgb-"+L].apply(this,R[this._type+"-rgb"].apply(this,this._components))},convert:function(L){return new Ie(L,this._convert(L),this._alpha)},getType:function(){return this._type},setType:function(L){this._components=this._convert(L),this._properties=r[L],this._type=L},getComponents:function(){var L=this._components.slice();return this._alpha!=null&&L.push(this._alpha),L},getAlpha:function(){return this._alpha!=null?this._alpha:1},setAlpha:function(L){this._alpha=L==null?null:Math.min(Math.max(L,0),1),this._changed()},hasAlpha:function(){return this._alpha!=null},equals:function(L){var q=l.isPlainValue(L,!0)?Ie.read(arguments):L;return q===this||q&&this._class===q._class&&this._type===q._type&&this.getAlpha()===q.getAlpha()&&l.equals(this._components,q._components)||!1},toString:function(){for(var L=this._properties,q=[],z=this._type==="gradient",X=M.instance,Z=0,Q=L.length;Z<Q;Z++){var j=this._components[Z];j!=null&&q.push(L[Z]+": "+(z?j:X.number(j)))}return this._alpha!=null&&q.push("alpha: "+X.number(this._alpha)),"{ "+q.join(", ")+" }"},toCSS:function(L){var q=this._convert("rgb"),z=L||this._alpha==null?1:this._alpha;function X(Z){return Math.round((Z<0?0:Z>1?1:Z)*255)}return q=[X(q[0]),X(q[1]),X(q[2])],z<1&&q.push(z<0?0:z),L?"#"+((1<<24)+(q[0]<<16)+(q[1]<<8)+q[2]).toString(16).slice(1):(q.length==4?"rgba(":"rgb(")+q.join(",")+")"},toCanvasStyle:function(L,q){if(this._canvasStyle)return this._canvasStyle;if(this._type!=="gradient")return this._canvasStyle=this.toCSS();var z=this._components,X=z[0],Z=X._stops,Q=z[1],j=z[2],ce=z[3],te=q&&q.inverted(),oe;if(te&&(Q=te._transformPoint(Q),j=te._transformPoint(j),ce&&(ce=te._transformPoint(ce))),X._radial){var ee=j.getDistance(Q);if(ce){var re=ce.subtract(Q);re.getLength()>ee&&(ce=Q.add(re.normalize(ee-.1)))}var K=ce||Q;oe=L.createRadialGradient(K.x,K.y,0,Q.x,Q.y,ee)}else oe=L.createLinearGradient(Q.x,Q.y,j.x,j.y);for(var se=0,de=Z.length;se<de;se++){var ve=Z[se],ue=ve._offset;oe.addColorStop(ue??se/(de-1),ve._color.toCanvasStyle())}return this._canvasStyle=oe},transform:function(L){if(this._type==="gradient"){for(var q=this._components,z=1,X=q.length;z<X;z++){var Z=q[z];L._transformPoint(Z,Z,!0)}this._changed()}},statics:{_types:r,random:function(){var L=Math.random;return new Ie(L(),L(),L())},_setOwner:function(L,q,z){return L&&(L._owner&&q&&L._owner!==q&&(L=L.clone()),!L._owner^!q&&(L._owner=q||null,L._setter=z||null)),L}}})},new function(){var r={add:function(c,m){return c+m},subtract:function(c,m){return c-m},multiply:function(c,m){return c*m},divide:function(c,m){return c/m}};return l.each(r,function(c,m){this[m]=function(x){x=Ie.read(arguments);for(var k=this._type,T=this._components,R=x._convert(k),L=0,q=T.length;L<q;L++)R[L]=c(T[L],R[L]);return new Ie(k,R,this._alpha!=null?c(this._alpha,x.getAlpha()):null)}},{})}),st=l.extend({_class:"Gradient",initialize:function(c,m){this._id=y.get(),c&&l.isPlainObject(c)&&(this.set(c),c=m=null),this._stops==null&&this.setStops(c||["white","black"]),this._radial==null&&this.setRadial(typeof m=="string"&&m==="radial"||m||!1)},_serialize:function(r,c){return c.add(this,function(){return l.serialize([this._stops,this._radial],r,!0,c)})},_changed:function(){for(var r=0,c=this._owners&&this._owners.length;r<c;r++)this._owners[r]._changed()},_addOwner:function(r){this._owners||(this._owners=[]),this._owners.push(r)},_removeOwner:function(r){var c=this._owners?this._owners.indexOf(r):-1;c!=-1&&(this._owners.splice(c,1),this._owners.length||(this._owners=n))},clone:function(){for(var r=[],c=0,m=this._stops.length;c<m;c++)r[c]=this._stops[c].clone();return new st(r,this._radial)},getStops:function(){return this._stops},setStops:function(r){if(r.length<2)throw new Error("Gradient stop list needs to contain at least two stops.");var c=this._stops;if(c)for(var m=0,x=c.length;m<x;m++)c[m]._owner=n;c=this._stops=wt.readList(r,0,{clone:!0});for(var m=0,x=c.length;m<x;m++)c[m]._owner=this;this._changed()},getRadial:function(){return this._radial},setRadial:function(r){this._radial=r,this._changed()},equals:function(r){if(r===this)return!0;if(r&&this._class===r._class){var c=this._stops,m=r._stops,x=c.length;if(x===m.length){for(var k=0;k<x;k++)if(!c[k].equals(m[k]))return!1;return!0}}return!1}}),wt=l.extend({_class:"GradientStop",initialize:function(c,m){var x=c,k=m;typeof c=="object"&&m===n&&(Array.isArray(c)&&typeof c[0]!="number"?(x=c[0],k=c[1]):("color"in c||"offset"in c||"rampPoint"in c)&&(x=c.color,k=c.offset||c.rampPoint||0)),this.setColor(x),this.setOffset(k)},clone:function(){return new wt(this._color.clone(),this._offset)},_serialize:function(r,c){var m=this._color,x=this._offset;return l.serialize(x==null?[m]:[m,x],r,!0,c)},_changed:function(){this._owner&&this._owner._changed(129)},getOffset:function(){return this._offset},setOffset:function(r){this._offset=r,this._changed()},getRampPoint:"#getOffset",setRampPoint:"#setOffset",getColor:function(){return this._color},setColor:function(){Ie._setOwner(this._color,null),this._color=Ie._setOwner(Ie.read(arguments,0),this,"setColor"),this._changed()},equals:function(r){return r===this||r&&this._class===r._class&&this._color.equals(r._color)&&this._offset==r._offset||!1}}),Ze=l.extend(new function(){var r={fillColor:null,fillRule:"nonzero",strokeColor:null,strokeWidth:1,strokeCap:"butt",strokeJoin:"miter",strokeScaling:!0,miterLimit:10,dashOffset:0,dashArray:[],shadowColor:null,shadowBlur:0,shadowOffset:new g,selectedColor:null},c=l.set({},r,{fontFamily:"sans-serif",fontWeight:"normal",fontSize:12,leading:null,justification:"left"}),m=l.set({},c,{fillColor:new Ie}),x={strokeWidth:193,strokeCap:193,strokeJoin:193,strokeScaling:201,miterLimit:193,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},k={beans:!0},T={_class:"Style",beans:!0,initialize:function(L,q,z){this._values={},this._owner=q,this._project=q&&q._project||z||Qe.project,this._defaults=!q||q instanceof me?c:q instanceof Te?m:r,L&&this.set(L)}};return l.each(c,function(R,L){var q=/Color$/.test(L),z=L==="shadowOffset",X=l.capitalize(L),Z=x[L],Q="set"+X,j="get"+X;T[Q]=function(ce){var te=this._owner,oe=te&&te._children,ee=oe&&oe.length>0&&!(te instanceof H);if(ee)for(var re=0,K=oe.length;re<K;re++)oe[re]._style[Q](ce);if((L==="selectedColor"||!ee)&&L in this._defaults){var se=this._values[L];se!==ce&&(q&&(se&&(Ie._setOwner(se,null),se._canvasStyle=null),ce&&ce.constructor===Ie&&(ce=Ie._setOwner(ce,te,ee&&Q))),this._values[L]=ce,te&&te._changed(Z||129))}},T[j]=function(ce){var te=this._owner,oe=te&&te._children,ee=oe&&oe.length>0&&!(te instanceof H),re;if(ee&&!ce)for(var K=0,se=oe.length;K<se;K++){var de=oe[K]._style[j]();if(!K)re=de;else if(!l.equals(re,de))return n}else if(L in this._defaults){var re=this._values[L];if(re===n)re=this._defaults[L],re&&re.clone&&(re=re.clone());else{var ve=q?Ie:z?g:null;ve&&!(re&&re.constructor===ve)&&(this._values[L]=re=ve.read([re],0,{readNull:!0,clone:!0}))}}return re&&q&&(re=Ie._setOwner(re,te,ee&&Q)),re},k[j]=function(ce){return this._style[j](ce)},k[Q]=function(ce){this._style[Q](ce)}}),l.each({Font:"FontFamily",WindingRule:"FillRule"},function(R,L){var q="get"+L,z="set"+L;T[q]=k[q]="#get"+R,T[z]=k[z]="#set"+R}),D.inject(k),T},{set:function(r){var c=r instanceof Ze,m=c?r._values:r;if(m){for(var x in m)if(x in this._defaults){var k=m[x];this[x]=k&&c&&k.clone?k.clone():k}}},equals:function(r){function c(m,x,k){var T=m._values,R=x._values,L=x._defaults;for(var q in T){var z=T[q],X=R[q];if(!(k&&q in R)&&!l.equals(z,X===n?L[q]:X))return!1}return!0}return r===this||r&&this._class===r._class&&c(this,r)&&c(r,this,!0)||!1},_dispose:function(){var r;r=this.getFillColor(),r&&(r._canvasStyle=null),r=this.getStrokeColor(),r&&(r._canvasStyle=null),r=this.getShadowColor(),r&&(r._canvasStyle=null)},hasFill:function(){var r=this.getFillColor();return!!r&&r.alpha>0},hasStroke:function(){var r=this.getStrokeColor();return!!r&&r.alpha>0&&this.getStrokeWidth()>0},hasShadow:function(){var r=this.getShadowColor();return!!r&&r.alpha>0&&(this.getShadowBlur()>0||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var r=this.getFontSize();return this.getFontWeight()+" "+r+(/[a-z]/i.test(r+"")?" ":"px ")+this.getFontFamily()},getFont:"#getFontFamily",setFont:"#setFontFamily",getLeading:function r(){var c=r.base.call(this),m=this.getFontSize();return/pt|em|%|px/.test(m)&&(m=this.getView().getPixelSize(m)),c??m*1.2}}),dt=new function(){function r(c,m,x,k){for(var T=["","webkit","moz","Moz","ms","o"],R=m[0].toUpperCase()+m.substring(1),L=0;L<6;L++){var q=T[L],z=q?q+R:m;if(z in c){if(x)c[z]=k;else return c[z];break}}}return{getStyles:function(c){var m=c&&c.nodeType!==9?c.ownerDocument:c,x=m&&m.defaultView;return x&&x.getComputedStyle(c,"")},getBounds:function(c,m){var x=c.ownerDocument,k=x.body,T=x.documentElement,R;try{R=c.getBoundingClientRect()}catch{R={left:0,top:0,width:0,height:0}}var L=R.left-(T.clientLeft||k.clientLeft||0),q=R.top-(T.clientTop||k.clientTop||0);if(!m){var z=x.defaultView;L+=z.pageXOffset||T.scrollLeft||k.scrollLeft,q+=z.pageYOffset||T.scrollTop||k.scrollTop}return new N(L,q,R.width,R.height)},getViewportBounds:function(c){var m=c.ownerDocument,x=m.defaultView,k=m.documentElement;return new N(0,0,x.innerWidth||k.clientWidth,x.innerHeight||k.clientHeight)},getOffset:function(c,m){return dt.getBounds(c,m).getPoint()},getSize:function(c){return dt.getBounds(c,!0).getSize()},isInvisible:function(c){return dt.getSize(c).equals(new p(0,0))},isInView:function(c){return!dt.isInvisible(c)&&dt.getViewportBounds(c).intersects(dt.getBounds(c,!0))},isInserted:function(c){return o.body.contains(c)},getPrefixed:function(c,m){return c&&r(c,m)},setPrefixed:function(c,m,x){if(typeof m=="object")for(var k in m)r(c,k,!0,m[k]);else r(c,m,!0,x)}}},bt={add:function(r,c){if(r)for(var m in c)for(var x=c[m],k=m.split(/[\s,]+/g),T=0,R=k.length;T<R;T++){var L=k[T],q=r===o&&(L==="touchstart"||L==="touchmove")?{passive:!1}:!1;r.addEventListener(L,x,q)}},remove:function(r,c){if(r)for(var m in c)for(var x=c[m],k=m.split(/[\s,]+/g),T=0,R=k.length;T<R;T++)r.removeEventListener(k[T],x,!1)},getPoint:function(r){var c=r.targetTouches?r.targetTouches.length?r.targetTouches[0]:r.changedTouches[0]:r;return new g(c.pageX||c.clientX+o.documentElement.scrollLeft,c.pageY||c.clientY+o.documentElement.scrollTop)},getTarget:function(r){return r.target||r.srcElement},getRelatedTarget:function(r){return r.relatedTarget||r.toElement},getOffset:function(r,c){return bt.getPoint(r).subtract(dt.getOffset(c||bt.getTarget(r)))}};bt.requestAnimationFrame=new function(){var r=dt.getPrefixed(a,"requestAnimationFrame"),c=!1,m=[],x;function k(){var T=m;m=[];for(var R=0,L=T.length;R<L;R++)T[R]();c=r&&m.length,c&&r(k)}return function(T){m.push(T),r?c||(r(k),c=!0):x||(x=setInterval(k,1e3/60))}};var et=l.extend(h,{_class:"View",initialize:function r(c,m){function x(Z){return m[Z]||parseInt(m.getAttribute(Z),10)}function k(){var Z=dt.getSize(m);return Z.isNaN()||Z.isZero()?new p(x("width"),x("height")):Z}var T;if(a&&m){this._id=m.getAttribute("id"),this._id==null&&m.setAttribute("id",this._id="paper-view-"+r._id++),bt.add(m,this._viewEvents);var R="none";if(dt.setPrefixed(m.style,{userDrag:R,userSelect:R,touchCallout:R,contentZooming:R,tapHighlightColor:"rgba(0,0,0,0)"}),f.hasAttribute(m,"resize")){var L=this;bt.add(a,this._windowEvents={resize:function(){L.setViewSize(k())}})}if(T=k(),f.hasAttribute(m,"stats")&&typeof Stats<"u"){this._stats=new Stats;var q=this._stats.domElement,z=q.style,X=dt.getOffset(m);z.position="absolute",z.left=X.x+"px",z.top=X.y+"px",o.body.appendChild(q)}}else T=new p(m),m=null;this._project=c,this._scope=c._scope,this._element=m,this._pixelRatio||(this._pixelRatio=a&&a.devicePixelRatio||1),this._setElementSize(T.width,T.height),this._viewSize=T,r._views.push(this),r._viewsById[this._id]=this,(this._matrix=new O)._owner=this,r._focused||(r._focused=this),this._frameItems={},this._frameItemCount=0,this._itemEvents={native:{},virtual:{}},this._autoUpdate=!Qe.agent.node,this._needsUpdate=!1},remove:function(){if(!this._project)return!1;et._focused===this&&(et._focused=null),et._views.splice(et._views.indexOf(this),1),delete et._viewsById[this._id];var r=this._project;return r._view===this&&(r._view=null),bt.remove(this._element,this._viewEvents),bt.remove(a,this._windowEvents),this._element=this._project=null,this.off("frame"),this._animate=!1,this._frameItems={},!0},_events:l.each(D._itemHandlers.concat(["onResize","onKeyDown","onKeyUp"]),function(r){this[r]={}},{onFrame:{install:function(){this.play()},uninstall:function(){this.pause()}}}),_animate:!1,_time:0,_count:0,getAutoUpdate:function(){return this._autoUpdate},setAutoUpdate:function(r){this._autoUpdate=r,r&&this.requestUpdate()},update:function(){},draw:function(){this.update()},requestUpdate:function(){if(!this._requested){var r=this;bt.requestAnimationFrame(function(){if(r._requested=!1,r._animate){r.requestUpdate();var c=r._element;(!dt.getPrefixed(o,"hidden")||f.getAttribute(c,"keepalive")==="true")&&dt.isInView(c)&&r._handleFrame()}r._autoUpdate&&r.update()}),this._requested=!0}},play:function(){this._animate=!0,this.requestUpdate()},pause:function(){this._animate=!1},_handleFrame:function(){Qe=this._scope;var r=Date.now()/1e3,c=this._last?r-this._last:0;this._last=r,this.emit("frame",new l({delta:c,time:this._time+=c,count:this._count++})),this._stats&&this._stats.update()},_animateItem:function(r,c){var m=this._frameItems;c?(m[r._id]={item:r,time:0,count:0},++this._frameItemCount===1&&this.on("frame",this._handleFrameItems)):(delete m[r._id],--this._frameItemCount===0&&this.off("frame",this._handleFrameItems))},_handleFrameItems:function(r){for(var c in this._frameItems){var m=this._frameItems[c];m.item.emit("frame",new l(r,{time:m.time+=r.delta,count:m.count++}))}},_changed:function(){this._project._changed(4097),this._bounds=this._decomposed=n},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return this._pixelRatio*72},getViewSize:function(){var r=this._viewSize;return new E(r.width,r.height,this,"setViewSize")},setViewSize:function(){var r=p.read(arguments),c=r.subtract(this._viewSize);c.isZero()||(this._setElementSize(r.width,r.height),this._viewSize.set(r),this._changed(),this.emit("resize",{size:r,delta:c}),this._autoUpdate&&this.update())},_setElementSize:function(r,c){var m=this._element;m&&(m.width!==r&&(m.width=r),m.height!==c&&(m.height=c))},getBounds:function(){return this._bounds||(this._bounds=this._matrix.inverted()._transformBounds(new N(new g,this._viewSize))),this._bounds},getSize:function(){return this.getBounds().getSize()},isVisible:function(){return dt.isInView(this._element)},isInserted:function(){return dt.isInserted(this._element)},getPixelSize:function(r){var c=this._element,m;if(c){var x=c.parentNode,k=o.createElement("div");k.style.fontSize=r,x.appendChild(k),m=parseFloat(dt.getStyles(k).fontSize),x.removeChild(k)}else m=parseFloat(m);return m},getTextWidth:function(r,c){return 0}},l.each(["rotate","scale","shear","skew"],function(r){var c=r==="rotate";this[r]=function(){var m=arguments,x=(c?l:g).read(m),k=g.read(m,0,{readNull:!0});return this.transform(new O()[r](x,k||this.getCenter(!0)))}},{_decompose:function(){return this._decomposed||(this._decomposed=this._matrix.decompose())},translate:function(){var r=new O;return this.transform(r.translate.apply(r,arguments))},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var r=g.read(arguments);this.translate(this.getCenter().subtract(r))},getZoom:function(){var r=this._decompose().scaling;return(r.x+r.y)/2},setZoom:function(r){this.transform(new O().scale(r/this.getZoom(),this.getCenter()))},getRotation:function(){return this._decompose().rotation},setRotation:function(r){var c=this.getRotation();c!=null&&r!=null&&this.rotate(r-c)},getScaling:function(){var r=this._decompose().scaling;return new w(r.x,r.y,this,"setScaling")},setScaling:function(){var r=this.getScaling(),c=g.read(arguments,0,{clone:!0,readNull:!0});r&&c&&this.scale(c.x/r.x,c.y/r.y)},getMatrix:function(){return this._matrix},setMatrix:function(){var r=this._matrix;r.set.apply(r,arguments)},transform:function(r){this._matrix.append(r)},scrollBy:function(){this.translate(g.read(arguments).negate())}}),{projectToView:function(){return this._matrix._transformPoint(g.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(g.read(arguments))},getEventPoint:function(r){return this.viewToProject(bt.getOffset(r,this._element))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(r,c){o&&typeof c=="string"&&(c=o.getElementById(c));var m=a?Nt:et;return new m(r,c)}}},new function(){if(!a)return;var r,c,m=!1,x=!1;function k(ke){var Le=bt.getTarget(ke);return Le.getAttribute&&et._viewsById[Le.getAttribute("id")]}function T(){var ke=et._focused;if(!ke||!ke.isVisible()){for(var Le=0,De=et._views.length;Le<De;Le++)if((ke=et._views[Le]).isVisible()){et._focused=c=ke;break}}}function R(ke,Le,De){ke._handleMouseEvent("mousemove",Le,De)}var L=a.navigator,q,z,X;L.pointerEnabled||L.msPointerEnabled?(q="pointerdown MSPointerDown",z="pointermove MSPointerMove",X="pointerup pointercancel MSPointerUp MSPointerCancel"):(q="touchstart",z="touchmove",X="touchend touchcancel","ontouchstart"in a&&L.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i)||(q+=" mousedown",z+=" mousemove",X+=" mouseup"));var Z={},Q={mouseout:function(ke){var Le=et._focused,De=bt.getRelatedTarget(ke);if(Le&&(!De||De.nodeName==="HTML")){var ze=bt.getOffset(ke,Le._element),He=ze.x,$e=Math.abs,ct=$e(He),ft=1<<25,vt=ct-ft;ze.x=$e(vt)<ct?vt*(He<0?-1:1):He,R(Le,ke,Le.viewToProject(ze))}},scroll:T};Z[q]=function(ke){var Le=et._focused=k(ke);m||(m=!0,Le._handleMouseEvent("mousedown",ke))},Q[z]=function(ke){var Le=et._focused;if(!x){var De=k(ke);De?Le!==De&&(Le&&R(Le,ke),r||(r=Le),Le=et._focused=c=De):c&&c===Le&&(r&&!r.isInserted()&&(r=null),Le=et._focused=r,r=null,T())}Le&&R(Le,ke)},Q[q]=function(){x=!0},Q[X]=function(ke){var Le=et._focused;Le&&m&&Le._handleMouseEvent("mouseup",ke),x=m=!1},bt.add(o,Q),bt.add(a,{load:T});var j=!1,ce=!1,te={doubleclick:"click",mousedrag:"mousemove"},oe=!1,ee,re,K,se,de,ve,ue,Ce;function Me(ke,Le,De,ze,He,$e,ct){var ft=!1,vt;function kt(tt,nt){if(tt.responds(nt)){if(vt||(vt=new Xt(nt,ze,He,Le||tt,$e?He.subtract($e):null)),tt.emit(nt,vt)&&(j=!0,vt.prevented&&(ce=!0),vt.stopped))return ft=!0}else{var _t=te[nt];if(_t)return kt(tt,_t)}}for(;ke&&ke!==ct&&!kt(ke,De);)ke=ke._parent;return ft}function Ae(ke,Le,De,ze,He,$e){return ke._project.removeOn(De),ce=j=!1,de&&Me(de,null,De,ze,He,$e)||Le&&Le!==de&&!Le.isDescendant(de)&&Me(Le,null,De==="mousedrag"?"mousemove":De,ze,He,$e,de)||Me(ke,de||Le||ke,De,ze,He,$e)}var Oe={mousedown:{mousedown:1,mousedrag:1,click:1,doubleclick:1},mouseup:{mouseup:1,mousedrag:1,click:1,doubleclick:1},mousemove:{mousedrag:1,mousemove:1,mouseenter:1,mouseleave:1}};return{_viewEvents:Z,_handleMouseEvent:function(ke,Le,De){var ze=this._itemEvents,He=ze.native[ke],$e=ke==="mousemove",ct=this._scope.tool,ft=this;function vt(Dt){return ze.virtual[Dt]||ft.responds(Dt)||ct&&ct.responds(Dt)}$e&&m&&vt("mousedrag")&&(ke="mousedrag"),De||(De=this.getEventPoint(Le));var kt=this.getBounds().contains(De),tt=He&&kt&&ft._project.hitTest(De,{tolerance:0,fill:!0,stroke:!0}),nt=tt&&tt.item||null,_t=!1,Et={};if(Et[ke.substr(5)]=!0,He&&nt!==se&&(se&&Me(se,null,"mouseleave",Le,De),nt&&Me(nt,null,"mouseenter",Le,De),se=nt),oe^kt&&(Me(this,null,kt?"mouseenter":"mouseleave",Le,De),_t=!0),(kt||Et.drag)&&!De.equals(re)&&(Ae(this,nt,$e?ke:"mousemove",Le,De,re),_t=!0),oe=kt,Et.down&&kt||Et.up&&ee){if(Ae(this,nt,ke,Le,De,ee),Et.down){if(Ce=nt===ve&&Date.now()-ue<300,K=ve=nt,!ce&&nt){for(var Mt=nt;Mt&&!Mt.responds("mousedrag");)Mt=Mt._parent;Mt&&(de=nt)}ee=De}else Et.up&&(!ce&&nt===K&&(ue=Date.now(),Ae(this,nt,Ce?"doubleclick":"click",Le,De,ee),Ce=!1),K=de=null);oe=!1,_t=!0}re=De,_t&&ct&&(j=ct._handleMouseEvent(ke,Le,De,Et)||j),Le.cancelable!==!1&&(j&&!Et.move||Et.down&&vt("mouseup"))&&Le.preventDefault()},_handleKeyEvent:function(ke,Le,De,ze){var He=this._scope,$e=He.tool,ct;function ft(vt){vt.responds(ke)&&(Qe=He,vt.emit(ke,ct=ct||new at(ke,Le,De,ze)))}this.isVisible()&&(ft(this),$e&&$e.responds(ke)&&ft($e))},_countItemEvent:function(ke,Le){var De=this._itemEvents,ze=De.native,He=De.virtual;for(var $e in Oe)ze[$e]=(ze[$e]||0)+(Oe[$e][ke]||0)*Le;He[ke]=(He[ke]||0)+Le},statics:{updateFocus:T,_resetState:function(){m=x=j=oe=!1,r=c=ee=re=K=se=de=ve=ue=Ce=null}}}}),Nt=et.extend({_class:"CanvasView",initialize:function(c,m){if(!(m instanceof a.HTMLCanvasElement)){var x=p.read(arguments,1);if(x.isZero())throw new Error("Cannot create CanvasView with the provided argument: "+l.slice(arguments,1));m=qe.getCanvas(x)}var k=this._context=m.getContext("2d");if(k.save(),this._pixelRatio=1,!/^off|false$/.test(f.getAttribute(m,"hidpi"))){var T=a.devicePixelRatio||1,R=dt.getPrefixed(k,"backingStorePixelRatio")||1;this._pixelRatio=T/R}et.call(this,c,m),this._needsUpdate=!0},remove:function r(){return this._context.restore(),r.base.call(this)},_setElementSize:function r(c,m){var x=this._pixelRatio;if(r.base.call(this,c*x,m*x),x!==1){var k=this._element,T=this._context;if(!f.hasAttribute(k,"resize")){var R=k.style;R.width=c+"px",R.height=m+"px"}T.restore(),T.save(),T.scale(x,x)}},getContext:function(){return this._context},getPixelSize:function r(c){var m=Qe.agent,x;if(m&&m.firefox)x=r.base.call(this,c);else{var k=this._context,T=k.font;k.font=c+" serif",x=parseFloat(k.font),k.font=T}return x},getTextWidth:function(r,c){var m=this._context,x=m.font,k=0;m.font=r;for(var T=0,R=c.length;T<R;T++)k=Math.max(k,m.measureText(c[T]).width);return m.font=x,k},update:function(){if(!this._needsUpdate)return!1;var r=this._project,c=this._context,m=this._viewSize;return c.clearRect(0,0,m.width+1,m.height+1),r&&r.draw(c,this._matrix,this._pixelRatio),this._needsUpdate=!1,!0}}),xt=l.extend({_class:"Event",initialize:function(c){this.event=c,this.type=c&&c.type},prevented:!1,stopped:!1,preventDefault:function(){this.prevented=!0,this.event.preventDefault()},stopPropagation:function(){this.stopped=!0,this.event.stopPropagation()},stop:function(){this.stopPropagation(),this.preventDefault()},getTimeStamp:function(){return this.event.timeStamp},getModifiers:function(){return rr.modifiers}}),at=xt.extend({_class:"KeyEvent",initialize:function(c,m,x,k){this.type=c,this.event=m,this.key=x,this.character=k},toString:function(){return"{ type: '"+this.type+"', key: '"+this.key+"', character: '"+this.character+"', modifiers: "+this.getModifiers()+" }"}}),rr=new function(){var r={" ":"tab"," ":"space","\b":"backspace","":"delete",Spacebar:"space",Del:"delete",Win:"meta",Esc:"escape"},c={tab:" ",space:" ",enter:"\r"},m={},x={},k,T,R=new l({shift:!1,control:!1,alt:!1,meta:!1,capsLock:!1,space:!1}).inject({option:{get:function(){return this.alt}},command:{get:function(){var z=Qe&&Qe.agent;return z&&z.mac?this.meta:this.control}}});function L(z){var X=z.key||z.keyIdentifier;return X=/^U\+/.test(X)?String.fromCharCode(parseInt(X.substr(2),16)):/^Arrow[A-Z]/.test(X)?X.substr(5):X==="Unidentified"||X===n?String.fromCharCode(z.keyCode):X,r[X]||(X.length>1?l.hyphenate(X):X.toLowerCase())}function q(z,X,Z,Q){var j=et._focused,ce;if(m[X]=z,z?x[X]=Z:delete x[X],X.length>1&&(ce=l.camelize(X))in R){R[ce]=z;var te=Qe&&Qe.agent;if(ce==="meta"&&te&&te.mac)if(z)k={};else{for(var oe in k)oe in x&&q(!1,oe,k[oe],Q);k=null}}else z&&k&&(k[X]=Z);j&&j._handleKeyEvent(z?"keydown":"keyup",Q,X,Z)}return bt.add(o,{keydown:function(z){var X=L(z),Z=Qe&&Qe.agent;X.length>1||Z&&Z.chrome&&(z.altKey||Z.mac&&z.metaKey||!Z.mac&&z.ctrlKey)?q(!0,X,c[X]||(X.length>1?"":X),z):T=X},keypress:function(z){if(T){var X=L(z),Z=z.charCode,Q=Z>=32?String.fromCharCode(Z):X.length>1?"":X;X!==T&&(X=Q.toLowerCase()),q(!0,X,Q,z),T=null}},keyup:function(z){var X=L(z);X in x&&q(!1,X,x[X],z)}}),bt.add(a,{blur:function(z){for(var X in x)q(!1,X,x[X],z)}}),{modifiers:R,isDown:function(z){return!!m[z]}}},Xt=xt.extend({_class:"MouseEvent",initialize:function(c,m,x,k,T){this.type=c,this.event=m,this.point=x,this.target=k,this.delta=T},toString:function(){return"{ type: '"+this.type+"', point: "+this.point+", target: "+this.target+(this.delta?", delta: "+this.delta:"")+", modifiers: "+this.getModifiers()+" }"}}),Ht=xt.extend({_class:"ToolEvent",_item:null,initialize:function(c,m,x){this.tool=c,this.type=m,this.event=x},_choosePoint:function(r,c){return r||(c?c.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(r){this._point=r},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(r){this._lastPoint=r},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(r){this._downPoint=r},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(r){this._middlePoint=r},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(r){this._delta=r},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?"_downCount":"_moveCount"]},setCount:function(r){this.tool[/^mouse(down|up)$/.test(this.type)?"downCount":"count"]=r},getItem:function(){if(!this._item){var r=this.tool._scope.project.hitTest(this.getPoint());if(r){for(var c=r.item,m=c._parent;/^(Group|CompoundPath)$/.test(m._class);)c=m,m=m._parent;this._item=c}}return this._item},setItem:function(r){this._item=r},toString:function(){return"{ type: "+this.type+", point: "+this.getPoint()+", count: "+this.getCount()+", modifiers: "+this.getModifiers()+" }"}}),nr=b.extend({_class:"Tool",_list:"tools",_reference:"tool",_events:["onMouseDown","onMouseUp","onMouseDrag","onMouseMove","onActivate","onDeactivate","onEditOptions","onKeyDown","onKeyUp"],initialize:function(c){b.call(this),this._moveCount=-1,this._downCount=-1,this.set(c)},getMinDistance:function(){return this._minDistance},setMinDistance:function(r){this._minDistance=r,r!=null&&this._maxDistance!=null&&r>this._maxDistance&&(this._maxDistance=r)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(r){this._maxDistance=r,this._minDistance!=null&&r!=null&&r<this._minDistance&&(this._minDistance=r)},getFixedDistance:function(){return this._minDistance==this._maxDistance?this._minDistance:null},setFixedDistance:function(r){this._minDistance=this._maxDistance=r},_handleMouseEvent:function(r,c,m,x){Qe=this._scope,x.drag&&!this.responds(r)&&(r="mousemove");var k=x.move||x.drag,T=this.responds(r),R=!1,L=this;function q(X,Z){var Q=m,j=k?L._point:L._downPoint||Q;if(k){if(L._moveCount>=0&&Q.equals(j))return!1;if(j&&(X!=null||Z!=null)){var ce=Q.subtract(j),te=ce.getLength();if(te<(X||0))return!1;Z&&(Q=j.add(ce.normalize(Math.min(te,Z))))}L._moveCount++}return L._point=Q,L._lastPoint=j||Q,x.down&&(L._moveCount=-1,L._downPoint=Q,L._downCount++),!0}function z(){T&&(R=L.emit(r,new Ht(L,r,c))||R)}if(x.down)q(),z();else if(x.up)q(null,this._maxDistance),z();else if(T)for(;q(this._minDistance,this._maxDistance);)z();return R}}),Ar=l.extend(h,{_class:"Tween",statics:{easings:new l({linear:function(r){return r},easeInQuad:function(r){return r*r},easeOutQuad:function(r){return r*(2-r)},easeInOutQuad:function(r){return r<.5?2*r*r:-1+2*(2-r)*r},easeInCubic:function(r){return r*r*r},easeOutCubic:function(r){return--r*r*r+1},easeInOutCubic:function(r){return r<.5?4*r*r*r:(r-1)*(2*r-2)*(2*r-2)+1},easeInQuart:function(r){return r*r*r*r},easeOutQuart:function(r){return 1- --r*r*r*r},easeInOutQuart:function(r){return r<.5?8*r*r*r*r:1-8*--r*r*r*r},easeInQuint:function(r){return r*r*r*r*r},easeOutQuint:function(r){return 1+--r*r*r*r*r},easeInOutQuint:function(r){return r<.5?16*r*r*r*r*r:1+16*--r*r*r*r*r}})},initialize:function r(c,m,x,k,T,R){this.object=c;var L=typeof T,q=L==="function";this.type=q?L:L==="string"?T:"linear",this.easing=q?T:r.easings[this.type],this.duration=k,this.running=!1,this._then=null,this._startTime=null;var z=m||x;this._keys=z?Object.keys(z):[],this._parsedKeys=this._parseKeys(this._keys),this._from=z&&this._getState(m),this._to=z&&this._getState(x),R!==!1&&this.start()},then:function(r){return this._then=r,this},start:function(){return this._startTime=null,this.running=!0,this},stop:function(){return this.running=!1,this},update:function(r){if(this.running){r>=1&&(r=1,this.running=!1);for(var c=this.easing(r),m=this._keys,x=function(X){return typeof X=="function"?X(c,r):X},k=0,T=m&&m.length;k<T;k++){var R=m[k],L=x(this._from[R]),q=x(this._to[R]),z=L&&q&&L.__add&&q.__add?q.__subtract(L).__multiply(c).__add(L):(q-L)*c+L;this._setProperty(this._parsedKeys[R],z)}this.responds("update")&&this.emit("update",new l({progress:r,factor:c})),!this.running&&this._then&&this._then(this.object)}return this},_events:{onUpdate:{}},_handleFrame:function(r){var c=this._startTime,m=c?(r-c)/this.duration:0;c||(this._startTime=r),this.update(m)},_getState:function(r){for(var c=this._keys,m={},x=0,k=c.length;x<k;x++){var T=c[x],R=this._parsedKeys[T],L=this._getProperty(R),q;if(r){var z=this._resolveValue(L,r[T]);this._setProperty(R,z),q=this._getProperty(R),q=q&&q.clone?q.clone():q,this._setProperty(R,L)}else q=L&&L.clone?L.clone():L;m[T]=q}return m},_resolveValue:function(r,c){if(c){if(Array.isArray(c)&&c.length===2){var m=c[0];return m&&m.match&&m.match(/^[+\-\*\/]=/)?this._calculate(r,m[0],c[1]):c}else if(typeof c=="string"){var x=c.match(/^[+\-*/]=(.*)/);if(x){var k=JSON.parse(x[1].replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,'"$2": '));return this._calculate(r,c[0],k)}}}return c},_calculate:function(r,c,m){return Qe.PaperScript.calculateBinary(r,c,m)},_parseKeys:function(r){for(var c={},m=0,x=r.length;m<x;m++){var k=r[m],T=k.replace(/\.([^.]*)/g,"/$1").replace(/\[['"]?([^'"\]]*)['"]?\]/g,"/$1");c[k]=T.split("/")}return c},_getProperty:function(r,c){for(var m=this.object,x=0,k=r.length-(c||0);x<k&&m;x++)m=m[r[x]];return m},_setProperty:function(r,c){var m=this._getProperty(r,1);m&&(m[r[r.length-1]]=c)}}),fr={request:function(r){var c=new t.XMLHttpRequest;return c.open((r.method||"get").toUpperCase(),r.url,l.pick(r.async,!0)),r.mimeType&&c.overrideMimeType(r.mimeType),c.onload=function(){var m=c.status;m===0||m===200?r.onLoad&&r.onLoad.call(c,c.responseText):c.onerror()},c.onerror=function(){var m=c.status,x='Could not load "'+r.url+'" (Status: '+m+")";if(r.onError)r.onError(x,m);else throw new Error(x)},c.send(null)}},qe=l.exports.CanvasProvider={canvases:[],getCanvas:function(r,c,m){if(!a)return null;var x,k=!0;typeof r=="object"&&(c=r.height,r=r.width),this.canvases.length?x=this.canvases.pop():(x=o.createElement("canvas"),k=!1);var T=x.getContext("2d",m||{});if(!T)throw new Error("Canvas "+x+" is unable to provide a 2D context.");return x.width===r&&x.height===c?k&&T.clearRect(0,0,r+1,c+1):(x.width=r,x.height=c),T.save(),x},getContext:function(r,c,m){var x=this.getCanvas(r,c,m);return x?x.getContext("2d",m||{}):null},release:function(r){var c=r&&r.canvas?r.canvas:r;c&&c.getContext&&(c.getContext("2d").restore(),this.canvases.push(c))}},je=new function(){var r=Math.min,c=Math.max,m=Math.abs,x,k,T,R,L,q,z,X,Z,Q,j;function ce(de,ve,ue){return .2989*de+.587*ve+.114*ue}function te(de,ve,ue,Ae){var Me=Ae-ce(de,ve,ue);Z=de+Me,Q=ve+Me,j=ue+Me;var Ae=ce(Z,Q,j),Oe=r(Z,Q,j),ke=c(Z,Q,j);if(Oe<0){var Le=Ae-Oe;Z=Ae+(Z-Ae)*Ae/Le,Q=Ae+(Q-Ae)*Ae/Le,j=Ae+(j-Ae)*Ae/Le}if(ke>255){var De=255-Ae,ze=ke-Ae;Z=Ae+(Z-Ae)*De/ze,Q=Ae+(Q-Ae)*De/ze,j=Ae+(j-Ae)*De/ze}}function oe(de,ve,ue){return c(de,ve,ue)-r(de,ve,ue)}function ee(de,ve,ue,Ce){var Me=[de,ve,ue],Ae=c(de,ve,ue),Oe=r(de,ve,ue),ke;Oe=Oe===de?0:Oe===ve?1:2,Ae=Ae===de?0:Ae===ve?1:2,ke=r(Oe,Ae)===0?c(Oe,Ae)===1?2:1:0,Me[Ae]>Me[Oe]?(Me[ke]=(Me[ke]-Me[Oe])*Ce/(Me[Ae]-Me[Oe]),Me[Ae]=Ce):Me[ke]=Me[Ae]=0,Me[Oe]=0,Z=Me[0],Q=Me[1],j=Me[2]}var re={multiply:function(){Z=L*x/255,Q=q*k/255,j=z*T/255},screen:function(){Z=L+x-L*x/255,Q=q+k-q*k/255,j=z+T-z*T/255},overlay:function(){Z=L<128?2*L*x/255:255-2*(255-L)*(255-x)/255,Q=q<128?2*q*k/255:255-2*(255-q)*(255-k)/255,j=z<128?2*z*T/255:255-2*(255-z)*(255-T)/255},"soft-light":function(){var de=x*L/255;Z=de+L*(255-(255-L)*(255-x)/255-de)/255,de=k*q/255,Q=de+q*(255-(255-q)*(255-k)/255-de)/255,de=T*z/255,j=de+z*(255-(255-z)*(255-T)/255-de)/255},"hard-light":function(){Z=x<128?2*x*L/255:255-2*(255-x)*(255-L)/255,Q=k<128?2*k*q/255:255-2*(255-k)*(255-q)/255,j=T<128?2*T*z/255:255-2*(255-T)*(255-z)/255},"color-dodge":function(){Z=L===0?0:x===255?255:r(255,255*L/(255-x)),Q=q===0?0:k===255?255:r(255,255*q/(255-k)),j=z===0?0:T===255?255:r(255,255*z/(255-T))},"color-burn":function(){Z=L===255?255:x===0?0:c(0,255-(255-L)*255/x),Q=q===255?255:k===0?0:c(0,255-(255-q)*255/k),j=z===255?255:T===0?0:c(0,255-(255-z)*255/T)},darken:function(){Z=L<x?L:x,Q=q<k?q:k,j=z<T?z:T},lighten:function(){Z=L>x?L:x,Q=q>k?q:k,j=z>T?z:T},difference:function(){Z=L-x,Z<0&&(Z=-Z),Q=q-k,Q<0&&(Q=-Q),j=z-T,j<0&&(j=-j)},exclusion:function(){Z=L+x*(255-L-L)/255,Q=q+k*(255-q-q)/255,j=z+T*(255-z-z)/255},hue:function(){ee(x,k,T,oe(L,q,z)),te(Z,Q,j,ce(L,q,z))},saturation:function(){ee(L,q,z,oe(x,k,T)),te(Z,Q,j,ce(L,q,z))},luminosity:function(){te(L,q,z,ce(x,k,T))},color:function(){te(x,k,T,ce(L,q,z))},add:function(){Z=r(L+x,255),Q=r(q+k,255),j=r(z+T,255)},subtract:function(){Z=c(L-x,0),Q=c(q-k,0),j=c(z-T,0)},average:function(){Z=(L+x)/2,Q=(q+k)/2,j=(z+T)/2},negation:function(){Z=255-m(255-x-L),Q=255-m(255-k-q),j=255-m(255-T-z)}},K=this.nativeModes=l.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],function(de){this[de]=!0},{}),se=qe.getContext(1,1,{willReadFrequently:!0});se&&(l.each(re,function(de,ve){var ue=ve==="darken",Ce=!1;se.save();try{se.fillStyle=ue?"#300":"#a00",se.fillRect(0,0,1,1),se.globalCompositeOperation=ve,se.globalCompositeOperation===ve&&(se.fillStyle=ue?"#a00":"#300",se.fillRect(0,0,1,1),Ce=se.getImageData(0,0,1,1).data[0]!==ue?170:51)}catch{}se.restore(),K[ve]=Ce}),qe.release(se)),this.process=function(de,ve,ue,Ce,Me){var Ae=ve.canvas,Oe=de==="normal";if(Oe||K[de])ue.save(),ue.setTransform(1,0,0,1,0,0),ue.globalAlpha=Ce,Oe||(ue.globalCompositeOperation=de),ue.drawImage(Ae,Me.x,Me.y),ue.restore();else{var ke=re[de];if(!ke)return;for(var Le=ue.getImageData(Me.x,Me.y,Ae.width,Ae.height),De=Le.data,ze=ve.getImageData(0,0,Ae.width,Ae.height).data,He=0,$e=De.length;He<$e;He+=4){x=ze[He],L=De[He],k=ze[He+1],q=De[He+1],T=ze[He+2],z=De[He+2],R=ze[He+3],X=De[He+3],ke();var ct=R*Ce/255,ft=1-ct;De[He]=ct*Z+ft*L,De[He+1]=ct*Q+ft*q,De[He+2]=ct*j+ft*z,De[He+3]=R*Ce+ft*X}ue.putImageData(Le,Me.x,Me.y)}}},Fe=new function(){var r="http://www.w3.org/2000/svg",c="http://www.w3.org/2000/xmlns",m="http://www.w3.org/1999/xlink",x={href:m,xlink:c,xmlns:c+"/","xmlns:xlink":c+"/"};function k(L,q,z){return R(o.createElementNS(r,L),q,z)}function T(L,q){var z=x[q],X=z?L.getAttributeNS(z,q):L.getAttribute(q);return X==="null"?null:X}function R(L,q,z){for(var X in q){var Z=q[X],Q=x[X];typeof Z=="number"&&z&&(Z=z.number(Z)),Q?L.setAttributeNS(Q,X,Z):L.setAttribute(X,Z)}return L}return{svg:r,xmlns:c,xlink:m,create:k,get:T,set:R}},Ue=l.each({fillColor:["fill","color"],fillRule:["fill-rule","string"],strokeColor:["stroke","color"],strokeWidth:["stroke-width","number"],strokeCap:["stroke-linecap","string"],strokeJoin:["stroke-linejoin","string"],strokeScaling:["vector-effect","lookup",{true:"none",false:"non-scaling-stroke"},function(r,c){return!c&&(r instanceof ye||r instanceof ie||r instanceof Te)}],miterLimit:["stroke-miterlimit","number"],dashArray:["stroke-dasharray","array"],dashOffset:["stroke-dashoffset","number"],fontFamily:["font-family","string"],fontWeight:["font-weight","string"],fontSize:["font-size","number"],justification:["text-anchor","lookup",{left:"start",center:"middle",right:"end"}],opacity:["opacity","number"],blendMode:["mix-blend-mode","style"]},function(r,c){var m=l.capitalize(c),x=r[2];this[c]={type:r[1],property:c,attribute:r[0],toSVG:x,fromSVG:x&&l.each(x,function(k,T){this[k]=T},{}),exportFilter:r[3],get:"get"+m,set:"set"+m}},{});new function(){var r;function c(re,K,se){var de=new l,ve=re.getTranslation();if(K){var ue;re.isInvertible()?(re=re._shiftless(),ue=re._inverseTransform(ve),ve=null):ue=new g,de[se?"cx":"x"]=ue.x,de[se?"cy":"y"]=ue.y}if(!re.isIdentity()){var Ce=re.decompose();if(Ce){var Me=[],Ae=Ce.rotation,Oe=Ce.scaling,ke=Ce.skewing;ve&&!ve.isZero()&&Me.push("translate("+r.point(ve)+")"),Ae&&Me.push("rotate("+r.number(Ae)+")"),(!C.isZero(Oe.x-1)||!C.isZero(Oe.y-1))&&Me.push("scale("+r.point(Oe)+")"),ke.x&&Me.push("skewX("+r.number(ke.x)+")"),ke.y&&Me.push("skewY("+r.number(ke.y)+")"),de.transform=Me.join(" ")}else de.transform="matrix("+re.getValues().join(",")+")"}return de}function m(re,K){for(var se=c(re._matrix),de=re._children,ve=Fe.create("g",se,r),ue=0,Ce=de.length;ue<Ce;ue++){var Me=de[ue],Ae=oe(Me,K);if(Ae)if(Me.isClipMask()){var Oe=Fe.create("clipPath");Oe.appendChild(Ae),ce(Me,Oe,"clip"),Fe.set(ve,{"clip-path":"url(#"+Oe.id+")"})}else ve.appendChild(Ae)}return ve}function x(re,K){var se=c(re._matrix,!0),de=re.getSize(),ve=re.getImage();return se.x-=de.width/2,se.y-=de.height/2,se.width=de.width,se.height=de.height,se.href=K.embedImages==!1&&ve&&ve.src||re.toDataURL(),Fe.create("image",se,r)}function k(re,K){var se=K.matchShapes;if(se){var de=re.toShape(!1);if(de)return T(de)}var ve=re._segments,ue=ve.length,Ce,Me=c(re._matrix);if(se&&ue>=2&&!re.hasHandles())if(ue>2){Ce=re._closed?"polygon":"polyline";for(var Ae=[],Oe=0;Oe<ue;Oe++)Ae.push(r.point(ve[Oe]._point));Me.points=Ae.join(" ")}else{Ce="line";var ke=ve[0]._point,Le=ve[1]._point;Me.set({x1:ke.x,y1:ke.y,x2:Le.x,y2:Le.y})}else Ce="path",Me.d=re.getPathData(null,K.precision);return Fe.create(Ce,Me,r)}function T(re){var K=re._type,se=re._radius,de=c(re._matrix,!0,K!=="rectangle");if(K==="rectangle"){K="rect";var ve=re._size,ue=ve.width,Ce=ve.height;de.x-=ue/2,de.y-=Ce/2,de.width=ue,de.height=Ce,se.isZero()&&(se=null)}return se&&(K==="circle"?de.r=se:(de.rx=se.width,de.ry=se.height)),Fe.create(K,de,r)}function R(re,K){var se=c(re._matrix),de=re.getPathData(null,K.precision);return de&&(se.d=de),Fe.create("path",se,r)}function L(re,K){var se=c(re._matrix,!0),de=re._definition,ve=j(de,"symbol"),ue=de._item,Ce=ue.getStrokeBounds();return ve||(ve=Fe.create("symbol",{viewBox:r.rectangle(Ce)}),ve.appendChild(oe(ue,K)),ce(de,ve,"symbol")),se.href="#"+ve.id,se.x+=Ce.x,se.y+=Ce.y,se.width=Ce.width,se.height=Ce.height,se.overflow="visible",Fe.create("use",se,r)}function q(re){var K=j(re,"color");if(!K){var se=re.getGradient(),de=se._radial,ve=re.getOrigin(),ue=re.getDestination(),Ce;if(de){Ce={cx:ve.x,cy:ve.y,r:ve.getDistance(ue)};var Me=re.getHighlight();Me&&(Ce.fx=Me.x,Ce.fy=Me.y)}else Ce={x1:ve.x,y1:ve.y,x2:ue.x,y2:ue.y};Ce.gradientUnits="userSpaceOnUse",K=Fe.create((de?"radial":"linear")+"Gradient",Ce,r);for(var Ae=se._stops,Oe=0,ke=Ae.length;Oe<ke;Oe++){var Le=Ae[Oe],De=Le._color,ze=De.getAlpha(),He=Le._offset;Ce={offset:He??Oe/(ke-1)},De&&(Ce["stop-color"]=De.toCSS(!0)),ze<1&&(Ce["stop-opacity"]=ze),K.appendChild(Fe.create("stop",Ce,r))}ce(re,K,"color")}return"url(#"+K.id+")"}function z(re){var K=Fe.create("text",c(re._matrix,!0),r);return K.textContent=re._content,K}var X={Group:m,Layer:m,Raster:x,Path:k,Shape:T,CompoundPath:R,SymbolItem:L,PointText:z};function Z(re,K,se,de){var ve={},ue=!de&&re.getParent(),Ce=[];return re._name!=null&&(ve.id=re._name),l.each(Ue,function(Me){var Ae=Me.get,Oe=Me.type,ke=re[Ae]();if(Me.exportFilter?Me.exportFilter(re,ke):se.reduceAttributes==!1||!ue||!l.equals(ue[Ae](),ke)){if(Oe==="color"&&ke!=null){var Le=ke.getAlpha();Le<1&&(ve[Me.attribute+"-opacity"]=Le)}Oe==="style"?Ce.push(Me.attribute+": "+ke):ve[Me.attribute]=ke==null?"none":Oe==="color"?ke.gradient?q(ke):ke.toCSS(!0):Oe==="array"?ke.join(","):Oe==="lookup"?Me.toSVG[ke]:ke}}),Ce.length&&(ve.style=Ce.join(";")),ve.opacity===1&&delete ve.opacity,re._visible||(ve.visibility="hidden"),Fe.set(K,ve,r)}var Q;function j(re,K){return Q||(Q={ids:{},svgs:{}}),re&&Q.svgs[K+"-"+(re._id||re.__id||(re.__id=y.get("svg")))]}function ce(re,K,se){Q||j();var de=Q.ids[se]=(Q.ids[se]||0)+1;K.id=se+"-"+de,Q.svgs[se+"-"+(re._id||re.__id)]=K}function te(re,K){var se=re,de=null;if(Q){se=re.nodeName.toLowerCase()==="svg"&&re;for(var ve in Q.svgs)de||(se||(se=Fe.create("svg"),se.appendChild(re)),de=se.insertBefore(Fe.create("defs"),se.firstChild)),de.appendChild(Q.svgs[ve]);Q=null}return K.asString?new t.XMLSerializer().serializeToString(se):se}function oe(re,K,se){var de=X[re._class],ve=de&&de(re,K);if(ve){var ue=K.onExport;ue&&(ve=ue(re,ve,K)||ve);var Ce=JSON.stringify(re._data);Ce&&Ce!=="{}"&&Ce!=="null"&&ve.setAttribute("data-paper-data",Ce)}return ve&&Z(re,ve,K,se)}function ee(re){return re||(re={}),r=new M(re.precision),re}D.inject({exportSVG:function(re){return re=ee(re),te(oe(this,re,!0),re)}}),U.inject({exportSVG:function(re){re=ee(re);var K=this._children,se=this.getView(),de=l.pick(re.bounds,"view"),ve=re.matrix||de==="view"&&se._matrix,ue=ve&&O.read([ve]),Ce=de==="view"?new N([0,0],se.getViewSize()):de==="content"?D._getBounds(K,ue,{stroke:!0}).rect:N.read([de],0,{readNull:!0}),Me={version:"1.1",xmlns:Fe.svg,"xmlns:xlink":Fe.xlink};Ce&&(Me.width=Ce.width,Me.height=Ce.height,(Ce.x||Ce.x===0||Ce.y||Ce.y===0)&&(Me.viewBox=r.rectangle(Ce)));var Ae=Fe.create("svg",Me,r),Oe=Ae;ue&&!ue.isIdentity()&&(Oe=Ae.appendChild(Fe.create("g",c(ue),r)));for(var ke=0,Le=K.length;ke<Le;ke++)Oe.appendChild(oe(K[ke],re,!0));return te(Ae,re)}})},new function(){var r={},c;function m(K,se,de,ve,ue,Ce){var Me=Fe.get(K,se)||Ce,Ae=Me==null?ve?null:de?"":0:de?Me:parseFloat(Me);return/%\s*$/.test(Me)?Ae/100*(ue?1:c[/x|^width/.test(se)?"width":"height"]):Ae}function x(K,se,de,ve,ue,Ce,Me){return se=m(K,se||"x",!1,ve,ue,Ce),de=m(K,de||"y",!1,ve,ue,Me),ve&&(se==null||de==null)?null:new g(se,de)}function k(K,se,de,ve,ue){return se=m(K,se||"width",!1,ve,ue),de=m(K,de||"height",!1,ve,ue),ve&&(se==null||de==null)?null:new p(se,de)}function T(K,se,de){return K==="none"?null:se==="number"?parseFloat(K):se==="array"?K?K.split(/[\s,]+/g).map(parseFloat):[]:se==="color"?oe(K)||K:se==="lookup"?de[K]:K}function R(K,se,de,ve){var ue=K.childNodes,Ce=se==="clippath",Me=se==="defs",Ae=new me,Oe=Ae._project,ke=Oe._currentStyle,Le=[];if(!Ce&&!Me&&(Ae=te(Ae,K,ve),Oe._currentStyle=Ae._style.clone()),ve)for(var De=K.querySelectorAll("defs"),ze=0,He=De.length;ze<He;ze++)ee(De[ze],de,!1);for(var ze=0,He=ue.length;ze<He;ze++){var $e=ue[ze],ct;$e.nodeType===1&&!/^defs$/i.test($e.nodeName)&&(ct=ee($e,de,!1))&&!(ct instanceof fe)&&Le.push(ct)}return Ae.addChildren(Le),Ce&&(Ae=te(Ae.reduce(),K,ve)),Oe._currentStyle=ke,(Ce||Me)&&(Ae.remove(),Ae=null),Ae}function L(K,se){for(var de=K.getAttribute("points").match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),ve=[],ue=0,Ce=de.length;ue<Ce;ue+=2)ve.push(new g(parseFloat(de[ue]),parseFloat(de[ue+1])));var Me=new F(ve);return se==="polygon"&&Me.closePath(),Me}function q(K){return ye.create(K.getAttribute("d"))}function z(K,se){var de=(m(K,"href",!0)||"").substring(1),ve=se==="radialgradient",ue;if(de)ue=r[de].getGradient(),ue._radial^ve&&(ue=ue.clone(),ue._radial=ve);else{for(var Ce=K.childNodes,Me=[],Ae=0,Oe=Ce.length;Ae<Oe;Ae++){var ke=Ce[Ae];ke.nodeType===1&&Me.push(te(new wt,ke))}ue=new st(Me,ve)}var Le,De,ze,He=m(K,"gradientUnits",!0)!=="userSpaceOnUse";ve?(Le=x(K,"cx","cy",!1,He,"50%","50%"),De=Le.add(m(K,"r",!1,!1,He,"50%"),0),ze=x(K,"fx","fy",!0,He)):(Le=x(K,"x1","y1",!1,He,"0%","0%"),De=x(K,"x2","y2",!1,He,"100%","0%"));var $e=te(new Ie(ue,Le,De,ze),K);return $e._scaleToBounds=He,null}var X={"#document":function(K,se,de,ve){for(var ue=K.childNodes,Ce=0,Me=ue.length;Ce<Me;Ce++){var Ae=ue[Ce];if(Ae.nodeType===1)return ee(Ae,de,ve)}},g:R,svg:R,clippath:R,polygon:L,polyline:L,path:q,lineargradient:z,radialgradient:z,image:function(K){var se=new he(m(K,"href",!0));return se.on("load",function(){var de=k(K);this.setSize(de);var ve=x(K).add(de.divide(2));this._matrix.append(new O().translate(ve))}),se},symbol:function(K,se,de,ve){return new fe(R(K,se,de,ve),!0)},defs:R,use:function(K){var se=(m(K,"href",!0)||"").substring(1),de=r[se],ve=x(K);return de?de instanceof fe?de.place(ve):de.clone().translate(ve):null},circle:function(K){return new ie.Circle(x(K,"cx","cy"),m(K,"r"))},ellipse:function(K){return new ie.Ellipse({center:x(K,"cx","cy"),radius:k(K,"rx","ry")})},rect:function(K){return new ie.Rectangle(new N(x(K),k(K)),k(K,"rx","ry"))},line:function(K){return new F.Line(x(K,"x1","y1"),x(K,"x2","y2"))},text:function(K){var se=new Re(x(K).add(x(K,"dx","dy")));return se.setContent(K.textContent.trim()||""),se},switch:R};function Z(K,se,de,ve){if(K.transform){for(var ue=(ve.getAttribute(de)||"").split(/\)\s*/g),Ce=new O,Me=0,Ae=ue.length;Me<Ae;Me++){var Oe=ue[Me];if(!Oe)break;for(var ke=Oe.split(/\(\s*/),Le=ke[0].trim(),De=ke[1].split(/[\s,]+/g),ze=0,He=De.length;ze<He;ze++)De[ze]=parseFloat(De[ze]);switch(Le){case"matrix":Ce.append(new O(De[0],De[1],De[2],De[3],De[4],De[5]));break;case"rotate":Ce.rotate(De[0],De[1]||0,De[2]||0);break;case"translate":Ce.translate(De[0],De[1]||0);break;case"scale":Ce.scale(De);break;case"skewX":Ce.skew(De[0],0);break;case"skewY":Ce.skew(0,De[0]);break}}K.transform(Ce)}}function Q(K,se,de){var ve=de==="fill-opacity"?"getFillColor":"getStrokeColor",ue=K[ve]&&K[ve]();ue&&ue.setAlpha(parseFloat(se))}var j=l.set(l.each(Ue,function(K){this[K.attribute]=function(se,de){if(se[K.set]&&(se[K.set](T(de,K.type,K.fromSVG)),K.type==="color")){var ve=se[K.get]();if(ve&&ve._scaleToBounds){var ue=se.getBounds();ve.transform(new O().translate(ue.getPoint()).scale(ue.getSize()))}}}},{}),{id:function(K,se){r[se]=K,K.setName&&K.setName(se)},"clip-path":function(K,se){var de=oe(se);if(de)if(de=de.clone(),de.setClipMask(!0),K instanceof me)K.insertChild(0,de);else return new me(de,K)},gradientTransform:Z,transform:Z,"fill-opacity":Q,"stroke-opacity":Q,visibility:function(K,se){K.setVisible&&K.setVisible(se==="visible")},display:function(K,se){K.setVisible&&K.setVisible(se!==null)},"stop-color":function(K,se){K.setColor&&K.setColor(se)},"stop-opacity":function(K,se){K._color&&K._color.setAlpha(parseFloat(se))},offset:function(K,se){if(K.setOffset){var de=se.match(/(.*)%$/);K.setOffset(de?de[1]/100:parseFloat(se))}},viewBox:function(K,se,de,ve,ue){var Ce=new N(T(se,"array")),Me=k(ve,null,null,!0),Ae,Oe;if(K instanceof me){var ke=Me?Me.divide(Ce.getSize()):1,Oe=new O().scale(ke).translate(Ce.getPoint().negate());Ae=K}else K instanceof fe&&(Me&&Ce.setSize(Me),Ae=K._item);if(Ae){if(ce(ve,"overflow",ue)!=="visible"){var Le=new ie.Rectangle(Ce);Le.setClipMask(!0),Ae.addChild(Le)}Oe&&Ae.transform(Oe)}}});function ce(K,se,de){var ve=K.attributes[se],ue=ve&&ve.value;if(!ue&&K.style){var Ce=l.camelize(se);ue=K.style[Ce],!ue&&de.node[Ce]!==de.parent[Ce]&&(ue=de.node[Ce])}return ue?ue==="none"?null:ue:n}function te(K,se,de){var ve=se.parentNode,ue={node:dt.getStyles(se)||{},parent:!de&&!/^defs$/i.test(ve.tagName)&&dt.getStyles(ve)||{}};return l.each(j,function(Ce,Me){var Ae=ce(se,Me,ue);K=Ae!==n&&Ce(K,Ae,Me,se,ue)||K}),K}function oe(K){var se=K&&K.match(/\((?:["'#]*)([^"')]+)/),de=se&&se[1],ve=de&&r[a?de.replace(a.location.href.split("#")[0]+"#",""):de];return ve&&ve._scaleToBounds&&(ve=ve.clone(),ve._scaleToBounds=!0),ve}function ee(K,se,de){var ve=K.nodeName.toLowerCase(),ue=ve!=="#document",Ce=o.body,Me,Ae,Oe;de&&ue&&(c=Qe.getView().getSize(),c=k(K,null,null,!0)||c,Me=Fe.create("svg",{style:"stroke-width: 1px; stroke-miterlimit: 10"}),Ae=K.parentNode,Oe=K.nextSibling,Me.appendChild(K),Ce.appendChild(Me));var ke=Qe.settings,Le=ke.applyMatrix,De=ke.insertItems;ke.applyMatrix=!1,ke.insertItems=!1;var ze=X[ve],He=ze&&ze(K,ve,se,de)||null;if(ke.insertItems=De,ke.applyMatrix=Le,He){ue&&!(He instanceof me)&&(He=te(He,K,de));var $e=se.onImport,ct=ue&&K.getAttribute("data-paper-data");$e&&(He=$e(K,He,se)||He),se.expandShapes&&He instanceof ie&&(He.remove(),He=He.toPath()),ct&&(He._data=JSON.parse(ct))}return Me&&(Ce.removeChild(Me),Ae&&(Oe?Ae.insertBefore(K,Oe):Ae.appendChild(K))),de&&(r={},He&&l.pick(se.applyMatrix,Le)&&He.matrix.apply(!0,!0)),He}function re(K,se,de){if(!K)return null;se=typeof se=="function"?{onLoad:se}:se||{};var ve=Qe,ue=null;function Ce(ke){try{var Le=typeof ke=="object"?ke:new t.DOMParser().parseFromString(ke.trim(),"image/svg+xml");if(!Le.nodeName)throw Le=null,new Error("Unsupported SVG source: "+K);Qe=ve,ue=ee(Le,se,!0),(!se||se.insert!==!1)&&de._insertItem(n,ue);var De=se.onLoad;De&&De(ue,ke)}catch(ze){Me(ze)}}function Me(ke,Le){var De=se.onError;if(De)De(ke,Le);else throw new Error(ke)}if(typeof K=="string"&&!/^[\s\S]*</.test(K)){var Ae=o.getElementById(K);Ae?Ce(Ae):fr.request({url:K,async:!0,onLoad:Ce,onError:Me})}else if(typeof File<"u"&&K instanceof File){var Oe=new FileReader;return Oe.onload=function(){Ce(Oe.result)},Oe.onerror=function(){Me(Oe.error)},Oe.readAsText(K)}else Ce(K);return ue}D.inject({importSVG:function(K,se){return re(K,se,this)}}),U.inject({importSVG:function(K,se){return this.activate(),re(K,se,this)}})},l.exports.PaperScript=function(){var r=this,c=r.acorn;if(!c&&typeof xx<"u")try{c=Ex()}catch{}if(!c){var m,x;c=m=x={},function(te,oe){if(typeof m=="object"&&typeof x=="object")return oe(m);if(typeof n=="function"&&n.amd)return n(["exports"],oe);oe(te.acorn||(te.acorn={}))}(this,function(te){te.version="0.5.0";var oe,ee,re,K;te.parse=function(xe,Pe){return ee=String(xe),re=ee.length,de(Pe),Ao(),oc(oe.program)};var se=te.defaultOptions={ecmaVersion:5,strictSemicolons:!1,allowTrailingCommas:!0,forbidReserved:!1,allowReturnOutsideFunction:!1,locations:!1,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null};function de(xe){oe=xe||{};for(var Pe in se)Object.prototype.hasOwnProperty.call(oe,Pe)||(oe[Pe]=se[Pe]);K=oe.sourceFile||null}var ve=te.getLineInfo=function(xe,Pe){for(var Ye=1,Je=0;;){ss.lastIndex=Je;var Ct=ss.exec(xe);if(Ct&&Ct.index<Pe)++Ye,Je=Ct.index+Ct[0].length;else break}return{line:Ye,column:Pe-Je}};te.tokenize=function(xe,Pe){ee=String(xe),re=ee.length,de(Pe),Ao();var Ye={};function Je(Ct){return ct=Me,as(Ct),Ye.start=Ce,Ye.end=Me,Ye.startLoc=Ae,Ye.endLoc=Oe,Ye.type=ke,Ye.value=Le,Ye}return Je.jumpTo=function(Ct,zt){if(ue=Ct,oe.locations){ze=1,He=ss.lastIndex=0;for(var Kt;(Kt=ss.exec(ee))&&Kt.index<Ct;)++ze,He=Kt.index+Kt[0].length}De=zt,Fs()},Je};var ue,Ce,Me,Ae,Oe,ke,Le,De,ze,He,$e,ct,ft,vt,kt,tt;function nt(xe,Pe){var Ye=ve(ee,xe);Pe+=" ("+Ye.line+":"+Ye.column+")";var Je=new SyntaxError(Pe);throw Je.pos=xe,Je.loc=Ye,Je.raisedAt=ue,Je}var _t=[],Et={type:"num"},Mt={type:"regexp"},Dt={type:"string"},Rt={type:"name"},Ft={type:"eof"},$t={keyword:"break"},Vt={keyword:"case",beforeExpr:!0},Rr={keyword:"catch"},Br={keyword:"continue"},Kr={keyword:"debugger"},mt={keyword:"default"},pr={keyword:"do",isLoop:!0},wr={keyword:"else",beforeExpr:!0},pi={keyword:"finally"},Gr={keyword:"for",isLoop:!0},gi={keyword:"function"},Zi={keyword:"if"},xi={keyword:"return",beforeExpr:!0},vi={keyword:"switch"},mi={keyword:"throw",beforeExpr:!0},si={keyword:"try"},Yr={keyword:"var"},Lr={keyword:"while",isLoop:!0},Rs={keyword:"with"},Bs={keyword:"new",beforeExpr:!0},aa={keyword:"this"},qs={keyword:"null",atomValue:null},Ha={keyword:"true",atomValue:!0},oa={keyword:"false",atomValue:!1},Ji={keyword:"in",binop:7,beforeExpr:!0},On={break:$t,case:Vt,catch:Rr,continue:Br,debugger:Kr,default:mt,do:pr,else:wr,finally:pi,for:Gr,function:gi,if:Zi,return:xi,switch:vi,throw:mi,try:si,var:Yr,while:Lr,with:Rs,null:qs,true:Ha,false:oa,new:Bs,in:Ji,instanceof:{keyword:"instanceof",binop:7,beforeExpr:!0},this:aa,typeof:{keyword:"typeof",prefix:!0,beforeExpr:!0},void:{keyword:"void",prefix:!0,beforeExpr:!0},delete:{keyword:"delete",prefix:!0,beforeExpr:!0}},Fi={type:"[",beforeExpr:!0},Dn={type:"]"},zi={type:"{",beforeExpr:!0},Qt={type:"}"},Ni={type:"(",beforeExpr:!0},wi={type:")"},Li={type:",",beforeExpr:!0},Ci={type:";",beforeExpr:!0},Rn={type:":",beforeExpr:!0},la={type:"."},ca={type:"?",beforeExpr:!0},d={binop:10,beforeExpr:!0},P={isAssign:!0,beforeExpr:!0},J={isAssign:!0,beforeExpr:!0},pe={postfix:!0,prefix:!0,isUpdate:!0},Ee={prefix:!0,beforeExpr:!0},We={binop:1,beforeExpr:!0},Ke={binop:2,beforeExpr:!0},pt={binop:3,beforeExpr:!0},yt={binop:4,beforeExpr:!0},Zt={binop:5,beforeExpr:!0},Gt={binop:6,beforeExpr:!0},jt={binop:7,beforeExpr:!0},gr={binop:8,beforeExpr:!0},is={binop:9,prefix:!0,beforeExpr:!0},Bn={binop:10,beforeExpr:!0};te.tokTypes={bracketL:Fi,bracketR:Dn,braceL:zi,braceR:Qt,parenL:Ni,parenR:wi,comma:Li,semi:Ci,colon:Rn,dot:la,question:ca,slash:d,eq:P,name:Rt,eof:Ft,num:Et,regexp:Mt,string:Dt};for(var ns in On)te.tokTypes["_"+ns]=On[ns];function Hi(xe){xe=xe.split(" ");var Pe="",Ye=[];e:for(var Je=0;Je<xe.length;++Je){for(var Ct=0;Ct<Ye.length;++Ct)if(Ye[Ct][0].length==xe[Je].length){Ye[Ct].push(xe[Je]);continue e}Ye.push([xe[Je]])}function zt(Jt){if(Jt.length==1)return Pe+="return str === "+JSON.stringify(Jt[0])+";";Pe+="switch(str){";for(var Mi=0;Mi<Jt.length;++Mi)Pe+="case "+JSON.stringify(Jt[Mi])+":";Pe+="return true}return false;"}if(Ye.length>3){Ye.sort(function(Jt,Mi){return Mi.length-Jt.length}),Pe+="switch(str.length){";for(var Je=0;Je<Ye.length;++Je){var Kt=Ye[Je];Pe+="case "+Kt[0].length+":",zt(Kt)}Pe+="}"}else zt(xe);return new Function("str",Pe)}var qn=Hi("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"),ic=Hi("class enum extends super const export import"),ko=Hi("implements interface let package private protected public static yield"),Va=Hi("eval arguments"),ai=Hi("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"),Mo=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Fn="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",k0="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_",Ua=new RegExp("["+Fn+"]"),Vi=new RegExp("["+Fn+k0+"]"),ua=/[\n\r\u2028\u2029]/,ss=/\r\n|[\n\r\u2028\u2029]/g,ha=te.isIdentifierStart=function(xe){return xe<65?xe===36:xe<91?!0:xe<97?xe===95:xe<123?!0:xe>=170&&Ua.test(String.fromCharCode(xe))},Eo=te.isIdentifierChar=function(xe){return xe<48?xe===36:xe<58?!0:xe<65?!1:xe<91?!0:xe<97?xe===95:xe<123?!0:xe>=170&&Vi.test(String.fromCharCode(xe))};function zn(){this.line=ze,this.column=ue-He}function Ao(){ze=1,ue=He=0,De=!0,Fs()}function kr(xe,Pe){Me=ue,oe.locations&&(Oe=new zn),ke=xe,Fs(),Le=Pe,De=xe.beforeExpr}function nc(){var xe=oe.onComment&&oe.locations&&new zn,Pe=ue,Ye=ee.indexOf("*/",ue+=2);if(Ye===-1&&nt(ue-2,"Unterminated comment"),ue=Ye+2,oe.locations){ss.lastIndex=Pe;for(var Je;(Je=ss.exec(ee))&&Je.index<ue;)++ze,He=Je.index+Je[0].length}oe.onComment&&oe.onComment(!0,ee.slice(Pe+2,Ye),Pe,ue,xe,oe.locations&&new zn)}function ki(){for(var xe=ue,Pe=oe.onComment&&oe.locations&&new zn,Ye=ee.charCodeAt(ue+=2);ue<re&&Ye!==10&&Ye!==13&&Ye!==8232&&Ye!==8233;)++ue,Ye=ee.charCodeAt(ue);oe.onComment&&oe.onComment(!1,ee.slice(xe+2,ue),xe,ue,Pe,oe.locations&&new zn)}function Fs(){for(;ue<re;){var xe=ee.charCodeAt(ue);if(xe===32)++ue;else if(xe===13){++ue;var Pe=ee.charCodeAt(ue);Pe===10&&++ue,oe.locations&&(++ze,He=ue)}else if(xe===10||xe===8232||xe===8233)++ue,oe.locations&&(++ze,He=ue);else if(xe>8&&xe<14)++ue;else if(xe===47){var Pe=ee.charCodeAt(ue+1);if(Pe===42)nc();else if(Pe===47)ki();else break}else if(xe===160)++ue;else if(xe>=5760&&Mo.test(String.fromCharCode(xe)))++ue;else break}}function M0(){var xe=ee.charCodeAt(ue+1);return xe>=48&&xe<=57?os(!0):(++ue,kr(la))}function Hn(){var xe=ee.charCodeAt(ue+1);return De?(++ue,E0()):xe===61?ni(J,2):ni(d,1)}function Ga(){var xe=ee.charCodeAt(ue+1);return xe===61?ni(J,2):ni(Bn,1)}function To(xe){var Pe=ee.charCodeAt(ue+1);return Pe===xe?ni(xe===124?We:Ke,2):Pe===61?ni(J,2):ni(xe===124?pt:Zt,1)}function Dr(){var xe=ee.charCodeAt(ue+1);return xe===61?ni(J,2):ni(yt,1)}function Vn(xe){var Pe=ee.charCodeAt(ue+1);return Pe===xe?Pe==45&&ee.charCodeAt(ue+2)==62&&ua.test(ee.slice(ct,ue))?(ue+=3,ki(),Fs(),as()):ni(pe,2):Pe===61?ni(J,2):ni(is,1)}function Po(xe){var Pe=ee.charCodeAt(ue+1),Ye=1;return Pe===xe?(Ye=xe===62&&ee.charCodeAt(ue+2)===62?3:2,ee.charCodeAt(ue+Ye)===61?ni(J,Ye+1):ni(gr,Ye)):Pe==33&&xe==60&&ee.charCodeAt(ue+2)==45&&ee.charCodeAt(ue+3)==45?(ue+=4,ki(),Fs(),as()):(Pe===61&&(Ye=ee.charCodeAt(ue+2)===61?3:2),ni(jt,Ye))}function sc(xe){var Pe=ee.charCodeAt(ue+1);return Pe===61?ni(Gt,ee.charCodeAt(ue+2)===61?3:2):ni(xe===61?P:Ee,1)}function Io(xe){switch(xe){case 46:return M0();case 40:return++ue,kr(Ni);case 41:return++ue,kr(wi);case 59:return++ue,kr(Ci);case 44:return++ue,kr(Li);case 91:return++ue,kr(Fi);case 93:return++ue,kr(Dn);case 123:return++ue,kr(zi);case 125:return++ue,kr(Qt);case 58:return++ue,kr(Rn);case 63:return++ue,kr(ca);case 48:var Pe=ee.charCodeAt(ue+1);if(Pe===120||Pe===88)return Ya();case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return os(!1);case 34:case 39:return ac(xe);case 47:return Hn();case 37:case 42:return Ga();case 124:case 38:return To(xe);case 94:return Dr();case 43:case 45:return Vn(xe);case 60:case 62:return Po(xe);case 61:case 33:return sc(xe);case 126:return ni(Ee,1)}return!1}function as(xe){if(xe?ue=Ce+1:Ce=ue,oe.locations&&(Ae=new zn),xe)return E0();if(ue>=re)return kr(Ft);var Pe=ee.charCodeAt(ue);if(ha(Pe)||Pe===92)return $a();var Ye=Io(Pe);if(Ye===!1){var Je=String.fromCharCode(Pe);if(Je==="\\"||Ua.test(Je))return $a();nt(ue,"Unexpected character '"+Je+"'")}return Ye}function ni(xe,Pe){var Ye=ee.slice(ue,ue+Pe);ue+=Pe,kr(xe,Ye)}function E0(){for(var Ct="",xe,Pe,Ye=ue;;){ue>=re&&nt(Ye,"Unterminated regular expression");var Je=ee.charAt(ue);if(ua.test(Je)&&nt(Ye,"Unterminated regular expression"),xe)xe=!1;else{if(Je==="[")Pe=!0;else if(Je==="]"&&Pe)Pe=!1;else if(Je==="/"&&!Pe)break;xe=Je==="\\"}++ue}var Ct=ee.slice(Ye,ue);++ue;var zt=Wa();zt&&!/^[gmsiy]*$/.test(zt)&&nt(Ye,"Invalid regexp flag");try{var Kt=new RegExp(Ct,zt)}catch(Jt){Jt instanceof SyntaxError&&nt(Ye,Jt.message),nt(Jt)}return kr(Mt,Kt)}function zs(xe,Pe){for(var Ye=ue,Je=0,Ct=0,zt=Pe??1/0;Ct<zt;++Ct){var Kt=ee.charCodeAt(ue),Jt;if(Kt>=97?Jt=Kt-97+10:Kt>=65?Jt=Kt-65+10:Kt>=48&&Kt<=57?Jt=Kt-48:Jt=1/0,Jt>=xe)break;++ue,Je=Je*xe+Jt}return ue===Ye||Pe!=null&&ue-Ye!==Pe?null:Je}function Ya(){ue+=2;var xe=zs(16);return xe==null&&nt(Ce+2,"Expected hexadecimal number"),ha(ee.charCodeAt(ue))&&nt(ue,"Identifier directly after number"),kr(Et,xe)}function os(xe){var Pe=ue,Ye=!1,Je=ee.charCodeAt(ue)===48;!xe&&zs(10)===null&&nt(Pe,"Invalid number"),ee.charCodeAt(ue)===46&&(++ue,zs(10),Ye=!0);var Ct=ee.charCodeAt(ue);(Ct===69||Ct===101)&&(Ct=ee.charCodeAt(++ue),(Ct===43||Ct===45)&&++ue,zs(10)===null&&nt(Pe,"Invalid number"),Ye=!0),ha(ee.charCodeAt(ue))&&nt(ue,"Identifier directly after number");var zt=ee.slice(Pe,ue),Kt;return Ye?Kt=parseFloat(zt):!Je||zt.length===1?Kt=parseInt(zt,10):/[89]/.test(zt)||tt?nt(Pe,"Invalid number"):Kt=parseInt(zt,8),kr(Et,Kt)}function ac(xe){ue++;for(var Pe="";;){ue>=re&&nt(Ce,"Unterminated string constant");var Ye=ee.charCodeAt(ue);if(Ye===xe)return++ue,kr(Dt,Pe);if(Ye===92){Ye=ee.charCodeAt(++ue);var Je=/^[0-7]+/.exec(ee.slice(ue,ue+3));for(Je&&(Je=Je[0]);Je&&parseInt(Je,8)>255;)Je=Je.slice(0,-1);if(Je==="0"&&(Je=null),++ue,Je)tt&&nt(ue-2,"Octal literal in strict mode"),Pe+=String.fromCharCode(parseInt(Je,8)),ue+=Je.length-1;else switch(Ye){case 110:Pe+=`
102
+ `;break;case 114:Pe+="\r";break;case 120:Pe+=String.fromCharCode(fa(2));break;case 117:Pe+=String.fromCharCode(fa(4));break;case 85:Pe+=String.fromCharCode(fa(8));break;case 116:Pe+=" ";break;case 98:Pe+="\b";break;case 118:Pe+="\v";break;case 102:Pe+="\f";break;case 48:Pe+="\0";break;case 13:ee.charCodeAt(ue)===10&&++ue;case 10:oe.locations&&(He=ue,++ze);break;default:Pe+=String.fromCharCode(Ye);break}}else(Ye===13||Ye===10||Ye===8232||Ye===8233)&&nt(Ce,"Unterminated string constant"),Pe+=String.fromCharCode(Ye),++ue}}function fa(xe){var Pe=zs(16,xe);return Pe===null&&nt(Ce,"Bad character escape sequence"),Pe}var ls;function Wa(){ls=!1;for(var xe,Pe=!0,Ye=ue;;){var Je=ee.charCodeAt(ue);if(Eo(Je))ls&&(xe+=ee.charAt(ue)),++ue;else if(Je===92){ls||(xe=ee.slice(Ye,ue)),ls=!0,ee.charCodeAt(++ue)!=117&&nt(ue,"Expecting Unicode escape sequence \\uXXXX"),++ue;var Ct=fa(4),zt=String.fromCharCode(Ct);zt||nt(ue-1,"Invalid Unicode escape"),(Pe?ha(Ct):Eo(Ct))||nt(ue-4,"Invalid Unicode escape"),xe+=zt}else break;Pe=!1}return ls?xe:ee.slice(Ye,ue)}function $a(){var xe=Wa(),Pe=Rt;return!ls&&ai(xe)&&(Pe=On[xe]),kr(Pe,xe)}function vr(){$e=Ce,ct=Me,ft=Oe,as()}function No(xe){if(tt=xe,ue=Ce,oe.locations)for(;ue<He;)He=ee.lastIndexOf(`
103
+ `,He-2)+1,--ze;Fs(),as()}function Ka(){this.type=null,this.start=Ce,this.end=null}function ja(){this.start=Ae,this.end=null,K!==null&&(this.source=K)}function oi(){var xe=new Ka;return oe.locations&&(xe.loc=new ja),oe.directSourceFile&&(xe.sourceFile=oe.directSourceFile),oe.ranges&&(xe.range=[Ce,0]),xe}function Sn(xe){var Pe=new Ka;return Pe.start=xe.start,oe.locations&&(Pe.loc=new ja,Pe.loc.start=xe.loc.start),oe.ranges&&(Pe.range=[xe.range[0],0]),Pe}function qt(xe,Pe){return xe.type=Pe,xe.end=ct,oe.locations&&(xe.loc.end=ft),oe.ranges&&(xe.range[1]=ct),xe}function da(xe){return oe.ecmaVersion>=5&&xe.type==="ExpressionStatement"&&xe.expression.type==="Literal"&&xe.expression.value==="use strict"}function Pr(xe){if(ke===xe)return vr(),!0}function pa(){return!oe.strictSemicolons&&(ke===Ft||ke===Qt||ua.test(ee.slice(ct,Ce)))}function Un(){!Pr(Ci)&&!pa()&&xn()}function jr(xe){ke===xe?vr():xn()}function xn(){nt(Ce,"Unexpected token")}function Xa(xe){xe.type!=="Identifier"&&xe.type!=="MemberExpression"&&nt(xe.start,"Assigning to rvalue"),tt&&xe.type==="Identifier"&&Va(xe.name)&&nt(xe.start,"Assigning to "+xe.name+" in strict mode")}function oc(xe){$e=ct=ue,oe.locations&&(ft=new zn),vt=tt=null,kt=[],as();var Pe=xe||oi(),Ye=!0;for(xe||(Pe.body=[]);ke!==Ft;){var Je=en();Pe.body.push(Je),Ye&&da(Je)&&No(!0),Ye=!1}return qt(Pe,"Program")}var Lo={kind:"loop"},Hs={kind:"switch"};function en(){(ke===d||ke===J&&Le=="/=")&&as(!0);var xe=ke,Pe=oi();switch(xe){case $t:case Br:vr();var Ye=xe===$t;Pr(Ci)||pa()?Pe.label=null:ke!==Rt?xn():(Pe.label=Xe(),Un());for(var Je=0;Je<kt.length;++Je){var Ct=kt[Je];if((Pe.label==null||Ct.name===Pe.label.name)&&(Ct.kind!=null&&(Ye||Ct.kind==="loop")||Pe.label&&Ye))break}return Je===kt.length&&nt(Pe.start,"Unsyntactic "+xe.keyword),qt(Pe,Ye?"BreakStatement":"ContinueStatement");case Kr:return vr(),Un(),qt(Pe,"DebuggerStatement");case pr:return vr(),kt.push(Lo),Pe.body=en(),kt.pop(),jr(Lr),Pe.test=ga(),Un(),qt(Pe,"DoWhileStatement");case Gr:if(vr(),kt.push(Lo),jr(Ni),ke===Ci)return Qa(Pe,null);if(ke===Yr){var zt=oi();return vr(),va(zt,!0),qt(zt,"VariableDeclaration"),zt.declarations.length===1&&Pr(Ji)?Cn(Pe,zt):Qa(Pe,zt)}var zt=_i(!1,!0);return Pr(Ji)?(Xa(zt),Cn(Pe,zt)):Qa(Pe,zt);case gi:return vr(),Ve(Pe,!0);case Zi:return vr(),Pe.test=ga(),Pe.consequent=en(),Pe.alternate=Pr(wr)?en():null,qt(Pe,"IfStatement");case xi:return!vt&&!oe.allowReturnOutsideFunction&&nt(Ce,"'return' outside of function"),vr(),Pr(Ci)||pa()?Pe.argument=null:(Pe.argument=_i(),Un()),qt(Pe,"ReturnStatement");case vi:vr(),Pe.discriminant=ga(),Pe.cases=[],jr(zi),kt.push(Hs);for(var Kt,Jt;ke!=Qt;)if(ke===Vt||ke===mt){var Mi=ke===Vt;Kt&&qt(Kt,"SwitchCase"),Pe.cases.push(Kt=oi()),Kt.consequent=[],vr(),Mi?Kt.test=_i():(Jt&&nt($e,"Multiple default clauses"),Jt=!0,Kt.test=null),jr(Rn)}else Kt||xn(),Kt.consequent.push(en());return Kt&&qt(Kt,"SwitchCase"),vr(),kt.pop(),qt(Pe,"SwitchStatement");case mi:return vr(),ua.test(ee.slice(ct,Ce))&&nt(ct,"Illegal newline after throw"),Pe.argument=_i(),Un(),qt(Pe,"ThrowStatement");case si:if(vr(),Pe.block=cs(),Pe.handler=null,ke===Rr){var hs=oi();vr(),jr(Ni),hs.param=Xe(),tt&&Va(hs.param.name)&&nt(hs.param.start,"Binding "+hs.param.name+" in strict mode"),jr(wi),hs.guard=null,hs.body=cs(),Pe.handler=qt(hs,"CatchClause")}return Pe.guardedHandlers=_t,Pe.finalizer=Pr(pi)?cs():null,!Pe.handler&&!Pe.finalizer&&nt(Pe.start,"Missing catch or finally clause"),qt(Pe,"TryStatement");case Yr:return vr(),va(Pe),Un(),qt(Pe,"VariableDeclaration");case Lr:return vr(),Pe.test=ga(),kt.push(Lo),Pe.body=en(),kt.pop(),qt(Pe,"WhileStatement");case Rs:return tt&&nt(Ce,"'with' in strict mode"),vr(),Pe.object=ga(),Pe.body=en(),qt(Pe,"WithStatement");case zi:return cs();case Ci:return vr(),qt(Pe,"EmptyStatement");default:var Gn=Le,fs=_i();if(xe===Rt&&fs.type==="Identifier"&&Pr(Rn)){for(var Je=0;Je<kt.length;++Je)kt[Je].name===Gn&&nt(fs.start,"Label '"+Gn+"' is already declared");var Ja=ke.isLoop?"loop":ke===vi?"switch":null;return kt.push({name:Gn,kind:Ja}),Pe.body=en(),kt.pop(),Pe.label=fs,qt(Pe,"LabeledStatement")}else return Pe.expression=fs,Un(),qt(Pe,"ExpressionStatement")}}function ga(){jr(Ni);var xe=_i();return jr(wi),xe}function cs(xe){var Pe=oi(),Ye=!0,Je=!1,Ct;for(Pe.body=[],jr(zi);!Pr(Qt);){var zt=en();Pe.body.push(zt),Ye&&xe&&da(zt)&&(Ct=Je,No(Je=!0)),Ye=!1}return Je&&!Ct&&No(!1),qt(Pe,"BlockStatement")}function Qa(xe,Pe){return xe.init=Pe,jr(Ci),xe.test=ke===Ci?null:_i(),jr(Ci),xe.update=ke===wi?null:_i(),jr(wi),xe.body=en(),kt.pop(),qt(xe,"ForStatement")}function Cn(xe,Pe){return xe.left=Pe,xe.right=_i(),jr(wi),xe.body=en(),kt.pop(),qt(xe,"ForInStatement")}function va(xe,Pe){for(xe.declarations=[],xe.kind="var";;){var Ye=oi();if(Ye.id=Xe(),tt&&Va(Ye.id.name)&&nt(Ye.id.start,"Binding "+Ye.id.name+" in strict mode"),Ye.init=Pr(P)?_i(!0,Pe):null,xe.declarations.push(qt(Ye,"VariableDeclarator")),!Pr(Li))break}return xe}function _i(xe,Pe){var Ye=Oo(Pe);if(!xe&&ke===Li){var Je=Sn(Ye);for(Je.expressions=[Ye];Pr(Li);)Je.expressions.push(Oo(Pe));return qt(Je,"SequenceExpression")}return Ye}function Oo(xe){var Pe=lc(xe);if(ke.isAssign){var Ye=Sn(Pe);return Ye.operator=Le,Ye.left=Pe,vr(),Ye.right=Oo(xe),Xa(Pe),qt(Ye,"AssignmentExpression")}return Pe}function lc(xe){var Pe=Vs(xe);if(Pr(ca)){var Ye=Sn(Pe);return Ye.test=Pe,Ye.consequent=_i(!0),jr(Rn),Ye.alternate=_i(!0,xe),qt(Ye,"ConditionalExpression")}return Pe}function Vs(xe){return Oi(Za(),-1,xe)}function Oi(xe,Pe,Ye){var Je=ke.binop;if(Je!=null&&(!Ye||ke!==Ji)&&Je>Pe){var Ct=Sn(xe);Ct.left=xe,Ct.operator=Le;var zt=ke;vr(),Ct.right=Oi(Za(),Je,Ye);var Kt=qt(Ct,zt===We||zt===Ke?"LogicalExpression":"BinaryExpression");return Oi(Kt,Pe,Ye)}return xe}function Za(){if(ke.prefix){var xe=oi(),Pe=ke.isUpdate;return xe.operator=Le,xe.prefix=!0,De=!0,vr(),xe.argument=Za(),Pe?Xa(xe.argument):tt&&xe.operator==="delete"&&xe.argument.type==="Identifier"&&nt(xe.start,"Deleting local variable in strict mode"),qt(xe,Pe?"UpdateExpression":"UnaryExpression")}for(var Ye=cc();ke.postfix&&!pa();){var xe=Sn(Ye);xe.operator=Le,xe.prefix=!1,xe.argument=Ye,Xa(Ye),vr(),Ye=qt(xe,"UpdateExpression")}return Ye}function cc(){return ma(Do())}function ma(xe,Pe){if(Pr(la)){var Ye=Sn(xe);return Ye.object=xe,Ye.property=Xe(!0),Ye.computed=!1,ma(qt(Ye,"MemberExpression"),Pe)}else if(Pr(Fi)){var Ye=Sn(xe);return Ye.object=xe,Ye.property=_i(),Ye.computed=!0,jr(Dn),ma(qt(Ye,"MemberExpression"),Pe)}else if(!Pe&&Pr(Ni)){var Ye=Sn(xe);return Ye.callee=xe,Ye.arguments=it(wi,!1),ma(qt(Ye,"CallExpression"),Pe)}else return xe}function Do(){switch(ke){case aa:var Je=oi();return vr(),qt(Je,"ThisExpression");case Rt:return Xe();case Et:case Dt:case Mt:var Je=oi();return Je.value=Le,Je.raw=ee.slice(Ce,Me),vr(),qt(Je,"Literal");case qs:case Ha:case oa:var Je=oi();return Je.value=ke.atomValue,Je.raw=ke.keyword,vr(),qt(Je,"Literal");case Ni:var xe=Ae,Pe=Ce;vr();var Ye=_i();return Ye.start=Pe,Ye.end=Me,oe.locations&&(Ye.loc.start=xe,Ye.loc.end=Oe),oe.ranges&&(Ye.range=[Pe,Me]),jr(wi),Ye;case Fi:var Je=oi();return vr(),Je.elements=it(Dn,!0,!0),qt(Je,"ArrayExpression");case zi:return hc();case gi:var Je=oi();return vr(),Ve(Je,!1);case Bs:return uc();default:xn()}}function uc(){var xe=oi();return vr(),xe.callee=ma(Do(),!0),Pr(Ni)?xe.arguments=it(wi,!1):xe.arguments=_t,qt(xe,"NewExpression")}function hc(){var xe=oi(),Pe=!0,Ye=!1;for(xe.properties=[],vr();!Pr(Qt);){if(Pe)Pe=!1;else if(jr(Li),oe.allowTrailingCommas&&Pr(Qt))break;var Je={key:us()},Ct=!1,zt;if(Pr(Rn)?(Je.value=_i(!0),zt=Je.kind="init"):oe.ecmaVersion>=5&&Je.key.type==="Identifier"&&(Je.key.name==="get"||Je.key.name==="set")?(Ct=Ye=!0,zt=Je.kind=Je.key.name,Je.key=us(),ke!==Ni&&xn(),Je.value=Ve(oi(),!1)):xn(),Je.key.type==="Identifier"&&(tt||Ye))for(var Kt=0;Kt<xe.properties.length;++Kt){var Jt=xe.properties[Kt];if(Jt.key.name===Je.key.name){var Mi=zt==Jt.kind||Ct&&Jt.kind==="init"||zt==="init"&&(Jt.kind==="get"||Jt.kind==="set");Mi&&!tt&&zt==="init"&&Jt.kind==="init"&&(Mi=!1),Mi&&nt(Je.key.start,"Redefinition of property")}}xe.properties.push(Je)}return qt(xe,"ObjectExpression")}function us(){return ke===Et||ke===Dt?Do():Xe(!0)}function Ve(xe,Pe){ke===Rt?xe.id=Xe():Pe?xn():xe.id=null,xe.params=[];var Ye=!0;for(jr(Ni);!Pr(wi);)Ye?Ye=!1:jr(Li),xe.params.push(Xe());var Je=vt,Ct=kt;if(vt=!0,kt=[],xe.body=cs(!0),vt=Je,kt=Ct,tt||xe.body.body.length&&da(xe.body.body[0]))for(var zt=xe.id?-1:0;zt<xe.params.length;++zt){var Kt=zt<0?xe.id:xe.params[zt];if((ko(Kt.name)||Va(Kt.name))&&nt(Kt.start,"Defining '"+Kt.name+"' in strict mode"),zt>=0)for(var Jt=0;Jt<zt;++Jt)Kt.name===xe.params[Jt].name&&nt(Kt.start,"Argument name clash in strict mode")}return qt(xe,Pe?"FunctionDeclaration":"FunctionExpression")}function it(xe,Pe,Ye){for(var Je=[],Ct=!0;!Pr(xe);){if(Ct)Ct=!1;else if(jr(Li),Pe&&oe.allowTrailingCommas&&Pr(xe))break;Ye&&ke===Li?Je.push(null):Je.push(_i(!0))}return Je}function Xe(xe){var Pe=oi();return xe&&oe.forbidReserved=="everywhere"&&(xe=!1),ke===Rt?(!xe&&(oe.forbidReserved&&(oe.ecmaVersion===3?qn:ic)(Le)||tt&&ko(Le))&&ee.slice(Ce,Me).indexOf("\\")==-1&&nt(Ce,"The keyword '"+Le+"' is reserved"),Pe.name=Le):xe&&ke.keyword?Pe.name=ke.keyword:xn(),De=!1,vr(),qt(Pe,"Identifier")}}),c.version||(c=null)}function k(te,oe){return(r.acorn||c).parse(te,oe)}var T={"+":"__add","-":"__subtract","*":"__multiply","/":"__divide","%":"__modulo","==":"__equals","!=":"__equals"},R={"-":"__negate","+":"__self"},L=l.each(["add","subtract","multiply","divide","modulo","equals","negate"],function(te){this["__"+te]="#"+te},{__self:function(){return this}});g.inject(L),p.inject(L),Ie.inject(L);function q(te,oe,ee){var re=T[oe];if(te&&te[re]){var K=te[re](ee);return oe==="!="?!K:K}switch(oe){case"+":return te+ee;case"-":return te-ee;case"*":return te*ee;case"/":return te/ee;case"%":return te%ee;case"==":return te==ee;case"!=":return te!=ee}}function z(te,oe){var ee=R[te];if(oe&&oe[ee])return oe[ee]();switch(te){case"+":return+oe;case"-":return-oe}}function X(te,oe){if(!te)return"";oe=oe||{};var ee=[];function re(tt){for(var nt=0,_t=ee.length;nt<_t;nt++){var Et=ee[nt];if(Et[0]>=tt)break;tt+=Et[1]}return tt}function K(tt){return te.substring(re(tt.range[0]),re(tt.range[1]))}function se(tt,nt){return te.substring(re(tt.range[1]),re(nt.range[0]))}function de(tt,nt){for(var _t=re(tt.range[0]),Et=re(tt.range[1]),Mt=0,Dt=ee.length-1;Dt>=0;Dt--)if(_t>ee[Dt][0]){Mt=Dt+1;break}ee.splice(Mt,0,[_t,nt.length-Et+_t]),te=te.substring(0,_t)+nt+te.substring(Et)}function ve(tt,nt){switch(tt.type){case"UnaryExpression":if(tt.operator in R&&tt.argument.type!=="Literal"){var _t=K(tt.argument);de(tt,'$__("'+tt.operator+'", '+_t+")")}break;case"BinaryExpression":if(tt.operator in T&&tt.left.type!=="Literal"){var Et=K(tt.left),Mt=K(tt.right),Dt=se(tt.left,tt.right),Rt=tt.operator;de(tt,"__$__("+Et+","+Dt.replace(new RegExp("\\"+Rt),'"'+Rt+'"')+", "+Mt+")")}break;case"UpdateExpression":case"AssignmentExpression":var Ft=nt&&nt.type;if(!(Ft==="ForStatement"||Ft==="BinaryExpression"&&/^[=!<>]/.test(nt.operator)||Ft==="MemberExpression"&&nt.computed)){if(tt.type==="UpdateExpression"){var _t=K(tt.argument),$t="__$__("+_t+', "'+tt.operator[0]+'", 1)',Vt=_t+" = "+$t;tt.prefix?Vt="("+Vt+")":(Ft==="AssignmentExpression"||Ft==="VariableDeclarator"||Ft==="BinaryExpression")&&(K(nt.left||nt.id)===_t&&(Vt=$t),Vt=_t+"; "+Vt),de(tt,Vt)}else if(/^.=$/.test(tt.operator)&&tt.left.type!=="Literal"){var Et=K(tt.left),Mt=K(tt.right),$t=Et+" = __$__("+Et+', "'+tt.operator[0]+'", '+Mt+")";de(tt,/^\(.*\)$/.test(K(tt))?"("+$t+")":$t)}}break}}function ue(tt){switch(tt.type){case"ExportDefaultDeclaration":de({range:[tt.start,tt.declaration.start]},"module.exports = ");break;case"ExportNamedDeclaration":var nt=tt.declaration,_t=tt.specifiers;if(nt){var Et=nt.declarations;Et&&(Et.forEach(function(Dt){de(Dt,"module.exports."+K(Dt))}),de({range:[tt.start,nt.start+nt.kind.length]},""))}else if(_t){var Mt=_t.map(function(Dt){var Rt=K(Dt);return"module.exports."+Rt+" = "+Rt+"; "}).join("");Mt&&de(tt,Mt)}break}}function Ce(tt,nt,_t){if(tt){for(var Et in tt)if(Et!=="range"&&Et!=="loc"){var Mt=tt[Et];if(Array.isArray(Mt))for(var Dt=0,Rt=Mt.length;Dt<Rt;Dt++)Ce(Mt[Dt],tt,_t);else Mt&&typeof Mt=="object"&&Ce(Mt,tt,_t)}_t.operatorOverloading!==!1&&ve(tt,nt),_t.moduleExports!==!1&&ue(tt)}}function Me(tt){var nt="",_t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(tt=(Math.abs(tt)<<1)+(tt<0?1:0);tt||!nt;){var Et=tt&31;tt>>=5,tt&&(Et|=32),nt+=_t[Et]}return nt}var Ae=oe.url||"",Oe=oe.sourceMaps,ke=oe.paperFeatures||{},Le=oe.source||te,De=oe.offset||0,ze=Qe.agent,He=ze.versionNumber,$e=!1,ct=/\r\n|\n|\r/mg,ft;if(Oe&&(ze.chrome&&He>=30||ze.webkit&&He>=537.76||ze.firefox&&He>=23||ze.node)){if(ze.node)De-=2;else if(a&&Ae&&!a.location.href.indexOf(Ae)){var vt=o.getElementsByTagName("html")[0].innerHTML;De=vt.substr(0,vt.indexOf(te)+1).match(ct).length+1}$e=De>0&&!(ze.chrome&&He>=36||ze.safari&&He>=600||ze.firefox&&He>=40||ze.node);var kt=["AA"+Me($e?0:De)+"A"];kt.length=(te.match(ct)||[]).length+1+($e?De:0),ft={version:3,file:Ae,names:[],mappings:kt.join(";AACA"),sourceRoot:"",sources:[Ae],sourcesContent:[Le]}}return(ke.operatorOverloading!==!1||ke.moduleExports!==!1)&&Ce(k(te,{ranges:!0,preserveParens:!0,sourceType:"module"}),null,ke),ft&&($e&&(te=new Array(De+1).join(`
104
+ `)+te),/^(inline|both)$/.test(Oe)&&(te+=`
105
+ //# sourceMappingURL=data:application/json;base64,`+t.btoa(unescape(encodeURIComponent(JSON.stringify(ft))))),te+=`
106
+ //# sourceURL=`+(Ae||"paperscript")),{url:Ae,source:Le,code:te,map:ft}}function Z(te,oe,ee){Qe=oe;var re=oe.getView(),K=/\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(te)&&!/\bnew\s+Tool\b/.test(te)?new nr:null,se=K?K._events:[],de=["onFrame","onResize"].concat(se),ve=[],ue=[],Ce,Me=typeof te=="object"?te:X(te,ee);te=Me.code;function Ae(He,$e){for(var ct in He)($e||!/^_/.test(ct))&&new RegExp("([\\b\\s\\W]|^)"+ct.replace(/\$/g,"\\$")+"\\b").test(te)&&(ve.push(ct),ue.push(He[ct]))}Ae({__$__:q,$__:z,paper:oe,tool:K},!0),Ae(oe),te="var module = { exports: {} }; "+te;var De=l.each(de,function(He){new RegExp("\\s+"+He+"\\b").test(te)&&(ve.push(He),this.push("module.exports."+He+" = "+He+";"))},[]).join(`
107
+ `);De&&(te+=`
108
+ `+De),te+=`
109
+ return module.exports;`;var Oe=Qe.agent;if(o&&(Oe.chrome||Oe.firefox&&Oe.versionNumber<40)){var ke=o.createElement("script"),Le=o.head||o.getElementsByTagName("head")[0];Oe.firefox&&(te=`
110
+ `+te),ke.appendChild(o.createTextNode("document.__paperscript__ = function("+ve+") {"+te+`
111
+ }`)),Le.appendChild(ke),Ce=o.__paperscript__,delete o.__paperscript__,Le.removeChild(ke)}else Ce=Function(ve,te);var De=Ce&&Ce.apply(oe,ue),ze=De||{};return l.each(se,function(He){var $e=ze[He];$e&&(K[He]=$e)}),re&&(ze.onResize&&re.setOnResize(ze.onResize),re.emit("resize",{size:re.size,delta:new g}),ze.onFrame&&re.setOnFrame(ze.onFrame),re.requestUpdate()),De}function Q(te){if(/^text\/(?:x-|)paperscript$/.test(te.type)&&f.getAttribute(te,"ignore")!=="true"){var oe=f.getAttribute(te,"canvas"),ee=o.getElementById(oe),re=te.src||te.getAttribute("data-src"),K=f.hasAttribute(te,"async"),se="data-paper-scope";if(!ee)throw new Error('Unable to find canvas with id "'+oe+'"');var de=f.get(ee.getAttribute(se))||new f().setup(ee);return ee.setAttribute(se,de._id),re?fr.request({url:re,async:K,mimeType:"text/plain",onLoad:function(ve){Z(ve,de,re)}}):Z(te.innerHTML,de,te.baseURI),te.setAttribute("data-paper-ignore","true"),de}}function j(){l.each(o&&o.getElementsByTagName("script"),Q)}function ce(te){return te?Q(te):j()}return a&&(o.readyState==="complete"?setTimeout(j):bt.add(a,{load:j})),{compile:X,execute:Z,load:ce,parse:k,calculateBinary:q,calculateUnary:z}}.call(this);var Qe=new(f.inject(l.exports,{Base:l,Numerical:C,Key:rr,DomEvent:bt,DomElement:dt,document:o,window:a,Symbol:fe,PlacedSymbol:ae}));return Qe.agent.node&&tv(Qe),typeof n=="function"&&n.amd?n("paper",Qe):e&&(e.exports=Qe),Qe}).call(Ax,typeof self=="object"?self:null)}(gl)),gl.exports}var Px=Tx();const Ea=Fl(Px),Ix=Vr({name:"CalculateSupplementaryAngle",components:{UserInputNumber:Ra},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"CalculateSupplementaryAngle"),a=ii(n),o=Lt(""),l=Lt(null),h=Lt();a.question.value=new Y3(e.data);const f=(b,S,M,C,y,g,w=30)=>new b.Point(S/2+w*Xo(M+(C+y)/2),g/2+w*Qo(M+(C+y)/2));return Nn(async()=>{if(await l7(),!l.value)return;h.value=new Ea.PaperScope,h.value.setup(l.value);const b=h.value,S=l.value.width,M=l.value.height,C=ks(0,360),y=S*Xo(C),g=S*Qo(C),w=new b.Path.Line({from:new b.Point(S/2+y,M/2+g),to:new b.Point(S/2-y,M/2-g)});w.strokeColor=new Ea.Color("black");let p=0;const E=[];if(a.question.value)for(let N=0;N<a.question.value.angles.length;N++){const I=a.question.value.angles[N];p+=I,console.log(`drawing angle ${N}:
112
+ angle: ${I}
113
+ angleSum: ${p}
114
+ `);let O;const V=p-I;N===a.question.value.angles.length-1?O=180:O=p;const U=new b.Point(S/2+30*Xo(C+V),M/2+30*Qo(C+V)),D=f(b,S,C,V,O,M),me=new b.Point(S/2+30*Xo(C+O),M/2+30*Qo(C+O)),B=S*Xo(C+p),ie=S*Qo(C+p),he=new b.Path.Line({from:new b.Point(S/2,M/2),to:new b.Point(S/2+B,M/2+ie)});if(he.strokeColor=new Ea.Color(0,0,0),E.push(he),a.question.value.targetAngleIndex===N){console.log(`drawing targetAngle at i = ${N}:
115
+ baseAngle: ${C}
116
+ targetAngle: ${I}
117
+ sum: ${p}
118
+ nextAngle: ${O}
119
+ `);const ae=new Ea.Color(.1,.5,.8,.35),fe=new b.Path.Arc({from:U,through:D,to:me});fe.strokeColor=new Ea.Color(.1,.5,.8,.75),fe.strokeWidth=3,fe.fillColor=ae;const le=new b.Path;le.closed=!0,le.add(U),le.add(new Ea.Point(S/2,M/2)),le.add(me),le.fillColor=ae}else{const ae=new Ea.PointText(D);ae.content=I.toString()+"°";let fe=!0,le=20;for(;fe;)fe=!1,ae.bounds.center=f(b,S,C,V,O,M,le),E.forEach(Y=>{Y.intersects(ae)&&(fe=!0)}),le+=7}}}),r3(()=>{h.value=void 0}),{answer:o,canvasRef:l,...n,...a}}}),Nx={"data-viewable":"CalculateSupplementaryAngle"},Lx={ref:"canvasRef",width:"300",height:"300"};function Ox(e,t,n,a,o,l){const h=hr("user-input-number");return St(),Pt("div",Nx,[t[1]||(t[1]=ht("h2",null,"What is the measurement of the highlighted angle?",-1)),ht("canvas",Lx,null,512),t[2]||(t[2]=ht("br",null,null,-1)),xr(h,{modelValue:e.answer,"onUpdate:modelValue":t[0]||(t[0]=f=>e.answer=f)},null,8,["modelValue"])])}const Dx=Ur(Ix,[["render",Ox],["__scopeId","data-v-4f8ac466"]]),Rx={instructions:"Must be 2 or 3.",test:e=>e==="2"||e==="3"?{status:ur.ok,msg:""}:{status:ur.error,msg:"Must be 2 or 3."}},Bx=[{name:"AngleCount",type:br.INT,validator:Rx}],a1=class yd extends fi{constructor(t){super(t),rt(this,"angles",[]),rt(this,"targetAngleIndex"),rt(this,"angleCount"),this.angleCount=t[0].AngleCount;let n=0;for(let a=0;a<=this.angleCount-2;a++){const o=ks(25,155-n);this.angles.push(o),n+=o}this.angles.push(180-n),this.targetAngleIndex=ks(0,this.angleCount-1)}isCorrect(t){return this.angles[this.targetAngleIndex]===t}dataShapes(){return yd.dataShapes}views(){return yd.views}};rt(a1,"dataShapes",[{name:di.MATH_SupplimentaryAngles,fields:Bx}]);rt(a1,"views",[Dx]);let Y3=a1;const qx=Vr({name:"VerbalAddition",props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"VerbalAddition"),a=ii(n),o=Lt(["","","","",""]);a.question.value=new Sd(e.data);const l=Sr(()=>a.question.value?a.question.value:new Sd(e.data)),h=f=>{var b,S,M,C,y,g;console.log(`change in ${f}!
120
+ userAnswer: ${o.value.toString()}
121
+
122
+ qAnswer: ${(b=l.value)==null?void 0:b.answer.toString()}`),l.value&&l.value.answer[f].toString().length===o.value[f].length&&(parseInt(o.value[f])===l.value.answer[f]?((S=document.getElementById("input"+f))==null||S.classList.add("correct"),(M=document.getElementById("input"+f))==null||M.classList.remove("incorrect"),(C=document.getElementById("input"+f))==null||C.setAttribute("disabled","true"),f+1<o.value.length?(y=document.getElementById("input"+(f+1)))==null||y.focus():a.submitAnswer(o.value)):((g=document.getElementById("input"+f))==null||g.classList.add("incorrect"),a.submitAnswer(o.value),console.log(`Wrong! ${o.value[f]} !== ${l.value.answer[f]}`)))};return Nn(()=>{var f;console.log("focusing..."),(f=document.getElementById("input0"))==null||f.focus()}),{...n,...a,answer:o,question:l,track:h}}}),Fx={"data-viewable":"VerbalAddition",class:"text-h5"},zx={class:"text-h5"},Hx=["value"],Vx=["id","onUpdate:modelValue","autofocus","onKeyup"],Ux={key:0};function Gx(e,t,n,a,o,l){var h;return St(),Pt("div",Fx,[ht("div",zx,[t[0]||(t[0]=Qr(" Count by ")),ht("strong",null,ir((h=e.question)==null?void 0:h.n),1),t[1]||(t[1]=Qr("s: "))]),ht("input",{type:"text",disabled:"",class:"correct",value:e.question.answer[0]-e.question.n},null,8,Hx),t[2]||(t[2]=Qr(", ")),(St(!0),Pt(qr,null,An(e.question.answer,(f,b)=>(St(),Pt("span",{key:b},[c7(ht("input",{id:`input${b}`,ref_for:!0,ref:`input${b}`,class:h7(`input${f}${b}`),"onUpdate:modelValue":S=>e.answer[b]=S,type:"text",autofocus:b===0,onKeyup:S=>e.track(b)},null,42,Vx),[[u7,e.answer[b]]]),b!==e.question.answer.length-1?(St(),Pt("span",Ux,", ")):Or("",!0)]))),128))])}const Yx=Ur(qx,[["render",Gx],["__scopeId","data-v-0452c3a5"]]),Wx=[{name:"n",type:br.INT},{name:"hand",type:br.STRING,validator:{test:e=>e==="LEFT"||e==="RIGHT"?{status:ur.ok,msg:""}:{status:ur.error,msg:"Hand must be LEFT or RIGHT"}}}],$x=function(){const e=[];for(let t=2;t<=10;t++)e.push({n:t,hand:"LEFT"}),e.push({n:t,hand:"RIGHT"});return e};function Kx(e){return typeof e=="string"?parseInt(e):e}const v0=class wd extends fi{constructor(t){super(t),rt(this,"n"),rt(this,"hand"),this.n=t[0].n,this.hand=t[0].hand}get answer(){const t=[],n=this.hand==="LEFT"?this.n:6*this.n;for(let a=0;a<5;a++)t.push(n+a*this.n);return t}isCorrect(t){console.log(`Solution: ${this.answer.toString()}`);for(let n=0;n<this.answer.length;n++)if(Kx(t[n])!==this.answer[n])return console.log(`answer[${n}] == ${t[n]} !== ${this.answer[n]}`),!1;return!0}dataShapes(){return wd.dataShapes}views(){return wd.views}};rt(v0,"dataShapes",[{name:di.MATH_CountBy,fields:Wx}]);rt(v0,"views",[Yx]);rt(v0,"seedData",$x());rt(v0,"acceptsUserData",!1);let Sd=v0;const W3=new Ns("math",[V3,r1,Jd,md,U3,G3,Y3,Sd]);var vl={exports:{}},jx=vl.exports,nv;function Xx(){return nv||(nv=1,function(e){(function(t){function n(){if(n.prototype._singleton)throw new Error("WebMidi is a singleton, it cannot be instantiated directly.");(n.prototype._singleton=this)._inputs=[],this._outputs=[],this._userHandlers={},this._stateChangeQueue=[],this._processingStateChange=!1,this._midiInterfaceEvents=["connected","disconnected"],this._nrpnBuffer=[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],this._nrpnEventsEnabled=!0,this._nrpnTypes=["entry","increment","decrement"],this._notes=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],this._semitones={C:0,D:2,E:4,F:5,G:7,A:9,B:11},Object.defineProperties(this,{MIDI_SYSTEM_MESSAGES:{value:{sysex:240,timecode:241,songposition:242,songselect:243,tuningrequest:246,sysexend:247,clock:248,start:250,continue:251,stop:252,activesensing:254,reset:255,midimessage:0,unknownsystemmessage:-1},writable:!1,enumerable:!0,configurable:!1},MIDI_CHANNEL_MESSAGES:{value:{noteoff:8,noteon:9,keyaftertouch:10,controlchange:11,channelmode:11,nrpn:11,programchange:12,channelaftertouch:13,pitchbend:14},writable:!1,enumerable:!0,configurable:!1},MIDI_REGISTERED_PARAMETER:{value:{pitchbendrange:[0,0],channelfinetuning:[0,1],channelcoarsetuning:[0,2],tuningprogram:[0,3],tuningbank:[0,4],modulationrange:[0,5],azimuthangle:[61,0],elevationangle:[61,1],gain:[61,2],distanceratio:[61,3],maximumdistance:[61,4],maximumdistancegain:[61,5],referencedistanceratio:[61,6],panspreadangle:[61,7],rollangle:[61,8]},writable:!1,enumerable:!0,configurable:!1},MIDI_CONTROL_CHANGE_MESSAGES:{value:{bankselectcoarse:0,modulationwheelcoarse:1,breathcontrollercoarse:2,footcontrollercoarse:4,portamentotimecoarse:5,dataentrycoarse:6,volumecoarse:7,balancecoarse:8,pancoarse:10,expressioncoarse:11,effectcontrol1coarse:12,effectcontrol2coarse:13,generalpurposeslider1:16,generalpurposeslider2:17,generalpurposeslider3:18,generalpurposeslider4:19,bankselectfine:32,modulationwheelfine:33,breathcontrollerfine:34,footcontrollerfine:36,portamentotimefine:37,dataentryfine:38,volumefine:39,balancefine:40,panfine:42,expressionfine:43,effectcontrol1fine:44,effectcontrol2fine:45,holdpedal:64,portamento:65,sustenutopedal:66,softpedal:67,legatopedal:68,hold2pedal:69,soundvariation:70,resonance:71,soundreleasetime:72,soundattacktime:73,brightness:74,soundcontrol6:75,soundcontrol7:76,soundcontrol8:77,soundcontrol9:78,soundcontrol10:79,generalpurposebutton1:80,generalpurposebutton2:81,generalpurposebutton3:82,generalpurposebutton4:83,reverblevel:91,tremololevel:92,choruslevel:93,celestelevel:94,phaserlevel:95,databuttonincrement:96,databuttondecrement:97,nonregisteredparametercoarse:98,nonregisteredparameterfine:99,registeredparametercoarse:100,registeredparameterfine:101},writable:!1,enumerable:!0,configurable:!1},MIDI_NRPN_MESSAGES:{value:{entrymsb:6,entrylsb:38,increment:96,decrement:97,paramlsb:98,parammsb:99,nullactiveparameter:127},writable:!1,enumerable:!0,configurable:!1},MIDI_CHANNEL_MODE_MESSAGES:{value:{allsoundoff:120,resetallcontrollers:121,localcontrol:122,allnotesoff:123,omnimodeoff:124,omnimodeon:125,monomodeon:126,polymodeon:127},writable:!1,enumerable:!0,configurable:!1},octaveOffset:{value:0,writable:!0,enumerable:!0,configurable:!1}}),Object.defineProperties(this,{supported:{enumerable:!0,get:function(){return"requestMIDIAccess"in navigator}},enabled:{enumerable:!0,get:function(){return this.interface!==void 0}.bind(this)},inputs:{enumerable:!0,get:function(){return this._inputs}.bind(this)},outputs:{enumerable:!0,get:function(){return this._outputs}.bind(this)},sysexEnabled:{enumerable:!0,get:function(){return!(!this.interface||!this.interface.sysexEnabled)}.bind(this)},nrpnEventsEnabled:{enumerable:!0,get:function(){return!!this._nrpnEventsEnabled}.bind(this),set:function(h){return this._nrpnEventsEnabled=h,this._nrpnEventsEnabled}},nrpnTypes:{enumerable:!0,get:function(){return this._nrpnTypes}.bind(this)},time:{enumerable:!0,get:function(){return performance.now()}}})}var a=new n;function o(h){var f=this;this._userHandlers={channel:{},system:{}},this._midiInput=h,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return f._midiInput.connection}},id:{enumerable:!0,get:function(){return f._midiInput.id}},manufacturer:{enumerable:!0,get:function(){return f._midiInput.manufacturer}},name:{enumerable:!0,get:function(){return f._midiInput.name}},state:{enumerable:!0,get:function(){return f._midiInput.state}},type:{enumerable:!0,get:function(){return f._midiInput.type}}}),this._initializeUserHandlers(),this._midiInput.onmidimessage=this._onMidiMessage.bind(this)}function l(h){var f=this;this._midiOutput=h,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return f._midiOutput.connection}},id:{enumerable:!0,get:function(){return f._midiOutput.id}},manufacturer:{enumerable:!0,get:function(){return f._midiOutput.manufacturer}},name:{enumerable:!0,get:function(){return f._midiOutput.name}},state:{enumerable:!0,get:function(){return f._midiOutput.state}},type:{enumerable:!0,get:function(){return f._midiOutput.type}}})}n.prototype.enable=function(h,f){this.enabled||(this.supported?navigator.requestMIDIAccess({sysex:f}).then(function(b){var S,M=[],C=[];this.interface=b,this._resetInterfaceUserHandlers(),this.interface.onstatechange=function(N){M.push(N)};for(var y=b.inputs.values(),g=y.next();g&&!g.done;g=y.next())C.push(g.value.open());for(var w=b.outputs.values(),p=w.next();p&&!p.done;p=w.next())C.push(p.value.open());function E(){clearTimeout(S),this._updateInputsAndOutputs(),this.interface.onstatechange=this._onInterfaceStateChange.bind(this),typeof h=="function"&&h.call(this),M.forEach(function(N){this._onInterfaceStateChange(N)}.bind(this))}S=setTimeout(E.bind(this),200),Promise&&Promise.all(C).catch(function(N){}).then(E.bind(this))}.bind(this),function(b){typeof h=="function"&&h.call(this,b)}.bind(this)):typeof h=="function"&&h(new Error("The Web MIDI API is not supported by your browser.")))},n.prototype.disable=function(){if(!this.supported)throw new Error("The Web MIDI API is not supported by your browser.");this.enabled&&(this.removeListener(),this.inputs.forEach(function(h){h.removeListener()})),this.interface&&(this.interface.onstatechange=void 0),this.interface=void 0,this._inputs=[],this._outputs=[],this._nrpnEventsEnabled=!0,this._resetInterfaceUserHandlers()},n.prototype.addListener=function(h,f){if(!this.enabled)throw new Error("WebMidi must be enabled before adding event listeners.");if(typeof f!="function")throw new TypeError("The 'listener' parameter must be a function.");if(!(0<=this._midiInterfaceEvents.indexOf(h)))throw new TypeError("The specified event type is not supported.");return this._userHandlers[h].push(f),this},n.prototype.hasListener=function(h,f){if(!this.enabled)throw new Error("WebMidi must be enabled before checking event listeners.");if(typeof f!="function")throw new TypeError("The 'listener' parameter must be a function.");if(!(0<=this._midiInterfaceEvents.indexOf(h)))throw new TypeError("The specified event type is not supported.");for(var b=0;b<this._userHandlers[h].length;b++)if(this._userHandlers[h][b]===f)return!0;return!1},n.prototype.removeListener=function(h,f){if(!this.enabled)throw new Error("WebMidi must be enabled before removing event listeners.");if(f!==void 0&&typeof f!="function")throw new TypeError("The 'listener' parameter must be a function.");if(0<=this._midiInterfaceEvents.indexOf(h))if(f)for(var b=0;b<this._userHandlers[h].length;b++)this._userHandlers[h][b]===f&&this._userHandlers[h].splice(b,1);else this._userHandlers[h]=[];else{if(h!==void 0)throw new TypeError("The specified event type is not supported.");this._resetInterfaceUserHandlers()}return this},n.prototype.toMIDIChannels=function(h){var f;if(h==="all"||h===void 0)f=["all"];else{if(h==="none")return f=[];f=Array.isArray(h)?h:[h]}return-1<f.indexOf("all")&&(f=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),f.map(function(b){return parseInt(b)}).filter(function(b){return 1<=b&&b<=16})},n.prototype.getInputById=function(h){if(!this.enabled)throw new Error("WebMidi is not enabled.");h=String(h);for(var f=0;f<this.inputs.length;f++)if(this.inputs[f].id===h)return this.inputs[f];return!1},n.prototype.getOutputById=function(h){if(!this.enabled)throw new Error("WebMidi is not enabled.");h=String(h);for(var f=0;f<this.outputs.length;f++)if(this.outputs[f].id===h)return this.outputs[f];return!1},n.prototype.getInputByName=function(h){if(!this.enabled)throw new Error("WebMidi is not enabled.");for(var f=0;f<this.inputs.length;f++)if(~this.inputs[f].name.indexOf(h))return this.inputs[f];return!1},n.prototype.getOctave=function(h){if(h!=null&&0<=h&&h<=127)return Math.floor(Math.floor(h)/12-1)+Math.floor(a.octaveOffset)},n.prototype.getOutputByName=function(h){if(!this.enabled)throw new Error("WebMidi is not enabled.");for(var f=0;f<this.outputs.length;f++)if(~this.outputs[f].name.indexOf(h))return this.outputs[f];return!1},n.prototype.guessNoteNumber=function(h){var f=!1;if(h&&h.toFixed&&0<=h&&h<=127?f=Math.round(h):0<=parseInt(h)&&parseInt(h)<=127?f=parseInt(h):(typeof h=="string"||h instanceof String)&&(f=this.noteNameToNumber(h)),f===!1)throw new Error("Invalid input value ("+h+").");return f},n.prototype.noteNameToNumber=function(h){typeof h!="string"&&(h="");var f=h.match(/([CDEFGAB])(#{0,2}|b{0,2})(-?\d+)/i);if(!f)throw new RangeError("Invalid note name.");var b=a._semitones[f[1].toUpperCase()],S=12*(parseInt(f[3])+1-Math.floor(a.octaveOffset))+b;if(-1<f[2].toLowerCase().indexOf("b")?S-=f[2].length:-1<f[2].toLowerCase().indexOf("#")&&(S+=f[2].length),S<0||127<S)throw new RangeError("Invalid note name or note outside valid range.");return S},n.prototype._updateInputsAndOutputs=function(){this._updateInputs(),this._updateOutputs()},n.prototype._updateInputs=function(){for(var h=0;h<this._inputs.length;h++){for(var f=!0,b=this.interface.inputs.values(),S=b.next();S&&!S.done;S=b.next())if(this._inputs[h]._midiInput===S.value){f=!1;break}f&&this._inputs.splice(h,1)}this.interface&&this.interface.inputs.forEach(function(M){for(var C=!0,y=0;y<this._inputs.length;y++)this._inputs[y]._midiInput===M&&(C=!1);C&&this._inputs.push(new o(M))}.bind(this))},n.prototype._updateOutputs=function(){for(var h=0;h<this._outputs.length;h++){for(var f=!0,b=this.interface.outputs.values(),S=b.next();S&&!S.done;S=b.next())if(this._outputs[h]._midiOutput===S.value){f=!1;break}f&&this._outputs.splice(h,1)}this.interface&&this.interface.outputs.forEach(function(M){for(var C=!0,y=0;y<this._outputs.length;y++)this._outputs[y]._midiOutput===M&&(C=!1);C&&this._outputs.push(new l(M))}.bind(this))},n.prototype._onInterfaceStateChange=function(h){this._updateInputsAndOutputs();var f={timestamp:h.timeStamp,type:h.port.state};this.interface&&h.port.state==="connected"?h.port.type==="output"?f.port=this.getOutputById(h.port.id):h.port.type==="input"&&(f.port=this.getInputById(h.port.id)):f.port={connection:"closed",id:h.port.id,manufacturer:h.port.manufacturer,name:h.port.name,state:h.port.state,type:h.port.type},this._userHandlers[h.port.state].forEach(function(b){b(f)})},n.prototype._resetInterfaceUserHandlers=function(){for(var h=0;h<this._midiInterfaceEvents.length;h++)this._userHandlers[this._midiInterfaceEvents[h]]=[]},o.prototype.on=o.prototype.addListener=function(h,f,b){var S=this;if(f===void 0&&(f="all"),Array.isArray(f)||(f=[f]),f.forEach(function(C){if(C!=="all"&&!(1<=C&&C<=16))throw new RangeError("The 'channel' parameter is invalid.")}),typeof b!="function")throw new TypeError("The 'listener' parameter must be a function.");if(a.MIDI_SYSTEM_MESSAGES[h]!==void 0)this._userHandlers.system[h]||(this._userHandlers.system[h]=[]),this._userHandlers.system[h].push(b);else{if(a.MIDI_CHANNEL_MESSAGES[h]===void 0)throw new TypeError("The specified event type is not supported.");if(-1<f.indexOf("all")){f=[];for(var M=1;M<=16;M++)f.push(M)}this._userHandlers.channel[h]||(this._userHandlers.channel[h]=[]),f.forEach(function(C){S._userHandlers.channel[h][C]||(S._userHandlers.channel[h][C]=[]),S._userHandlers.channel[h][C].push(b)})}return this},o.prototype.hasListener=function(h,f,b){var S=this;if(typeof b!="function")throw new TypeError("The 'listener' parameter must be a function.");if(f===void 0&&(f="all"),f.constructor!==Array&&(f=[f]),a.MIDI_SYSTEM_MESSAGES[h]!==void 0){for(var M=0;M<this._userHandlers.system[h].length;M++)if(this._userHandlers.system[h][M]===b)return!0}else if(a.MIDI_CHANNEL_MESSAGES[h]!==void 0){if(-1<f.indexOf("all")){f=[];for(var C=1;C<=16;C++)f.push(C)}return!!this._userHandlers.channel[h]&&f.every(function(y){var g=S._userHandlers.channel[h][y];return g&&-1<g.indexOf(b)})}return!1},o.prototype.removeListener=function(h,f,b){var S=this;if(b!==void 0&&typeof b!="function")throw new TypeError("The 'listener' parameter must be a function.");if(f===void 0&&(f="all"),f.constructor!==Array&&(f=[f]),a.MIDI_SYSTEM_MESSAGES[h]!==void 0)if(b===void 0)this._userHandlers.system[h]=[];else for(var M=0;M<this._userHandlers.system[h].length;M++)this._userHandlers.system[h][M]===b&&this._userHandlers.system[h].splice(M,1);else if(a.MIDI_CHANNEL_MESSAGES[h]!==void 0){if(-1<f.indexOf("all")){f=[];for(var C=1;C<=16;C++)f.push(C)}if(!this._userHandlers.channel[h])return this;f.forEach(function(y){var g=S._userHandlers.channel[h][y];if(g)if(b===void 0)S._userHandlers.channel[h][y]=[];else for(var w=0;w<g.length;w++)g[w]===b&&g.splice(w,1)})}else{if(h!==void 0)throw new TypeError("The specified event type is not supported.");this._initializeUserHandlers()}return this},o.prototype._initializeUserHandlers=function(){for(var h in a.MIDI_CHANNEL_MESSAGES)Object.prototype.hasOwnProperty.call(a.MIDI_CHANNEL_MESSAGES,h)&&(this._userHandlers.channel[h]={});for(var f in a.MIDI_SYSTEM_MESSAGES)Object.prototype.hasOwnProperty.call(a.MIDI_SYSTEM_MESSAGES,f)&&(this._userHandlers.system[f]=[])},o.prototype._onMidiMessage=function(h){if(0<this._userHandlers.system.midimessage.length){var f={target:this,data:h.data,timestamp:h.timeStamp,type:"midimessage"};this._userHandlers.system.midimessage.forEach(function(b){b(f)})}h.data[0]<240?(this._parseChannelEvent(h),this._parseNrpnEvent(h)):h.data[0]<=255&&this._parseSystemEvent(h)},o.prototype._parseNrpnEvent=function(h){var f,b,S=h.data[0]>>4,M=15&h.data[0],C=1+M;if(1<h.data.length&&(f=h.data[1],b=2<h.data.length?h.data[2]:void 0),a.nrpnEventsEnabled&&S===a.MIDI_CHANNEL_MESSAGES.controlchange&&(f>=a.MIDI_NRPN_MESSAGES.increment&&f<=a.MIDI_NRPN_MESSAGES.parammsb||f===a.MIDI_NRPN_MESSAGES.entrymsb||f===a.MIDI_NRPN_MESSAGES.entrylsb)){var y={target:this,type:"controlchange",data:h.data,timestamp:h.timeStamp,channel:C,controller:{number:f,name:this.getCcNameByNumber(f)},value:b};if(y.controller.number===a.MIDI_NRPN_MESSAGES.parammsb&&y.value!=a.MIDI_NRPN_MESSAGES.nullactiveparameter)a._nrpnBuffer[M]=[],a._nrpnBuffer[M][0]=y;else if(a._nrpnBuffer[M].length===1&&y.controller.number===a.MIDI_NRPN_MESSAGES.paramlsb)a._nrpnBuffer[M].push(y);else if(a._nrpnBuffer[M].length!==2||y.controller.number!==a.MIDI_NRPN_MESSAGES.increment&&y.controller.number!==a.MIDI_NRPN_MESSAGES.decrement&&y.controller.number!==a.MIDI_NRPN_MESSAGES.entrymsb)if(a._nrpnBuffer[M].length===3&&a._nrpnBuffer[M][2].number===a.MIDI_NRPN_MESSAGES.entrymsb&&y.controller.number===a.MIDI_NRPN_MESSAGES.entrylsb)a._nrpnBuffer[M].push(y);else if(3<=a._nrpnBuffer[M].length&&a._nrpnBuffer[M].length<=4&&y.controller.number===a.MIDI_NRPN_MESSAGES.parammsb&&y.value===a.MIDI_NRPN_MESSAGES.nullactiveparameter)a._nrpnBuffer[M].push(y);else if(4<=a._nrpnBuffer[M].length&&a._nrpnBuffer[M].length<=5&&y.controller.number===a.MIDI_NRPN_MESSAGES.paramlsb&&y.value===a.MIDI_NRPN_MESSAGES.nullactiveparameter){a._nrpnBuffer[M].push(y);var g=[];a._nrpnBuffer[M].forEach(function(I){g.push(I.data)});var w=a._nrpnBuffer[M][0].value<<7|a._nrpnBuffer[M][1].value,p=a._nrpnBuffer[M][2].value;a._nrpnBuffer[M].length===6&&(p=a._nrpnBuffer[M][2].value<<7|a._nrpnBuffer[M][3].value);var E="";switch(a._nrpnBuffer[M][2].controller.number){case a.MIDI_NRPN_MESSAGES.entrymsb:E=a._nrpnTypes[0];break;case a.MIDI_NRPN_MESSAGES.increment:E=a._nrpnTypes[1];break;case a.MIDI_NRPN_MESSAGES.decrement:E=a._nrpnTypes[2];break;default:throw new Error("The NPRN type was unidentifiable.")}var N={timestamp:y.timestamp,channel:y.channel,type:"nrpn",data:g,controller:{number:w,type:E,name:"Non-Registered Parameter "+w},value:p};a._nrpnBuffer[M]=[],this._userHandlers.channel[N.type]&&this._userHandlers.channel[N.type][N.channel]&&this._userHandlers.channel[N.type][N.channel].forEach(function(I){I(N)})}else a._nrpnBuffer[M]=[];else a._nrpnBuffer[M].push(y)}},o.prototype._parseChannelEvent=function(h){var f,b,S=h.data[0]>>4,M=1+(15&h.data[0]);1<h.data.length&&(f=h.data[1],b=2<h.data.length?h.data[2]:void 0);var C={target:this,data:h.data,timestamp:h.timeStamp,channel:M};S===a.MIDI_CHANNEL_MESSAGES.noteoff||S===a.MIDI_CHANNEL_MESSAGES.noteon&&b===0?(C.type="noteoff",C.note={number:f,name:a._notes[f%12],octave:a.getOctave(f)},C.velocity=b/127,C.rawVelocity=b):S===a.MIDI_CHANNEL_MESSAGES.noteon?(C.type="noteon",C.note={number:f,name:a._notes[f%12],octave:a.getOctave(f)},C.velocity=b/127,C.rawVelocity=b):S===a.MIDI_CHANNEL_MESSAGES.keyaftertouch?(C.type="keyaftertouch",C.note={number:f,name:a._notes[f%12],octave:a.getOctave(f)},C.value=b/127):S===a.MIDI_CHANNEL_MESSAGES.controlchange&&0<=f&&f<=119?(C.type="controlchange",C.controller={number:f,name:this.getCcNameByNumber(f)},C.value=b):S===a.MIDI_CHANNEL_MESSAGES.channelmode&&120<=f&&f<=127?(C.type="channelmode",C.controller={number:f,name:this.getChannelModeByNumber(f)},C.value=b):S===a.MIDI_CHANNEL_MESSAGES.programchange?(C.type="programchange",C.value=f):S===a.MIDI_CHANNEL_MESSAGES.channelaftertouch?(C.type="channelaftertouch",C.value=f/127):S===a.MIDI_CHANNEL_MESSAGES.pitchbend?(C.type="pitchbend",C.value=((b<<7)+f-8192)/8192):C.type="unknownchannelmessage",this._userHandlers.channel[C.type]&&this._userHandlers.channel[C.type][M]&&this._userHandlers.channel[C.type][M].forEach(function(y){y(C)})},o.prototype.getCcNameByNumber=function(h){if(!(0<=(h=Math.floor(h))&&h<=119))throw new RangeError("The control change number must be between 0 and 119.");for(var f in a.MIDI_CONTROL_CHANGE_MESSAGES)if(Object.prototype.hasOwnProperty.call(a.MIDI_CONTROL_CHANGE_MESSAGES,f)&&h===a.MIDI_CONTROL_CHANGE_MESSAGES[f])return f},o.prototype.getChannelModeByNumber=function(h){if(!(120<=(h=Math.floor(h))&&status<=127))throw new RangeError("The control change number must be between 120 and 127.");for(var f in a.MIDI_CHANNEL_MODE_MESSAGES)if(Object.prototype.hasOwnProperty.call(a.MIDI_CHANNEL_MODE_MESSAGES,f)&&h===a.MIDI_CHANNEL_MODE_MESSAGES[f])return f},o.prototype._parseSystemEvent=function(h){var f=h.data[0],b={target:this,data:h.data,timestamp:h.timeStamp};f===a.MIDI_SYSTEM_MESSAGES.sysex?b.type="sysex":f===a.MIDI_SYSTEM_MESSAGES.timecode?b.type="timecode":f===a.MIDI_SYSTEM_MESSAGES.songposition?b.type="songposition":f===a.MIDI_SYSTEM_MESSAGES.songselect?(b.type="songselect",b.song=h.data[1]):f===a.MIDI_SYSTEM_MESSAGES.tuningrequest?b.type="tuningrequest":f===a.MIDI_SYSTEM_MESSAGES.clock?b.type="clock":f===a.MIDI_SYSTEM_MESSAGES.start?b.type="start":f===a.MIDI_SYSTEM_MESSAGES.continue?b.type="continue":f===a.MIDI_SYSTEM_MESSAGES.stop?b.type="stop":f===a.MIDI_SYSTEM_MESSAGES.activesensing?b.type="activesensing":f===a.MIDI_SYSTEM_MESSAGES.reset?b.type="reset":b.type="unknownsystemmessage",this._userHandlers.system[b.type]&&this._userHandlers.system[b.type].forEach(function(S){S(b)})},l.prototype.send=function(h,f,b){if(!(128<=h&&h<=255))throw new RangeError("The status byte must be an integer between 128 (0x80) and 255 (0xFF).");f===void 0&&(f=[]),Array.isArray(f)||(f=[f]);var S=[];return f.forEach(function(M){var C=Math.floor(M);if(!(0<=C&&C<=255))throw new RangeError("Data bytes must be integers between 0 (0x00) and 255 (0xFF).");S.push(C)}),this._midiOutput.send([h].concat(S),parseFloat(b)||0),this},l.prototype.sendSysex=function(h,f,b){if(!a.sysexEnabled)throw new Error("Sysex message support must first be activated.");return b=b||{},h=[].concat(h),f.forEach(function(S){if(S<0||127<S)throw new RangeError("The data bytes of a sysex message must be integers between 0 (0x00) and 127 (0x7F).")}),f=h.concat(f,a.MIDI_SYSTEM_MESSAGES.sysexend),this.send(a.MIDI_SYSTEM_MESSAGES.sysex,f,this._parseTimeParameter(b.time)),this},l.prototype.sendTimecodeQuarterFrame=function(h,f){return f=f||{},this.send(a.MIDI_SYSTEM_MESSAGES.timecode,h,this._parseTimeParameter(f.time)),this},l.prototype.sendSongPosition=function(h,f){f=f||{};var b=(h=Math.floor(h)||0)>>7&127,S=127&h;return this.send(a.MIDI_SYSTEM_MESSAGES.songposition,[b,S],this._parseTimeParameter(f.time)),this},l.prototype.sendSongSelect=function(h,f){if(f=f||{},!(0<=(h=Math.floor(h))&&h<=127))throw new RangeError("The song number must be between 0 and 127.");return this.send(a.MIDI_SYSTEM_MESSAGES.songselect,[h],this._parseTimeParameter(f.time)),this},l.prototype.sendTuningRequest=function(h){return h=h||{},this.send(a.MIDI_SYSTEM_MESSAGES.tuningrequest,void 0,this._parseTimeParameter(h.time)),this},l.prototype.sendClock=function(h){return h=h||{},this.send(a.MIDI_SYSTEM_MESSAGES.clock,void 0,this._parseTimeParameter(h.time)),this},l.prototype.sendStart=function(h){return h=h||{},this.send(a.MIDI_SYSTEM_MESSAGES.start,void 0,this._parseTimeParameter(h.time)),this},l.prototype.sendContinue=function(h){return h=h||{},this.send(a.MIDI_SYSTEM_MESSAGES.continue,void 0,this._parseTimeParameter(h.time)),this},l.prototype.sendStop=function(h){return h=h||{},this.send(a.MIDI_SYSTEM_MESSAGES.stop,void 0,this._parseTimeParameter(h.time)),this},l.prototype.sendActiveSensing=function(h){return h=h||{},this.send(a.MIDI_SYSTEM_MESSAGES.activesensing,[],this._parseTimeParameter(h.time)),this},l.prototype.sendReset=function(h){return h=h||{},this.send(a.MIDI_SYSTEM_MESSAGES.reset,void 0,this._parseTimeParameter(h.time)),this},l.prototype.stopNote=function(h,f,b){if(h==="all")return this.sendChannelMode("allnotesoff",0,f,b);var S=64;return(b=b||{}).rawVelocity?!isNaN(b.velocity)&&0<=b.velocity&&b.velocity<=127&&(S=b.velocity):!isNaN(b.velocity)&&0<=b.velocity&&b.velocity<=1&&(S=127*b.velocity),this._convertNoteToArray(h).forEach(function(M){a.toMIDIChannels(f).forEach(function(C){this.send((a.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(C-1),[M,Math.round(S)],this._parseTimeParameter(b.time))}.bind(this))}.bind(this)),this},l.prototype.playNote=function(h,f,b){var S,M=64;if((b=b||{}).rawVelocity?!isNaN(b.velocity)&&0<=b.velocity&&b.velocity<=127&&(M=b.velocity):!isNaN(b.velocity)&&0<=b.velocity&&b.velocity<=1&&(M=127*b.velocity),S=this._parseTimeParameter(b.time),this._convertNoteToArray(h).forEach(function(y){a.toMIDIChannels(f).forEach(function(g){this.send((a.MIDI_CHANNEL_MESSAGES.noteon<<4)+(g-1),[y,Math.round(M)],S)}.bind(this))}.bind(this)),!isNaN(b.duration)){b.duration<=0&&(b.duration=0);var C=64;b.rawVelocity?!isNaN(b.release)&&0<=b.release&&b.release<=127&&(C=b.release):!isNaN(b.release)&&0<=b.release&&b.release<=1&&(C=127*b.release),this._convertNoteToArray(h).forEach(function(y){a.toMIDIChannels(f).forEach(function(g){this.send((a.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(g-1),[y,Math.round(C)],(S||a.time)+b.duration)}.bind(this))}.bind(this))}return this},l.prototype.sendKeyAftertouch=function(h,f,b,S){var M=this;if(S=S||{},f<1||16<f)throw new RangeError("The channel must be between 1 and 16.");(isNaN(b)||b<0||1<b)&&(b=.5);var C=Math.round(127*b);return this._convertNoteToArray(h).forEach(function(y){a.toMIDIChannels(f).forEach(function(g){M.send((a.MIDI_CHANNEL_MESSAGES.keyaftertouch<<4)+(g-1),[y,C],M._parseTimeParameter(S.time))})}),this},l.prototype.sendControlChange=function(h,f,b,S){if(S=S||{},typeof h=="string"){if((h=a.MIDI_CONTROL_CHANGE_MESSAGES[h])===void 0)throw new TypeError("Invalid controller name.")}else if(!(0<=(h=Math.floor(h))&&h<=119))throw new RangeError("Controller numbers must be between 0 and 119.");if(!(0<=(f=Math.floor(f)||0)&&f<=127))throw new RangeError("Controller value must be between 0 and 127.");return a.toMIDIChannels(b).forEach(function(M){this.send((a.MIDI_CHANNEL_MESSAGES.controlchange<<4)+(M-1),[h,f],this._parseTimeParameter(S.time))}.bind(this)),this},l.prototype._selectRegisteredParameter=function(h,f,b){var S=this;if(h[0]=Math.floor(h[0]),!(0<=h[0]&&h[0]<=127))throw new RangeError("The control65 value must be between 0 and 127");if(h[1]=Math.floor(h[1]),!(0<=h[1]&&h[1]<=127))throw new RangeError("The control64 value must be between 0 and 127");return a.toMIDIChannels(f).forEach(function(){S.sendControlChange(101,h[0],f,{time:b}),S.sendControlChange(100,h[1],f,{time:b})}),this},l.prototype._selectNonRegisteredParameter=function(h,f,b){var S=this;if(h[0]=Math.floor(h[0]),!(0<=h[0]&&h[0]<=127))throw new RangeError("The control63 value must be between 0 and 127");if(h[1]=Math.floor(h[1]),!(0<=h[1]&&h[1]<=127))throw new RangeError("The control62 value must be between 0 and 127");return a.toMIDIChannels(f).forEach(function(){S.sendControlChange(99,h[0],f,{time:b}),S.sendControlChange(98,h[1],f,{time:b})}),this},l.prototype._setCurrentRegisteredParameter=function(h,f,b){var S=this;if((h=[].concat(h))[0]=Math.floor(h[0]),!(0<=h[0]&&h[0]<=127))throw new RangeError("The msb value must be between 0 and 127");return a.toMIDIChannels(f).forEach(function(){S.sendControlChange(6,h[0],f,{time:b})}),h[1]=Math.floor(h[1]),0<=h[1]&&h[1]<=127&&a.toMIDIChannels(f).forEach(function(){S.sendControlChange(38,h[1],f,{time:b})}),this},l.prototype._deselectRegisteredParameter=function(h,f){var b=this;return a.toMIDIChannels(h).forEach(function(){b.sendControlChange(101,127,h,{time:f}),b.sendControlChange(100,127,h,{time:f})}),this},l.prototype.setRegisteredParameter=function(h,f,b,S){var M=this;if(S=S||{},!Array.isArray(h)){if(!a.MIDI_REGISTERED_PARAMETER[h])throw new Error("The specified parameter is not available.");h=a.MIDI_REGISTERED_PARAMETER[h]}return a.toMIDIChannels(b).forEach(function(){M._selectRegisteredParameter(h,b,S.time),M._setCurrentRegisteredParameter(f,b,S.time),M._deselectRegisteredParameter(b,S.time)}),this},l.prototype.setNonRegisteredParameter=function(h,f,b,S){var M=this;if(S=S||{},!(0<=h[0]&&h[0]<=127&&0<=h[1]&&h[1]<=127))throw new Error("Position 0 and 1 of the 2-position parameter array must both be between 0 and 127.");return f=[].concat(f),a.toMIDIChannels(b).forEach(function(){M._selectNonRegisteredParameter(h,b,S.time),M._setCurrentRegisteredParameter(f,b,S.time),M._deselectRegisteredParameter(b,S.time)}),this},l.prototype.incrementRegisteredParameter=function(h,f,b){var S=this;if(b=b||{},!Array.isArray(h)){if(!a.MIDI_REGISTERED_PARAMETER[h])throw new Error("The specified parameter is not available.");h=a.MIDI_REGISTERED_PARAMETER[h]}return a.toMIDIChannels(f).forEach(function(){S._selectRegisteredParameter(h,f,b.time),S.sendControlChange(96,0,f,{time:b.time}),S._deselectRegisteredParameter(f,b.time)}),this},l.prototype.decrementRegisteredParameter=function(h,f,b){if(b=b||{},!Array.isArray(h)){if(!a.MIDI_REGISTERED_PARAMETER[h])throw new TypeError("The specified parameter is not available.");h=a.MIDI_REGISTERED_PARAMETER[h]}return a.toMIDIChannels(f).forEach(function(){this._selectRegisteredParameter(h,f,b.time),this.sendControlChange(97,0,f,{time:b.time}),this._deselectRegisteredParameter(f,b.time)}.bind(this)),this},l.prototype.setPitchBendRange=function(h,f,b,S){var M=this;if(S=S||{},!(0<=(h=Math.floor(h)||0)&&h<=127))throw new RangeError("The semitones value must be between 0 and 127");if(!(0<=(f=Math.floor(f)||0)&&f<=127))throw new RangeError("The cents value must be between 0 and 127");return a.toMIDIChannels(b).forEach(function(){M.setRegisteredParameter("pitchbendrange",[h,f],b,{time:S.time})}),this},l.prototype.setModulationRange=function(h,f,b,S){var M=this;if(S=S||{},!(0<=(h=Math.floor(h)||0)&&h<=127))throw new RangeError("The semitones value must be between 0 and 127");if(!(0<=(f=Math.floor(f)||0)&&f<=127))throw new RangeError("The cents value must be between 0 and 127");return a.toMIDIChannels(b).forEach(function(){M.setRegisteredParameter("modulationrange",[h,f],b,{time:S.time})}),this},l.prototype.setMasterTuning=function(h,f,b){var S=this;if(b=b||{},(h=parseFloat(h)||0)<=-65||64<=h)throw new RangeError("The value must be a decimal number larger than -65 and smaller than 64.");var M=Math.floor(h)+64,C=h-Math.floor(h),y=(C=Math.round((C+1)/2*16383))>>7&127,g=127&C;return a.toMIDIChannels(f).forEach(function(){S.setRegisteredParameter("channelcoarsetuning",M,f,{time:b.time}),S.setRegisteredParameter("channelfinetuning",[y,g],f,{time:b.time})}),this},l.prototype.setTuningProgram=function(h,f,b){var S=this;if(b=b||{},!(0<=(h=Math.floor(h))&&h<=127))throw new RangeError("The program value must be between 0 and 127");return a.toMIDIChannels(f).forEach(function(){S.setRegisteredParameter("tuningprogram",h,f,{time:b.time})}),this},l.prototype.setTuningBank=function(h,f,b){var S=this;if(b=b||{},!(0<=(h=Math.floor(h)||0)&&h<=127))throw new RangeError("The bank value must be between 0 and 127");return a.toMIDIChannels(f).forEach(function(){S.setRegisteredParameter("tuningbank",h,f,{time:b.time})}),this},l.prototype.sendChannelMode=function(h,f,b,S){if(S=S||{},typeof h=="string"){if(!(h=a.MIDI_CHANNEL_MODE_MESSAGES[h]))throw new TypeError("Invalid channel mode message name.")}else if(!(120<=(h=Math.floor(h))&&h<=127))throw new RangeError("Channel mode numerical identifiers must be between 120 and 127.");if((f=Math.floor(f)||0)<0||127<f)throw new RangeError("Value must be an integer between 0 and 127.");return a.toMIDIChannels(b).forEach(function(M){this.send((a.MIDI_CHANNEL_MESSAGES.channelmode<<4)+(M-1),[h,f],this._parseTimeParameter(S.time))}.bind(this)),this},l.prototype.sendProgramChange=function(h,f,b){var S=this;if(b=b||{},h=Math.floor(h),isNaN(h)||h<0||127<h)throw new RangeError("Program numbers must be between 0 and 127.");return a.toMIDIChannels(f).forEach(function(M){S.send((a.MIDI_CHANNEL_MESSAGES.programchange<<4)+(M-1),[h],S._parseTimeParameter(b.time))}),this},l.prototype.sendChannelAftertouch=function(h,f,b){var S=this;b=b||{},h=parseFloat(h),(isNaN(h)||h<0||1<h)&&(h=.5);var M=Math.round(127*h);return a.toMIDIChannels(f).forEach(function(C){S.send((a.MIDI_CHANNEL_MESSAGES.channelaftertouch<<4)+(C-1),[M],S._parseTimeParameter(b.time))}),this},l.prototype.sendPitchBend=function(h,f,b){var S=this;if(b=b||{},isNaN(h)||h<-1||1<h)throw new RangeError("Pitch bend value must be between -1 and 1.");var M=Math.round((h+1)/2*16383),C=M>>7&127,y=127&M;return a.toMIDIChannels(f).forEach(function(g){S.send((a.MIDI_CHANNEL_MESSAGES.pitchbend<<4)+(g-1),[y,C],S._parseTimeParameter(b.time))}),this},l.prototype._parseTimeParameter=function(h){var f,b=parseFloat(h);return typeof h=="string"&&h.substring(0,1)==="+"?b&&0<b&&(f=a.time+b):b>a.time&&(f=b),f},l.prototype._convertNoteToArray=function(h){var f=[];return Array.isArray(h)||(h=[h]),h.forEach(function(b){f.push(a.guessNoteNumber(b))}),f},e.exports?e.exports=a:t.WebMidi||(t.WebMidi=a)})(jx)}(vl)),vl.exports}var Qx=Xx();const Zx=Fl(Qx),Tl=(e,t)=>Array(Math.abs(t)+1).join(e);function $3(e){return e!==null&&typeof e=="object"&&typeof e.name=="string"}function K3(e){return e!==null&&typeof e=="object"&&typeof e.step=="number"&&typeof e.alt=="number"}const j3=[0,2,4,-1,1,3,5],X3=j3.map(e=>Math.floor(e*7/12));function Q3(e){const{step:t,alt:n,oct:a,dir:o=1}=e,l=j3[t]+7*n;if(a===void 0)return[o*l];const h=a-X3[t]-4*n;return[o*l,o*h]}const Jx=[3,0,4,1,5,2,6];function eC(e){const[t,n,a]=e,o=Jx[tC(t)],l=Math.floor((t+1)/7);if(n===void 0)return{step:o,alt:l,dir:a};const h=n+4*l+X3[o];return{step:o,alt:l,oct:h,dir:a}}function tC(e){const t=(e+1)%7;return t<0?7+t:t}const Z3={empty:!0,name:"",pc:"",acc:""},sv=new Map,rC=e=>"CDEFGAB".charAt(e),iC=e=>e<0?Tl("b",-e):Tl("#",e),nC=e=>e[0]==="b"?-e.length:e.length;function Oa(e){const t=sv.get(e);if(t)return t;const n=typeof e=="string"?lC(e):K3(e)?Oa(cC(e)):$3(e)?Oa(e.name):Z3;return sv.set(e,n),n}const sC=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function aC(e){const t=sC.exec(e);return[t[1].toUpperCase(),t[2].replace(/x/g,"##"),t[3],t[4]]}function xd(e){return Oa(eC(e))}const oC=(e,t)=>(e%t+t)%t,pu=[0,2,4,5,7,9,11];function lC(e){const t=aC(e);if(t[0]===""||t[3]!=="")return Z3;const n=t[0],a=t[1],o=t[2],l=(n.charCodeAt(0)+3)%7,h=nC(a),f=o.length?+o:void 0,b=Q3({step:l,alt:h,oct:f}),S=n+a+o,M=n+a,C=(pu[l]+h+120)%12,y=f===void 0?oC(pu[l]+h,12)-12*99:pu[l]+h+12*(f+1),g=y>=0&&y<=127?y:null,w=f===void 0?null:Math.pow(2,(y-69)/12)*440;return{empty:!1,acc:a,alt:h,chroma:C,coord:b,freq:w,height:y,letter:n,midi:g,name:S,oct:f,pc:M,step:l}}function cC(e){const{step:t,alt:n,oct:a}=e,o=rC(t);if(!o)return"";const l=o+iC(n);return a||a===0?l+a:l}const Cd={empty:!0,name:"",acc:""},uC="([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})",hC="(AA|A|P|M|m|d|dd)([-+]?\\d+)",fC=new RegExp("^"+uC+"|"+hC+"$");function dC(e){const t=fC.exec(`${e}`);return t===null?["",""]:t[1]?[t[1],t[2]]:[t[4],t[3]]}const av={};function Pl(e){return typeof e=="string"?av[e]||(av[e]=pC(e)):K3(e)?Pl(vC(e)):$3(e)?Pl(e.name):Cd}const ov=[0,2,4,5,7,9,11],J3="PMMPPMM";function pC(e){const t=dC(e);if(t[0]==="")return Cd;const n=+t[0],a=t[1],o=(Math.abs(n)-1)%7,l=J3[o];if(l==="M"&&a==="P")return Cd;const h=l==="M"?"majorable":"perfectable",f=""+n+a,b=n<0?-1:1,S=n===8||n===-8?n:b*(o+1),M=gC(h,a),C=Math.floor((Math.abs(n)-1)/7),y=b*(ov[o]+M+12*C),g=(b*(ov[o]+M)%12+12)%12,w=Q3({step:o,alt:M,oct:C,dir:b});return{empty:!1,name:f,num:n,q:a,step:o,alt:M,dir:b,type:h,simple:S,semitones:y,chroma:g,coord:w,oct:C}}function gC(e,t){return t==="M"&&e==="majorable"||t==="P"&&e==="perfectable"?0:t==="m"&&e==="majorable"?-1:/^A+$/.test(t)?t.length:/^d+$/.test(t)?-1*(e==="perfectable"?t.length:t.length+1):0}function vC(e){const{step:t,alt:n,oct:a=0,dir:o}=e;if(!o)return"";const l=t+1+7*a,h=o<0?"-":"",f=J3[t]==="M"?"majorable":"perfectable";return h+l+mC(f,n)}function mC(e,t){return t===0?e==="majorable"?"M":"P":t===-1&&e==="majorable"?"m":t>0?Tl("A",t):Tl("d",e==="perfectable"?t:t+1)}function eb(e,t){const n=Oa(e),a=Pl(t);if(n.empty||a.empty)return"";const o=n.coord,l=a.coord,h=o.length===1?[o[0]+l[0]]:[o[0]+l[0],o[1]+l[1]];return xd(h).name}function _C(e,t){const n=t.length,a=(e%n+n)%n;return t.slice(a,n).concat(t.slice(0,a))}const Da={empty:!0,name:"",setNum:0,chroma:"000000000000",normalized:"000000000000",intervals:[]},tb=e=>Number(e).toString(2),lv=e=>parseInt(e,2),bC=/^[01]{12}$/;function rb(e){return bC.test(e)}const yC=e=>typeof e=="number"&&e>=0&&e<=4095,wC=e=>e&&rb(e.chroma),cv={[Da.chroma]:Da};function ib(e){const t=rb(e)?e:yC(e)?tb(e):Array.isArray(e)?kC(e):wC(e)?e.chroma:Da.chroma;return cv[t]=cv[t]||CC(t)}const SC=["1P","2m","2M","3m","3M","4P","5d","5P","6m","6M","7m","7M"];function nb(e){const t=[];for(let n=0;n<12;n++)e.charAt(n)==="1"&&t.push(SC[n]);return t}function xC(e){const t=e.split("");return t.map((n,a)=>_C(a,t).join(""))}function CC(e){const t=lv(e),n=xC(e).map(lv).filter(l=>l>=2048).sort()[0],a=tb(n),o=nb(e);return{empty:!1,name:"",setNum:t,chroma:e,normalized:a,intervals:o}}function kC(e){if(e.length===0)return Da.chroma;let t;const n=[0,0,0,0,0,0,0,0,0,0,0,0];for(let a=0;a<e.length;a++)t=Oa(e[a]),t.empty&&(t=Pl(e[a])),t.empty||(n[t.chroma]=1);return n.join("")}const MC=[["1P 3M 5P","major","M ^ "],["1P 3M 5P 7M","major seventh","maj7 Δ ma7 M7 Maj7 ^7"],["1P 3M 5P 7M 9M","major ninth","maj9 Δ9 ^9"],["1P 3M 5P 7M 9M 13M","major thirteenth","maj13 Maj13 ^13"],["1P 3M 5P 6M","sixth","6 add6 add13 M6"],["1P 3M 5P 6M 9M","sixth/ninth","6/9 69 M69"],["1P 3M 6m 7M","major seventh flat sixth","M7b6 ^7b6"],["1P 3M 5P 7M 11A","major seventh sharp eleventh","maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11"],["1P 3m 5P","minor","m min -"],["1P 3m 5P 7m","minor seventh","m7 min7 mi7 -7"],["1P 3m 5P 7M","minor/major seventh","m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7"],["1P 3m 5P 6M","minor sixth","m6 -6"],["1P 3m 5P 7m 9M","minor ninth","m9 -9"],["1P 3m 5P 7M 9M","minor/major ninth","mM9 mMaj9 -^9"],["1P 3m 5P 7m 9M 11P","minor eleventh","m11 -11"],["1P 3m 5P 7m 9M 13M","minor thirteenth","m13 -13"],["1P 3m 5d","diminished","dim ° o"],["1P 3m 5d 7d","diminished seventh","dim7 °7 o7"],["1P 3m 5d 7m","half-diminished","m7b5 ø -7b5 h7 h"],["1P 3M 5P 7m","dominant seventh","7 dom"],["1P 3M 5P 7m 9M","dominant ninth","9"],["1P 3M 5P 7m 9M 13M","dominant thirteenth","13"],["1P 3M 5P 7m 11A","lydian dominant seventh","7#11 7#4"],["1P 3M 5P 7m 9m","dominant flat ninth","7b9"],["1P 3M 5P 7m 9A","dominant sharp ninth","7#9"],["1P 3M 7m 9m","altered","alt7"],["1P 4P 5P","suspended fourth","sus4 sus"],["1P 2M 5P","suspended second","sus2"],["1P 4P 5P 7m","suspended fourth seventh","7sus4 7sus"],["1P 5P 7m 9M 11P","eleventh","11"],["1P 4P 5P 7m 9m","suspended fourth flat ninth","b9sus phryg 7b9sus 7b9sus4"],["1P 5P","fifth","5"],["1P 3M 5A","augmented","aug + +5 ^#5"],["1P 3m 5A","minor augmented","m#5 -#5 m+"],["1P 3M 5A 7M","augmented seventh","maj7#5 maj7+5 +maj7 ^7#5"],["1P 3M 5P 7M 9M 11A","major sharp eleventh (lydian)","maj9#11 Δ9#11 ^9#11"],["1P 2M 4P 5P","","sus24 sus4add9"],["1P 3M 5A 7M 9M","","maj9#5 Maj9#5"],["1P 3M 5A 7m","","7#5 +7 7+ 7aug aug7"],["1P 3M 5A 7m 9A","","7#5#9 7#9#5 7alt"],["1P 3M 5A 7m 9M","","9#5 9+"],["1P 3M 5A 7m 9M 11A","","9#5#11"],["1P 3M 5A 7m 9m","","7#5b9 7b9#5"],["1P 3M 5A 7m 9m 11A","","7#5b9#11"],["1P 3M 5A 9A","","+add#9"],["1P 3M 5A 9M","","M#5add9 +add9"],["1P 3M 5P 6M 11A","","M6#11 M6b5 6#11 6b5"],["1P 3M 5P 6M 7M 9M","","M7add13"],["1P 3M 5P 6M 9M 11A","","69#11"],["1P 3m 5P 6M 9M","","m69 -69"],["1P 3M 5P 6m 7m","","7b6"],["1P 3M 5P 7M 9A 11A","","maj7#9#11"],["1P 3M 5P 7M 9M 11A 13M","","M13#11 maj13#11 M13+4 M13#4"],["1P 3M 5P 7M 9m","","M7b9"],["1P 3M 5P 7m 11A 13m","","7#11b13 7b5b13"],["1P 3M 5P 7m 13M","","7add6 67 7add13"],["1P 3M 5P 7m 9A 11A","","7#9#11 7b5#9 7#9b5"],["1P 3M 5P 7m 9A 11A 13M","","13#9#11"],["1P 3M 5P 7m 9A 11A 13m","","7#9#11b13"],["1P 3M 5P 7m 9A 13M","","13#9"],["1P 3M 5P 7m 9A 13m","","7#9b13"],["1P 3M 5P 7m 9M 11A","","9#11 9+4 9#4"],["1P 3M 5P 7m 9M 11A 13M","","13#11 13+4 13#4"],["1P 3M 5P 7m 9M 11A 13m","","9#11b13 9b5b13"],["1P 3M 5P 7m 9m 11A","","7b9#11 7b5b9 7b9b5"],["1P 3M 5P 7m 9m 11A 13M","","13b9#11"],["1P 3M 5P 7m 9m 11A 13m","","7b9b13#11 7b9#11b13 7b5b9b13"],["1P 3M 5P 7m 9m 13M","","13b9"],["1P 3M 5P 7m 9m 13m","","7b9b13"],["1P 3M 5P 7m 9m 9A","","7b9#9"],["1P 3M 5P 9M","","Madd9 2 add9 add2"],["1P 3M 5P 9m","","Maddb9"],["1P 3M 5d","","Mb5"],["1P 3M 5d 6M 7m 9M","","13b5"],["1P 3M 5d 7M","","M7b5"],["1P 3M 5d 7M 9M","","M9b5"],["1P 3M 5d 7m","","7b5"],["1P 3M 5d 7m 9M","","9b5"],["1P 3M 7m","","7no5"],["1P 3M 7m 13m","","7b13"],["1P 3M 7m 9M","","9no5"],["1P 3M 7m 9M 13M","","13no5"],["1P 3M 7m 9M 13m","","9b13"],["1P 3m 4P 5P","","madd4"],["1P 3m 5P 6m 7M","","mMaj7b6"],["1P 3m 5P 6m 7M 9M","","mMaj9b6"],["1P 3m 5P 7m 11P","","m7add11 m7add4"],["1P 3m 5P 9M","","madd9"],["1P 3m 5d 6M 7M","","o7M7"],["1P 3m 5d 7M","","oM7"],["1P 3m 6m 7M","","mb6M7"],["1P 3m 6m 7m","","m7#5"],["1P 3m 6m 7m 9M","","m9#5"],["1P 3m 5A 7m 9M 11P","","m11A"],["1P 3m 6m 9m","","mb6b9"],["1P 2M 3m 5d 7m","","m9b5"],["1P 4P 5A 7M","","M7#5sus4"],["1P 4P 5A 7M 9M","","M9#5sus4"],["1P 4P 5A 7m","","7#5sus4"],["1P 4P 5P 7M","","M7sus4"],["1P 4P 5P 7M 9M","","M9sus4"],["1P 4P 5P 7m 9M","","9sus4 9sus"],["1P 4P 5P 7m 9M 13M","","13sus4 13sus"],["1P 4P 5P 7m 9m 13m","","7sus4b9b13 7b9b13sus4"],["1P 4P 7m 10m","","4 quartal"],["1P 5P 7m 9m 11P","","11b9"]];({...Da});let sb=[],ml={};function EC(e,t,n){const a=TC(e),o={...ib(e),name:n||"",quality:a,intervals:e,aliases:t};sb.push(o),o.name&&(ml[o.name]=o),ml[o.setNum]=o,ml[o.chroma]=o,o.aliases.forEach(l=>AC(o,l))}function AC(e,t){ml[t]=e}function TC(e){const t=n=>e.indexOf(n)!==-1;return t("5A")?"Augmented":t("3M")?"Major":t("5d")?"Diminished":t("3m")?"Minor":"Unknown"}MC.forEach(([e,t,n])=>EC(e.split(" "),n.split(" "),t));sb.sort((e,t)=>e.setNum-t.setNum);const PC=[["1P 2M 3M 5P 6M","major pentatonic","pentatonic"],["1P 3M 4P 5P 7M","ionian pentatonic"],["1P 3M 4P 5P 7m","mixolydian pentatonic","indian"],["1P 2M 4P 5P 6M","ritusen"],["1P 2M 4P 5P 7m","egyptian"],["1P 3M 4P 5d 7m","neopolitan major pentatonic"],["1P 3m 4P 5P 6m","vietnamese 1"],["1P 2m 3m 5P 6m","pelog"],["1P 2m 4P 5P 6m","kumoijoshi"],["1P 2M 3m 5P 6m","hirajoshi"],["1P 2m 4P 5d 7m","iwato"],["1P 2m 4P 5P 7m","in-sen"],["1P 3M 4A 5P 7M","lydian pentatonic","chinese"],["1P 3m 4P 6m 7m","malkos raga"],["1P 3m 4P 5d 7m","locrian pentatonic","minor seven flat five pentatonic"],["1P 3m 4P 5P 7m","minor pentatonic","vietnamese 2"],["1P 3m 4P 5P 6M","minor six pentatonic"],["1P 2M 3m 5P 6M","flat three pentatonic","kumoi"],["1P 2M 3M 5P 6m","flat six pentatonic"],["1P 2m 3M 5P 6M","scriabin"],["1P 3M 5d 6m 7m","whole tone pentatonic"],["1P 3M 4A 5A 7M","lydian #5P pentatonic"],["1P 3M 4A 5P 7m","lydian dominant pentatonic"],["1P 3m 4P 5P 7M","minor #7M pentatonic"],["1P 3m 4d 5d 7m","super locrian pentatonic"],["1P 2M 3m 4P 5P 7M","minor hexatonic"],["1P 2A 3M 5P 5A 7M","augmented"],["1P 2M 3m 3M 5P 6M","major blues"],["1P 2M 4P 5P 6M 7m","piongio"],["1P 2m 3M 4A 6M 7m","prometheus neopolitan"],["1P 2M 3M 4A 6M 7m","prometheus"],["1P 2m 3M 5d 6m 7m","mystery #1"],["1P 2m 3M 4P 5A 6M","six tone symmetric"],["1P 2M 3M 4A 5A 7m","whole tone","messiaen's mode #1"],["1P 2m 4P 4A 5P 7M","messiaen's mode #5"],["1P 3m 4P 5d 5P 7m","minor blues","blues"],["1P 2M 3M 4P 5d 6m 7m","locrian major","arabian"],["1P 2m 3M 4A 5P 6m 7M","double harmonic lydian"],["1P 2M 3m 4P 5P 6m 7M","harmonic minor"],["1P 2m 3m 4d 5d 6m 7m","altered","super locrian","diminished whole tone","pomeroy"],["1P 2M 3m 4P 5d 6m 7m","locrian #2","half-diminished","aeolian b5"],["1P 2M 3M 4P 5P 6m 7m","mixolydian b6","melodic minor fifth mode","hindu"],["1P 2M 3M 4A 5P 6M 7m","lydian dominant","lydian b7","overtone"],["1P 2M 3M 4A 5P 6M 7M","lydian"],["1P 2M 3M 4A 5A 6M 7M","lydian augmented"],["1P 2m 3m 4P 5P 6M 7m","dorian b2","phrygian #6","melodic minor second mode"],["1P 2M 3m 4P 5P 6M 7M","melodic minor"],["1P 2m 3m 4P 5d 6m 7m","locrian"],["1P 2m 3m 4d 5d 6m 7d","ultralocrian","superlocrian bb7","·superlocrian diminished"],["1P 2m 3m 4P 5d 6M 7m","locrian 6","locrian natural 6","locrian sharp 6"],["1P 2A 3M 4P 5P 5A 7M","augmented heptatonic"],["1P 2M 3m 5d 5P 6M 7m","romanian minor"],["1P 2M 3m 4A 5P 6M 7m","dorian #4"],["1P 2M 3m 4A 5P 6M 7M","lydian diminished"],["1P 2m 3m 4P 5P 6m 7m","phrygian"],["1P 2M 3M 4A 5A 7m 7M","leading whole tone"],["1P 2M 3M 4A 5P 6m 7m","lydian minor"],["1P 2m 3M 4P 5P 6m 7m","phrygian dominant","spanish","phrygian major"],["1P 2m 3m 4P 5P 6m 7M","balinese"],["1P 2m 3m 4P 5P 6M 7M","neopolitan major"],["1P 2M 3m 4P 5P 6m 7m","aeolian","minor"],["1P 2M 3M 4P 5P 6m 7M","harmonic major"],["1P 2m 3M 4P 5P 6m 7M","double harmonic major","gypsy"],["1P 2M 3m 4P 5P 6M 7m","dorian"],["1P 2M 3m 4A 5P 6m 7M","hungarian minor"],["1P 2A 3M 4A 5P 6M 7m","hungarian major"],["1P 2m 3M 4P 5d 6M 7m","oriental"],["1P 2m 3m 3M 4A 5P 7m","flamenco"],["1P 2m 3m 4A 5P 6m 7M","todi raga"],["1P 2M 3M 4P 5P 6M 7m","mixolydian","dominant"],["1P 2m 3M 4P 5d 6m 7M","persian"],["1P 2M 3M 4P 5P 6M 7M","major","ionian"],["1P 2m 3M 5d 6m 7m 7M","enigmatic"],["1P 2M 3M 4P 5A 6M 7M","major augmented","major #5","ionian augmented","ionian #5"],["1P 2A 3M 4A 5P 6M 7M","lydian #9"],["1P 2m 2M 4P 4A 5P 6m 7M","messiaen's mode #4"],["1P 2m 3M 4P 4A 5P 6m 7M","purvi raga"],["1P 2m 3m 3M 4P 5P 6m 7m","spanish heptatonic"],["1P 2M 3M 4P 5P 6M 7m 7M","bebop"],["1P 2M 3m 3M 4P 5P 6M 7m","bebop minor"],["1P 2M 3M 4P 5P 5A 6M 7M","bebop major"],["1P 2m 3m 4P 5d 5P 6m 7m","bebop locrian"],["1P 2M 3m 4P 5P 6m 7m 7M","minor bebop"],["1P 2M 3m 4P 5d 6m 6M 7M","diminished","whole-half diminished"],["1P 2M 3M 4P 5d 5P 6M 7M","ichikosucho"],["1P 2M 3m 4P 5P 6m 6M 7M","minor six diminished"],["1P 2m 3m 3M 4A 5P 6M 7m","half-whole diminished","dominant diminished","messiaen's mode #2"],["1P 3m 3M 4P 5P 6M 7m 7M","kafi raga"],["1P 2M 3M 4P 4A 5A 6A 7M","messiaen's mode #6"],["1P 2M 3m 3M 4P 5d 5P 6M 7m","composite blues"],["1P 2M 3m 3M 4A 5P 6m 7m 7M","messiaen's mode #3"],["1P 2m 2M 3m 4P 4A 5P 6m 6M 7M","messiaen's mode #7"],["1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M","chromatic"]];({...Da});let _l={};function IC(e,t,n=[]){const a={...ib(e),name:t,intervals:e,aliases:n};return _l[a.name]=a,_l[a.setNum]=a,_l[a.chroma]=a,a.aliases.forEach(o=>NC(a,o)),a}function NC(e,t){_l[t]=e}PC.forEach(([e,t,...n])=>IC(e.split(" "),t,n));const LC=[[.125,"dl",["large","duplex longa","maxima","octuple","octuple whole"]],[.25,"l",["long","longa"]],[.5,"d",["double whole","double","breve"]],[1,"w",["whole","semibreve"]],[2,"h",["half","minim"]],[4,"q",["quarter","crotchet"]],[8,"e",["eighth","quaver"]],[16,"s",["sixteenth","semiquaver"]],[32,"t",["thirty-second","demisemiquaver"]],[64,"sf",["sixty-fourth","hemidemisemiquaver"]],[128,"h",["hundred twenty-eighth"]],[256,"th",["two hundred fifty-sixth"]]];LC.forEach(([e,t,n])=>void 0);const OC=Math.log(2),DC=Math.log(440);function ab(e){const t=12*(Math.log(e)-DC)/OC+69;return Math.round(t*100)/100}const RC="C C# D D# E F F# G G# A A# B".split(" "),BC="C Db D Eb E F Gb G Ab A Bb B".split(" ");function m0(e,t={}){if(isNaN(e)||e===-1/0||e===1/0)return"";e=Math.round(e);const a=(t.sharps===!0?RC:BC)[e%12];if(t.pitchClass)return a;const o=Math.floor(e/12)-1;return a+o}const qC=["C","D","E","F","G","A","B"],ob=e=>e.name,lb=e=>e.map(Oa).filter(t=>!t.empty);function FC(e){return e===void 0?qC.slice():Array.isArray(e)?lb(e).map(ob):[]}const Zn=Oa,zC=e=>Zn(e).name,HC=e=>Zn(e).pc,VC=e=>Zn(e).acc,UC=e=>Zn(e).oct,GC=e=>Zn(e).midi,YC=e=>Zn(e).freq,WC=e=>Zn(e).chroma;function $C(e){return m0(e)}function KC(e){return m0(ab(e))}function jC(e){return m0(ab(e),{sharps:!0})}function XC(e){return m0(e,{sharps:!0})}const o1=eb,QC=eb,cb=e=>t=>o1(t,e),ZC=cb,ub=e=>t=>o1(e,t),JC=ub;function hb(e,t){const n=Zn(e);if(n.empty)return"";const[a,o]=n.coord;return xd(o===void 0?[a+t]:[a+t,o]).name}const ek=hb,l1=(e,t)=>e.height-t.height,tk=(e,t)=>t.height-e.height;function fb(e,t){return t=t||l1,lb(e).sort(t).map(ob)}function rk(e){return fb(e,l1).filter((t,n,a)=>n===0||t!==a[n-1])}const ik=db(!0),nk=db(!1);function db(e){return t=>{const n=Zn(t);if(n.empty)return"";const a=e?n.alt>0:n.alt<0,o=n.midi===null;return m0(n.midi||n.chroma,{sharps:a,pitchClass:o})}}var pn={names:FC,get:Zn,name:zC,pitchClass:HC,accidentals:VC,octave:UC,midi:GC,ascending:l1,descending:tk,sortedNames:fb,sortedUniqNames:rk,fromMidi:$C,fromMidiSharps:XC,freq:YC,fromFreq:KC,fromFreqSharps:jC,chroma:WC,transpose:o1,tr:QC,transposeBy:cb,trBy:ZC,transposeFrom:ub,trFrom:JC,transposeFifths:hb,trFifths:ek,simplify:ik,enharmonic:nk};const sk=[[0,2773,0,"ionian","","Maj7","major"],[1,2902,2,"dorian","m","m7"],[2,3418,4,"phrygian","m","m7"],[3,2741,-1,"lydian","","Maj7"],[4,2774,1,"mixolydian","","7"],[5,2906,3,"aeolian","m","m7","minor"],[6,3434,5,"locrian","dim","m7b5"]];({...Da});const ak=sk.map(ok),uv={};ak.forEach(e=>{uv[e.name]=e,e.aliases.forEach(t=>{uv[t]=e})});function ok(e){const[t,n,a,o,l,h,f]=e,b=f?[f]:[],S=Number(n).toString(2);return{empty:!1,intervals:nb(S),modeNum:t,chroma:S,normalized:S,name:o,setNum:n,alt:a,triad:l,seventh:h,aliases:b}}function on(e){const t=[];e=e.filter(n=>n.type==="noteon").sort((n,a)=>n.timestamp-a.timestamp);for(let n=10;n>0;n--)for(let a=0;a<e.length-n+1;a++)try{t.push(new vo(e.slice(a,a+n))),e.splice(a,n),a=-1}catch{}return new zl(t)}class zl{constructor(t){rt(this,"syllables"),rt(this,"rootNote"),t.length>0?(this.syllables=t.sort((n,a)=>n.timestamp-a.timestamp),this.rootNote=this.syllables[0].notes.reduce((n,a)=>a.note.number<n.note.number?a:n).note):(this.syllables=[],this.rootNote={name:"C",octave:4,number:0})}append(t){if(this.syllables.length)try{const n=new vo(this.syllables[this.syllables.length-1].notes.map(a=>({note:a.note,timestamp:a.timestamp,type:a.type,velocity:a.velocity})).concat(t));this.syllables.splice(this.syllables.length-1,1,n)}catch{this.syllables.push(new vo([t]))}else this.syllables.push(new vo([t])),this.rootNote=t.note}grade(t){const n=[];for(let a=0;a<this.syllables.length;a++)n.push(this.syllables[a].grade(t.syllables[a]));return new zl(n)}toString(){let t="";return this.syllables.forEach((n,a)=>{t+=`Syllable ${a+1}: {
123
+ `,n.notes.forEach(o=>{t+=` ${o.note.name} ${o.note.number} ${o.timestamp} ${o.isCorrect?"":"(incorrect)"} ${o.isMissing?"(missing)":""}
124
+ `}),t+=`} - ${n.timestamp}, correct: ${n.isCorrect}
125
+ `}),t}isCorrect(){let t=!0;return this.syllables.forEach(n=>{n.isCorrect===!1?t=!1:n.notes.forEach(a=>{a.isCorrect===!1&&(t=!1)})}),t}}class vo{constructor(t){rt(this,"notes"),rt(this,"isCorrect"),t=t.filter(l=>l.type==="noteon");const n=t.reduce((l,h)=>l.timestamp<h.timestamp?l:h),o=t.reduce((l,h)=>l.timestamp>h.timestamp?l:h).timestamp-n.timestamp;if(vo.gracePeriod(t.length)<o)throw new Error(`Notes ${t.toString()} are not close enough together to be a syllable`);this.notes=t.map(l=>({...l,isCorrect:!0,isMissing:!1})).sort((l,h)=>l.note.number-h.note.number)}get timestamp(){let t=0;return this.notes.forEach(n=>{if(n.timestamp===0)return 0;t+=n.timestamp}),t/=this.notes.length,t}static gracePeriod(t){return 1.3*12*t}grade(t){return this.notes.length!==t.notes.length&&(t.isCorrect=!1),t.notes.forEach(n=>{let a=pn.fromMidi(n.note.number),o=pn.fromMidiSharps(n.note.number);a=pn.pitchClass(a),o=pn.pitchClass(o),n.isCorrect=this.notes.filter(l=>pn.chroma(a)===pn.chroma(l.note.name)||pn.chroma(o)===pn.chroma(l.note.name)).length>=1,n.isCorrect||(t.isCorrect=!1)}),this.notes.forEach(n=>{let a=pn.fromMidi(n.note.number);a=pn.pitchClass(a),t.notes.some(o=>pn.chroma(o.note.name)===pn.chroma(a))||t.notes.push({...n,isMissing:!0,isCorrect:!1})}),t}}const Hl=class Kn{constructor(t){rt(this,"recording",[]),rt(this,"webmidi",Zx),rt(this,"input"),rt(this,"output"),rt(this,"_noteonListeners",[]),rt(this,"_noteoffListeners",[]),rt(this,"midiAccess"),rt(this,"_state","initializing"),rt(this,"_userLookup"),this._userLookup=t??null}get state(){return this._state}async init(){if(!this.midiAccess)try{navigator.requestMIDIAccess().then(t=>{this.midiAccess=t,this.midiAccess.onstatechange=n=>{fl({text:`Midi device ${n.port.name} is ${n.port.state}`,status:n.port.state==="connected"?ur.ok:ur.error})}})}catch(t){console.log(`Webmidi not enabled: ${t}`),this._state="notsupported"}try{this.webmidi.disable()}catch(t){console.log(`Webmidi not enabled: ${t}`),this._state="notsupported"}return new Promise((t,n)=>{this.webmidi.enable(async a=>{a?(this._state="notsupported",console.log(`Webmidi not enabled: ${a}`),n(a)):(console.log("Webmidi enabled"),console.log(`Inputs: ${JSON.stringify(this.webmidi.inputs)}`),console.log(`Outputs: ${JSON.stringify(this.webmidi.outputs)}`),this.output=this.webmidi.outputs[0],this.input=this.webmidi.inputs[0],Kn._initializedWithUserConfig||(await this.loadUserConfiguration(),Kn._initializedWithUserConfig=!0),this.input&&this.output?(console.log("midi init state: ready"),this._state="ready",this.attachListeners()):(console.log("midi init state: nodevice"),this._state="nodevice"),t(!0))})})}async loadUserConfiguration(){try{if(!this._userLookup){console.log("User lookup function not provided - using default MIDI configuration");return}const t=await this._userLookup();if(!t){console.log("No user found, using default MIDI configuration");return}const n=await t.getActiveCourses();for(const a of n){const l=await(await t.getCourseInterface(a.courseID)).getCourseSettings();if(l?.midiinput||l?.midioutput){l.midiinput&&this.webmidi.getInputById(l.midiinput.toString())&&(this.selectInput(l.midiinput.toString()),console.log(`Loaded saved MIDI input: ${l.midiinput}`)),l.midioutput&&this.webmidi.getOutputById(l.midioutput.toString())&&(this.selectOutput(l.midioutput.toString()),console.log(`Loaded saved MIDI output: ${l.midioutput}`));break}}}catch(t){console.error("Failed to load user MIDI configuration:",t)}}setStateChangeListener(t){if(this.midiAccess)this.midiAccess.onstatechange=n=>{this.init().then(()=>{console.log(`Midi state: ${this.state}`),t()}),fl({text:`Midi device ${n.port.name} is ${n.port.state}`,status:n.port.state==="connected"?ur.ok:ur.error})};else try{navigator.requestMIDIAccess().then(n=>{this.midiAccess=n,this.midiAccess.onstatechange=a=>{this.init().then(()=>{console.log(`Midi state: ${this.state}`),t()}),fl({text:`Midi device ${a.port.name} is ${a.port.state}`,status:a.port.state==="connected"?ur.ok:ur.error})}})}catch(n){console.log(`Webmidi not enabled: ${n}`),this._state="notsupported"}}attachListeners(){this.input&&(this._noteonListeners.forEach(t=>{var n;(n=this.input)==null||n.on("noteon","all",t)}),this._noteoffListeners.forEach(t=>{var n;(n=this.input)==null||n.on("noteoff","all",t)}))}get hasRecording(){return this.record.length>0}get configuredInput(){return this.input?`${this.input.manufacturer}: ${this.input.name}`:"(Not Sure!)"}eraseRecording(){this.recording=[]}stopRecording(){var t;(t=this.input)==null||t.removeListener()}record(){let t=0;if(this.input===void 0)throw new Error("Midi input not configured!");this.input.connection==="open"&&(this.stopRecording(),this.eraseRecording(),this.input.on("noteon","all",n=>{this.recording.length===0&&(t=n.timestamp),this.recording.push({note:n.note,type:n.type,velocity:n.velocity,timestamp:n.timestamp-t})}),this.input.on("noteoff","all",n=>{this.recording.length===0&&(t=n.timestamp),this.recording.push({note:n.note,velocity:n.velocity,type:n.type,timestamp:n.timestamp-t})}))}addNoteonListenter(t){this._noteonListeners.push(t),this.input&&this.input.on("noteon","all",t)}addNoteoffListenter(t){this._noteoffListeners.push(t),this.input&&this.input.on("noteoff","all",t)}play(t){let n=t||this.recording;n=n.map(a=>({...a,timestamp:a.timestamp+Kn.OFFSET})),n.forEach(a=>{var o,l;a.type==="noteon"?(o=this.output)==null||o.playNote(a.note.name+a.note.octave,1,{velocity:a.velocity,time:`+${a.timestamp}`,rawVelocity:!1}):(l=this.output)==null||l.stopNote(a.note.name+a.note.octave,1,{velocity:a.velocity,time:`+${a.timestamp}`,rawVelocity:!1})})}static async instance(){return Kn._instance||(console.log("Buzz, whirr, Midi instance factory is at work"),Kn._instance=new Kn,await Kn._instance.init()),Kn._instance}get inputs(){return this.webmidi.inputs}get outputs(){return this.webmidi.outputs}selectInput(t){this.webmidi.getInputById(t)!==!1?this.input=this.webmidi.getInputById(t):this.webmidi.getInputByName(t)!==!1&&(this.input=this.webmidi.getInputByName(t))}selectOutput(t){this.webmidi.getOutputById(t)!==!1?this.output=this.webmidi.getOutputById(t):this.webmidi.getOutputByName(t)!==!1&&(this.output=this.webmidi.getOutputByName(t))}};rt(Hl,"_instance");rt(Hl,"OFFSET",5);rt(Hl,"_initializedWithUserConfig",!1);let c1=Hl;//! moment.js
126
+ //! version : 2.30.1
127
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
128
+ //! license : MIT
129
+ //! momentjs.com
130
+ var pb;function Tt(){return pb.apply(null,arguments)}function lk(e){pb=e}function Pn(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Na(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function Mr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u1(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(Mr(e,t))return!1;return!0}function Ki(e){return e===void 0}function Is(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function _0(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function gb(e,t){var n=[],a,o=e.length;for(a=0;a<o;++a)n.push(t(e[a],a));return n}function Js(e,t){for(var n in t)Mr(t,n)&&(e[n]=t[n]);return Mr(t,"toString")&&(e.toString=t.toString),Mr(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Jn(e,t,n,a){return qb(e,t,n,a,!0).utc()}function ck(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function or(e){return e._pf==null&&(e._pf=ck()),e._pf}var kd;Array.prototype.some?kd=Array.prototype.some:kd=function(e){var t=Object(this),n=t.length>>>0,a;for(a=0;a<n;a++)if(a in t&&e.call(this,t[a],a,t))return!0;return!1};function h1(e){var t=null,n=!1,a=e._d&&!isNaN(e._d.getTime());if(a&&(t=or(e),n=kd.call(t.parsedDateParts,function(o){return o!=null}),a=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(a=a&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=a;else return a;return e._isValid}function Vl(e){var t=Jn(NaN);return e!=null?Js(or(t),e):or(t).userInvalidated=!0,t}var hv=Tt.momentProperties=[],gu=!1;function f1(e,t){var n,a,o,l=hv.length;if(Ki(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Ki(t._i)||(e._i=t._i),Ki(t._f)||(e._f=t._f),Ki(t._l)||(e._l=t._l),Ki(t._strict)||(e._strict=t._strict),Ki(t._tzm)||(e._tzm=t._tzm),Ki(t._isUTC)||(e._isUTC=t._isUTC),Ki(t._offset)||(e._offset=t._offset),Ki(t._pf)||(e._pf=or(t)),Ki(t._locale)||(e._locale=t._locale),l>0)for(n=0;n<l;n++)a=hv[n],o=t[a],Ki(o)||(e[a]=o);return e}function b0(e){f1(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),gu===!1&&(gu=!0,Tt.updateOffset(this),gu=!1)}function In(e){return e instanceof b0||e!=null&&e._isAMomentObject!=null}function vb(e){Tt.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function yn(e,t){var n=!0;return Js(function(){if(Tt.deprecationHandler!=null&&Tt.deprecationHandler(null,e),n){var a=[],o,l,h,f=arguments.length;for(l=0;l<f;l++){if(o="",typeof arguments[l]=="object"){o+=`
131
+ [`+l+"] ";for(h in arguments[0])Mr(arguments[0],h)&&(o+=h+": "+arguments[0][h]+", ");o=o.slice(0,-2)}else o=arguments[l];a.push(o)}vb(e+`
132
+ Arguments: `+Array.prototype.slice.call(a).join("")+`
133
+ `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var fv={};function mb(e,t){Tt.deprecationHandler!=null&&Tt.deprecationHandler(e,t),fv[e]||(vb(t),fv[e]=!0)}Tt.suppressDeprecationWarnings=!1;Tt.deprecationHandler=null;function es(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function uk(e){var t,n;for(n in e)Mr(e,n)&&(t=e[n],es(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Md(e,t){var n=Js({},e),a;for(a in t)Mr(t,a)&&(Na(e[a])&&Na(t[a])?(n[a]={},Js(n[a],e[a]),Js(n[a],t[a])):t[a]!=null?n[a]=t[a]:delete n[a]);for(a in e)Mr(e,a)&&!Mr(t,a)&&Na(e[a])&&(n[a]=Js({},n[a]));return n}function d1(e){e!=null&&this.set(e)}var Ed;Object.keys?Ed=Object.keys:Ed=function(e){var t,n=[];for(t in e)Mr(e,t)&&n.push(t);return n};var hk={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function fk(e,t,n){var a=this._calendar[e]||this._calendar.sameElse;return es(a)?a.call(t,n):a}function Qn(e,t,n){var a=""+Math.abs(e),o=t-a.length,l=e>=0;return(l?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+a}var p1=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ul=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vu={},mo={};function Bt(e,t,n,a){var o=a;typeof a=="string"&&(o=function(){return this[a]()}),e&&(mo[e]=o),t&&(mo[t[0]]=function(){return Qn(o.apply(this,arguments),t[1],t[2])}),n&&(mo[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function dk(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function pk(e){var t=e.match(p1),n,a;for(n=0,a=t.length;n<a;n++)mo[t[n]]?t[n]=mo[t[n]]:t[n]=dk(t[n]);return function(o){var l="",h;for(h=0;h<a;h++)l+=es(t[h])?t[h].call(o,e):t[h];return l}}function bl(e,t){return e.isValid()?(t=_b(t,e.localeData()),vu[t]=vu[t]||pk(t),vu[t](e)):e.localeData().invalidDate()}function _b(e,t){var n=5;function a(o){return t.longDateFormat(o)||o}for(ul.lastIndex=0;n>=0&&ul.test(e);)e=e.replace(ul,a),ul.lastIndex=0,n-=1;return e}var gk={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function vk(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(p1).map(function(a){return a==="MMMM"||a==="MM"||a==="DD"||a==="dddd"?a.slice(1):a}).join(""),this._longDateFormat[e])}var mk="Invalid date";function _k(){return this._invalidDate}var bk="%d",yk=/\d{1,2}/;function wk(e){return this._ordinal.replace("%d",e)}var Sk={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function xk(e,t,n,a){var o=this._relativeTime[n];return es(o)?o(e,t,n,a):o.replace(/%d/i,e)}function Ck(e,t){var n=this._relativeTime[e>0?"future":"past"];return es(n)?n(t):n.replace(/%s/i,t)}var dv={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function wn(e){return typeof e=="string"?dv[e]||dv[e.toLowerCase()]:void 0}function g1(e){var t={},n,a;for(a in e)Mr(e,a)&&(n=wn(a),n&&(t[n]=e[a]));return t}var kk={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Mk(e){var t=[],n;for(n in e)Mr(e,n)&&t.push({unit:n,priority:kk[n]});return t.sort(function(a,o){return a.priority-o.priority}),t}var bb=/\d/,ln=/\d\d/,yb=/\d{3}/,v1=/\d{4}/,Ul=/[+-]?\d{6}/,zr=/\d\d?/,wb=/\d\d\d\d?/,Sb=/\d\d\d\d\d\d?/,Gl=/\d{1,3}/,m1=/\d{1,4}/,Yl=/[+-]?\d{1,6}/,yo=/\d+/,Wl=/[+-]?\d+/,Ek=/Z|[+-]\d\d:?\d\d/gi,$l=/Z|[+-]\d\d(?::?\d\d)?/gi,Ak=/[+-]?\d+(\.\d{1,3})?/,y0=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,wo=/^[1-9]\d?/,_1=/^([1-9]\d|\d)/,Il;Il={};function It(e,t,n){Il[e]=es(t)?t:function(a,o){return a&&n?n:t}}function Tk(e,t){return Mr(Il,e)?Il[e](t._strict,t._locale):new RegExp(Pk(e))}function Pk(e){return Ts(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,a,o,l){return n||a||o||l}))}function Ts(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function mn(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function _r(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=mn(t)),n}var Ad={};function Nr(e,t){var n,a=t,o;for(typeof e=="string"&&(e=[e]),Is(t)&&(a=function(l,h){h[t]=_r(l)}),o=e.length,n=0;n<o;n++)Ad[e[n]]=a}function w0(e,t){Nr(e,function(n,a,o,l){o._w=o._w||{},t(n,o._w,o,l)})}function Ik(e,t,n){t!=null&&Mr(Ad,e)&&Ad[e](t,n._a,n,e)}function Kl(e){return e%4===0&&e%100!==0||e%400===0}var Ii=0,Es=1,Xn=2,hi=3,Tn=4,As=5,Pa=6,Nk=7,Lk=8;Bt("Y",0,0,function(){var e=this.year();return e<=9999?Qn(e,4):"+"+e});Bt(0,["YY",2],0,function(){return this.year()%100});Bt(0,["YYYY",4],0,"year");Bt(0,["YYYYY",5],0,"year");Bt(0,["YYYYYY",6,!0],0,"year");It("Y",Wl);It("YY",zr,ln);It("YYYY",m1,v1);It("YYYYY",Yl,Ul);It("YYYYYY",Yl,Ul);Nr(["YYYYY","YYYYYY"],Ii);Nr("YYYY",function(e,t){t[Ii]=e.length===2?Tt.parseTwoDigitYear(e):_r(e)});Nr("YY",function(e,t){t[Ii]=Tt.parseTwoDigitYear(e)});Nr("Y",function(e,t){t[Ii]=parseInt(e,10)});function a0(e){return Kl(e)?366:365}Tt.parseTwoDigitYear=function(e){return _r(e)+(_r(e)>68?1900:2e3)};var xb=So("FullYear",!0);function Ok(){return Kl(this.year())}function So(e,t){return function(n){return n!=null?(Cb(this,e,n),Tt.updateOffset(this,t),this):c0(this,e)}}function c0(e,t){if(!e.isValid())return NaN;var n=e._d,a=e._isUTC;switch(t){case"Milliseconds":return a?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return a?n.getUTCSeconds():n.getSeconds();case"Minutes":return a?n.getUTCMinutes():n.getMinutes();case"Hours":return a?n.getUTCHours():n.getHours();case"Date":return a?n.getUTCDate():n.getDate();case"Day":return a?n.getUTCDay():n.getDay();case"Month":return a?n.getUTCMonth():n.getMonth();case"FullYear":return a?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Cb(e,t,n){var a,o,l,h,f;if(!(!e.isValid()||isNaN(n))){switch(a=e._d,o=e._isUTC,t){case"Milliseconds":return void(o?a.setUTCMilliseconds(n):a.setMilliseconds(n));case"Seconds":return void(o?a.setUTCSeconds(n):a.setSeconds(n));case"Minutes":return void(o?a.setUTCMinutes(n):a.setMinutes(n));case"Hours":return void(o?a.setUTCHours(n):a.setHours(n));case"Date":return void(o?a.setUTCDate(n):a.setDate(n));case"FullYear":break;default:return}l=n,h=e.month(),f=e.date(),f=f===29&&h===1&&!Kl(l)?28:f,o?a.setUTCFullYear(l,h,f):a.setFullYear(l,h,f)}}function Dk(e){return e=wn(e),es(this[e])?this[e]():this}function Rk(e,t){if(typeof e=="object"){e=g1(e);var n=Mk(e),a,o=n.length;for(a=0;a<o;a++)this[n[a].unit](e[n[a].unit])}else if(e=wn(e),es(this[e]))return this[e](t);return this}function Bk(e,t){return(e%t+t)%t}var ti;Array.prototype.indexOf?ti=Array.prototype.indexOf:ti=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function b1(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Bk(t,12);return e+=(t-n)/12,n===1?Kl(e)?29:28:31-n%7%2}Bt("M",["MM",2],"Mo",function(){return this.month()+1});Bt("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)});Bt("MMMM",0,0,function(e){return this.localeData().months(this,e)});It("M",zr,wo);It("MM",zr,ln);It("MMM",function(e,t){return t.monthsShortRegex(e)});It("MMMM",function(e,t){return t.monthsRegex(e)});Nr(["M","MM"],function(e,t){t[Es]=_r(e)-1});Nr(["MMM","MMMM"],function(e,t,n,a){var o=n._locale.monthsParse(e,a,n._strict);o!=null?t[Es]=o:or(n).invalidMonth=e});var qk="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),kb="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Mb=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Fk=y0,zk=y0;function Hk(e,t){return e?Pn(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Mb).test(t)?"format":"standalone"][e.month()]:Pn(this._months)?this._months:this._months.standalone}function Vk(e,t){return e?Pn(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Mb.test(t)?"format":"standalone"][e.month()]:Pn(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Uk(e,t,n){var a,o,l,h=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;a<12;++a)l=Jn([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(l,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(l,"").toLocaleLowerCase();return n?t==="MMM"?(o=ti.call(this._shortMonthsParse,h),o!==-1?o:null):(o=ti.call(this._longMonthsParse,h),o!==-1?o:null):t==="MMM"?(o=ti.call(this._shortMonthsParse,h),o!==-1?o:(o=ti.call(this._longMonthsParse,h),o!==-1?o:null)):(o=ti.call(this._longMonthsParse,h),o!==-1?o:(o=ti.call(this._shortMonthsParse,h),o!==-1?o:null))}function Gk(e,t,n){var a,o,l;if(this._monthsParseExact)return Uk.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),a=0;a<12;a++){if(o=Jn([2e3,a]),n&&!this._longMonthsParse[a]&&(this._longMonthsParse[a]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[a]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),!n&&!this._monthsParse[a]&&(l="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[a]=new RegExp(l.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[a].test(e))return a;if(n&&t==="MMM"&&this._shortMonthsParse[a].test(e))return a;if(!n&&this._monthsParse[a].test(e))return a}}function Eb(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=_r(t);else if(t=e.localeData().monthsParse(t),!Is(t))return e}var n=t,a=e.date();return a=a<29?a:Math.min(a,b1(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,a):e._d.setMonth(n,a),e}function Ab(e){return e!=null?(Eb(this,e),Tt.updateOffset(this,!0),this):c0(this,"Month")}function Yk(){return b1(this.year(),this.month())}function Wk(e){return this._monthsParseExact?(Mr(this,"_monthsRegex")||Tb.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(Mr(this,"_monthsShortRegex")||(this._monthsShortRegex=Fk),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function $k(e){return this._monthsParseExact?(Mr(this,"_monthsRegex")||Tb.call(this),e?this._monthsStrictRegex:this._monthsRegex):(Mr(this,"_monthsRegex")||(this._monthsRegex=zk),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Tb(){function e(b,S){return S.length-b.length}var t=[],n=[],a=[],o,l,h,f;for(o=0;o<12;o++)l=Jn([2e3,o]),h=Ts(this.monthsShort(l,"")),f=Ts(this.months(l,"")),t.push(h),n.push(f),a.push(f),a.push(h);t.sort(e),n.sort(e),a.sort(e),this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Kk(e,t,n,a,o,l,h){var f;return e<100&&e>=0?(f=new Date(e+400,t,n,a,o,l,h),isFinite(f.getFullYear())&&f.setFullYear(e)):f=new Date(e,t,n,a,o,l,h),f}function u0(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Nl(e,t,n){var a=7+t-n,o=(7+u0(e,0,a).getUTCDay()-t)%7;return-o+a-1}function Pb(e,t,n,a,o){var l=(7+n-a)%7,h=Nl(e,a,o),f=1+7*(t-1)+l+h,b,S;return f<=0?(b=e-1,S=a0(b)+f):f>a0(e)?(b=e+1,S=f-a0(e)):(b=e,S=f),{year:b,dayOfYear:S}}function h0(e,t,n){var a=Nl(e.year(),t,n),o=Math.floor((e.dayOfYear()-a-1)/7)+1,l,h;return o<1?(h=e.year()-1,l=o+Ps(h,t,n)):o>Ps(e.year(),t,n)?(l=o-Ps(e.year(),t,n),h=e.year()+1):(h=e.year(),l=o),{week:l,year:h}}function Ps(e,t,n){var a=Nl(e,t,n),o=Nl(e+1,t,n);return(a0(e)-a+o)/7}Bt("w",["ww",2],"wo","week");Bt("W",["WW",2],"Wo","isoWeek");It("w",zr,wo);It("ww",zr,ln);It("W",zr,wo);It("WW",zr,ln);w0(["w","ww","W","WW"],function(e,t,n,a){t[a.substr(0,1)]=_r(e)});function jk(e){return h0(e,this._week.dow,this._week.doy).week}var Xk={dow:0,doy:6};function Qk(){return this._week.dow}function Zk(){return this._week.doy}function Jk(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function eM(e){var t=h0(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Bt("d",0,"do","day");Bt("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Bt("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Bt("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Bt("e",0,0,"weekday");Bt("E",0,0,"isoWeekday");It("d",zr);It("e",zr);It("E",zr);It("dd",function(e,t){return t.weekdaysMinRegex(e)});It("ddd",function(e,t){return t.weekdaysShortRegex(e)});It("dddd",function(e,t){return t.weekdaysRegex(e)});w0(["dd","ddd","dddd"],function(e,t,n,a){var o=n._locale.weekdaysParse(e,a,n._strict);o!=null?t.d=o:or(n).invalidWeekday=e});w0(["d","e","E"],function(e,t,n,a){t[a]=_r(e)});function tM(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function rM(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function y1(e,t){return e.slice(t,7).concat(e.slice(0,t))}var iM="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ib="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),nM="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),sM=y0,aM=y0,oM=y0;function lM(e,t){var n=Pn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?y1(n,this._week.dow):e?n[e.day()]:n}function cM(e){return e===!0?y1(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function uM(e){return e===!0?y1(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function hM(e,t,n){var a,o,l,h=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;a<7;++a)l=Jn([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(l,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(l,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(l,"").toLocaleLowerCase();return n?t==="dddd"?(o=ti.call(this._weekdaysParse,h),o!==-1?o:null):t==="ddd"?(o=ti.call(this._shortWeekdaysParse,h),o!==-1?o:null):(o=ti.call(this._minWeekdaysParse,h),o!==-1?o:null):t==="dddd"?(o=ti.call(this._weekdaysParse,h),o!==-1||(o=ti.call(this._shortWeekdaysParse,h),o!==-1)?o:(o=ti.call(this._minWeekdaysParse,h),o!==-1?o:null)):t==="ddd"?(o=ti.call(this._shortWeekdaysParse,h),o!==-1||(o=ti.call(this._weekdaysParse,h),o!==-1)?o:(o=ti.call(this._minWeekdaysParse,h),o!==-1?o:null)):(o=ti.call(this._minWeekdaysParse,h),o!==-1||(o=ti.call(this._weekdaysParse,h),o!==-1)?o:(o=ti.call(this._shortWeekdaysParse,h),o!==-1?o:null))}function fM(e,t,n){var a,o,l;if(this._weekdaysParseExact)return hM.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),a=0;a<7;a++){if(o=Jn([2e3,1]).day(a),n&&!this._fullWeekdaysParse[a]&&(this._fullWeekdaysParse[a]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[a]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[a]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[a]||(l="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[a]=new RegExp(l.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[a].test(e))return a;if(n&&t==="ddd"&&this._shortWeekdaysParse[a].test(e))return a;if(n&&t==="dd"&&this._minWeekdaysParse[a].test(e))return a;if(!n&&this._weekdaysParse[a].test(e))return a}}function dM(e){if(!this.isValid())return e!=null?this:NaN;var t=c0(this,"Day");return e!=null?(e=tM(e,this.localeData()),this.add(e-t,"d")):t}function pM(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function gM(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=rM(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function vM(e){return this._weekdaysParseExact?(Mr(this,"_weekdaysRegex")||w1.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(Mr(this,"_weekdaysRegex")||(this._weekdaysRegex=sM),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function mM(e){return this._weekdaysParseExact?(Mr(this,"_weekdaysRegex")||w1.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Mr(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=aM),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function _M(e){return this._weekdaysParseExact?(Mr(this,"_weekdaysRegex")||w1.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Mr(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=oM),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function w1(){function e(M,C){return C.length-M.length}var t=[],n=[],a=[],o=[],l,h,f,b,S;for(l=0;l<7;l++)h=Jn([2e3,1]).day(l),f=Ts(this.weekdaysMin(h,"")),b=Ts(this.weekdaysShort(h,"")),S=Ts(this.weekdays(h,"")),t.push(f),n.push(b),a.push(S),o.push(f),o.push(b),o.push(S);t.sort(e),n.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function S1(){return this.hours()%12||12}function bM(){return this.hours()||24}Bt("H",["HH",2],0,"hour");Bt("h",["hh",2],0,S1);Bt("k",["kk",2],0,bM);Bt("hmm",0,0,function(){return""+S1.apply(this)+Qn(this.minutes(),2)});Bt("hmmss",0,0,function(){return""+S1.apply(this)+Qn(this.minutes(),2)+Qn(this.seconds(),2)});Bt("Hmm",0,0,function(){return""+this.hours()+Qn(this.minutes(),2)});Bt("Hmmss",0,0,function(){return""+this.hours()+Qn(this.minutes(),2)+Qn(this.seconds(),2)});function Nb(e,t){Bt(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Nb("a",!0);Nb("A",!1);function Lb(e,t){return t._meridiemParse}It("a",Lb);It("A",Lb);It("H",zr,_1);It("h",zr,wo);It("k",zr,wo);It("HH",zr,ln);It("hh",zr,ln);It("kk",zr,ln);It("hmm",wb);It("hmmss",Sb);It("Hmm",wb);It("Hmmss",Sb);Nr(["H","HH"],hi);Nr(["k","kk"],function(e,t,n){var a=_r(e);t[hi]=a===24?0:a});Nr(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});Nr(["h","hh"],function(e,t,n){t[hi]=_r(e),or(n).bigHour=!0});Nr("hmm",function(e,t,n){var a=e.length-2;t[hi]=_r(e.substr(0,a)),t[Tn]=_r(e.substr(a)),or(n).bigHour=!0});Nr("hmmss",function(e,t,n){var a=e.length-4,o=e.length-2;t[hi]=_r(e.substr(0,a)),t[Tn]=_r(e.substr(a,2)),t[As]=_r(e.substr(o)),or(n).bigHour=!0});Nr("Hmm",function(e,t,n){var a=e.length-2;t[hi]=_r(e.substr(0,a)),t[Tn]=_r(e.substr(a))});Nr("Hmmss",function(e,t,n){var a=e.length-4,o=e.length-2;t[hi]=_r(e.substr(0,a)),t[Tn]=_r(e.substr(a,2)),t[As]=_r(e.substr(o))});function yM(e){return(e+"").toLowerCase().charAt(0)==="p"}var wM=/[ap]\.?m?\.?/i,SM=So("Hours",!0);function xM(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Ob={calendar:hk,longDateFormat:gk,invalidDate:mk,ordinal:bk,dayOfMonthOrdinalParse:yk,relativeTime:Sk,months:qk,monthsShort:kb,week:Xk,weekdays:iM,weekdaysMin:nM,weekdaysShort:Ib,meridiemParse:wM},Hr={},t0={},f0;function CM(e,t){var n,a=Math.min(e.length,t.length);for(n=0;n<a;n+=1)if(e[n]!==t[n])return n;return a}function pv(e){return e&&e.toLowerCase().replace("_","-")}function kM(e){for(var t=0,n,a,o,l;t<e.length;){for(l=pv(e[t]).split("-"),n=l.length,a=pv(e[t+1]),a=a?a.split("-"):null;n>0;){if(o=jl(l.slice(0,n).join("-")),o)return o;if(a&&a.length>=n&&CM(l,a)>=n-1)break;n--}t++}return f0}function MM(e){return!!(e&&e.match("^[^/\\\\]*$"))}function jl(e){var t=null,n;if(Hr[e]===void 0&&typeof module<"u"&&module&&module.exports&&MM(e))try{t=f0._abbr,n=require,n("./locale/"+e),ta(t)}catch{Hr[e]=null}return Hr[e]}function ta(e,t){var n;return e&&(Ki(t)?n=Ls(e):n=x1(e,t),n?f0=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),f0._abbr}function x1(e,t){if(t!==null){var n,a=Ob;if(t.abbr=e,Hr[e]!=null)mb("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),a=Hr[e]._config;else if(t.parentLocale!=null)if(Hr[t.parentLocale]!=null)a=Hr[t.parentLocale]._config;else if(n=jl(t.parentLocale),n!=null)a=n._config;else return t0[t.parentLocale]||(t0[t.parentLocale]=[]),t0[t.parentLocale].push({name:e,config:t}),null;return Hr[e]=new d1(Md(a,t)),t0[e]&&t0[e].forEach(function(o){x1(o.name,o.config)}),ta(e),Hr[e]}else return delete Hr[e],null}function EM(e,t){if(t!=null){var n,a,o=Ob;Hr[e]!=null&&Hr[e].parentLocale!=null?Hr[e].set(Md(Hr[e]._config,t)):(a=jl(e),a!=null&&(o=a._config),t=Md(o,t),a==null&&(t.abbr=e),n=new d1(t),n.parentLocale=Hr[e],Hr[e]=n),ta(e)}else Hr[e]!=null&&(Hr[e].parentLocale!=null?(Hr[e]=Hr[e].parentLocale,e===ta()&&ta(e)):Hr[e]!=null&&delete Hr[e]);return Hr[e]}function Ls(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return f0;if(!Pn(e)){if(t=jl(e),t)return t;e=[e]}return kM(e)}function AM(){return Ed(Hr)}function C1(e){var t,n=e._a;return n&&or(e).overflow===-2&&(t=n[Es]<0||n[Es]>11?Es:n[Xn]<1||n[Xn]>b1(n[Ii],n[Es])?Xn:n[hi]<0||n[hi]>24||n[hi]===24&&(n[Tn]!==0||n[As]!==0||n[Pa]!==0)?hi:n[Tn]<0||n[Tn]>59?Tn:n[As]<0||n[As]>59?As:n[Pa]<0||n[Pa]>999?Pa:-1,or(e)._overflowDayOfYear&&(t<Ii||t>Xn)&&(t=Xn),or(e)._overflowWeeks&&t===-1&&(t=Nk),or(e)._overflowWeekday&&t===-1&&(t=Lk),or(e).overflow=t),e}var TM=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,PM=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,IM=/Z|[+-]\d\d(?::?\d\d)?/,hl=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],mu=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],NM=/^\/?Date\((-?\d+)/i,LM=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,OM={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Db(e){var t,n,a=e._i,o=TM.exec(a)||PM.exec(a),l,h,f,b,S=hl.length,M=mu.length;if(o){for(or(e).iso=!0,t=0,n=S;t<n;t++)if(hl[t][1].exec(o[1])){h=hl[t][0],l=hl[t][2]!==!1;break}if(h==null){e._isValid=!1;return}if(o[3]){for(t=0,n=M;t<n;t++)if(mu[t][1].exec(o[3])){f=(o[2]||" ")+mu[t][0];break}if(f==null){e._isValid=!1;return}}if(!l&&f!=null){e._isValid=!1;return}if(o[4])if(IM.exec(o[4]))b="Z";else{e._isValid=!1;return}e._f=h+(f||"")+(b||""),M1(e)}else e._isValid=!1}function DM(e,t,n,a,o,l){var h=[RM(e),kb.indexOf(t),parseInt(n,10),parseInt(a,10),parseInt(o,10)];return l&&h.push(parseInt(l,10)),h}function RM(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function BM(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function qM(e,t,n){if(e){var a=Ib.indexOf(e),o=new Date(t[0],t[1],t[2]).getDay();if(a!==o)return or(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function FM(e,t,n){if(e)return OM[e];if(t)return 0;var a=parseInt(n,10),o=a%100,l=(a-o)/100;return l*60+o}function Rb(e){var t=LM.exec(BM(e._i)),n;if(t){if(n=DM(t[4],t[3],t[2],t[5],t[6],t[7]),!qM(t[1],n,e))return;e._a=n,e._tzm=FM(t[8],t[9],t[10]),e._d=u0.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),or(e).rfc2822=!0}else e._isValid=!1}function zM(e){var t=NM.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Db(e),e._isValid===!1)delete e._isValid;else return;if(Rb(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:Tt.createFromInputFallback(e)}Tt.createFromInputFallback=yn("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function uo(e,t,n){return e??t??n}function HM(e){var t=new Date(Tt.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function k1(e){var t,n,a=[],o,l,h;if(!e._d){for(o=HM(e),e._w&&e._a[Xn]==null&&e._a[Es]==null&&VM(e),e._dayOfYear!=null&&(h=uo(e._a[Ii],o[Ii]),(e._dayOfYear>a0(h)||e._dayOfYear===0)&&(or(e)._overflowDayOfYear=!0),n=u0(h,0,e._dayOfYear),e._a[Es]=n.getUTCMonth(),e._a[Xn]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=a[t]=o[t];for(;t<7;t++)e._a[t]=a[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[hi]===24&&e._a[Tn]===0&&e._a[As]===0&&e._a[Pa]===0&&(e._nextDay=!0,e._a[hi]=0),e._d=(e._useUTC?u0:Kk).apply(null,a),l=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[hi]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==l&&(or(e).weekdayMismatch=!0)}}function VM(e){var t,n,a,o,l,h,f,b,S;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(l=1,h=4,n=uo(t.GG,e._a[Ii],h0(Fr(),1,4).year),a=uo(t.W,1),o=uo(t.E,1),(o<1||o>7)&&(b=!0)):(l=e._locale._week.dow,h=e._locale._week.doy,S=h0(Fr(),l,h),n=uo(t.gg,e._a[Ii],S.year),a=uo(t.w,S.week),t.d!=null?(o=t.d,(o<0||o>6)&&(b=!0)):t.e!=null?(o=t.e+l,(t.e<0||t.e>6)&&(b=!0)):o=l),a<1||a>Ps(n,l,h)?or(e)._overflowWeeks=!0:b!=null?or(e)._overflowWeekday=!0:(f=Pb(n,a,o,l,h),e._a[Ii]=f.year,e._dayOfYear=f.dayOfYear)}Tt.ISO_8601=function(){};Tt.RFC_2822=function(){};function M1(e){if(e._f===Tt.ISO_8601){Db(e);return}if(e._f===Tt.RFC_2822){Rb(e);return}e._a=[],or(e).empty=!0;var t=""+e._i,n,a,o,l,h,f=t.length,b=0,S,M;for(o=_b(e._f,e._locale).match(p1)||[],M=o.length,n=0;n<M;n++)l=o[n],a=(t.match(Tk(l,e))||[])[0],a&&(h=t.substr(0,t.indexOf(a)),h.length>0&&or(e).unusedInput.push(h),t=t.slice(t.indexOf(a)+a.length),b+=a.length),mo[l]?(a?or(e).empty=!1:or(e).unusedTokens.push(l),Ik(l,a,e)):e._strict&&!a&&or(e).unusedTokens.push(l);or(e).charsLeftOver=f-b,t.length>0&&or(e).unusedInput.push(t),e._a[hi]<=12&&or(e).bigHour===!0&&e._a[hi]>0&&(or(e).bigHour=void 0),or(e).parsedDateParts=e._a.slice(0),or(e).meridiem=e._meridiem,e._a[hi]=UM(e._locale,e._a[hi],e._meridiem),S=or(e).era,S!==null&&(e._a[Ii]=e._locale.erasConvertYear(S,e._a[Ii])),k1(e),C1(e)}function UM(e,t,n){var a;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(a=e.isPM(n),a&&t<12&&(t+=12),!a&&t===12&&(t=0)),t)}function GM(e){var t,n,a,o,l,h,f=!1,b=e._f.length;if(b===0){or(e).invalidFormat=!0,e._d=new Date(NaN);return}for(o=0;o<b;o++)l=0,h=!1,t=f1({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[o],M1(t),h1(t)&&(h=!0),l+=or(t).charsLeftOver,l+=or(t).unusedTokens.length*10,or(t).score=l,f?l<a&&(a=l,n=t):(a==null||l<a||h)&&(a=l,n=t,h&&(f=!0));Js(e,n||t)}function YM(e){if(!e._d){var t=g1(e._i),n=t.day===void 0?t.date:t.day;e._a=gb([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(a){return a&&parseInt(a,10)}),k1(e)}}function WM(e){var t=new b0(C1(Bb(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Bb(e){var t=e._i,n=e._f;return e._locale=e._locale||Ls(e._l),t===null||n===void 0&&t===""?Vl({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),In(t)?new b0(C1(t)):(_0(t)?e._d=t:Pn(n)?GM(e):n?M1(e):$M(e),h1(e)||(e._d=null),e))}function $M(e){var t=e._i;Ki(t)?e._d=new Date(Tt.now()):_0(t)?e._d=new Date(t.valueOf()):typeof t=="string"?zM(e):Pn(t)?(e._a=gb(t.slice(0),function(n){return parseInt(n,10)}),k1(e)):Na(t)?YM(e):Is(t)?e._d=new Date(t):Tt.createFromInputFallback(e)}function qb(e,t,n,a,o){var l={};return(t===!0||t===!1)&&(a=t,t=void 0),(n===!0||n===!1)&&(a=n,n=void 0),(Na(e)&&u1(e)||Pn(e)&&e.length===0)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=o,l._l=n,l._i=e,l._f=t,l._strict=a,WM(l)}function Fr(e,t,n,a){return qb(e,t,n,a,!1)}var KM=yn("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Fr.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Vl()}),jM=yn("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Fr.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Vl()});function Fb(e,t){var n,a;if(t.length===1&&Pn(t[0])&&(t=t[0]),!t.length)return Fr();for(n=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](n))&&(n=t[a]);return n}function XM(){var e=[].slice.call(arguments,0);return Fb("isBefore",e)}function QM(){var e=[].slice.call(arguments,0);return Fb("isAfter",e)}var ZM=function(){return Date.now?Date.now():+new Date},r0=["year","quarter","month","week","day","hour","minute","second","millisecond"];function JM(e){var t,n=!1,a,o=r0.length;for(t in e)if(Mr(e,t)&&!(ti.call(r0,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(a=0;a<o;++a)if(e[r0[a]]){if(n)return!1;parseFloat(e[r0[a]])!==_r(e[r0[a]])&&(n=!0)}return!0}function eE(){return this._isValid}function tE(){return Ln(NaN)}function Xl(e){var t=g1(e),n=t.year||0,a=t.quarter||0,o=t.month||0,l=t.week||t.isoWeek||0,h=t.day||0,f=t.hour||0,b=t.minute||0,S=t.second||0,M=t.millisecond||0;this._isValid=JM(t),this._milliseconds=+M+S*1e3+b*6e4+f*1e3*60*60,this._days=+h+l*7,this._months=+o+a*3+n*12,this._data={},this._locale=Ls(),this._bubble()}function yl(e){return e instanceof Xl}function Td(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function rE(e,t,n){var a=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),l=0,h;for(h=0;h<a;h++)_r(e[h])!==_r(t[h])&&l++;return l+o}function zb(e,t){Bt(e,0,0,function(){var n=this.utcOffset(),a="+";return n<0&&(n=-n,a="-"),a+Qn(~~(n/60),2)+t+Qn(~~n%60,2)})}zb("Z",":");zb("ZZ","");It("Z",$l);It("ZZ",$l);Nr(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=E1($l,e)});var iE=/([\+\-]|\d\d)/gi;function E1(e,t){var n=(t||"").match(e),a,o,l;return n===null?null:(a=n[n.length-1]||[],o=(a+"").match(iE)||["-",0,0],l=+(o[1]*60)+_r(o[2]),l===0?0:o[0]==="+"?l:-l)}function A1(e,t){var n,a;return t._isUTC?(n=t.clone(),a=(In(e)||_0(e)?e.valueOf():Fr(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),Tt.updateOffset(n,!1),n):Fr(e).local()}function Pd(e){return-Math.round(e._d.getTimezoneOffset())}Tt.updateOffset=function(){};function nE(e,t,n){var a=this._offset||0,o;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=E1($l,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(o=Pd(this)),this._offset=e,this._isUTC=!0,o!=null&&this.add(o,"m"),a!==e&&(!t||this._changeInProgress?Ub(this,Ln(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Tt.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?a:Pd(this)}function sE(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function aE(e){return this.utcOffset(0,e)}function oE(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Pd(this),"m")),this}function lE(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=E1(Ek,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function cE(e){return this.isValid()?(e=e?Fr(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function uE(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function hE(){if(!Ki(this._isDSTShifted))return this._isDSTShifted;var e={},t;return f1(e,this),e=Bb(e),e._a?(t=e._isUTC?Jn(e._a):Fr(e._a),this._isDSTShifted=this.isValid()&&rE(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function fE(){return this.isValid()?!this._isUTC:!1}function dE(){return this.isValid()?this._isUTC:!1}function Hb(){return this.isValid()?this._isUTC&&this._offset===0:!1}var pE=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,gE=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ln(e,t){var n=e,a=null,o,l,h;return yl(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:Is(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(a=pE.exec(e))?(o=a[1]==="-"?-1:1,n={y:0,d:_r(a[Xn])*o,h:_r(a[hi])*o,m:_r(a[Tn])*o,s:_r(a[As])*o,ms:_r(Td(a[Pa]*1e3))*o}):(a=gE.exec(e))?(o=a[1]==="-"?-1:1,n={y:Aa(a[2],o),M:Aa(a[3],o),w:Aa(a[4],o),d:Aa(a[5],o),h:Aa(a[6],o),m:Aa(a[7],o),s:Aa(a[8],o)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(h=vE(Fr(n.from),Fr(n.to)),n={},n.ms=h.milliseconds,n.M=h.months),l=new Xl(n),yl(e)&&Mr(e,"_locale")&&(l._locale=e._locale),yl(e)&&Mr(e,"_isValid")&&(l._isValid=e._isValid),l}Ln.fn=Xl.prototype;Ln.invalid=tE;function Aa(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function gv(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function vE(e,t){var n;return e.isValid()&&t.isValid()?(t=A1(t,e),e.isBefore(t)?n=gv(e,t):(n=gv(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Vb(e,t){return function(n,a){var o,l;return a!==null&&!isNaN(+a)&&(mb(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),l=n,n=a,a=l),o=Ln(n,a),Ub(this,o,e),this}}function Ub(e,t,n,a){var o=t._milliseconds,l=Td(t._days),h=Td(t._months);e.isValid()&&(a=a??!0,h&&Eb(e,c0(e,"Month")+h*n),l&&Cb(e,"Date",c0(e,"Date")+l*n),o&&e._d.setTime(e._d.valueOf()+o*n),a&&Tt.updateOffset(e,l||h))}var mE=Vb(1,"add"),_E=Vb(-1,"subtract");function Gb(e){return typeof e=="string"||e instanceof String}function bE(e){return In(e)||_0(e)||Gb(e)||Is(e)||wE(e)||yE(e)||e===null||e===void 0}function yE(e){var t=Na(e)&&!u1(e),n=!1,a=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],o,l,h=a.length;for(o=0;o<h;o+=1)l=a[o],n=n||Mr(e,l);return t&&n}function wE(e){var t=Pn(e),n=!1;return t&&(n=e.filter(function(a){return!Is(a)&&Gb(e)}).length===0),t&&n}function SE(e){var t=Na(e)&&!u1(e),n=!1,a=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],o,l;for(o=0;o<a.length;o+=1)l=a[o],n=n||Mr(e,l);return t&&n}function xE(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function CE(e,t){arguments.length===1&&(arguments[0]?bE(arguments[0])?(e=arguments[0],t=void 0):SE(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Fr(),a=A1(n,this).startOf("day"),o=Tt.calendarFormat(this,a)||"sameElse",l=t&&(es(t[o])?t[o].call(this,n):t[o]);return this.format(l||this.localeData().calendar(o,this,Fr(n)))}function kE(){return new b0(this)}function ME(e,t){var n=In(e)?e:Fr(e);return this.isValid()&&n.isValid()?(t=wn(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function EE(e,t){var n=In(e)?e:Fr(e);return this.isValid()&&n.isValid()?(t=wn(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function AE(e,t,n,a){var o=In(e)?e:Fr(e),l=In(t)?t:Fr(t);return this.isValid()&&o.isValid()&&l.isValid()?(a=a||"()",(a[0]==="("?this.isAfter(o,n):!this.isBefore(o,n))&&(a[1]===")"?this.isBefore(l,n):!this.isAfter(l,n))):!1}function TE(e,t){var n=In(e)?e:Fr(e),a;return this.isValid()&&n.isValid()?(t=wn(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(a=n.valueOf(),this.clone().startOf(t).valueOf()<=a&&a<=this.clone().endOf(t).valueOf())):!1}function PE(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function IE(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function NE(e,t,n){var a,o,l;if(!this.isValid())return NaN;if(a=A1(e,this),!a.isValid())return NaN;switch(o=(a.utcOffset()-this.utcOffset())*6e4,t=wn(t),t){case"year":l=wl(this,a)/12;break;case"month":l=wl(this,a);break;case"quarter":l=wl(this,a)/3;break;case"second":l=(this-a)/1e3;break;case"minute":l=(this-a)/6e4;break;case"hour":l=(this-a)/36e5;break;case"day":l=(this-a-o)/864e5;break;case"week":l=(this-a-o)/6048e5;break;default:l=this-a}return n?l:mn(l)}function wl(e,t){if(e.date()<t.date())return-wl(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),a=e.clone().add(n,"months"),o,l;return t-a<0?(o=e.clone().add(n-1,"months"),l=(t-a)/(a-o)):(o=e.clone().add(n+1,"months"),l=(t-a)/(o-a)),-(n+l)||0}Tt.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";Tt.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function LE(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function OE(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?bl(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):es(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",bl(n,"Z")):bl(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function DE(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,a,o,l;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',a=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o="-MM-DD[T]HH:mm:ss.SSS",l=t+'[")]',this.format(n+a+o+l)}function RE(e){e||(e=this.isUtc()?Tt.defaultFormatUtc:Tt.defaultFormat);var t=bl(this,e);return this.localeData().postformat(t)}function BE(e,t){return this.isValid()&&(In(e)&&e.isValid()||Fr(e).isValid())?Ln({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function qE(e){return this.from(Fr(),e)}function FE(e,t){return this.isValid()&&(In(e)&&e.isValid()||Fr(e).isValid())?Ln({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function zE(e){return this.to(Fr(),e)}function Yb(e){var t;return e===void 0?this._locale._abbr:(t=Ls(e),t!=null&&(this._locale=t),this)}var Wb=yn("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function $b(){return this._locale}var Ll=1e3,_o=60*Ll,Ol=60*_o,Kb=(365*400+97)*24*Ol;function bo(e,t){return(e%t+t)%t}function jb(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Kb:new Date(e,t,n).valueOf()}function Xb(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Kb:Date.UTC(e,t,n)}function HE(e){var t,n;if(e=wn(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Xb:jb,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=bo(t+(this._isUTC?0:this.utcOffset()*_o),Ol);break;case"minute":t=this._d.valueOf(),t-=bo(t,_o);break;case"second":t=this._d.valueOf(),t-=bo(t,Ll);break}return this._d.setTime(t),Tt.updateOffset(this,!0),this}function VE(e){var t,n;if(e=wn(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Xb:jb,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Ol-bo(t+(this._isUTC?0:this.utcOffset()*_o),Ol)-1;break;case"minute":t=this._d.valueOf(),t+=_o-bo(t,_o)-1;break;case"second":t=this._d.valueOf(),t+=Ll-bo(t,Ll)-1;break}return this._d.setTime(t),Tt.updateOffset(this,!0),this}function UE(){return this._d.valueOf()-(this._offset||0)*6e4}function GE(){return Math.floor(this.valueOf()/1e3)}function YE(){return new Date(this.valueOf())}function WE(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function $E(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function KE(){return this.isValid()?this.toISOString():null}function jE(){return h1(this)}function XE(){return Js({},or(this))}function QE(){return or(this).overflow}function ZE(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Bt("N",0,0,"eraAbbr");Bt("NN",0,0,"eraAbbr");Bt("NNN",0,0,"eraAbbr");Bt("NNNN",0,0,"eraName");Bt("NNNNN",0,0,"eraNarrow");Bt("y",["y",1],"yo","eraYear");Bt("y",["yy",2],0,"eraYear");Bt("y",["yyy",3],0,"eraYear");Bt("y",["yyyy",4],0,"eraYear");It("N",T1);It("NN",T1);It("NNN",T1);It("NNNN",cA);It("NNNNN",uA);Nr(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,a){var o=n._locale.erasParse(e,a,n._strict);o?or(n).era=o:or(n).invalidEra=e});It("y",yo);It("yy",yo);It("yyy",yo);It("yyyy",yo);It("yo",hA);Nr(["y","yy","yyy","yyyy"],Ii);Nr(["yo"],function(e,t,n,a){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ii]=n._locale.eraYearOrdinalParse(e,o):t[Ii]=parseInt(e,10)});function JE(e,t){var n,a,o,l=this._eras||Ls("en")._eras;for(n=0,a=l.length;n<a;++n){switch(typeof l[n].since){case"string":o=Tt(l[n].since).startOf("day"),l[n].since=o.valueOf();break}switch(typeof l[n].until){case"undefined":l[n].until=1/0;break;case"string":o=Tt(l[n].until).startOf("day").valueOf(),l[n].until=o.valueOf();break}}return l}function eA(e,t,n){var a,o,l=this.eras(),h,f,b;for(e=e.toUpperCase(),a=0,o=l.length;a<o;++a)if(h=l[a].name.toUpperCase(),f=l[a].abbr.toUpperCase(),b=l[a].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(f===e)return l[a];break;case"NNNN":if(h===e)return l[a];break;case"NNNNN":if(b===e)return l[a];break}else if([h,f,b].indexOf(e)>=0)return l[a]}function tA(e,t){var n=e.since<=e.until?1:-1;return t===void 0?Tt(e.since).year():Tt(e.since).year()+(t-e.offset)*n}function rA(){var e,t,n,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),a[e].since<=n&&n<=a[e].until||a[e].until<=n&&n<=a[e].since)return a[e].name;return""}function iA(){var e,t,n,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),a[e].since<=n&&n<=a[e].until||a[e].until<=n&&n<=a[e].since)return a[e].narrow;return""}function nA(){var e,t,n,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),a[e].since<=n&&n<=a[e].until||a[e].until<=n&&n<=a[e].since)return a[e].abbr;return""}function sA(){var e,t,n,a,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e)if(n=o[e].since<=o[e].until?1:-1,a=this.clone().startOf("day").valueOf(),o[e].since<=a&&a<=o[e].until||o[e].until<=a&&a<=o[e].since)return(this.year()-Tt(o[e].since).year())*n+o[e].offset;return this.year()}function aA(e){return Mr(this,"_erasNameRegex")||P1.call(this),e?this._erasNameRegex:this._erasRegex}function oA(e){return Mr(this,"_erasAbbrRegex")||P1.call(this),e?this._erasAbbrRegex:this._erasRegex}function lA(e){return Mr(this,"_erasNarrowRegex")||P1.call(this),e?this._erasNarrowRegex:this._erasRegex}function T1(e,t){return t.erasAbbrRegex(e)}function cA(e,t){return t.erasNameRegex(e)}function uA(e,t){return t.erasNarrowRegex(e)}function hA(e,t){return t._eraYearOrdinalRegex||yo}function P1(){var e=[],t=[],n=[],a=[],o,l,h,f,b,S=this.eras();for(o=0,l=S.length;o<l;++o)h=Ts(S[o].name),f=Ts(S[o].abbr),b=Ts(S[o].narrow),t.push(h),e.push(f),n.push(b),a.push(h),a.push(f),a.push(b);this._erasRegex=new RegExp("^("+a.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}Bt(0,["gg",2],0,function(){return this.weekYear()%100});Bt(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ql(e,t){Bt(0,[e,e.length],0,t)}Ql("gggg","weekYear");Ql("ggggg","weekYear");Ql("GGGG","isoWeekYear");Ql("GGGGG","isoWeekYear");It("G",Wl);It("g",Wl);It("GG",zr,ln);It("gg",zr,ln);It("GGGG",m1,v1);It("gggg",m1,v1);It("GGGGG",Yl,Ul);It("ggggg",Yl,Ul);w0(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,a){t[a.substr(0,2)]=_r(e)});w0(["gg","GG"],function(e,t,n,a){t[a]=Tt.parseTwoDigitYear(e)});function fA(e){return Qb.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function dA(e){return Qb.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function pA(){return Ps(this.year(),1,4)}function gA(){return Ps(this.isoWeekYear(),1,4)}function vA(){var e=this.localeData()._week;return Ps(this.year(),e.dow,e.doy)}function mA(){var e=this.localeData()._week;return Ps(this.weekYear(),e.dow,e.doy)}function Qb(e,t,n,a,o){var l;return e==null?h0(this,a,o).year:(l=Ps(e,a,o),t>l&&(t=l),_A.call(this,e,t,n,a,o))}function _A(e,t,n,a,o){var l=Pb(e,t,n,a,o),h=u0(l.year,0,l.dayOfYear);return this.year(h.getUTCFullYear()),this.month(h.getUTCMonth()),this.date(h.getUTCDate()),this}Bt("Q",0,"Qo","quarter");It("Q",bb);Nr("Q",function(e,t){t[Es]=(_r(e)-1)*3});function bA(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Bt("D",["DD",2],"Do","date");It("D",zr,wo);It("DD",zr,ln);It("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});Nr(["D","DD"],Xn);Nr("Do",function(e,t){t[Xn]=_r(e.match(zr)[0])});var Zb=So("Date",!0);Bt("DDD",["DDDD",3],"DDDo","dayOfYear");It("DDD",Gl);It("DDDD",yb);Nr(["DDD","DDDD"],function(e,t,n){n._dayOfYear=_r(e)});function yA(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Bt("m",["mm",2],0,"minute");It("m",zr,_1);It("mm",zr,ln);Nr(["m","mm"],Tn);var wA=So("Minutes",!1);Bt("s",["ss",2],0,"second");It("s",zr,_1);It("ss",zr,ln);Nr(["s","ss"],As);var SA=So("Seconds",!1);Bt("S",0,0,function(){return~~(this.millisecond()/100)});Bt(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Bt(0,["SSS",3],0,"millisecond");Bt(0,["SSSS",4],0,function(){return this.millisecond()*10});Bt(0,["SSSSS",5],0,function(){return this.millisecond()*100});Bt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Bt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Bt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Bt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});It("S",Gl,bb);It("SS",Gl,ln);It("SSS",Gl,yb);var ea,Jb;for(ea="SSSS";ea.length<=9;ea+="S")It(ea,yo);function xA(e,t){t[Pa]=_r(("0."+e)*1e3)}for(ea="S";ea.length<=9;ea+="S")Nr(ea,xA);Jb=So("Milliseconds",!1);Bt("z",0,0,"zoneAbbr");Bt("zz",0,0,"zoneName");function CA(){return this._isUTC?"UTC":""}function kA(){return this._isUTC?"Coordinated Universal Time":""}var gt=b0.prototype;gt.add=mE;gt.calendar=CE;gt.clone=kE;gt.diff=NE;gt.endOf=VE;gt.format=RE;gt.from=BE;gt.fromNow=qE;gt.to=FE;gt.toNow=zE;gt.get=Dk;gt.invalidAt=QE;gt.isAfter=ME;gt.isBefore=EE;gt.isBetween=AE;gt.isSame=TE;gt.isSameOrAfter=PE;gt.isSameOrBefore=IE;gt.isValid=jE;gt.lang=Wb;gt.locale=Yb;gt.localeData=$b;gt.max=jM;gt.min=KM;gt.parsingFlags=XE;gt.set=Rk;gt.startOf=HE;gt.subtract=_E;gt.toArray=WE;gt.toObject=$E;gt.toDate=YE;gt.toISOString=OE;gt.inspect=DE;typeof Symbol<"u"&&Symbol.for!=null&&(gt[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});gt.toJSON=KE;gt.toString=LE;gt.unix=GE;gt.valueOf=UE;gt.creationData=ZE;gt.eraName=rA;gt.eraNarrow=iA;gt.eraAbbr=nA;gt.eraYear=sA;gt.year=xb;gt.isLeapYear=Ok;gt.weekYear=fA;gt.isoWeekYear=dA;gt.quarter=gt.quarters=bA;gt.month=Ab;gt.daysInMonth=Yk;gt.week=gt.weeks=Jk;gt.isoWeek=gt.isoWeeks=eM;gt.weeksInYear=vA;gt.weeksInWeekYear=mA;gt.isoWeeksInYear=pA;gt.isoWeeksInISOWeekYear=gA;gt.date=Zb;gt.day=gt.days=dM;gt.weekday=pM;gt.isoWeekday=gM;gt.dayOfYear=yA;gt.hour=gt.hours=SM;gt.minute=gt.minutes=wA;gt.second=gt.seconds=SA;gt.millisecond=gt.milliseconds=Jb;gt.utcOffset=nE;gt.utc=aE;gt.local=oE;gt.parseZone=lE;gt.hasAlignedHourOffset=cE;gt.isDST=uE;gt.isLocal=fE;gt.isUtcOffset=dE;gt.isUtc=Hb;gt.isUTC=Hb;gt.zoneAbbr=CA;gt.zoneName=kA;gt.dates=yn("dates accessor is deprecated. Use date instead.",Zb);gt.months=yn("months accessor is deprecated. Use month instead",Ab);gt.years=yn("years accessor is deprecated. Use year instead",xb);gt.zone=yn("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",sE);gt.isDSTShifted=yn("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",hE);function MA(e){return Fr(e*1e3)}function EA(){return Fr.apply(null,arguments).parseZone()}function ey(e){return e}var Er=d1.prototype;Er.calendar=fk;Er.longDateFormat=vk;Er.invalidDate=_k;Er.ordinal=wk;Er.preparse=ey;Er.postformat=ey;Er.relativeTime=xk;Er.pastFuture=Ck;Er.set=uk;Er.eras=JE;Er.erasParse=eA;Er.erasConvertYear=tA;Er.erasAbbrRegex=oA;Er.erasNameRegex=aA;Er.erasNarrowRegex=lA;Er.months=Hk;Er.monthsShort=Vk;Er.monthsParse=Gk;Er.monthsRegex=$k;Er.monthsShortRegex=Wk;Er.week=jk;Er.firstDayOfYear=Zk;Er.firstDayOfWeek=Qk;Er.weekdays=lM;Er.weekdaysMin=uM;Er.weekdaysShort=cM;Er.weekdaysParse=fM;Er.weekdaysRegex=vM;Er.weekdaysShortRegex=mM;Er.weekdaysMinRegex=_M;Er.isPM=yM;Er.meridiem=xM;function Dl(e,t,n,a){var o=Ls(),l=Jn().set(a,t);return o[n](l,e)}function ty(e,t,n){if(Is(e)&&(t=e,e=void 0),e=e||"",t!=null)return Dl(e,t,n,"month");var a,o=[];for(a=0;a<12;a++)o[a]=Dl(e,a,n,"month");return o}function I1(e,t,n,a){typeof e=="boolean"?(Is(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,Is(t)&&(n=t,t=void 0),t=t||"");var o=Ls(),l=e?o._week.dow:0,h,f=[];if(n!=null)return Dl(t,(n+l)%7,a,"day");for(h=0;h<7;h++)f[h]=Dl(t,(h+l)%7,a,"day");return f}function AA(e,t){return ty(e,t,"months")}function TA(e,t){return ty(e,t,"monthsShort")}function PA(e,t,n){return I1(e,t,n,"weekdays")}function IA(e,t,n){return I1(e,t,n,"weekdaysShort")}function NA(e,t,n){return I1(e,t,n,"weekdaysMin")}ta("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=_r(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});Tt.lang=yn("moment.lang is deprecated. Use moment.locale instead.",ta);Tt.langData=yn("moment.langData is deprecated. Use moment.localeData instead.",Ls);var xs=Math.abs;function LA(){var e=this._data;return this._milliseconds=xs(this._milliseconds),this._days=xs(this._days),this._months=xs(this._months),e.milliseconds=xs(e.milliseconds),e.seconds=xs(e.seconds),e.minutes=xs(e.minutes),e.hours=xs(e.hours),e.months=xs(e.months),e.years=xs(e.years),this}function ry(e,t,n,a){var o=Ln(t,n);return e._milliseconds+=a*o._milliseconds,e._days+=a*o._days,e._months+=a*o._months,e._bubble()}function OA(e,t){return ry(this,e,t,1)}function DA(e,t){return ry(this,e,t,-1)}function vv(e){return e<0?Math.floor(e):Math.ceil(e)}function RA(){var e=this._milliseconds,t=this._days,n=this._months,a=this._data,o,l,h,f,b;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=vv(Id(n)+t)*864e5,t=0,n=0),a.milliseconds=e%1e3,o=mn(e/1e3),a.seconds=o%60,l=mn(o/60),a.minutes=l%60,h=mn(l/60),a.hours=h%24,t+=mn(h/24),b=mn(iy(t)),n+=b,t-=vv(Id(b)),f=mn(n/12),n%=12,a.days=t,a.months=n,a.years=f,this}function iy(e){return e*4800/146097}function Id(e){return e*146097/4800}function BA(e){if(!this.isValid())return NaN;var t,n,a=this._milliseconds;if(e=wn(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+a/864e5,n=this._months+iy(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Id(this._months)),e){case"week":return t/7+a/6048e5;case"day":return t+a/864e5;case"hour":return t*24+a/36e5;case"minute":return t*1440+a/6e4;case"second":return t*86400+a/1e3;case"millisecond":return Math.floor(t*864e5)+a;default:throw new Error("Unknown unit "+e)}}function Os(e){return function(){return this.as(e)}}var ny=Os("ms"),qA=Os("s"),FA=Os("m"),zA=Os("h"),HA=Os("d"),VA=Os("w"),UA=Os("M"),GA=Os("Q"),YA=Os("y"),WA=ny;function $A(){return Ln(this)}function KA(e){return e=wn(e),this.isValid()?this[e+"s"]():NaN}function Fa(e){return function(){return this.isValid()?this._data[e]:NaN}}var jA=Fa("milliseconds"),XA=Fa("seconds"),QA=Fa("minutes"),ZA=Fa("hours"),JA=Fa("days"),eT=Fa("months"),tT=Fa("years");function rT(){return mn(this.days()/7)}var Cs=Math.round,fo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function iT(e,t,n,a,o){return o.relativeTime(t||1,!!n,e,a)}function nT(e,t,n,a){var o=Ln(e).abs(),l=Cs(o.as("s")),h=Cs(o.as("m")),f=Cs(o.as("h")),b=Cs(o.as("d")),S=Cs(o.as("M")),M=Cs(o.as("w")),C=Cs(o.as("y")),y=l<=n.ss&&["s",l]||l<n.s&&["ss",l]||h<=1&&["m"]||h<n.m&&["mm",h]||f<=1&&["h"]||f<n.h&&["hh",f]||b<=1&&["d"]||b<n.d&&["dd",b];return n.w!=null&&(y=y||M<=1&&["w"]||M<n.w&&["ww",M]),y=y||S<=1&&["M"]||S<n.M&&["MM",S]||C<=1&&["y"]||["yy",C],y[2]=t,y[3]=+e>0,y[4]=a,iT.apply(null,y)}function sT(e){return e===void 0?Cs:typeof e=="function"?(Cs=e,!0):!1}function aT(e,t){return fo[e]===void 0?!1:t===void 0?fo[e]:(fo[e]=t,e==="s"&&(fo.ss=t-1),!0)}function oT(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,a=fo,o,l;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(a=Object.assign({},fo,t),t.s!=null&&t.ss==null&&(a.ss=t.s-1)),o=this.localeData(),l=nT(this,!n,a,o),n&&(l=o.pastFuture(+this,l)),o.postformat(l)}var _u=Math.abs;function lo(e){return(e>0)-(e<0)||+e}function Zl(){if(!this.isValid())return this.localeData().invalidDate();var e=_u(this._milliseconds)/1e3,t=_u(this._days),n=_u(this._months),a,o,l,h,f=this.asSeconds(),b,S,M,C;return f?(a=mn(e/60),o=mn(a/60),e%=60,a%=60,l=mn(n/12),n%=12,h=e?e.toFixed(3).replace(/\.?0+$/,""):"",b=f<0?"-":"",S=lo(this._months)!==lo(f)?"-":"",M=lo(this._days)!==lo(f)?"-":"",C=lo(this._milliseconds)!==lo(f)?"-":"",b+"P"+(l?S+l+"Y":"")+(n?S+n+"M":"")+(t?M+t+"D":"")+(o||a||e?"T":"")+(o?C+o+"H":"")+(a?C+a+"M":"")+(e?C+h+"S":"")):"P0D"}var Cr=Xl.prototype;Cr.isValid=eE;Cr.abs=LA;Cr.add=OA;Cr.subtract=DA;Cr.as=BA;Cr.asMilliseconds=ny;Cr.asSeconds=qA;Cr.asMinutes=FA;Cr.asHours=zA;Cr.asDays=HA;Cr.asWeeks=VA;Cr.asMonths=UA;Cr.asQuarters=GA;Cr.asYears=YA;Cr.valueOf=WA;Cr._bubble=RA;Cr.clone=$A;Cr.get=KA;Cr.milliseconds=jA;Cr.seconds=XA;Cr.minutes=QA;Cr.hours=ZA;Cr.days=JA;Cr.weeks=rT;Cr.months=eT;Cr.years=tT;Cr.humanize=oT;Cr.toISOString=Zl;Cr.toString=Zl;Cr.toJSON=Zl;Cr.locale=Yb;Cr.localeData=$b;Cr.toIsoString=yn("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Zl);Cr.lang=Wb;Bt("X",0,0,"unix");Bt("x",0,0,"valueOf");It("x",Wl);It("X",Ak);Nr("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});Nr("x",function(e,t,n){n._d=new Date(_r(e))});//! moment.js
134
+ Tt.version="2.30.1";lk(Fr);Tt.fn=gt;Tt.min=XM;Tt.max=QM;Tt.now=ZM;Tt.utc=Jn;Tt.unix=MA;Tt.months=AA;Tt.isDate=_0;Tt.locale=ta;Tt.invalid=Vl;Tt.duration=Ln;Tt.isMoment=In;Tt.weekdays=PA;Tt.parseZone=EA;Tt.localeData=Ls;Tt.isDuration=yl;Tt.monthsShort=TA;Tt.weekdaysMin=NA;Tt.defineLocale=x1;Tt.updateLocale=EM;Tt.locales=AM;Tt.weekdaysShort=IA;Tt.normalizeUnits=wn;Tt.relativeTimeRounding=sT;Tt.relativeTimeThreshold=aT;Tt.calendarFormat=xE;Tt.prototype=gt;Tt.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const lT=Vr({name:"SyllableSeqVis",props:{seq:{type:Object,required:!0},lastTSsuggestion:{type:Number,required:!1,default:0}},setup(e){const t=Lt(0),n=Lt(0),a=Lt(0),o=Lt(500),l=S=>{console.log(`${JSON.stringify(S)}`)},h=Sr(()=>{const M=e.seq.syllables[e.seq.syllables.length-1].timestamp;return Math.max(1,M,e.lastTSsuggestion)}),f=Sr(()=>{let S=0,M=500;return e.seq.syllables.forEach(C=>{C.notes.forEach(y=>{y.note.number>S&&(S=y.note.number),y.note.number<M&&(M=y.note.number)})}),Math.max(3*(S-M)+10,0)}),b=()=>{try{t.value=e.seq.syllables[0].timestamp;const S=e.seq.syllables[e.seq.syllables.length-1].timestamp,M=t.value+e.lastTSsuggestion;n.value=Math.max(S,M)}catch(S){console.log(`[SyllableSeqVis] Error updating bounds: ${S}`)}e.seq.syllables.forEach(S=>{S.notes.forEach(M=>{M.note.number>a.value&&(a.value=M.note.number),M.note.number<o.value&&(o.value=M.note.number)})})};return Nn(()=>{console.log(`SyllableSeqVis created w/ input:
135
+ ${e.seq}`),b()}),{firstTS:t,lastTS:n,high:a,low:o,sayNote:l,getLastTS:h,getHeight:f,updateBounds:b}}}),cT=["height"],uT=["cx","cy","alt","fill","stroke","onMouseenter"];function hT(e,t,n,a,o,l){return St(),Pt("div",null,[(St(),Pt("svg",{width:510,height:Math.max(3*(e.high-e.low)+10,0)},[(St(!0),Pt(qr,null,An(e.seq.syllables,h=>(St(),Pt(qr,null,[(St(!0),Pt(qr,null,An(h.notes,f=>(St(),Pt("circle",{key:h.timestamp+"-"+f.note.number,cx:(h.timestamp-e.firstTS)*500/(e.lastTS-e.firstTS)+4,cy:3*(e.high-f.note.number)+4,alt:f.note.name,r:"3",fill:f.isCorrect?"black":f.isMissing?"none":"red",stroke:f.isMissing?"red":"none",onMouseenter:b=>e.sayNote(f)},null,40,uT))),128))],64))),256))],8,cT))])}const sy=Ur(lT,[["render",hT],["__scopeId","data-v-2f79c080"]]),fT=Vr({name:"NoteDisplay",props:{chroma:{type:Number,required:!0}},setup(e){return{style:o=>{let l="#ffffff";return o===e.chroma?l="#1976D2":(o===1||o===3||o===6||o===8||o===10||o===-2)&&(l="#000000"),{fill:l,"fill-opacity":1,stroke:"#000000","stroke-width":.79375,"stroke-miterlimit":4,"stroke-dasharray":"none","stroke-opacity":1}},white:-1,black:-2}}}),dT={id:"svg8",width:"300px",height:"auto","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","sodipodi:docname":"keys.svg","inkscape:version":"1.0rc1 (09960d6f05, 2020-04-09)",version:"1.1",viewBox:"0 0 175.24936 73.594925"},pT={id:"metadata5"},gT={id:"layer1",transform:"translate(167.75219,-151.96011)","inkscape:groupmode":"layer","inkscape:label":"Layer 1"};function vT(e,t,n,a,o,l){const h=hr("sodipodi:namedview"),f=hr("dc:format"),b=hr("dc:type"),S=hr("dc:title"),M=hr("cc:Work"),C=hr("rdf:RDF");return St(),Pt("svg",dT,[t[1]||(t[1]=ht("defs",{id:"defs2"},null,-1)),xr(h,{id:"base","inkscape:window-maximized":"1","inkscape:window-y":"726","inkscape:window-x":"1491","inkscape:window-height":"1321","inkscape:window-width":"2400",showborder:"false",showgrid:"false","inkscape:document-rotation":"0","inkscape:current-layer":"layer1","inkscape:document-units":"mm","inkscape:cy":"255.88343","inkscape:cx":"754.94284","inkscape:zoom":"0.98994949","inkscape:pageshadow":"2","inkscape:pageopacity":"0.0",borderopacity:"1.0",bordercolor:"#666666",pagecolor:"#ffffff"}),ht("metadata",pT,[xr(C,null,{default:_n(()=>[xr(M,{"rdf:about":""},{default:_n(()=>[xr(f,null,{default:_n(()=>t[0]||(t[0]=[Qr("image/svg+xml")])),_:1}),xr(b,{"rdf:resource":"http://purl.org/dc/dcmitype/StillImage"}),xr(S)]),_:1})]),_:1})]),ht("g",gT,[ht("rect",{id:"rect845",y:"152.19064",x:"-150.12129",height:"73.220116",width:"17.486626",style:ei(e.style(0))},null,4),ht("rect",{id:"rect845-9",style:ei(e.style(2)),width:"17.486626",height:"73.220116",x:"-132.63466",y:"152.19064"},null,4),ht("rect",{id:"rect845-6",style:ei(e.style(4)),width:"17.486626",height:"73.220116",x:"-115.14803",y:"152.19064"},null,4),ht("rect",{id:"rect845-4",style:ei(e.style(5)),width:"17.486626",height:"73.220116",x:"-97.661407",y:"152.19064"},null,4),ht("rect",{id:"rect845-92",style:ei(e.style(7)),width:"17.486626",height:"73.220116",x:"-80.174782",y:"152.19064"},null,4),ht("rect",{id:"rect845-3",style:ei(e.style(9)),width:"17.486626",height:"73.220116",x:"-62.688156",y:"152.19064"},null,4),ht("rect",{id:"rect845-0",style:ei(e.style(11)),width:"17.486626",height:"73.220116",x:"-45.20153",y:"152.19064"},null,4),ht("rect",{id:"rect845-30",style:ei(e.style(e.white)),width:"17.486626",height:"73.220116",x:"-27.714905",y:"152.10745"},null,4),ht("rect",{id:"rect898",ry:"0",y:"152.10744",x:"-138.43532",height:"54.415863",width:"10.466455",style:ei(e.style(1))},null,4),ht("rect",{id:"rect898-3",style:ei(e.style(3)),width:"10.466455",height:"54.415863",x:"-120.84978",y:"152.10744",ry:"0"},null,4),ht("rect",{id:"rect898-7",style:ei(e.style(6)),width:"10.466455",height:"54.415863",x:"-85.678711",y:"152.10744",ry:"0"},null,4),ht("rect",{id:"rect898-8",style:ei(e.style(8)),width:"10.466455",height:"54.415863",x:"-68.09317",y:"152.10744",ry:"0"},null,4),ht("rect",{id:"rect898-1",style:ei(e.style(10)),width:"10.466455",height:"54.415863",x:"-50.507633",y:"152.10744",ry:"0"},null,4),ht("rect",{id:"rect845-30-1",y:"152.10745",x:"-10.228278",height:"73.220116",width:"17.486626",style:ei(e.style(e.white))},null,4),ht("rect",{id:"rect845-30-9",y:"152.10744",x:"-167.60791",height:"73.220116",width:"17.486626",style:ei(e.style(e.white))},null,4),ht("rect",{id:"rect898-4",style:ei(e.style(e.black)),width:"10.466455",height:"54.415863",x:"-15.336554",y:"152.10744",ry:"0"},null,4),ht("rect",{id:"rect898-74",style:ei(e.style(e.black)),width:"4.4679713",height:"54.415863",x:"-167.60791",y:"152.10744",ry:"0"},null,4),ht("rect",{id:"rect898-10",style:ei(e.style(e.black)),width:"5.1863246",height:"54.507248",x:"2.2092075",y:"152.06175",ry:"0"},null,4)])])}const mT=Ur(fT,[["render",vT]]),_T=Vr({name:"Playback",components:{SyllableSeqVis:sy,NoteDisplay:mT},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"Playback"),a=ii(n),o=Lt(),l=Lt(!1),h=Lt("notSet"),f=Lt(!1),b=Lt(0),S=Lt(Tt.utc()),M=Lt(0),C=Lt(0),y=Lt(on([])),g=Lt(!1),w=Lt(on([])),p=Lt(0),E=Lt(""),N=Lt(0),I=Lt(0),O=Lt(),V=Lt();a.question.value=new Ld(e.data);const U=Sr(()=>new Ld(e.data)),D=Sr(()=>on(U.value.midi).syllables[0].notes.length>1?"Lowest note of first chord:":"First note:"),me=Sr(()=>l.value?on(U.value.midi).rootNote.number%12:0),B=()=>{var Y,$,ne;h.value?h.value!==((Y=o.value)==null?void 0:Y.state)&&(l.value=!1,h.value=(($=o.value)==null?void 0:$.state)||"notSet",l.value=!0):(h.value=((ne=o.value)==null?void 0:ne.state)||"notSet",l.value=!0),n.logger.log(`Playback is running init with state: ${h.value}`),h.value==="ready"&&(M.value=U.value.duration,ae())},ie=()=>{try{O.value&&(O.value.style.animationName="",requestAnimationFrame(()=>{requestAnimationFrame(()=>{O.value&&(O.value.style.animationDuration=M.value+"ms",O.value.style.animationName="progress")})}))}catch{setTimeout(ie,50)}},he=()=>{var Y,$,ne;(Y=o.value)==null||Y.record(),f.value=!0,($=o.value)==null||$.addNoteonListenter(we=>{var ye;N.value++,w.value.append(we),(ye=V.value)==null||ye.updateBounds(),N.value+I.value>=U.value.midi.length&&fe()}),(ne=o.value)==null||ne.addNoteoffListenter(()=>{I.value++,N.value+I.value>=U.value.midi.length&&fe()})},ae=()=>{var Y,$,ne;(Y=o.value)==null||Y.stopRecording(),($=o.value)==null||$.eraseRecording(),S.value=Tt.utc(),N.value=0,I.value=0,f.value=!1,b.value=0,ie(),(ne=o.value)==null||ne.play(U.value.midi),setTimeout(()=>{n.logger.log("done playback..."),he()},U.value.lastNoteOnTimestamp)},fe=()=>{var Y;if(!((Y=o.value)!=null&&Y.recording))return!1;const $=on(U.value.midi),ne=on(o.value.recording);return y.value=$.grade(ne),w.value=on([]),a.submitAnswer(o.value.recording).isCorrect?!0:(C.value++,g.value=!0,C.value<a.maxAttemptsPerView.value&&ae(),!1)},le=()=>{N.value>0?fe():ae()};return Nn(async()=>{try{o.value=await c1.instance(),o.value.setStateChangeListener(()=>{B()}),l.value=!0}catch(Y){fl({status:ur.error,text:"Midi device not supported"}),E.value=JSON.stringify(Y),h.value="notsupported",l.value=!0}B(),Bg.addBinding([{hotkey:"space",callback:le,command:"Clear attempt or play again"}])}),r3(()=>{Bg.removeBinding("space")}),{...n,...a,initialized:l,state:h,recording:f,inputSeq:w,lastTSsuggestion:p,gradedSeq:y,graded:g,promptText:D,firstNoteChroma:me,progressBar:O,inputVisRef:V,clearAttempt:le,notesOn:N}}}),bT={key:0,"data-viewable":"Playback"},yT={key:0},wT={class:"text-h4"},ST={class:"text-h5"},xT={key:0},CT={class:"progressContainer"},kT={id:"progress",ref:"progressBar"},MT={key:1},ET={key:2};function AT(e,t,n,a,o,l){const h=hr("note-display"),f=hr("v-icon"),b=hr("v-btn"),S=hr("syllable-seq-vis");return e.initialized?(St(),Pt("div",bT,[e.state==="ready"?(St(),Pt("div",yT,[ht("div",wT,[Qr(ir(e.promptText)+" ",1),xr(h,{chroma:e.firstNoteChroma},null,8,["chroma"])]),ht("div",ST,[t[0]||(t[0]=Qr("Listen...")),e.recording?(St(),Pt("span",xT," and Repeat")):Or("",!0)]),ht("div",CT,[ht("div",kT,null,512)]),xr(b,{color:"primary",autofocus:"",onClick:e.clearAttempt},{default:_n(()=>[t[2]||(t[2]=Qr(" Play again ")),xr(f,{end:""},{default:_n(()=>t[1]||(t[1]=[Qr("volume_up")])),_:1})]),_:1},8,["onClick"]),(St(),ho(S,{key:0,ref:"inputVisRef",seq:e.inputSeq,"last-t-ssuggestion":e.lastTSsuggestion},null,8,["seq","last-t-ssuggestion"])),e.graded?(St(),ho(S,{key:1,seq:e.gradedSeq},null,8,["seq"])):Or("",!0)])):e.state==="nodevice"?(St(),Pt("div",MT,"No midi device detected. Please attach one!")):e.state==="notsupported"?(St(),Pt("div",ET,t[3]||(t[3]=[ht("p",null,"This exercise requires a midi input device, which is not supported by this browser ☹",-1),ht("div",null,[ht("p",null,"Please try again with one of the following browsers:"),ht("ul",null,[ht("li",null,[ht("a",{href:"https://www.google.com/chrome/"},"Google Chrome")]),ht("li",null,[ht("a",{href:"https://www.microsoft.com/edge"},"Microsoft Edge")]),ht("li",null,[ht("a",{href:"https://brave.com/"},"Brave")])])],-1)]))):Or("",!0)])):Or("",!0)}const TT=Ur(_T,[["render",AT]]),PT=[{name:"Melody",type:br.MIDI}],N1=class Nd extends fi{constructor(t){super(t),rt(this,"midi"),this.midi=t[0].Melody}get duration(){return this.midi.reduce((t,n)=>n.timestamp>t.timestamp?n:t).timestamp}get lastNoteOnTimestamp(){return this.midi.filter(t=>t.type==="noteon").reduce((t,n)=>n.timestamp>t.timestamp?n:t).timestamp}isCorrect(t){const n=on(this.midi),a=on(t);try{return n.grade(a).isCorrect()}catch(o){return console.log("ERROR grading this midi sequence!",o),!1}}dataShapes(){return Nd.dataShapes}views(){return Nd.views}};rt(N1,"dataShapes",[{fields:PT,name:di.PIANO_Echo}]);rt(N1,"views",[TT]);let Ld=N1;const IT=Vr({name:"NotePlayback",components:{},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"NotePlayback"),a=ii(n),o=Lt(),l=Lt(!1),h=Lt(!1),f=Lt(0),b=Lt(Tt.utc()),S=Lt(0),M=Lt(on([])),C=Lt(!1),y=Lt(on([])),g=Lt("");a.question.value=new Dd(e.data);const w=Sr(()=>new Dd(e.data)),p=()=>{var I,O,V;(I=o.value)==null||I.record(),h.value=!0,(O=o.value)==null||O.addNoteonListenter(U=>{y.value.append(U)}),(V=o.value)==null||V.addNoteoffListenter(()=>{var U,D,me,B;(D=(U=o.value)==null?void 0:U.recording)!=null&&D.length&&((B=(me=o.value)==null?void 0:me.recording)==null?void 0:B.length)>=2&&N()})},E=()=>{var I,O;(I=o.value)==null||I.stopRecording(),(O=o.value)==null||O.eraseRecording(),b.value=Tt.utc(),h.value=!1,f.value=0,p()},N=()=>{var I;return(I=o.value)!=null&&I.recording?(y.value=on([]),a.submitAnswer(o.value.recording).isCorrect?!0:(S.value++,C.value=!0,S.value<a.maxAttemptsPerView.value&&E(),!1)):!1};return Nn(async()=>{try{o.value=await c1.instance(),g.value=w.value.note,E(),l.value=!0}catch(I){n.logger.error("Failed to initialize MIDI:",I)}}),{...n,...a,initialized:l,recording:h,inputSeq:y,gradedSeq:M,graded:C,note:g,attempts:S}}}),NT={"data-viewable":"NotePlayback"},LT={class:"text-h4"},OT={class:"font-weight-bold"},DT={key:0,id:"svg8",width:"300px",height:"auto","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","sodipodi:docname":"keys.svg","inkscape:version":"1.0rc1 (09960d6f05, 2020-04-09)",version:"1.1",viewBox:"0 0 175.24936 73.594925"},RT={id:"metadata5"};function BT(e,t,n,a,o,l){const h=hr("sodipodi:namedview"),f=hr("dc:format"),b=hr("dc:type"),S=hr("dc:title"),M=hr("cc:Work"),C=hr("rdf:RDF");return St(),Pt("div",NT,[ht("div",LT,[t[0]||(t[0]=Qr(" Play the note: ")),ht("span",OT,ir(e.note),1)]),e.graded?(St(),Pt("svg",DT,[t[2]||(t[2]=ht("defs",{id:"defs2"},null,-1)),xr(h,{id:"base","inkscape:window-maximized":"1","inkscape:window-y":"726","inkscape:window-x":"1491","inkscape:window-height":"1321","inkscape:window-width":"2400",showborder:"false",showgrid:"false","inkscape:document-rotation":"0","inkscape:current-layer":"layer1","inkscape:document-units":"mm","inkscape:cy":"255.88343","inkscape:cx":"754.94284","inkscape:zoom":"0.98994949","inkscape:pageshadow":"2","inkscape:pageopacity":"0.0",borderopacity:"1.0",bordercolor:"#666666",pagecolor:"#ffffff"}),ht("metadata",RT,[xr(C,null,{default:_n(()=>[xr(M,{"rdf:about":""},{default:_n(()=>[xr(f,null,{default:_n(()=>t[1]||(t[1]=[Qr("image/svg+xml")])),_:1}),xr(b,{"rdf:resource":"http://purl.org/dc/dcmitype/StillImage"}),xr(S)]),_:1})]),_:1})]),t[3]||(t[3]=ht("g",{id:"layer1",transform:"translate(167.75219,-151.96011)","inkscape:groupmode":"layer","inkscape:label":"Layer 1"},[ht("rect",{id:"rect845",y:"152.19064",x:"-150.12129",height:"73.220116",width:"17.486626",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"}}),ht("rect",{id:"rect845-9",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-132.63466",y:"152.19064"}),ht("rect",{id:"rect845-6",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-115.14803",y:"152.19064"}),ht("rect",{id:"rect845-0",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-45.20153",y:"152.19064"}),ht("rect",{id:"rect845-92",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-80.174782",y:"152.19064"}),ht("rect",{id:"rect845-3",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-62.688156",y:"152.19064"}),ht("rect",{id:"rect845-4",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-97.661407",y:"152.19064"}),ht("rect",{id:"rect845-30",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-27.714905",y:"152.10745"}),ht("rect",{id:"rect898",ry:"0",y:"152.10744",x:"-138.43532",height:"54.415863",width:"10.466455",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"}}),ht("rect",{id:"rect898-3",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-120.84978",y:"152.10744",ry:"0"}),ht("rect",{id:"rect898-7",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-85.678711",y:"152.10744",ry:"0"}),ht("rect",{id:"rect898-8",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-68.09317",y:"152.10744",ry:"0"}),ht("rect",{id:"rect898-1",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-50.507633",y:"152.10744",ry:"0"}),ht("rect",{id:"rect845-30-1",y:"152.10745",x:"-10.228278",height:"73.220116",width:"17.486626",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"}}),ht("rect",{id:"rect845-30-9",y:"152.10744",x:"-167.60791",height:"73.220116",width:"17.486626",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"}}),ht("rect",{id:"rect898-4",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-15.336554",y:"152.10744",ry:"0"}),ht("rect",{id:"rect898-74",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"4.4679713",height:"54.415863",x:"-167.60791",y:"152.10744",ry:"0"}),ht("rect",{id:"rect898-10",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"5.1863246",height:"54.507248",x:"2.2092075",y:"152.06175",ry:"0"})],-1))])):Or("",!0)])}const qT=Ur(IT,[["render",BT]]),FT=[{name:"Note",type:br.STRING}],zT=["A","B","C","D","E","F","G","A♯","C♯","D♯","F♯","G♯","D♭","E♭","G♭","A♭","B♭"],Jl=class Od extends fi{constructor(t){super(t),rt(this,"note"),this.note=t[0].Note}isCorrect(t){return t[0].note.name===this.note}dataShapes(){return Od.dataShapes}views(){return Od.views}};rt(Jl,"dataShapes",[{fields:FT,name:di.PIANO_PlayNote}]);rt(Jl,"seedData",zT.map(e=>({Note:e})));rt(Jl,"views",[qT]);let Dd=Jl;const ay=new Ns("piano",[Ld,Dd]),HT=Vr({name:"IdentifyChroma",components:{RadioMultipleChoice:Bl},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"IdentifyChroma"),a=ii(n),o=Lt(""),l=Lt(new AudioContext);a.question.value=new ly(e.data);const h=Sr(()=>a.question.value),f=M=>{const C=[];let y=M/2;for(;y>100;)C.push(y),y/=2;C.push(M);let g=M*2;for(;g<5e3;)C.push(g),g*=2;return C},b=M=>{const C=l.value.createOscillator();C.type="sine",C.frequency.value=M;const y=l.value.createGain();console.log("Max Gain: "+y.gain.maxValue),y.gain.setValueAtTime(0,0),y.gain.linearRampToValueAtTime(.5,15),C.connect(y),y.connect(l.value.destination),C.start(0),C.stop(14)};return Nn(()=>{f(295).forEach(M=>b(M))}),{...n,...a,answer:o,question:h,submit:()=>{h.value&&h.value.isCorrect(o.value)}}}}),VT={"data-viewable":"IdentifyChroma"};function UT(e,t,n,a,o,l){const h=hr("radio-multiple-choice");return St(),Pt("div",VT,[e.question?(St(),Pt(qr,{key:0},[t[0]||(t[0]=Qr(" What note is being played? ")),xr(h,{"choice-list":e.question.choiceList},null,8,["choice-list"])],64)):Or("",!0)])}const GT=Ur(HT,[["render",UT]]);var oy=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e))(oy||{});const YT=[{name:"Chroma",type:br.STRING,validator:{test:e=>Object.values(oy).includes(e)?{status:ur.ok,msg:""}:{status:ur.error,msg:"That's not a chroma!"},instructions:"Enter a valid musical note (A-G)"}}],L1=class Rd extends fi{constructor(t){super(t),rt(this,"chroma"),this.chroma=t[0].Chroma}get baseFreq(){return this.chroma==="A"?440:this.chroma==="B"?440*Math.pow(2,2/12):this.chroma==="C"?440*Math.pow(2,3/12):440}get choiceList(){return po.shuffle([this.chroma.toString(),"test","options","are","fun"])}isCorrect(t){return t.choiceList[t.selection]===this.chroma.toString()}dataShapes(){return Rd.dataShapes}views(){return Rd.views}};rt(L1,"dataShapes",[{fields:YT,name:di.PITCH_chroma}]);rt(L1,"views",[GT]);let ly=L1;const cy=new Ns("pitch",[ly]);var bu,mv;function WT(){if(mv)return bu;mv=1;var e="6.4.4";return bu=e,bu}var yu,_v;function O1(){if(_v)return yu;_v=1;var e=function(n,a){var o=this;if(a||(a={}),o.qpm=a.qpm?parseInt(a.qpm,10):null,!o.qpm){var l=n.metaText?n.metaText.tempo:null;o.qpm=n.getBpm(l)}o.extraMeasuresAtBeginning=a.extraMeasuresAtBeginning?parseInt(a.extraMeasuresAtBeginning,10):0,o.beatCallback=a.beatCallback,o.eventCallback=a.eventCallback,o.lineEndCallback=a.lineEndCallback,o.lineEndAnticipation=a.lineEndAnticipation?parseInt(a.lineEndAnticipation,10):0,o.beatSubdivisions=a.beatSubdivisions?parseInt(a.beatSubdivisions,10):1,o.joggerTimer=null,o.replaceTarget=function(f){o.noteTimings=f.setTiming(o.qpm,o.extraMeasuresAtBeginning),f.noteTimings.length===0&&(o.noteTimings=f.setTiming(0,0)),o.lineEndCallback&&(o.lineEndTimings=t(f.noteTimings,o.lineEndAnticipation)),o.startTime=null,o.currentBeat=0,o.currentEvent=0,o.currentLine=0,o.currentTime=0,o.isPaused=!1,o.isRunning=!1,o.pausedPercent=null,o.justUnpaused=!1,o.newSeekPercent=0,o.lastTimestamp=0,o.noteTimings.length!==0&&(o.millisecondsPerBeat=1e3/(o.qpm/60)/o.beatSubdivisions,o.lastMoment=o.noteTimings[o.noteTimings.length-1].milliseconds,o.totalBeats=Math.round(o.lastMoment/o.millisecondsPerBeat))},o.replaceTarget(n),o.doTiming=function(f){if(o.lastTimestamp!==f&&(o.lastTimestamp=f,o.startTime||(o.startTime=f),!o.isPaused&&o.isRunning)){for(o.currentTime=f-o.startTime,o.currentTime+=16;o.noteTimings.length>o.currentEvent&&o.noteTimings[o.currentEvent].milliseconds<o.currentTime;){if(o.eventCallback&&o.noteTimings[o.currentEvent].type==="event"){var b=o.startTime;o.eventCallback(o.noteTimings[o.currentEvent]),b!==o.startTime&&(o.currentTime=f-o.startTime)}o.currentEvent++}if(o.lineEndCallback&&o.lineEndTimings.length>o.currentLine&&o.lineEndTimings[o.currentLine].milliseconds<o.currentTime&&o.currentEvent<o.noteTimings.length){var S=o.noteTimings[o.currentEvent].milliseconds===o.currentTime?o.noteTimings[o.currentEvent]:o.noteTimings[o.currentEvent-1];o.lineEndCallback(o.lineEndTimings[o.currentLine],S,{line:o.currentLine,endTimings:o.lineEndTimings,currentTime:o.currentTime}),o.currentLine++}if(o.currentTime<o.lastMoment){if(requestAnimationFrame(o.doTiming),o.currentBeat*o.millisecondsPerBeat<o.currentTime){var M=o.doBeatCallback(f);M!==null&&(o.currentTime=M)}}else if(o.currentBeat<=o.totalBeats&&o.beatCallback){var C=o.doBeatCallback(f);C!==null&&(o.currentTime=C),requestAnimationFrame(o.doTiming)}if(o.currentTime>=o.lastMoment)if(o.eventCallback){var y=o.eventCallback(null);o.shouldStop(y).then(function(g){g&&o.stop()})}else o.stop()}},o.shouldStop=function(f){return new Promise(function(b){if(!f)return b(!0);if(f==="continue")return b(!1);f.then&&f.then(function(S){b(S!=="continue")})})},o.doBeatCallback=function(f){if(o.beatCallback){for(var b=o.currentEvent;b<o.noteTimings.length&&o.noteTimings[b].left===null;)b++;var S,M;if(b<o.noteTimings.length){for(S=o.noteTimings[b].milliseconds,b=Math.max(0,o.currentEvent-1);b>=0&&o.noteTimings[b].left===null;)b--;M=o.noteTimings[b]}var C={},y={};if(M){C.top=M.top,C.height=M.height;var g=Math.max(0,f-o.startTime-M.milliseconds),w=S-M.milliseconds,p=M.endX-M.left,E=w?g*p/w:0;C.left=M.left+E,o.currentEvent===0&&M.milliseconds>f-o.startTime&&(C.left=void 0),y={timestamp:f,startTime:o.startTime,ev:M,endMs:S,offMs:g,offPx:E,gapMs:w,gapPx:p}}else y={timestamp:f,startTime:o.startTime};var N=o.startTime;if(o.beatCallback(o.currentBeat/o.beatSubdivisions,o.totalBeats/o.beatSubdivisions,o.lastMoment,C,y),N!==o.startTime)return f-o.startTime;o.currentBeat++}return null};var h=60;o.animationJogger=function(){o.isRunning&&(o.doTiming(performance.now()),o.joggerTimer=setTimeout(o.animationJogger,h))},o.start=function(f,b){if(o.isRunning=!0,o.isPaused&&(o.isPaused=!1,f===void 0&&(o.justUnpaused=!0)),f)o.setProgress(f,b);else if(f===0)o.reset();else if(o.pausedPercent!==null){var S=performance.now();o.currentTime=o.lastMoment*o.pausedPercent,o.startTime=S-o.currentTime,o.pausedPercent=null,o.reportNext=!0}requestAnimationFrame(o.doTiming),o.joggerTimer=setTimeout(o.animationJogger,h)},o.pause=function(){o.isPaused=!0;var f=performance.now();o.pausedPercent=(f-o.startTime)/o.lastMoment,o.isRunning=!1,o.joggerTimer&&(clearTimeout(o.joggerTimer),o.joggerTimer=null)},o.currentMillisecond=function(){return o.currentTime},o.reset=function(){o.currentBeat=0,o.currentEvent=0,o.currentLine=0,o.startTime=null,o.pausedPercent=null},o.stop=function(){o.pause(),o.reset()},o.setProgress=function(f,b){var S;switch(b){case"seconds":o.currentTime=f*1e3,o.currentTime<0&&(o.currentTime=0),o.currentTime>o.lastMoment&&(o.currentTime=o.lastMoment),S=o.currentTime/o.lastMoment;break;case"beats":o.currentTime=f*o.millisecondsPerBeat*o.beatSubdivisions,o.currentTime<0&&(o.currentTime=0),o.currentTime>o.lastMoment&&(o.currentTime=o.lastMoment),S=o.currentTime/o.lastMoment;break;default:S=f,S<0&&(S=0),S>1&&(S=1),o.currentTime=o.lastMoment*S;break}o.isRunning||(o.pausedPercent=S);var M=performance.now();for(o.startTime=M-o.currentTime,o.currentEvent,o.currentEvent=0;o.noteTimings.length>o.currentEvent&&o.noteTimings[o.currentEvent].milliseconds<o.currentTime;)o.currentEvent++;if(o.lineEndCallback)for(o.currentLine=0;o.lineEndTimings.length>o.currentLine&&o.lineEndTimings[o.currentLine].milliseconds+o.lineEndAnticipation<o.currentTime;)o.currentLine++;var C=o.currentBeat;o.currentBeat=Math.floor(o.currentTime/o.millisecondsPerBeat),o.beatCallback&&C!==o.currentBeat&&o.doBeatCallback(o.startTime+o.currentTime),o.eventCallback&&o.currentEvent>=0&&o.noteTimings[o.currentEvent].type==="event"&&o.eventCallback(o.noteTimings[o.currentEvent]),o.lineEndCallback&&o.lineEndCallback(o.lineEndTimings[o.currentLine],o.noteTimings[o.currentEvent],{line:o.currentLine,endTimings:o.lineEndTimings}),o.joggerTimer=setTimeout(o.animationJogger,h)}};function t(n,a){for(var o=[],l=null,h=0;h<n.length;h++){var f=n[h];f.type!=="end"&&f.top!==l&&(o.push({measureNumber:f.measureNumber,milliseconds:f.milliseconds-a,top:f.top,bottom:f.top+f.height}),l=f.top)}return o}return yu=e,yu}var wu,bv;function $T(){if(bv)return wu;bv=1;var e=O1(),t={};return function(){var n,a;t.startAnimation=function(o,l,h){n&&(n.stop(),n=void 0),h.showCursor&&(a=o.querySelector(".abcjs-cursor"),a||(a=document.createElement("DIV"),a.className="abcjs-cursor cursor",a.style.position="absolute",o.appendChild(a),o.style.position="relative"));function f(w){for(var p=0;p<w.length;p++){var E=w[p];E.classList.contains("abcjs-bar")||(E.style.display="none")}}var b;function S(w){if(b){var p=o.querySelectorAll(b);f(p)}b=w}function M(w){var p=o.querySelectorAll(w);f(p)}function C(w){h.hideCurrentMeasure?M(w):h.hideFinishedMeasures&&S(w)}function y(w){return".abcjs-l"+w.line+".abcjs-m"+w.measureNumber}function g(w){if(w){if(w.measureStart){var p=y(w);p&&C(p)}a&&(a.style.left=w.left+"px",a.style.top=w.top+"px",a.style.width=w.width+"px",a.style.height=w.height+"px")}else n.stop(),n=void 0}n=new e(l,{qpm:h.bpm,eventCallback:g}),n.start()},t.pauseAnimation=function(o){n&&(o?n.pause():n.start())},t.stopAnimation=function(){n&&(n.stop(),n=void 0)}}(),wu=t,wu}var Su,yv;function Ds(){if(yv)return Su;yv=1;var e={};return e.cloneArray=function(t){for(var n=[],a=0;a<t.length;a++)n.push(Object.assign({},t[a]));return n},e.cloneHashOfHash=function(t){var n={};for(var a in t)t.hasOwnProperty(a)&&(n[a]=Object.assign({},t[a]));return n},e.cloneHashOfArrayOfHash=function(t){var n={};for(var a in t)t.hasOwnProperty(a)&&(n[a]=e.cloneArray(t[a]));return n},e.strip=function(t){return t.replace(/^\s+/,"").replace(/\s+$/,"")},e.startsWith=function(t,n){return t.indexOf(n)===0},e.endsWith=function(t,n){var a=t.length-n.length;return a>=0&&t.lastIndexOf(n)===a},e.last=function(t){return t.length===0?null:t[t.length-1]},Su=e,Su}var xu,wv;function D1(){if(wv)return xu;wv=1;var e=Ds(),t={};return function(){var n,a,o,l,h;t.initialize=function(F,H,W,_e,Te){n=F,a=H,o=W,l=_e,h=Te,f()};function f(){o.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},o.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},o.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},o.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},o.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},o.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},o.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},o.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},o.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},o.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},o.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},l.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},l.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},l.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},l.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},l.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},l.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},l.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},l.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},l.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},l.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},l.formatting.annotationfont=o.annotationfont,l.formatting.gchordfont=o.gchordfont,l.formatting.historyfont=o.historyfont,l.formatting.infofont=o.infofont,l.formatting.measurefont=o.measurefont,l.formatting.partsfont=o.partsfont,l.formatting.repeatfont=o.repeatfont,l.formatting.textfont=o.textfont,l.formatting.tripletfont=o.tripletfont,l.formatting.vocalfont=o.vocalfont,l.formatting.wordsfont=o.wordsfont}var b={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},S=function(F){switch(F){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}},M=function(F,H,W,_e,Te){function Re(){var Ht=parseInt(F[0].token);return F.shift(),H?F.length===0?{face:H.face,weight:H.weight,style:H.style,decoration:H.decoration,size:Ht}:F.length===1&&F[0].token==="box"&&b[Te]?{face:H.face,weight:H.weight,style:H.style,decoration:H.decoration,size:Ht,box:!0}:(a("Extra parameters in font definition.",W,_e),{face:H.face,weight:H.weight,style:H.style,decoration:H.decoration,size:Ht}):(a("Can't set just the size of the font since there is no default value.",W,_e),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:Ht})}if(F[0].token==="*"){if(F.shift(),F[0].type==="number")return Re();a("Expected font size number after *.",W,_e)}if(F[0].type==="number")return Re();for(var Ie=[],st,wt="normal",Ze="normal",dt="none",bt=!1,et="face",Nt=!1;F.length;){var xt=F.shift(),at=xt.token.toLowerCase();switch(et){case"face":Nt||at!=="utf"&&xt.type!=="number"&&at!=="bold"&&at!=="italic"&&at!=="underline"&&at!=="box"?Ie.length>0&&xt.token==="-"?(Nt=!0,Ie[Ie.length-1]=Ie[Ie.length-1]+xt.token):Nt?(Nt=!1,Ie[Ie.length-1]=Ie[Ie.length-1]+xt.token):Ie.push(xt.token):xt.type==="number"?(st?a("Font size specified twice in font definition.",W,_e):st=xt.token,et="modifier"):at==="bold"?wt="bold":at==="italic"?Ze="italic":at==="underline"?dt="underline":at==="box"?(b[Te]?bt=!0:a(`This font style doesn't support "box"`,W,_e),et="finished"):at==="utf"?(xt=F.shift(),et="size"):a("Unknown parameter "+xt.token+" in font definition.",W,_e);break;case"size":xt.type==="number"?st?a("Font size specified twice in font definition.",W,_e):st=xt.token:a("Expected font size in font definition.",W,_e),et="modifier";break;case"modifier":at==="bold"?wt="bold":at==="italic"?Ze="italic":at==="underline"?dt="underline":at==="box"?(b[Te]?bt=!0:a(`This font style doesn't support "box"`,W,_e),et="finished"):a("Unknown parameter "+xt.token+" in font definition.",W,_e);break;case"finished":a('Extra characters found after "box" in font definition.',W,_e);break}}st===void 0?H?st=H.size:(a("Must specify the size of the font since there is no default value.",W,_e),st=12):st=parseFloat(st),Ie=Ie.join(" "),Ie===""&&(H?Ie=H.face:(a("Must specify the name of the font since there is no default value.",W,_e),Ie="sans-serif"));var rr=S(Ie),Xt={};return rr?(Xt.face=rr.face,Xt.weight=rr.weight,Xt.style=rr.style,Xt.decoration=rr.decoration,Xt.size=st,bt&&(Xt.box=!0),Xt):(Xt.face=Ie,Xt.weight=wt,Xt.style=Ze,Xt.decoration=dt,Xt.size=st,bt&&(Xt.box=!0),Xt)},C=function(F,H,W){return H.length===0?'Directive "'+F+'" requires a font as a parameter.':(o[F]=M(H,o[F],W,0,F),o.is_in_header&&(l.formatting[F]=o[F]),null)},y=function(F,H,W){return H.length===0?'Directive "'+F+'" requires a font as a parameter.':(l.formatting[F]=M(H,l.formatting[F],W,0,F),null)},g=function(F,H){var W="";H.forEach(function(Te){W+=Te.token});var _e=parseFloat(W);if(isNaN(_e)||_e===0)return'Directive "'+F+'" requires a number as a parameter.';l.formatting.scale=_e},w=["acoustic-bass-drum","bass-drum-1","side-stick","acoustic-snare","hand-clap","electric-snare","low-floor-tom","closed-hi-hat","high-floor-tom","pedal-hi-hat","low-tom","open-hi-hat","low-mid-tom","hi-mid-tom","crash-cymbal-1","high-tom","ride-cymbal-1","chinese-cymbal","ride-bell","tambourine","splash-cymbal","cowbell","crash-cymbal-2","vibraslap","ride-cymbal-2","hi-bongo","low-bongo","mute-hi-conga","open-hi-conga","low-conga","high-timbale","low-timbale","high-agogo","low-agogo","cabasa","maracas","short-whistle","long-whistle","short-guiro","long-guiro","claves","hi-wood-block","low-wood-block","mute-cuica","open-cuica","mute-triangle","open-triangle"],p=function(F){var H=F.split(/\s+/);if(H.length!==2&&H.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var W=H[0],_e=parseInt(H[1],10);if((isNaN(_e)||_e<35||_e>81)&&H[1]&&(_e=w.indexOf(H[1].toLowerCase())+35),isNaN(_e)||_e<35||_e>81)return{error:'Expected drum name, received "'+H[1]+'"'};var Te={sound:_e};return H.length===3&&(Te.noteHead=H[2]),{key:W,value:Te}},E=function(F,H){var W=n.getMeasurement(H);return W.used===0||H.length!==0?{error:'Directive "'+F+'" requires a measurement as a parameter.'}:W.value},N=function(F,H){var W=n.getMeasurement(H);return W.used===0||H.length!==0?'Directive "'+F+'" requires a measurement as a parameter.':(l.formatting[F]=W.value,null)},I=function(F,H,W,_e,Te){if(W.length!==1||W[0].type!=="number")return'Directive "'+H+'" requires a number as a parameter.';var Re=W[0].intt;return _e!==void 0&&Re<_e?'Directive "'+H+'" requires a number greater than or equal to '+_e+" as a parameter.":Te!==void 0&&Re>Te?'Directive "'+H+'" requires a number less than or equal to '+Te+" as a parameter.":(o[F]=Re,null)},O=function(F,H,W){if(W.length===1&&(W[0].token==="true"||W[0].token==="false"))return o[F]=W[0].token==="true",null;var _e=I(F,H,W,0,1);return _e!==null?_e:(o[F]=o[F]===1,null)},V=function(F,H,W,_e){if(W.length!==1)return'Directive "'+H+'" requires one of [ '+_e.join(", ")+" ] as a parameter.";for(var Te=W[0].token,Re=!1,Ie=0;!Re&&Ie<_e.length;Ie++)_e[Ie]===Te&&(Re=!0);return Re?(o[F]=Te,null):'Directive "'+H+'" requires one of [ '+_e.join(", ")+" ] as a parameter."},U=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],D=["gchord","ptstress","beatstring"],me=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],B=["program"],ie=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],he=["beat"],ae=["drone"],fe=["portamento"],le=["expand","grace","trim"],Y=["drum","chordname"],$=["bassprog","chordprog"],ne=function(F,H,W){var _e=F.shift().token,Te=[];if(U.indexOf(_e)>=0)F.length!==0&&a("Unexpected parameter in MIDI "+_e,W,0);else if(D.indexOf(_e)>=0)F.length!==1?a("Expected one parameter in MIDI "+_e,W,0):Te.push(F[0].token);else if(me.indexOf(_e)>=0)F.length!==1?a("Expected one parameter in MIDI "+_e,W,0):F[0].type!=="number"?a("Expected one integer parameter in MIDI "+_e,W,0):Te.push(F[0].intt);else if(B.indexOf(_e)>=0)F.length!==1&&F.length!==2?a("Expected one or two parameters in MIDI "+_e,W,0):F[0].type!=="number"||F.length===2&&F[1].type!=="number"?a("Expected integer parameter in MIDI "+_e,W,0):(Te.push(F[0].intt),F.length===2&&Te.push(F[1].intt));else if(ie.indexOf(_e)>=0)F.length!==2?a("Expected two parameters in MIDI "+_e,W,0):F[0].type!=="number"||F[1].type!=="number"?a("Expected two integer parameters in MIDI "+_e,W,0):(Te.push(F[0].intt),Te.push(F[1].intt));else if(fe.indexOf(_e)>=0)F.length!==2?a("Expected two parameters in MIDI "+_e,W,0):F[0].type!=="alpha"||F[1].type!=="number"?a("Expected one string and one integer parameters in MIDI "+_e,W,0):(Te.push(F[0].token),Te.push(F[1].intt));else if(_e==="drummap")F.length===2&&F[0].type==="alpha"&&F[1].type==="number"?(H.formatting||(H.formatting={}),H.formatting.midi||(H.formatting.midi={}),H.formatting.midi.drummap||(H.formatting.midi.drummap={}),H.formatting.midi.drummap[F[0].token]=F[1].intt,Te=H.formatting.midi.drummap):F.length===3&&F[0].type==="punct"&&F[1].type==="alpha"&&F[2].type==="number"?(H.formatting||(H.formatting={}),H.formatting.midi||(H.formatting.midi={}),H.formatting.midi.drummap||(H.formatting.midi.drummap={}),H.formatting.midi.drummap[F[0].token+F[1].token]=F[2].intt,Te=H.formatting.midi.drummap):a("Expected one note name and one integer parameter in MIDI "+_e,W,0);else if(le.indexOf(_e)>=0)F.length!==3||F[0].type!=="number"||F[1].token!=="/"||F[2].type!=="number"?a("Expected fraction parameter in MIDI "+_e,W,0):(Te.push(F[0].intt),Te.push(F[2].intt));else if(he.indexOf(_e)>=0)F.length!==4?a("Expected four parameters in MIDI "+_e,W,0):F[0].type!=="number"||F[1].type!=="number"||F[2].type!=="number"||F[3].type!=="number"?a("Expected four integer parameters in MIDI "+_e,W,0):(Te.push(F[0].intt),Te.push(F[1].intt),Te.push(F[2].intt),Te.push(F[3].intt));else if(ae.indexOf(_e)>=0)F.length!==5?a("Expected five parameters in MIDI "+_e,W,0):F[0].type!=="number"||F[1].type!=="number"||F[2].type!=="number"||F[3].type!=="number"||F[4].type!=="number"?a("Expected five integer parameters in MIDI "+_e,W,0):(Te.push(F[0].intt),Te.push(F[1].intt),Te.push(F[2].intt),Te.push(F[3].intt),Te.push(F[4].intt));else if(B.indexOf(_e)>=0)F.length!==1||F.length!==4?a("Expected one or two parameters in MIDI "+_e,W,0):F[0].type!=="number"?a("Expected integer parameter in MIDI "+_e,W,0):F.length===4?(F[1].token!=="octave"&&a("Expected octave parameter in MIDI "+_e,W,0),F[2].token!=="="&&a("Expected octave parameter in MIDI "+_e,W,0),F[3].type!=="number"&&a("Expected integer parameter for octave in MIDI "+_e,W,0)):(Te.push(F[0].intt),F.length===4&&Te.push(F[3].intt));else if(Y.indexOf(_e)>=0)if(F.length<2)a("Expected string parameter and at least one integer parameter in MIDI "+_e,W,0);else if(F[0].type!=="alpha")a("Expected string parameter and at least one integer parameter in MIDI "+_e,W,0);else{var Re=F.shift();for(Te.push(Re.token);F.length>0;)Re=F.shift(),Re.type!=="number"&&a("Expected integer parameter in MIDI "+_e,W,0),Te.push(Re.intt)}else if($.indexOf(_e)>=0){if(F.length!==1&&F.length!==2)a("Expected one or two parameters in MIDI "+_e,W,0);else if(F[0].type!=="number")a("Expected integer parameter in MIDI "+_e,W,0);else if(F.length===2&&F[1].type!=="alpha")a("Expected alpha parameter in MIDI "+_e,W,0);else if(Te.push(F[0].intt),F.length===2){var Ie=F[1].token;Ie.indexOf("octave=")!=-1?(Ie=Ie.replace("octave=",""),Ie=parseInt(Ie),isNaN(Ie)?a("Expected octave value in MIDI"+_e):(Ie<-1&&(a("Expected octave= in MIDI "+_e+" to be >= -1 (recv:"+Ie+")"),Ie=-1),Ie>3&&(a("Expected octave= in MIDI "+_e+" to be <= 3 (recv:"+Ie+")"),Ie=3),Te.push(Ie))):a("Expected octave= in MIDI"+_e)}}h.hasBeginMusic()?h.appendElement("midi",-1,-1,{cmd:_e,params:Te}):(H.formatting.midi===void 0&&(H.formatting.midi={}),H.formatting.midi[_e]=Te)};t.parseFontChangeLine=function(F){F=F.replace(/\$\$/g,"");var H=F.split("$");if(H.length>1&&o.setfont){var W=[];H[0]!==""&&W.push({text:H[0]});for(var _e=1;_e<H.length;_e++)if(H[_e][0]==="0")W.push({text:H[_e].substring(1).replace(/\x03/g,"$$")});else{var Te=parseInt(H[_e][0],10);o.setfont[Te]?W.push({font:o.setfont[Te],text:H[_e].substring(1).replace(/\x03/g,"$$")}):W[W.length-1].text+="$"+H[_e].replace(/\x03/g,"$$")}return W}return F.replace(/\x03/g,"$$")};var we=["auto","above","below","hidden"];t.addDirective=function(F){var H=n.tokenize(F,0,F.length);if(H.length===0||H[0].type!=="alpha")return null;var W=F.substring(F.indexOf(H[0].token)+H[0].token.length);W=n.stripComment(W);var _e=H.shift().token.toLowerCase(),Te="",Re;switch(_e){case"bagpipes":l.formatting.bagpipes=!0;break;case"flatbeams":l.formatting.flatbeams=!0;break;case"jazzchords":l.formatting.jazzchords=!0;break;case"accentAbove":l.formatting.accentAbove=!0;break;case"germanAlphabet":l.formatting.germanAlphabet=!0;break;case"landscape":o.landscape=!0;break;case"papersize":o.papersize=W;break;case"graceslurs":if(H.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(H[0].token==="0"||H[0].token==="false")l.formatting.graceSlurs=!1;else if(H[0].token==="1"||H[0].token==="true")l.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+H[0].token+")";break;case"lineThickness":var Ie=ye(H);if(Ie.value!==void 0&&(l.formatting.lineThickness=Ie.value),Ie.error)return Ie.error;break;case"stretchlast":var st=ye(H);if(st.value!==void 0&&(l.formatting.stretchlast=st.value),st.error)return st.error;break;case"titlecaps":o.titlecaps=!0;break;case"titleleft":l.formatting.titleleft=!0;break;case"measurebox":l.formatting.measurebox=!0;break;case"vocal":return V("vocalPosition",_e,H,we);case"dynamic":return V("dynamicPosition",_e,H,we);case"gchord":return V("chordPosition",_e,H,we);case"ornament":return V("ornamentPosition",_e,H,we);case"volume":return V("volumePosition",_e,H,we);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"stafftopmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return N(_e,H);case"voicescale":if(H.length!==1||H[0].type!=="number")return"voicescale requires one float as a parameter";var wt=H.shift();return o.currentVoice&&(o.currentVoice.scale=wt.floatt,h.changeVoiceScale(o.currentVoice.scale)),null;case"voicecolor":if(H.length!==1)return"voicecolor requires one string as a parameter";var Ze=H.shift();return o.currentVoice&&(o.currentVoice.color=Ze.token,h.changeVoiceColor(o.currentVoice.color)),null;case"vskip":var dt=Math.round(E(_e,H));return dt.error?dt.error:(h.addSpacing(dt),null);case"scale":g(_e,H);break;case"sep":if(H.length===0)h.addSeparator(14,14,85,{startChar:o.iChar,endChar:o.iChar+5});else{var bt=n.getMeasurement(H);if(bt.used===0)return'Directive "'+_e+'" requires 3 numbers: space above, space below, length of line';var et=bt.value;if(bt=n.getMeasurement(H),bt.used===0)return'Directive "'+_e+'" requires 3 numbers: space above, space below, length of line';var Nt=bt.value;if(bt=n.getMeasurement(H),bt.used===0||H.length!==0)return'Directive "'+_e+'" requires 3 numbers: space above, space below, length of line';var xt=bt.value;h.addSeparator(et,Nt,xt,{startChar:o.iChar,endChar:o.iChar+W.length})}break;case"barsperstaff":if(Te=I("barsperstaff",_e,H),Te!==null)return Te;break;case"staffnonote":if(H.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(H[0].token==="0")o.staffnonote=!0;else if(H[0].token==="1")o.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+H[0].token+")";break;case"printtempo":if(Te=O("printTempo",_e,H),Te!==null)return Te;break;case"partsbox":if(Te=O("partsBox",_e,H),Te!==null)return Te;o.partsfont.box=o.partsBox;break;case"freegchord":if(Te=O("freegchord",_e,H),Te!==null)return Te;break;case"measurenb":case"barnumbers":if(Te=I("barNumbers",_e,H),Te!==null)return Te;break;case"setbarnb":if(H.length!==1||H[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";o.currBarNumber=h.setBarNumberImmediate(H[0].intt);break;case"begintext":var at="";for(Re=n.nextLine();Re&&Re.indexOf("%%endtext")!==0;)e.startsWith(Re,"%%")?at+=Re.substring(2)+`
136
+ `:at+=Re+`
137
+ `,Re=n.nextLine();h.addText(at,{startChar:o.iChar,endChar:o.iChar+at.length+7});break;case"continueall":o.continueall=!0;break;case"beginps":for(Re=n.nextLine();Re&&Re.indexOf("%%endps")!==0;)n.nextLine();a("Postscript ignored",F,0);break;case"deco":W.length>0&&o.ignoredDecorations.push(W.substring(0,W.indexOf(" "))),a("Decoration redefinition ignored",F,0);break;case"text":var rr=n.translateString(W);h.addText(t.parseFontChangeLine(rr),{startChar:o.iChar,endChar:o.iChar+W.length+7});break;case"center":var Xt=n.translateString(W);h.addCentered(t.parseFontChangeLine(Xt));break;case"font":break;case"setfont":var Ht=n.tokenize(W,0,W.length);if(Ht.length>=4&&Ht[0].token==="-"&&Ht[1].type==="number"){var nr=parseInt(Ht[1].token);nr>=1&&nr<=9&&(o.setfont||(o.setfont=[]),Ht.shift(),Ht.shift(),o.setfont[nr]=M(Ht,o.setfont[nr],F,0,"setfont"))}break;case"gchordfont":case"partsfont":case"tripletfont":case"vocalfont":case"textfont":case"annotationfont":case"historyfont":case"infofont":case"measurefont":case"repeatfont":case"wordsfont":return C(_e,H,F);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return y(_e,H,F);case"barlabelfont":case"barnumberfont":case"barnumfont":return C("measurefont",H,F);case"staves":case"score":o.score_is_present=!0;for(var Ar=function(oe,ee,re,K,se){(ee||o.staves.length===0)&&o.staves.push({index:o.staves.length,numVoices:0});var de=e.last(o.staves);re!==void 0&&de.bracket===void 0&&(de.bracket=re),K!==void 0&&de.brace===void 0&&(de.brace=K),se&&(de.connectBarLines="end"),o.voices[oe]===void 0&&(o.voices[oe]={staffNum:de.index,index:de.numVoices},de.numVoices++)},fr=!1,qe=!1,je=!1,Fe=!1,Ue=!1,Qe=!1,r=!1,c,m=function(){if(r=!0,c){var oe="start";c.staffNum>0&&(o.staves[c.staffNum-1].connectBarLines==="start"||o.staves[c.staffNum-1].connectBarLines==="continue")&&(oe="continue"),o.staves[c.staffNum].connectBarLines=oe}};H.length;){var x=H.shift();switch(x.token){case"(":fr?a("Can't nest parenthesis in %%score",F,x.start):(fr=!0,Fe=!0);break;case")":!fr||Fe?a("Unexpected close parenthesis in %%score",F,x.start):fr=!1;break;case"[":qe?a("Can't nest brackets in %%score",F,x.start):(qe=!0,Ue=!0);break;case"]":!qe||Ue?a("Unexpected close bracket in %%score",F,x.start):(qe=!1,o.staves[c.staffNum].bracket="end");break;case"{":je?a("Can't nest braces in %%score",F,x.start):(je=!0,Qe=!0);break;case"}":!je||Qe?a("Unexpected close brace in %%score",F,x.start):(je=!1,o.staves[c.staffNum].brace="end");break;case"|":m();break;default:for(var k="";(x.type==="alpha"||x.type==="number")&&(k+=x.token,x.continueId);)x=H.shift();var T=!fr||Fe,R=Ue?"start":qe?"continue":void 0,L=Qe?"start":je?"continue":void 0;Ar(k,T,R,L,r),Fe=!1,Ue=!1,Qe=!1,r=!1,c=o.voices[k],_e==="staves"&&m();break}}break;case"newpage":var q=n.getInt(W);h.addNewPage(q.digits===0?-1:q.value);break;case"abc":var z=W.split(" ");switch(z[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var X=z.shift();h.addMetaText(_e+X,z.join(" "),{startChar:o.iChar,endChar:o.iChar+W.length+5});break;default:return"Unknown directive: "+_e+z[0]}break;case"header":case"footer":var Z=n.getMeat(W,0,W.length);Z=W.substring(Z.start,Z.end),Z[0]==='"'&&Z[Z.length-1]==='"'&&(Z=Z.substring(1,Z.length-1));var Q=Z.split(" "),j={};Q.length===1?j={left:"",center:Q[0],right:""}:Q.length===2?j={left:Q[0],center:Q[1],right:""}:j={left:Q[0],center:Q[1],right:Q[2]},Q.length>3&&a("Too many tabs in "+_e+": "+Q.length+" found.",W,0),h.addMetaTextObj(_e,j,{startChar:o.iChar,endChar:o.iChar+F.length});break;case"midi":var ce=n.tokenize(W,0,W.length,!0);ce.length>0&&ce[0].token==="="&&ce.shift(),ce.length===0?a("Expected midi command",W,0):ne(ce,l,W);break;case"percmap":var te=p(W);te.error?a(te.error,F,8):(l.formatting.percmap||(l.formatting.percmap={}),l.formatting.percmap[te.key]=te.value);break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":l.formatting[_e]=W;break;default:return"Unknown directive: "+_e}return null},t.globalFormatting=function(F){for(var H in F)if(F.hasOwnProperty(H)){var W=""+F[H],_e=n.tokenize(W,0,W.length),Te;switch(H){case"titlefont":case"gchordfont":case"composerfont":case"footerfont":case"headerfont":case"historyfont":case"infofont":case"measurefont":case"partsfont":case"repeatfont":case"subtitlefont":case"tempofont":case"textfont":case"voicefont":case"tripletfont":case"vocalfont":case"wordsfont":case"annotationfont":case"tablabelfont":case"tabnumberfont":case"tabgracefont":C(H,_e,W);break;case"scale":g(H,_e);break;case"partsbox":Te=O("partsBox",H,_e),Te!==null&&a(Te),o.partsfont.box=o.partsBox;break;case"freegchord":Te=O("freegchord",H,_e),Te!==null&&a(Te);break;case"fontboxpadding":(_e.length!==1||_e[0].type!=="number")&&a('Directive "'+H+'" requires a number as a parameter.'),l.formatting.fontboxpadding=_e[0].floatt;break;case"stafftopmargin":(_e.length!==1||_e[0].type!=="number")&&a('Directive "'+H+'" requires a number as a parameter.'),l.formatting.stafftopmargin=_e[0].floatt;break;case"stretchlast":var Re=ye(_e);if(Re.value!==void 0&&(l.formatting.stretchlast=Re.value),Re.error)return Re.error;break;default:a("Formatting directive unrecognized: ",H,0)}}};function ye(F){if(F.length===0)return{value:1};if(F.length===1)if(F[0].type==="number"){if(F[0].floatt>=0||F[0].floatt<=1)return{value:F[0].floatt}}else{if(F[0].token==="false")return{value:0};if(F[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+F[0].token+")"}}}(),xu=t,xu}var Cu,Sv;function KT(){if(Sv)return Cu;Sv=1;var e={};const t=["C,,,","D,,,","E,,,","F,,,","G,,,","A,,,","B,,,","C,,","D,,","E,,","F,,","G,,","A,,","B,,","C,","D,","E,","F,","G,","A,","B,","C","D","E","F","G","A","B","c","d","e","f","g","a","b","c'","d'","e'","f'","g'","a'","b'","c''","d''","e''","f''","g''","a''","b''","c'''","d'''","e'''","f'''","g'''","a'''","b'''"];return e.pitchIndex=function(n){return t.indexOf(n)},e.noteName=function(n){return t[n]},Cu=e,Cu}var ku,xv;function uy(){if(xv)return ku;xv=1;var e=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],t=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],n=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],a=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function o(l,h,f,b){if(!h||h%12===0)return l;for(;h<0;)h+=12;h>11&&(h=h%12);var S=l.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!S)return l;var M=S[1],C=S[2],y=S[3],g=S[4],w=e.indexOf(M);if(w<0&&(w=t.indexOf(M)),w<0&&(w=n.indexOf(M)),w<0&&(w=a.indexOf(M)),w<0)return l;if(w+=h,w=w%12,f?b?l=a[w]:l=t[w]:b?l=n[w]:l=e[w],C&&(l+=C),y){var w=e.indexOf(y);w<0&&(w=t.indexOf(y)),w<0&&(w=n.indexOf(y)),w<0&&(w=a.indexOf(y)),l+="/",w>=0?(w+=h,w=w%12,f?b?l+=a[w]:l+=t[w]:b?l+=n[w]:l+=e[w]):l+=y}return g&&(l+=g),l}return ku=o,ku}var Mu,Cv;function hy(){if(Cv)return Mu;Cv=1;var e={C:{modes:["CMaj","Amin","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","Bbmin","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","Bmin","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","Cmin","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","C#min","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","Dmin","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","Ebmin","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","Emin","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","Fmin","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","F#min","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","Gmin","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","G#min","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","A#min","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","D#min","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","Abmin","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},t=null;function n(){t={};for(var h=Object.keys(e),f=0;f<h.length;f++){var b=e[h[f]];t[h[f].toLowerCase()]=h[f];for(var S=0;S<b.modes.length;S++){var M=b.modes[S].toLowerCase();t[M]=h[f]}}}function a(h){t||n();var f=h.toLowerCase().match(/([a-g][b#]?)(maj|min|mix|dor|phr|lyd|loc|m)?/);if(!f||!f[2])return h;f=f[1]+f[2];var b=t[f];return b||h}function o(h,f){var b=e[h];if(!b||f==="")return h;var S=f.toLowerCase().match(/^(maj|min|mix|dor|phr|lyd|loc|m)/);if(!S)return h;for(var M=S[1],C=0;C<b.modes.length;C++){var y=b.modes[C],g=y.toLowerCase().indexOf(M);if(g!==-1&&g===y.length-M.length)return y.substring(0,y.length-M.length)}return h}function l(h,f){var b=e[h];if(!b)return h;for(;f<0;)f+=12;for(var S=(b.stepsFromC+f)%12,M=0;M<Object.keys(e).length;M++){var C=Object.keys(e)[M];if(e[C].stepsFromC===S)return C}return h}return Mu={relativeMajor:a,relativeMode:o,transposeKey:l},Mu}var Eu,kv;function fy(){if(kv)return Eu;kv=1;var{relativeMajor:e}=hy(),t={acc:"sharp",note:"f"},n={acc:"sharp",note:"c"},a={acc:"sharp",note:"g"},o={acc:"sharp",note:"d"},l={acc:"sharp",note:"A"},h={acc:"sharp",note:"e"},f={acc:"sharp",note:"B"},b={acc:"flat",note:"B"},S={acc:"flat",note:"e"},M={acc:"flat",note:"A"},C={acc:"flat",note:"d"},y={acc:"flat",note:"G"},g={acc:"flat",note:"c"},w={acc:"flat",note:"F"},p={"C#":[t,n,a,o,l,h,f],"F#":[t,n,a,o,l,h],B:[t,n,a,o,l],E:[t,n,a,o],A:[t,n,a],D:[t,n],G:[t],C:[],F:[b],Bb:[b,S],Eb:[b,S,M],Cm:[b,S,M],Ab:[b,S,M,C],Db:[b,S,M,C,y],Gb:[b,S,M,C,y,g],Cb:[b,S,M,C,y,g,w],"A#":[b,S],"B#":[],"D#":[b,S,M],"E#":[b],"G#":[b,S,M,C],none:[]};function E(N){var I=p[e(N)];return I?JSON.parse(JSON.stringify(I)):null}return Eu=E,Eu}var Au,Mv;function dy(){if(Mv)return Au;Mv=1;var e=KT(),t=uy(),n=fy(),a={},o={C:0,"C#":1,Db:1,D:2,"D#":3,Eb:3,E:4,F:5,"F#":6,Gb:6,G:7,"G#":8,Ab:8,A:9,"A#":10,Bb:10,B:11},l=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],h=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];a.keySignature=function(y,g,w,p,E){if(y.clef.type==="perc"||y.clef.type==="none")return{accidentals:n(g),root:w,acc:p};E||(E=0),y.localTransposeVerticalMovement=0,y.localTransposePreferFlats=!1;var N=n(g);if(!N)return y.key;if(y.localTranspose=(y.globalTranspose?y.globalTranspose:0)+E,!y.localTranspose)return{accidentals:N,root:w,acc:p};if(y.globalTransposeOrigKeySig=N,y.localTranspose%12===0)return y.localTransposeVerticalMovement=y.localTranspose/12*7,{accidentals:N,root:w,acc:p};var I=g[0];g[1]==="b"||g[1]==="#"?(I+=g[1],g=g.substr(2)):g=g.substr(1);var O=o[I],V=O!==void 0;V||(O=0,I="C",g="");for(var U=O+y.localTranspose;U<0;)U+=12;U>11&&(U=U%12);var D=g[0]==="m"?h[U]:l[U],me=D+g,B=n(me);B.length>0&&B[0].acc==="flat"&&(y.localTransposePreferFlats=!0);var ie=me.charCodeAt(0)-I.charCodeAt(0);return y.localTranspose>0?(ie<0||ie===0&&(I[1]==="#"||me[1]==="b"))&&(ie+=7):y.localTranspose<0&&(ie>0||ie===0&&(I[1]==="b"||me[1]==="#"))&&(ie-=7),y.localTranspose>0?y.localTransposeVerticalMovement=ie+Math.floor(y.localTranspose/12)*7:y.localTransposeVerticalMovement=ie+Math.ceil(y.localTranspose/12)*7,V?{accidentals:B,root:D[0],acc:D.length>1?D[1]:""}:{accidentals:[],root:w,acc:p}},a.chordName=function(y,g){return t(g,y.localTranspose,y.localTransposePreferFlats,y.freegchord)};var f=["c","d","e","f","g","a","b"];function b(y,g,w,p,E){for(var N=f[(y+49)%7],I=0,O=0;O<p.length;O++)p[O].note.toLowerCase()===N&&(I=S[p[O].acc]);for(var V=S[w],U=V-I,D=f[(g+49)%7],me=0,B=0;B<E.accidentals.length;B++)E.accidentals[B].note.toLowerCase()===D&&(me=S[E.accidentals[B].acc]);var ie=U+me;return ie<-2&&(g--,ie+=D==="c"||D==="f"?1:2),ie>2&&(g++,ie-=D==="b"||D==="e"?1:2),[g,ie]}var S={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},M={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},C={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};return a.note=function(y,g){if(!(!y.localTranspose||y.clef.type==="perc")){var w=g.pitch;if(y.localTransposeVerticalMovement&&(g.pitch=g.pitch+y.localTransposeVerticalMovement,g.name)){var p=g.accidental?g.name.substring(1):g.name,E=g.accidental?g.name[0]:"",N=e.pitchIndex(p);g.name=E+e.noteName(N+y.localTransposeVerticalMovement)}if(g.accidental){var I=b(w,g.pitch,g.accidental,y.globalTransposeOrigKeySig,y.targetKey);g.pitch=I[0],g.accidental=M[I[1]],g.name&&(g.name=C[I[1]]+g.name.replace(/[_^=]/g,""))}}},Au=a,Au}var Tu,Ev;function R1(){if(Ev)return Tu;Ev=1;var e=D1(),t=dy(),n={};return function(){var a,o,l,h;n.initialize=function(g,w,p,E,N){a=g,o=w,l=p,h=N},n.standardKey=function(g,w,p,E){return t.keySignature(l,g,w,p,E)};var f={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},b=function(g,w){var p=f[g],E=p?p.mid:0;return E+w};n.fixClef=function(g){var w=f[g.type];w&&(g.clefPos=w.pitch,g.type=w.clef)},n.deepCopyKey=function(g){var w={accidentals:[],root:g.root,acc:g.acc,mode:g.mode};return g.accidentals.forEach(function(p){w.accidentals.push(Object.assign({},p))}),w};var S={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};n.addPosToKey=function(g,w){var p=g.verticalPos;w.accidentals.forEach(function(E){var N=S[E.note];N=N-p,E.verticalPos=N}),w.impliedNaturals&&w.impliedNaturals.forEach(function(E){var N=S[E.note];N=N-p,E.verticalPos=N}),p<-10?(w.accidentals.forEach(function(E){E.verticalPos-=7,(E.verticalPos>=11||E.verticalPos===10&&E.acc==="flat")&&(E.verticalPos-=7),E.note==="A"&&E.acc==="sharp"&&(E.verticalPos-=7),(E.note==="G"||E.note==="F")&&E.acc==="flat"&&(E.verticalPos-=7)}),w.impliedNaturals&&w.impliedNaturals.forEach(function(E){E.verticalPos-=7,(E.verticalPos>=11||E.verticalPos===10&&E.acc==="flat")&&(E.verticalPos-=7),E.note==="A"&&E.acc==="sharp"&&(E.verticalPos-=7),(E.note==="G"||E.note==="F")&&E.acc==="flat"&&(E.verticalPos-=7)})):p<-4?(w.accidentals.forEach(function(E){E.verticalPos-=7,p===-8&&(E.note==="f"||E.note==="g")&&E.acc==="sharp"&&(E.verticalPos-=7)}),w.impliedNaturals&&w.impliedNaturals.forEach(function(E){E.verticalPos-=7,p===-8&&(E.note==="f"||E.note==="g")&&E.acc==="sharp"&&(E.verticalPos-=7)})):p>=7&&(w.accidentals.forEach(function(E){E.verticalPos+=7}),w.impliedNaturals&&w.impliedNaturals.forEach(function(E){E.verticalPos+=7}))},n.fixKey=function(g,w){var p=Object.assign({},w);return n.addPosToKey(g,p),p};var M=function(g){var w=0,p=g[w++];(p==="^"||p==="_")&&(p=g[w++]);var E=S[p];for(E===void 0&&(E=6);w<g.length;w++)if(g[w]===",")E-=7;else if(g[w]==="'")E+=7;else break;return{mid:E-6,str:g.substring(w)}},C=function(g){for(var w=0;w<g.length;w++)g[w].note==="b"?g[w].note="B":g[w].note==="a"?g[w].note="A":g[w].note==="F"?g[w].note="f":g[w].note==="E"?g[w].note="e":g[w].note==="D"?g[w].note="d":g[w].note==="C"?g[w].note="c":g[w].note==="G"&&g[w].acc==="sharp"?g[w].note="g":g[w].note==="g"&&g[w].acc==="flat"&&(g[w].note="G")};n.parseKey=function(g,w){g.length===0&&(g="none");var p=a.tokenize(g,0,g.length),E={};if(p.length===0)return o("Must pass in key signature.",g,0),E;switch(p[0].token){case"HP":e.addDirective("bagpipes"),l.key={root:"HP",accidentals:[],acc:"",mode:""},E.foundKey=!0,p.shift();break;case"Hp":e.addDirective("bagpipes"),l.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},E.foundKey=!0,p.shift();break;case"none":l.key={root:"none",accidentals:[],acc:"",mode:""},E.foundKey=!0,p.shift();break;default:var N=a.getKeyPitch(p[0].token);if(N.len>0){E.foundKey=!0;var I="",O="";p[0].token.length>1?p[0].token=p[0].token.substring(1):p.shift();var V=N.token;if(p.length>0){var U=a.getSharpFlat(p[0].token);if(U.len>0&&(p[0].token.length>1?p[0].token=p[0].token.substring(1):p.shift(),V+=U.token,I=U.token),p.length>0){var D=a.getMode(p[0].token);D.len>0&&(p.shift(),V+=D.token,O=D.token)}if(n.standardKey(V,N.token,I,0)===void 0)return o("Unsupported key signature: "+V,g,0),E}var me=n.deepCopyKey(l.key),B=!w&&l.globalTranspose?-l.globalTranspose:0,ie;if(w&&(ie=l.globalTransposeOrigKeySig),l.key=n.deepCopyKey(n.standardKey(V,N.token,I,B)),w&&(l.globalTransposeOrigKeySig=ie),l.key.mode=O,me){for(var he,ae=0;ae<l.key.accidentals.length;ae++)for(he=0;he<me.accidentals.length;he++)me.accidentals[he].note&&l.key.accidentals[ae].note.toLowerCase()===me.accidentals[he].note.toLowerCase()&&(me.accidentals[he].note=null);for(he=0;he<me.accidentals.length;he++)me.accidentals[he].note&&(l.key.impliedNaturals||(l.key.impliedNaturals=[]),l.key.impliedNaturals.push({acc:"natural",note:me.accidentals[he].note}))}}break}if(p.length===0||(p[0].token==="exp"&&p.shift(),p.length===0)||(p[0].token==="oct"&&p.shift(),p.length===0))return E;var fe=a.getKeyAccidentals2(p);if(fe.warn&&o(fe.warn,g,0),fe.accs){E.foundKey||(E.foundKey=!0,l.key={root:"none",acc:"",mode:"",accidentals:[]}),C(fe.accs);for(var le=0;le<fe.accs.length;le++){for(var Y=!1,$=0;$<l.key.accidentals.length&&!Y;$++)l.key.accidentals[$].note===fe.accs[le].note&&(Y=!0,l.key.accidentals[$].acc!==fe.accs[le].acc&&(l.key.accidentals[$].acc=fe.accs[le].acc,l.key.explicitAccidentals||(l.key.explicitAccidentals=[]),l.key.explicitAccidentals.push(fe.accs[le])));if(!Y&&(l.key.explicitAccidentals||(l.key.explicitAccidentals=[]),l.key.explicitAccidentals.push(fe.accs[le]),l.key.accidentals.push(fe.accs[le]),l.key.impliedNaturals))for(var ne=0;ne<l.key.impliedNaturals.length;ne++)l.key.impliedNaturals[ne].note===fe.accs[le].note&&l.key.impliedNaturals.splice(ne,1)}}for(var we;p.length>0;)switch(p[0].token){case"m":case"middle":if(p.shift(),p.length===0)return o("Expected = after middle",g,0),E;if(we=p.shift(),we.token!=="="){o("Expected = after middle",g,we.start);break}if(p.length===0)return o("Expected parameter after middle=",g,0),E;var ye=a.getPitchFromTokens(p);ye.warn&&o(ye.warn,g,0),ye.position&&(l.clef.verticalPos=ye.position-6);break;case"transpose":if(p.shift(),p.length===0)return o("Expected = after transpose",g,0),E;if(we=p.shift(),we.token!=="="){o("Expected = after transpose",g,we.start);break}if(p.length===0)return o("Expected parameter after transpose=",g,0),E;if(p[0].type!=="number"){o("Expected number after transpose",g,p[0].start);break}l.clef.transpose=p[0].intt,p.shift();break;case"stafflines":if(p.shift(),p.length===0)return o("Expected = after stafflines",g,0),E;if(we=p.shift(),we.token!=="="){o("Expected = after stafflines",g,we.start);break}if(p.length===0)return o("Expected parameter after stafflines=",g,0),E;if(p[0].type!=="number"){o("Expected number after stafflines",g,p[0].start);break}l.clef.stafflines=p[0].intt,p.shift();break;case"staffscale":if(p.shift(),p.length===0)return o("Expected = after staffscale",g,0),E;if(we=p.shift(),we.token!=="="){o("Expected = after staffscale",g,we.start);break}if(p.length===0)return o("Expected parameter after staffscale=",g,0),E;if(p[0].type!=="number"){o("Expected number after staffscale",g,p[0].start);break}l.clef.staffscale=p[0].floatt,p.shift();break;case"octave":if(p.shift(),p.length===0)return o("Expected = after octave",g,0),E;if(we=p.shift(),we.token!=="="){o("Expected = after octave",g,we.start);break}if(p.length===0)return o("Expected parameter after octave=",g,0),E;if(p[0].type!=="number"){o("Expected number after octave",g,p[0].start);break}l.octave=p[0].intt,p.shift();break;case"style":if(p.shift(),p.length===0)return o("Expected = after style",g,0),E;if(we=p.shift(),we.token!=="="){o("Expected = after style",g,we.start);break}if(p.length===0)return o("Expected parameter after style=",g,0),E;switch(p[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":l.style=p[0].token,p.shift();break;default:o("error parsing style element: "+p[0].token,g,p[0].start);break}break;case"clef":if(p.shift(),p.length===0)return o("Expected = after clef",g,0),E;if(we=p.shift(),we.token!=="="){o("Expected = after clef",g,we.start);break}if(p.length===0)return o("Expected parameter after clef=",g,0),E;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var F=p.shift();switch(F.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":F.token="alto";break;case"F":F.token="bass";break;case"G":F.token="treble";break;case"c":F.token="alto";break;case"f":F.token="bass";break;case"g":F.token="treble";break;default:o("Expected clef name. Found "+F.token,g,F.start);break}p.length>0&&p[0].type==="number"&&(F.token+=p[0].token,p.shift()),p.length>1&&(p[0].token==="-"||p[0].token==="+"||p[0].token==="^"||p[0].token==="_")&&p[1].token==="8"&&(F.token+=p[0].token+p[1].token,p.shift(),p.shift()),l.clef={type:F.token,verticalPos:b(F.token,0)},l.currentVoice&&l.currentVoice.transpose!==void 0&&(l.clef.transpose=l.currentVoice.transpose),E.foundClef=!0;break;default:o("Unknown parameter: "+p[0].token,g,p[0].start),p.shift()}return E};var y=function(g){var w=l.voices[g];if(!(l.currentVoice&&l.currentVoice.index===w.index&&l.currentVoice.staffNum===w.staffNum))return l.currentVoice=w,h.setCurrentVoice(w.staffNum,w.index,g)};n.parseVoice=function(g,w,p){var E=a.getMeat(g,w,p),N=E.start,I=E.end,O=a.getToken(g,N,I);if(O.length===0){o("Expected a voice id",g,N);return}var V=!1;l.voices[O]===void 0&&(l.voices[O]={},V=!0,l.score_is_present&&o("Can't have an unknown V: id when the %score directive is present",g,N)),N+=O.length,N+=a.eatWhiteSpace(g,N);for(var U={startStaff:V},D=function(ye){var F=a.getVoiceToken(g,N,I);F.warn!==void 0?o("Expected value for "+ye+" in voice: "+F.warn,g,N):F.err!==void 0?o("Expected value for "+ye+" in voice: "+F.err,g,N):F.token.length===0&&g[N]!=='"'?o("Expected value for "+ye+" in voice",g,N):U[ye]=F.token,N+=F.len},me=function(ye,F,H){var W=a.getVoiceToken(g,N,I);W.warn!==void 0?o("Expected value for "+F+" in voice: "+W.warn,g,N):W.err!==void 0?o("Expected value for "+F+" in voice: "+W.err,g,N):W.token.length===0&&g[N]!=='"'?o("Expected value for "+F+" in voice",g,N):(W.token=parseFloat(W.token),l.voices[ye][F]=W.token),N+=W.len},B=function(ye,F){var H=a.getVoiceToken(g,N,I);if(H.warn!==void 0)o("Expected value for "+ye+" in voice: "+H.warn,g,N);else if(H.err!==void 0)o("Expected value for "+ye+" in voice: "+H.err,g,N);else if(H.token.length===0&&g[N]!=='"')o("Expected value for "+ye+" in voice",g,N);else return H.token;N+=H.len},ie=function(ye,F){var H={_B:2,_E:9,_b:-10,_e:-3},W=a.getVoiceToken(g,N,I);if(W.warn!==void 0)o("Expected one of (_B, _E, _b, _e) for "+F+" in voice: "+W.warn,g,N);else if(W.token.length===0&&g[N]!=='"')o("Expected one of (_B, _E, _b, _e) for "+F+" in voice",g,N);else{var _e=H[W.token];_e?l.voices[ye][F]=_e:o("Expected one of (_B, _E, _b, _e) for "+F+" in voice",g,N)}N+=W.len};N<I;){var he=a.getVoiceToken(g,N,I);if(N+=he.len,he.warn)o("Error parsing voice: "+he.warn,g,N);else{var ae=null;switch(he.token){case"clef":case"cl":D("clef");var fe=0;U.clef!==void 0&&(U.clef=U.clef.replace(/[',]/g,""),U.clef.indexOf("+16")!==-1&&(fe+=14,U.clef=U.clef.replace("+16","")),U.verticalPos=b(U.clef,fe));break;case"treble":case"bass":case"tenor":case"alto":case"perc":case"none":case"treble'":case"bass'":case"tenor'":case"alto'":case"none'":case"treble''":case"bass''":case"tenor''":case"alto''":case"none''":case"treble,":case"bass,":case"tenor,":case"alto,":case"none,":case"treble,,":case"bass,,":case"tenor,,":case"alto,,":case"none,,":var le=0;U.clef=he.token.replace(/[',]/g,""),U.verticalPos=b(U.clef,le),l.voices[O].clef=he.token;break;case"staves":case"stave":case"stv":D("staves");break;case"brace":case"brc":D("brace");break;case"bracket":case"brk":D("bracket");break;case"name":case"nm":D("name");break;case"subname":case"sname":case"snm":D("subname");break;case"merge":U.startStaff=!1;break;case"stem":case"stems":ae=a.getVoiceToken(g,N,I),ae.warn!==void 0?o("Expected value for stems in voice: "+ae.warn,g,N):ae.err!==void 0?o("Expected value for stems in voice: "+ae.err,g,N):ae.token==="up"||ae.token==="down"?l.voices[O].stem=ae.token:o("Expected up or down for voice stem",g,N),N+=ae.len;break;case"up":case"down":l.voices[O].stem=he.token;break;case"middle":case"m":D("verticalPos"),U.verticalPos=M(U.verticalPos).mid;break;case"gchords":case"gch":l.voices[O].suppressChords=!0,ae=a.getVoiceToken(g,N,I),ae.token==="0"&&(N=N+ae.len);break;case"space":case"spc":D("spacing");break;case"scale":me(O,"scale");break;case"score":ie(O,"scoreTranspose");break;case"transpose":me(O,"transpose");break;case"stafflines":me(O,"stafflines");break;case"staffscale":me(O,"staffscale");break;case"octave":me(O,"octave");break;case"volume":me(O,"volume");break;case"cue":var Y=B("cue");Y==="on"?l.voices[O].scale=.6:l.voices[O].scale=1;break;case"style":ae=a.getVoiceToken(g,N,I),ae.warn!==void 0?o("Expected value for style in voice: "+ae.warn,g,N):ae.err!==void 0?o("Expected value for style in voice: "+ae.err,g,N):ae.token==="normal"||ae.token==="harmonic"||ae.token==="rhythm"||ae.token==="x"||ae.token==="triangle"?l.voices[O].style=ae.token:o("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",g,N),N+=ae.len;break}}N+=a.eatWhiteSpace(g,N)}if((U.startStaff||l.staves.length===0)&&(l.staves.push({index:l.staves.length,meter:l.origMeter}),l.score_is_present||(l.staves[l.staves.length-1].numVoices=0)),l.voices[O].staffNum===void 0){l.voices[O].staffNum=l.staves.length-1;var $=0;for(var ne in l.voices)l.voices.hasOwnProperty(ne)&&l.voices[ne].staffNum===l.voices[O].staffNum&&$++;l.voices[O].index=$-1}var we=l.staves[l.voices[O].staffNum];return l.score_is_present||we.numVoices++,U.clef&&(we.clef={type:U.clef,verticalPos:U.verticalPos}),U.spacing&&(we.spacing_below_offset=U.spacing),U.verticalPos&&(we.verticalPos=U.verticalPos),U.name&&(we.name?we.name.push(U.name):we.name=[U.name]),U.subname&&(we.subname?we.subname.push(U.subname):we.subname=[U.subname]),y(O)}}(),Tu=n,Tu}var Pu,Av;function jT(){if(Av)return Pu;Av=1;var e=Ds(),t=D1(),n=R1(),a=function(o,l,h,f,b){this.reset=function(C,y,g,w){n.initialize(C,y,g,w,b),t.initialize(C,y,g,w,b)},this.reset(o,l,h,f),this.setTitle=function(C,y){h.hasMainTitle?b.addSubtitle(C,{startChar:h.iChar,endChar:h.iChar+y+2}):(b.addMetaText("title",C,{startChar:h.iChar,endChar:h.iChar+y+2}),h.hasMainTitle=!0)},this.setMeter=function(C){if(C=o.stripComment(C),C==="C")return h.havent_set_length===!0&&(h.default_length=.125,h.havent_set_length=!1),{type:"common_time"};if(C==="C|")return h.havent_set_length===!0&&(h.default_length=.125,h.havent_set_length=!1),{type:"cut_time"};if(C==="o")return h.havent_set_length===!0&&(h.default_length=.125,h.havent_set_length=!1),{type:"tempus_perfectum"};if(C==="c")return h.havent_set_length===!0&&(h.default_length=.125,h.havent_set_length=!1),{type:"tempus_imperfectum"};if(C==="o.")return h.havent_set_length===!0&&(h.default_length=.125,h.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(C==="c.")return h.havent_set_length===!0&&(h.default_length=.125,h.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(C.length===0||C.toLowerCase()==="none")return h.havent_set_length===!0&&(h.default_length=.125,h.havent_set_length=!1),null;var y=o.tokenize(C,0,C.length);try{var g=function(){var O={value:0,num:""},V=y.shift();for(V.token==="("&&(V=y.shift());;){if(V.type!=="number")throw"Expected top number of meter";if(O.value+=parseInt(V.token),O.num+=V.token,y.length===0||y[0].token==="/")return O;if(V=y.shift(),V.token===")"){if(y.length===0||y[0].token==="/")return O;throw"Unexpected paren in meter"}if(V.token!=="."&&V.token!=="+"||(O.num+=V.token,y.length===0))throw"Expected top number of meter";V=y.shift()}return O},w=function(){var O=g();if(y.length===0)return O;var V=y.shift();if(V.token!=="/")throw"Expected slash in meter";if(V=y.shift(),V.type!=="number")throw"Expected bottom number of meter";return O.den=V.token,O.value=O.value/parseInt(O.den),O};if(y.length===0)throw"Expected meter definition in M: line";for(var p={type:"specified",value:[]},E=0;;){var N=w();E+=N.value;var I={num:N.num};if(N.den!==void 0&&(I.den=N.den),p.value.push(I),y.length===0)break}return h.havent_set_length===!0&&(h.default_length=E<.75?.0625:.125,h.havent_set_length=!1),p}catch(O){l(O,C,0)}return null},this.calcTempo=function(C){var y=.25;h.meter&&h.meter.type==="specified"?y=1/parseInt(h.meter.value[0].den):h.origMeter&&h.origMeter.type==="specified"&&(y=1/parseInt(h.origMeter.value[0].den));for(var g=0;g<C.duration;g++)C.duration[g]=y*C.duration[g];return C},this.resolveTempo=function(){h.tempo&&(this.calcTempo(h.tempo),f.metaText.tempo=h.tempo,delete h.tempo)},this.addUserDefinition=function(C,y,g){var w=C.indexOf("=",y);if(w===-1){l("Need an = in a macro definition",C,y);return}var p=e.strip(C.substring(y,w)),E=e.strip(C.substring(w+1));if(p.length!==1){l("Macro definitions can only be one character",C,y);return}var N="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(N.indexOf(p)===-1){l("Macro definitions must be H-Y, h-w, or tilde",C,y);return}if(E.length===0){l("Missing macro definition",C,y);return}h.macros===void 0&&(h.macros={}),h.macros[p]=E},this.setDefaultLength=function(C,y,g){var w=C.substring(y,g).replace(/ /g,""),p=w.split("/");if(p.length===2){var E=parseInt(p[0]),N=parseInt(p[1]);N>0&&(h.default_length=E/N,h.havent_set_length=!1)}else p.length===1&&p[0]==="1"&&(h.default_length=1,h.havent_set_length=!1)};var S={larghissimo:20,adagissimo:24,sostenuto:28,grave:32,largo:40,lento:50,larghetto:60,adagio:68,adagietto:74,andante:80,andantino:88,"marcia moderato":84,"andante moderato":100,moderato:112,allegretto:116,"allegro moderato":120,allegro:126,animato:132,agitato:140,veloce:148,"mosso vivo":156,vivace:164,vivacissimo:172,allegrissimo:176,presto:184,prestissimo:210};this.setTempo=function(C,y,g,w){try{var p=o.tokenize(C,y,g);if(p.length===0)throw"Missing parameter in Q: field";var E={startChar:w+y-2,endChar:w+g},N=!0,I=p.shift();if(I.type==="quote"&&(E.preString=I.token,I=p.shift(),p.length===0))return S[E.preString.toLowerCase()]&&(E.bpm=S[E.preString.toLowerCase()],E.suppressBpm=!0),{type:"immediate",tempo:E};if(I.type==="alpha"&&I.token==="C"){if(p.length===0)throw"Missing tempo after C in Q: field";if(I=p.shift(),I.type==="punct"&&I.token==="="){if(p.length===0)throw"Missing tempo after = in Q: field";if(I=p.shift(),I.type!=="number")throw"Expected number after = in Q: field";E.duration=[1],E.bpm=parseInt(I.token)}else if(I.type==="number"){if(E.duration=[parseInt(I.token)],p.length===0)throw"Missing = after duration in Q: field";if(I=p.shift(),I.type!=="punct"||I.token!=="=")throw"Expected = after duration in Q: field";if(p.length===0)throw"Missing tempo after = in Q: field";if(I=p.shift(),I.type!=="number")throw"Expected number after = in Q: field";E.bpm=parseInt(I.token)}else throw"Expected number or equal after C in Q: field"}else if(I.type==="number"){var O=parseInt(I.token);if(p.length===0||p[0].type==="quote")E.duration=[1],E.bpm=O;else{if(N=!1,I=p.shift(),I.type!=="punct"&&I.token!=="/"||(I=p.shift(),I.type!=="number"))throw"Expected fraction in Q: field";var V=parseInt(I.token);for(E.duration=[O/V];p.length>0&&p[0].token!=="="&&p[0].type!=="quote";){if(I=p.shift(),I.type!=="number"||(O=parseInt(I.token),I=p.shift(),I.type!=="punct"&&I.token!=="/")||(I=p.shift(),I.type!=="number"))throw"Expected fraction in Q: field";V=parseInt(I.token),E.duration.push(O/V)}if(I=p.shift(),I.type!=="punct"&&I.token!=="=")throw"Expected = in Q: field";if(I=p.shift(),I.type!=="number")throw"Expected tempo in Q: field";E.bpm=parseInt(I.token)}}else throw"Unknown value in Q: field";if(p.length!==0&&(I=p.shift(),I.type==="quote"&&(E.postString=I.token,I=p.shift()),p.length!==0))throw"Unexpected string at end of Q: field";return h.printTempo===!1&&(E.suppress=!0),{type:N?"delaySet":"immediate",tempo:E}}catch(U){return l(U,C,y),{type:"none"}}},this.letter_to_inline_header=function(C,y,g){var w=!1,p=o.eatWhiteSpace(C,y);if(y+=p,C.length>=y+5&&C[y]==="["&&C[y+2]===":"){var E=C.indexOf("]",y),N=h.iChar+y,I=h.iChar+E+1;switch(C.substring(y,y+3)){case"[I:":var O=t.addDirective(C.substring(y+3,E));return O&&l(O,C,y),[E-y+1+p];case"[M:":var V=this.setMeter(C.substring(y+3,E));return b.hasBeginMusic()&&V?b.appendStartingElement("meter",N,I,V):h.meter=V,[E-y+1+p];case"[K:":var U=n.parseKey(C.substring(y+3,E),!0);return U.foundClef&&b.hasBeginMusic()&&b.appendStartingElement("clef",N,I,h.clef),U.foundKey&&b.hasBeginMusic()&&b.appendStartingElement("key",N,I,n.fixKey(h.clef,h.key)),[E-y+1+p];case"[P:":var D=t.parseFontChangeLine(C.substring(y+3,E));return g||f.lines.length<=f.lineNum?h.partForNextLine={title:D,startChar:N,endChar:I}:b.appendElement("part",N,I,{title:D}),[E-y+1+p];case"[L:":return this.setDefaultLength(C,y+3,E),[E-y+1+p];case"[Q:":if(E>0){var me=this.setTempo(C,y+3,E,h.iChar);return me.type==="delaySet"?b.hasBeginMusic()?b.appendElement("tempo",N,I,this.calcTempo(me.tempo)):h.tempoForNextLine=["tempo",N,I,this.calcTempo(me.tempo)]:me.type==="immediate"&&(!g&&b.hasBeginMusic()?b.appendElement("tempo",N,I,me.tempo):h.tempoForNextLine=["tempo",N,I,me.tempo]),[E-y+1+p,C[y+1],C.substring(y+3,E)]}break;case"[V:":if(E>0)return w=n.parseVoice(C,y+3,E),[E-y+1+p,C[y+1],C.substring(y+3,E),w];break;case"[r:":return[E-y+1+p]}}return[0]},this.letter_to_body_header=function(C,y){var g=!1;if(C.length>=y+3)switch(C.substring(y,y+2)){case"I:":var w=t.addDirective(C.substring(y+2));return w&&l(w,C,y),[C.length];case"M:":var p=this.setMeter(C.substring(y+2));return b.hasBeginMusic()&&p&&b.appendStartingElement("meter",h.iChar+y,h.iChar+C.length,p),[C.length];case"K:":var E=n.parseKey(C.substring(y+2),b.hasBeginMusic());return E.foundClef&&b.hasBeginMusic()&&b.appendStartingElement("clef",h.iChar+y,h.iChar+C.length,h.clef),E.foundKey&&b.hasBeginMusic()&&b.appendStartingElement("key",h.iChar+y,h.iChar+C.length,n.fixKey(h.clef,h.key)),[C.length];case"P:":return b.hasBeginMusic()&&b.appendElement("part",h.iChar+y,h.iChar+C.length,{title:C.substring(y+2)}),[C.length];case"L:":return this.setDefaultLength(C,y+2,C.length),[C.length];case"Q:":var N=C.indexOf("",y+2);N===-1&&(N=C.length);var I=this.setTempo(C,y+2,N,h.iChar);return I.type==="delaySet"?b.appendElement("tempo",h.iChar+y,h.iChar+C.length,this.calcTempo(I.tempo)):I.type==="immediate"&&b.appendElement("tempo",h.iChar+y,h.iChar+C.length,I.tempo),[N,C[y],e.strip(C.substring(y+2))];case"V:":return g=n.parseVoice(C,y+2,C.length),[C.length,C[y],e.strip(C.substring(y+2)),g]}return[0]};var M={A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"};this.parseHeader=function(C){var y=M[C[0]],g=C.length-2,w=o.translateString(o.stripComment(C.substring(2)));if(y==="unalignedWords"||y==="notes")b.addMetaTextArray(y,t.parseFontChangeLine(w),{startChar:h.iChar,endChar:h.iChar+C.length});else if(y!==void 0)b.addMetaText(y,t.parseFontChangeLine(w),{startChar:h.iChar,endChar:h.iChar+C.length});else{var p=h.iChar,E=p+C.length;switch(C[0]){case"H":for(b.addMetaTextArray("history",t.parseFontChangeLine(w),{startChar:h.iChar,endChar:h.iChar+C.length}),C=o.peekLine();C&&C[1]!==":";)o.nextLine(),b.addMetaTextArray("history",t.parseFontChangeLine(o.translateString(o.stripComment(C))),{startChar:h.iChar,endChar:h.iChar+C.length}),C=o.peekLine();break;case"K":this.resolveTempo();var N=n.parseKey(C.substring(2),!1);!h.is_in_header&&b.hasBeginMusic()&&(N.foundClef&&b.appendStartingElement("clef",p,E,h.clef),N.foundKey&&b.appendStartingElement("key",p,E,n.fixKey(h.clef,h.key))),h.is_in_header=!1;break;case"L":this.setDefaultLength(C,2,C.length);break;case"M":h.origMeter=h.meter=this.setMeter(C.substring(2));break;case"P":h.is_in_header?b.addMetaText("partOrder",t.parseFontChangeLine(w),{startChar:h.iChar,endChar:h.iChar+C.length}):h.partForNextLine={title:w,startChar:p,endChar:E};break;case"Q":var I=this.setTempo(C,2,C.length,h.iChar);I.type==="delaySet"?h.tempo=I.tempo:I.type==="immediate"&&(f.metaText.tempo?h.tempoForNextLine=["tempo",p,E,I.tempo]:f.metaText.tempo=I.tempo);break;case"T":h.titlecaps&&(w=w.toUpperCase()),this.setTitle(t.parseFontChangeLine(o.theReverser(w)),g);break;case"U":this.addUserDefinition(C,2,C.length);break;case"V":if(n.parseVoice(C,2,C.length),!h.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":l("Ignored header",C,0);break;default:return{regular:!0}}}return{}}};return Pu=a,Pu}var an={},Tv;function XT(){return Tv||(Tv=1,an.legalAccents=["trill","lowermordent","uppermordent","mordent","pralltriller","accent","fermata","invertedfermata","tenuto","0","1","2","3","4","5","+","wedge","open","thumb","snap","turn","roll","breath","shortphrase","mediumphrase","longphrase","segno","coda","D.S.","D.C.","fine","beambr1","beambr2","slide","marcato","upbow","downbow","/","//","///","////","trem1","trem2","trem3","trem4","turnx","invertedturn","invertedturnx","trill(","trill)","arpeggio","xstem","mark","umarcato","style=normal","style=harmonic","style=rhythm","style=x","style=triangle","D.C.alcoda","D.C.alfine","D.S.alcoda","D.S.alfine","editorial","courtesy"],an.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"],an.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"],an.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],an.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],an.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{",an.durations=[.5,.75,.875,.9375,.96875,.984375,.25,.375,.4375,.46875,.484375,.4921875,.125,.1875,.21875,.234375,.2421875,.24609375,.0625,.09375,.109375,.1171875,.12109375,.123046875,.03125,.046875,.0546875,.05859375,.060546875,.0615234375,.015625,.0234375,.02734375,.029296875,.0302734375,.03076171875],an.pitches={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11},an.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"},an.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"},an.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2}),an}var Iu,Pv;function QT(){if(Pv)return Iu;Pv=1;var e=R1(),t=dy(),n,a,o,l,h,f,{legalAccents:b,volumeDecorations:S,dynamicDecorations:M,accentPseudonyms:C,accentDynamicPseudonyms:y,nonDecorations:g,durations:w,pitches:p,rests:E,accMap:N,tripletQ:I}=XT(),O=function(F,H,W,_e,Te,Re){n=F,a=H,o=W,l=_e,h=Te,f=Re,this.lineContinuation=!1},V=function(F,H,W){if(F.inTie[H]===void 0)return!1;var _e=F.currentVoice?F.currentVoice.staffNum*100+F.currentVoice.index:0;return!!(F.inTie[H][_e]&&(W.pitches!==void 0||W.rest.type!=="spacer"))},U={};O.prototype.parseMusic=function(F){f.resolveTempo(),o.is_in_header=!1;for(var H=0,W=o.iChar;n.isWhiteSpace(F[H])&&H<F.length;)H++;if(!(H===F.length||F[H]==="%")){var _e=o.start_new_line;o.continueall===void 0?o.start_new_line=!0:o.start_new_line=!1;var Te=0,Re=f.letter_to_body_header(F,H);Re[0]>0&&(H+=Re[0],Re[1]==="V"&&this.startNewLine());for(var Ie=0;H<F.length;){var st=H;if(F[H]==="%")break;var wt=f.letter_to_inline_header(F,H,_e);if(wt[0]>0)H+=wt[0],wt[1]==="V"&&(_e=!0);else{(!h.hasBeginMusic()||_e&&!this.lineContinuation)&&(this.startNewLine(),_e=!1);for(var Ze;;)if(Ze=n.eatWhiteSpace(F,H),Ze>0&&(H+=Ze),H>0&&F[H-1]===""&&(Ze=f.letter_to_body_header(F,H),Ze[0]>0&&(Ze[1]==="V"&&this.startNewLine(),H=Ze[0],o.start_new_line=!1)),Ze=fe(F,H),Ze[0]>0&&(H+=Ze[0]),Ze=me(F,H),Ze[0]>0){U.chord||(U.chord=[]);var dt=n.translateString(Ze[1]);dt=dt.replace(/;/g,`
138
+ `);for(var bt=!1,et=0;et<U.chord.length;et++)U.chord[et].position===Ze[2]&&(bt=!0,U.chord[et].name+=`
139
+ `+dt);bt===!1&&(Ze[2]===null&&Ze[3]?U.chord.push({name:dt,rel_position:Ze[3]}):U.chord.push({name:dt,position:Ze[2]})),H+=Ze[0];var Nt=n.skipWhiteSpace(F.substring(H));Nt>0&&(U.force_end_beam_last=!0),H+=Nt}else if(g.indexOf(F[H])===-1?Ze=ae(F,H):Ze=[0],Ze[0]>0)Ze[1]===null?H+1<F.length&&this.startNewLine():Ze[1].length>0&&(Ze[1].indexOf("style=")===0?U.style=Ze[1].substr(6):(U.decoration===void 0&&(U.decoration=[]),Ze[1]==="beambr1"?U.beambr=1:Ze[1]==="beambr2"?U.beambr=2:U.decoration.push(Ze[1]))),H+=Ze[0];else if(Ze=B(F,H),Ze[0]>0)U.gracenotes=Ze[1],H+=Ze[0];else break;if(Ze=le(F,H),Ze[0]>0){Ie=0,U.gracenotes!==void 0&&(U.rest={type:"spacer"},U.duration=.125,o.addFormattingOptions(U,l.formatting,"note"),h.appendElement("note",W+H,W+H+Ze[0],U),o.measureNotEmpty=!0,U={});var xt={type:Ze[1]};xt.type.length===0?a("Unknown bar type",F,H):(o.inEnding&&xt.type!=="bar_thin"&&(xt.endEnding=!0,o.inEnding=!1),Ze[2]&&(xt.startEnding=Ze[2],o.inEnding&&(xt.endEnding=!0),o.inEnding=!0,Ze[1]==="bar_right_repeat"?o.restoreStartEndingHoldOvers():o.duplicateStartEndingHoldOvers()),U.decoration!==void 0&&(xt.decoration=U.decoration),U.chord!==void 0&&(xt.chord=U.chord),xt.startEnding&&o.barFirstEndingNum===void 0?o.barFirstEndingNum=o.currBarNumber:xt.startEnding&&xt.endEnding&&o.barFirstEndingNum?o.currBarNumber=o.barFirstEndingNum:xt.endEnding&&(o.barFirstEndingNum=void 0),xt.type!=="bar_invisible"&&o.measureNotEmpty&&ye()&&(o.currBarNumber++,o.barNumbers&&o.currBarNumber%o.barNumbers===0&&(xt.barNumber=o.currBarNumber)),o.addFormattingOptions(U,l.formatting,"bar"),h.appendElement("bar",W+st,W+H+Ze[0],xt),o.measureNotEmpty=!1,U={}),H+=Ze[0]}else if(F[H]==="&")Ze=ie(F,H),Ze[0]>0&&(h.appendElement("overlay",W,W+1,{}),H+=1,Ie++);else{if(Ze=Y(F,H),Ze.consumed>0&&(Ze.startSlur!==void 0&&(U.startSlur=Ze.startSlur),Ze.dottedSlur&&(U.dottedSlur=!0),Ze.triplet!==void 0&&(Te>0?a("Can't nest triplets",F,H):(U.startTriplet=Ze.triplet,U.tripletMultiplier=Ze.tripletQ/Ze.triplet,U.tripletR=Ze.num_notes,Te=Ze.num_notes===void 0?Ze.triplet:Ze.num_notes)),H+=Ze.consumed),F[H]==="["){H++;for(var at=null,rr=!1,Xt=!1;!Xt;){var Ht=ae(F,H);Ht[0]>0&&(H+=Ht[0]);var nr=ne(F,H,{},!1);if(nr!==null&&nr.pitch!==void 0)Ht[0]>0&&Ht[1].indexOf("style=")!==0&&(U.decoration===void 0&&(U.decoration=[]),U.decoration.push(Ht[1])),nr.end_beam&&(U.end_beam=!0,delete nr.end_beam),U.pitches===void 0?(U.duration=nr.duration,U.pitches=[nr]):U.pitches.push(nr),delete nr.duration,Ht[0]>0&&Ht[1].indexOf("style=")===0&&(U.pitches[U.pitches.length-1].style=Ht[1].substr(6)),o.inTieChord[U.pitches.length]&&(nr.endTie=!0,o.inTieChord[U.pitches.length]=void 0),nr.startTie&&(o.inTieChord[U.pitches.length]=!0),H=nr.endChar,delete nr.endChar;else if(F[H]===" ")a("Spaces are not allowed in chords",F,H),H++;else{if(H<F.length&&F[H]==="]"){H++,o.next_note_duration!==0&&(U.duration=U.duration*o.next_note_duration,o.next_note_duration=0),V(o,Ie,U)&&(U.pitches.forEach(function(r){r.endTie=!0}),D(o,Ie,!1)),Te>0&&!(U.rest&&U.rest.type==="spacer")&&(Te--,Te===0&&(U.endTriplet=!0));for(var Ar=!1;H<F.length&&!Ar;){switch(F[H]){case" ":case" ":$(U);break;case")":U.endSlur===void 0?U.endSlur=1:U.endSlur++;break;case"-":U.pitches.forEach(function(r){r.startTie={}}),D(o,Ie,!0);break;case">":case"<":var fr=we(F,H);H+=fr[0]-1,o.next_note_duration=fr[2],at?at=at*fr[1]:at=fr[1];break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"/":var qe=n.getFraction(F,H);at=qe.value,H=qe.index;var je=F[H];je===" "&&(rr=!0),je==="-"||je===")"||je===" "||je==="<"||je===">"?H--:Ar=!0;break;case"0":at=0;break;default:Ar=!0;break}Ar||H++}}else a("Expected ']' to end the chords",F,H);U.pitches!==void 0&&(at!==null&&(U.duration=U.duration*at,rr&&$(U)),o.addFormattingOptions(U,l.formatting,"note"),h.appendElement("note",W+st,W+H,U),o.measureNotEmpty=!0,U={}),Xt=!0}}}else{var Fe={},Ue=ne(F,H,Fe,!0);if(Fe.endTie!==void 0&&D(o,Ie,!0),Ue!==null){Ue.pitch!==void 0?(U.pitches=[{}],Ue.accidental!==void 0&&(U.pitches[0].accidental=Ue.accidental),U.pitches[0].pitch=Ue.pitch,U.pitches[0].name=Ue.name,(Ue.midipitch||Ue.midipitch===0)&&(U.pitches[0].midipitch=Ue.midipitch),Ue.endSlur!==void 0&&(U.pitches[0].endSlur=Ue.endSlur),Ue.endTie!==void 0&&(U.pitches[0].endTie=Ue.endTie),Ue.startSlur!==void 0&&(U.pitches[0].startSlur=Ue.startSlur),U.startSlur!==void 0&&(U.pitches[0].startSlur=U.startSlur),U.dottedSlur!==void 0&&(U.pitches[0].dottedSlur=!0),Ue.startTie!==void 0&&(U.pitches[0].startTie=Ue.startTie),U.startTie!==void 0&&(U.pitches[0].startTie=U.startTie)):(U.rest=Ue.rest,Ue.rest.type==="multimeasure"&&ye()&&(o.currBarNumber+=Ue.rest.text-1),Ue.endSlur!==void 0&&(U.endSlur=Ue.endSlur),Ue.endTie!==void 0&&(U.rest.endTie=Ue.endTie),Ue.startSlur!==void 0&&(U.startSlur=Ue.startSlur),Ue.startTie!==void 0&&(U.rest.startTie=Ue.startTie),U.startTie!==void 0&&(U.rest.startTie=U.startTie)),Ue.chord!==void 0&&(U.chord=Ue.chord),Ue.duration!==void 0&&(U.duration=Ue.duration),Ue.decoration!==void 0&&(U.decoration=Ue.decoration),Ue.graceNotes!==void 0&&(U.graceNotes=Ue.graceNotes),delete U.startSlur,delete U.dottedSlur,V(o,Ie,U)&&(U.pitches!==void 0?U.pitches[0].endTie=!0:U.rest.type!=="spacer"&&(U.rest.endTie=!0),D(o,Ie,!1)),(Ue.startTie||U.startTie)&&D(o,Ie,!0),H=Ue.endChar,Te>0&&!(Ue.rest&&Ue.rest.type==="spacer")&&(Te--,Te===0&&(U.endTriplet=!0)),Ue.end_beam&&$(U),U.rest&&U.rest.type==="rest"&&U.duration===1&&he(o)<=1&&(U.rest.type="whole",U.duration=he(o)),U.duration<1&&w.indexOf(U.duration)===-1&&U.duration!==0&&(!U.rest||U.rest.type!=="spacer")&&a("Duration not representable: "+F.substring(st,H),F,H),o.addFormattingOptions(U,l.formatting,"note");var Qe=h.appendElement("note",W+st,W+H,U);Qe||(this.startNewLine(),h.appendElement("note",W+st,W+H,U)),o.measureNotEmpty=!0,U={}}}H===st&&(F[H]!==" "&&F[H]!=="`"&&a("Unknown character ignored",F,H),H++)}}}this.lineContinuation=F.indexOf("")>=0||Re[0]>0,this.lineContinuation||(U={})}};var D=function(F,H,W){var _e=F.currentVoice?F.currentVoice.staffNum*100+F.currentVoice.index:0;F.inTie[H]===void 0&&(F.inTie[H]=[]),F.inTie[H][_e]=W},me=function(F,H){if(F[H]==='"'){var W=n.getBrackettedSubstring(F,H,5);if(W[2]||a("Missing the closing quote while parsing the chord symbol",F,H),W[0]>0&&W[1].length>0&&W[1][0]==="^")W[1]=W[1].substring(1),W[2]="above";else if(W[0]>0&&W[1].length>0&&W[1][0]==="_")W[1]=W[1].substring(1),W[2]="below";else if(W[0]>0&&W[1].length>0&&W[1][0]==="<")W[1]=W[1].substring(1),W[2]="left";else if(W[0]>0&&W[1].length>0&&W[1][0]===">")W[1]=W[1].substring(1),W[2]="right";else if(W[0]>0&&W[1].length>0&&W[1][0]==="@"){W[1]=W[1].substring(1);var _e=n.getFloat(W[1]);if(_e.digits===0)return a("Missing first position in absolutely positioned annotation.",F,H),W[1]=W[1].replace("@",""),W[2]="above",W;if(W[1]=W[1].substring(_e.digits),W[1][0]!==",")return a("Missing comma absolutely positioned annotation.",F,H),W[1]=W[1].replace("@",""),W[2]="above",W;W[1]=W[1].substring(1);var Te=n.getFloat(W[1]);if(Te.digits===0)return a("Missing second position in absolutely positioned annotation.",F,H),W[1]=W[1].replace("@",""),W[2]="above",W;W[1]=W[1].substring(Te.digits);var Re=n.skipWhiteSpace(W[1]);W[1]=W[1].substring(Re),W[2]=null,W[3]={x:_e.value,y:Te.value}}else o.freegchord!==!0&&(W[1]=W[1].replace(/([ABCDEFG0-9])b/g,"$1♭"),W[1]=W[1].replace(/([ABCDEFG0-9])#/g,"$1♯"),W[1]=W[1].replace(/^([ABCDEFG])([♯♭]?)o([^A-Za-z])/g,"$1$2°$3"),W[1]=W[1].replace(/^([ABCDEFG])([♯♭]?)o$/g,"$1$2°"),W[1]=W[1].replace(/^([ABCDEFG])([♯♭]?)0([^A-Za-z])/g,"$1$2ø$3"),W[1]=W[1].replace(/^([ABCDEFG])([♯♭]?)\^([^A-Za-z])/g,"$1$2∆$3")),W[2]="default",W[1]=t.chordName(o,W[1]);return W}return[0,""]},B=function(F,H){if(F[H]==="{"){var W=n.getBrackettedSubstring(F,H,1,"}");W[2]||a("Missing the closing '}' while parsing grace note",F,H),F[H+W[0]]===")"&&(W[0]++,W[1]+=")");for(var _e=[],Te=0,Re=!1;Te<W[1].length;){var Ie=!1;W[1][Te]==="/"&&(Ie=!0,Te++);var st=ne(W[1],Te,{},!1);st!==null?(st.duration=st.duration/(o.default_length*8),Ie&&(st.acciaccatura=!0),st.rest?a("Rests not allowed as grace notes '"+W[1][Te]+"' while parsing grace note",F,H):_e.push(st),Re&&(st.endTie=!0,Re=!1),st.startTie&&(Re=!0),Te=st.endChar,delete st.endChar,st.end_beam&&(st.endBeam=!0,delete st.end_beam)):(W[1][Te]===" "?_e.length>0&&(_e[_e.length-1].endBeam=!0):a("Unknown character '"+W[1][Te]+"' while parsing grace note",F,H),Te++)}if(_e.length)return[W[0],_e]}return[0]};function ie(F,H){if(F[H]==="&"){for(var W=H;F[H]&&F[H]!==":"&&F[H]!=="|";)H++;return[H-W,F.substring(W+1,H)]}return[0]}function he(F){var H=F.origMeter;return!H||H.type!=="specified"||!H.value||H.value.length===0?1:parseInt(H.value[0].num,10)/parseInt(H.value[0].den,10)}var ae=function(F,H){var W=o.macros[F[H]];if(W!==void 0)return(W[0]==="!"||W[0]==="+")&&(W=W.substring(1)),(W[W.length-1]==="!"||W[W.length-1]==="+")&&(W=W.substring(0,W.length-1)),b.includes(W)?[1,W]:S.includes(W)?(o.volumePosition==="hidden"&&(W=""),[1,W]):M.includes(W)?(o.dynamicPosition==="hidden"&&(W=""),[1,W]):(o.ignoredDecorations.includes(W)||a("Unknown macro: "+W,F,H),[1,""]);switch(F[H]){case".":if(F[H+1]==="("||F[H+1]==="-")break;return[1,"staccato"];case"u":return[1,"upbow"];case"v":return[1,"downbow"];case"~":return[1,"irishroll"];case"!":case"+":var _e=n.getBrackettedSubstring(F,H,5);if(_e[1].length>1&&(_e[1][0]==="^"||_e[1][0]==="_")&&(_e[1]=_e[1].substring(1)),b.includes(_e[1]))return _e;if(S.includes(_e[1]))return o.volumePosition==="hidden"&&(_e[1]=""),_e;if(M.includes(_e[1]))return o.dynamicPosition==="hidden"&&(_e[1]=""),_e;var Te=C.findIndex(function(Re){return _e[1]===Re[0]});return Te>=0?(_e[1]=C[Te][1],_e):(Te=y.findIndex(function(Re){return _e[1]===Re[0]}),Te>=0?(_e[1]=y[Te][1],o.dynamicPosition==="hidden"&&(_e[1]=""),_e):F[H]==="!"&&(_e[0]===1||F[H+_e[0]-1]!=="!")?[1,null]:(a("Unknown decoration: "+_e[1],F,H),_e[1]="",_e));case"H":return[1,"fermata"];case"J":return[1,"slide"];case"L":return[1,"accent"];case"M":return[1,"mordent"];case"O":return[1,"coda"];case"P":return[1,"pralltriller"];case"R":return[1,"roll"];case"S":return[1,"segno"];case"T":return[1,"trill"]}return[0,0]},fe=function(F,H){for(var W=H;n.isWhiteSpace(F[H]);)H++;return[H-W]},le=function(F,H){var W=n.getBarLine(F,H);if(W.len===0)return[0,""];if(W.warn)return a(W.warn,F,H),[W.len,""];for(var _e=0;_e<F.length&&F[H+W.len+_e]===" ";_e++);var Te=W.len;if(F[H+W.len+_e]==="["&&(W.len+=_e+1),F[H+W.len]==='"'&&F[H+W.len-1]==="["){var Re=n.getBrackettedSubstring(F,H+W.len,5);return[W.len+Re[0],W.token,Re[1]]}var Ie=n.getTokenOf(F.substring(H+W.len),"1234567890-,");return Ie.len===0||Ie.token[0]==="-"?[Te,W.token]:[W.len+Ie.len,W.token,Ie.token]},Y=function(F,H){var W={},_e=H;for(F[H]==="."&&F[H+1]==="("&&(W.dottedSlur=!0,H++);F[H]==="("||n.isWhiteSpace(F[H]);)F[H]==="("&&(H+1<F.length&&F[H+1]>="2"&&F[H+1]<="9"?(W.triplet!==void 0?a("Can't nest triplets",F,H):(W.triplet=F[H+1]-"0",W.tripletQ=I[W.triplet],W.num_notes=W.triplet,H+2<F.length&&F[H+2]===":"&&(H+3<F.length&&F[H+3]===":"?H+4<F.length&&F[H+4]>="1"&&F[H+4]<="9"?(W.num_notes=F[H+4]-"0",H+=3):a("expected number after the two colons after the triplet to mark the duration",F,H):H+3<F.length&&F[H+3]>="1"&&F[H+3]<="9"?(W.tripletQ=F[H+3]-"0",H+4<F.length&&F[H+4]===":"?H+5<F.length&&F[H+5]>="1"&&F[H+5]<="9"&&(W.num_notes=F[H+5]-"0",H+=4):H+=2):a("expected number after the triplet to mark the duration",F,H))),H++):W.startSlur===void 0?W.startSlur=1:W.startSlur++),H++;return W.consumed=H-_e,W};O.prototype.startNewLine=function(){var F={startChar:-1,endChar:-1};o.partForNextLine.title&&(F.part=o.partForNextLine),F.clef=o.currentVoice&&o.staves[o.currentVoice.staffNum].clef!==void 0?Object.assign({},o.staves[o.currentVoice.staffNum].clef):Object.assign({},o.clef);var H=o.currentVoice?o.currentVoice.scoreTranspose:0;if(F.key=e.standardKey(o.key.root+o.key.acc+o.key.mode,o.key.root,o.key.acc,H),F.key.mode=o.key.mode,o.key.impliedNaturals&&(F.key.impliedNaturals=o.key.impliedNaturals),o.key.explicitAccidentals)for(var W=0;W<o.key.explicitAccidentals.length;W++){for(var _e=!1,Te=0;Te<F.key.accidentals.length;Te++)F.key.accidentals[Te].note===o.key.explicitAccidentals[W].note&&(F.key.accidentals[Te].acc=o.key.explicitAccidentals[W].acc,_e=!0);_e||F.key.accidentals.push(o.key.explicitAccidentals[W])}if(o.targetKey=F.key,F.key.explicitAccidentals&&delete F.key.explicitAccidentals,e.addPosToKey(F.clef,F.key),o.meter!==null?(o.currentVoice?(o.staves.forEach(function(wt){wt.meter=o.meter}),F.meter=o.staves[o.currentVoice.staffNum].meter,o.staves[o.currentVoice.staffNum].meter=null):F.meter=o.meter,o.meter=null):o.currentVoice&&o.staves[o.currentVoice.staffNum].meter&&(F.meter=o.staves[o.currentVoice.staffNum].meter,o.staves[o.currentVoice.staffNum].meter=null),o.currentVoice&&o.currentVoice.name&&(F.name=o.currentVoice.name),o.vocalfont&&(F.vocalfont=o.vocalfont),o.tripletfont&&(F.tripletfont=o.tripletfont),o.gchordfont&&(F.gchordfont=o.gchordfont),o.style&&(F.style=o.style),o.currentVoice){var Re=o.staves[o.currentVoice.staffNum];Re.brace&&(F.brace=Re.brace),Re.bracket&&(F.bracket=Re.bracket),Re.connectBarLines&&(F.connectBarLines=Re.connectBarLines),Re.name&&(F.name=Re.name[o.currentVoice.index]),Re.subname&&(F.subname=Re.subname[o.currentVoice.index]),o.currentVoice.stem&&(F.stem=o.currentVoice.stem),o.currentVoice.stafflines&&(F.stafflines=o.currentVoice.stafflines),o.currentVoice.staffscale&&(F.staffscale=o.currentVoice.staffscale),o.currentVoice.scale&&(F.scale=o.currentVoice.scale),o.currentVoice.color&&(F.color=o.currentVoice.color),o.currentVoice.style&&(F.style=o.currentVoice.style),o.currentVoice.transpose&&(F.clef.transpose=o.currentVoice.transpose),F.currentVoice=o.currentVoice;for(var Ie=Object.keys(o.voices),st=0;st<Ie.length;st++)F.currentVoice.staffNum===o.voices[Ie[st]].staffNum&&F.currentVoice.index===o.voices[Ie[st]].index&&(F.currentVoiceName=Ie[st])}o.barNumbers===0&&ye()&&o.currBarNumber!==1&&(F.barNumber=o.currBarNumber),h.startNewLine(F),o.key.impliedNaturals&&delete o.key.impliedNaturals,o.partForNextLine={},o.tempoForNextLine.length===4&&h.appendElement(o.tempoForNextLine[0],o.tempoForNextLine[1],o.tempoForNextLine[2],o.tempoForNextLine[3]),o.tempoForNextLine=[]};var $=function(F){return F.duration!==void 0&&F.duration<.25&&(F.end_beam=!0),F},ne=function(F,H,W,_e){var Te=function(et){return et==="octave"||et==="duration"||et==="Zduration"||et==="broken_rhythm"||et==="end_slur"},Re;F[H]==="."&&F[H+1]==="-"&&(Re=!0,H++);for(var Ie="startSlur",st=!1;;){switch(F[H]){case"(":if(Ie==="startSlur")W.startSlur===void 0?W.startSlur=1:W.startSlur++;else return Te(Ie)?(W.endChar=H,W):null;break;case")":if(Te(Ie))W.endSlur===void 0?W.endSlur=1:W.endSlur++;else return null;break;case"^":if(Ie==="startSlur")W.accidental="sharp",Ie="sharp2";else if(Ie==="sharp2")W.accidental="dblsharp",Ie="pitch";else return Te(Ie)?(W.endChar=H,W):null;break;case"_":if(Ie==="startSlur")W.accidental="flat",Ie="flat2";else if(Ie==="flat2")W.accidental="dblflat",Ie="pitch";else return Te(Ie)?(W.endChar=H,W):null;break;case"=":if(Ie==="startSlur")W.accidental="natural",Ie="pitch";else return Te(Ie)?(W.endChar=H,W):null;break;case"A":case"B":case"C":case"D":case"E":case"F":case"G":case"a":case"b":case"c":case"d":case"e":case"f":case"g":if(Ie==="startSlur"||Ie==="sharp2"||Ie==="flat2"||Ie==="pitch"){if(W.pitch=p[F[H]],W.pitch+=7*(o.currentVoice&&o.currentVoice.octave!==void 0?o.currentVoice.octave:o.octave),W.name=F[H],W.accidental&&(W.name=N[W.accidental]+W.name),t.note(o,W),Ie="octave",_e&&o.next_note_duration!==0?(W.duration=o.default_length*o.next_note_duration,o.next_note_duration=0,st=!0):W.duration=o.default_length,o.clef&&o.clef.type==="perc"||o.currentVoice&&o.currentVoice.clef==="perc"){var wt=F[H];W.accidental&&(wt=N[W.accidental]+wt),l.formatting&&l.formatting.midi&&l.formatting.midi.drummap&&(W.midipitch=l.formatting.midi.drummap[wt])}}else return Te(Ie)?(W.endChar=H,W):null;break;case",":if(Ie==="octave")W.pitch-=7,W.name+=",";else return Te(Ie)?(W.endChar=H,W):null;break;case"'":if(Ie==="octave")W.pitch+=7,W.name+="'";else return Te(Ie)?(W.endChar=H,W):null;break;case"x":case"X":case"y":case"z":case"Z":if(Ie==="startSlur")W.rest={type:E[F[H]]},delete W.accidental,delete W.startSlur,delete W.startTie,delete W.endSlur,delete W.endTie,delete W.end_beam,delete W.grace_notes,W.rest.type.indexOf("multimeasure")>=0?(W.duration=l.getBarLength(),W.rest.text=1,Ie="Zduration"):(_e&&o.next_note_duration!==0?(W.duration=o.default_length*o.next_note_duration,o.next_note_duration=0,st=!0):W.duration=o.default_length,Ie="duration");else return Te(Ie)?(W.endChar=H,W):null;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"0":case"/":if(Ie==="octave"||Ie==="duration"){var Ze=n.getFraction(F,H);for(W.duration=W.duration*Ze.value,W.endChar=Ze.index;Ze.index<F.length&&(n.isWhiteSpace(F[Ze.index])||F[Ze.index]==="-");)F[Ze.index]==="-"?W.startTie={}:W=$(W),Ze.index++;H=Ze.index-1,Ie="broken_rhythm"}else if(Ie==="sharp2")W.accidental="quartersharp",Ie="pitch";else if(Ie==="flat2")W.accidental="quarterflat",Ie="pitch";else if(Ie==="Zduration"){var dt=n.getNumber(F,H);return W.duration=dt.num*l.getBarLength(),W.rest.text=dt.num,W.endChar=dt.index,W}else return null;break;case"-":if(Ie==="startSlur")h.addTieToLastNote(Re),W.endTie=!0;else if(Ie==="octave"||Ie==="duration"||Ie==="end_slur")if(W.startTie={},!st&&_e)Ie="broken_rhythm";else return n.isWhiteSpace(F[H+1])&&$(W),W.endChar=H+1,W;else return Ie==="broken_rhythm"?(W.endChar=H,W):null;break;case" ":case" ":if(Te(Ie)){W.end_beam=!0,Re=!1;do F[H]==="."&&F[H+1]==="-"&&(Re=!0,H++),F[H]==="-"&&(W.startTie={},Re&&(W.startTie.style="dotted")),H++;while(H<F.length&&(n.isWhiteSpace(F[H])||F[H]==="-")||F[H]==="."&&F[H+1]==="-");if(W.endChar=H,!st&&_e&&(F[H]==="<"||F[H]===">"))H--,Ie="broken_rhythm";else return W}else return null;break;case">":case"<":if(Te(Ie))if(_e){var bt=we(F,H);H+=bt[0]-1,o.next_note_duration=bt[2],W.duration=bt[1]*W.duration,Ie="end_slur"}else return W.endChar=H,W;else return null;break;default:return Te(Ie)?(W.endChar=H,W):null}if(H++,H===F.length)return Te(Ie)?(W.endChar=H,W):null}return null},we=function(F,H){switch(F[H]){case">":return H<F.length-2&&F[H+1]===">"&&F[H+2]===">"?[3,1.875,.125]:H<F.length-1&&F[H+1]===">"?[2,1.75,.25]:[1,1.5,.5];case"<":return H<F.length-2&&F[H+1]==="<"&&F[H+2]==="<"?[3,.125,1.875]:H<F.length-1&&F[H+1]==="<"?[2,.25,1.75]:[1,.5,1.5]}return null};function ye(){return o.currentVoice===void 0||o.currentVoice.staffNum===0&&o.currentVoice.index===0}return Iu=O,Iu}var Nu,Iv;function ZT(){if(Iv)return Nu;Iv=1;var e=Ds(),t=function(n,a){this.lineIndex=0,this.lines=n,this.multilineVars=a,this.skipWhiteSpace=function(g){for(var w=0;w<g.length;w++)if(!this.isWhiteSpace(g[w]))return w;return g.length};var o=function(g,w){return w>=g.length};this.eatWhiteSpace=function(g,w){for(var p=w;p<g.length;p++)if(!this.isWhiteSpace(g[p]))return p-w;return p-w},this.getKeyPitch=function(g){var w=this.skipWhiteSpace(g);if(o(g,w))return{len:0};switch(g[w]){case"A":return{len:w+1,token:"A"};case"B":return{len:w+1,token:"B"};case"C":return{len:w+1,token:"C"};case"D":return{len:w+1,token:"D"};case"E":return{len:w+1,token:"E"};case"F":return{len:w+1,token:"F"};case"G":return{len:w+1,token:"G"}}return{len:0}},this.getSharpFlat=function(g){if(g==="bass")return{len:0};switch(g[0]){case"#":return{len:1,token:"#"};case"b":return{len:1,token:"b"}}return{len:0}},this.getMode=function(g){var w=function(N,I){for(;I<N.length&&(N[I]>="a"&&N[I]<="z"||N[I]>="A"&&N[I]<="Z");)I++;return I},p=this.skipWhiteSpace(g);if(o(g,p))return{len:0};var E=g.substring(p,p+3).toLowerCase();switch((E.length>1&&E[1]===" "||E[1]==="^"||E[1]==="_"||E[1]==="=")&&(E=E[0]),E){case"mix":return{len:w(g,p),token:"Mix"};case"dor":return{len:w(g,p),token:"Dor"};case"phr":return{len:w(g,p),token:"Phr"};case"lyd":return{len:w(g,p),token:"Lyd"};case"loc":return{len:w(g,p),token:"Loc"};case"aeo":return{len:w(g,p),token:"m"};case"maj":return{len:w(g,p),token:""};case"ion":return{len:w(g,p),token:""};case"min":return{len:w(g,p),token:"m"};case"m":return{len:w(g,p),token:"m"}}return{len:0}},this.getClef=function(g,w){var p=g,E=this.skipWhiteSpace(g);if(o(g,E))return{len:0};var N=!1,I=g.substring(E);if(e.startsWith(I,"clef=")&&(N=!0,I=I.substring(5),E+=5),I.length===0&&N)return{len:E+5,warn:"No clef specified: "+p};var O=this.skipWhiteSpace(I);if(o(I,O))return{len:0};O>0&&(E+=O,I=I.substring(O));var V=null;if(e.startsWith(I,"treble"))V="treble";else if(e.startsWith(I,"bass3"))V="bass3";else if(e.startsWith(I,"bass"))V="bass";else if(e.startsWith(I,"tenor"))V="tenor";else if(e.startsWith(I,"alto2"))V="alto2";else if(e.startsWith(I,"alto1"))V="alto1";else if(e.startsWith(I,"alto"))V="alto";else if(!w&&N&&e.startsWith(I,"none"))V="none";else if(e.startsWith(I,"perc"))V="perc";else if(!w&&N&&e.startsWith(I,"C"))V="tenor";else if(!w&&N&&e.startsWith(I,"F"))V="bass";else if(!w&&N&&e.startsWith(I,"G"))V="treble";else return{len:E+5,warn:"Unknown clef specified: "+p};return I=I.substring(V.length),O=this.isMatch(I,"+8"),O>0?V+="+8":(O=this.isMatch(I,"-8"),O>0&&(V+="-8")),{len:E+V.length,token:V,explicit:N}},this.getBarLine=function(g,w){switch(g[w]){case"]":switch(++w,g[w]){case"|":return{len:2,token:"bar_thick_thin"};case"[":return++w,g[w]>="1"&&g[w]<="9"||g[w]==='"'?{len:2,token:"bar_invisible"}:{len:1,warn:"Unknown bar symbol"};default:return{len:1,token:"bar_invisible"}}case":":switch(++w,g[w]){case":":return{len:2,token:"bar_dbl_repeat"};case"|":switch(++w,g[w]){case"]":switch(++w,g[w]){case"|":return++w,g[w]===":"?{len:5,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:3,token:"bar_right_repeat"}}case"|":return++w,g[w]===":"?{len:4,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:2,token:"bar_right_repeat"}}default:return{len:1,warn:"Unknown bar symbol"}}case"[":if(++w,g[w]==="|")switch(++w,g[w]){case":":return{len:3,token:"bar_left_repeat"};case"]":return{len:3,token:"bar_invisible"};default:return{len:2,token:"bar_thick_thin"}}else return g[w]>="1"&&g[w]<="9"||g[w]==='"'?{len:1,token:"bar_invisible"}:{len:0};case"|":switch(++w,g[w]){case"]":return{len:2,token:"bar_thin_thick"};case"|":return++w,g[w]===":"?{len:3,token:"bar_left_repeat"}:{len:2,token:"bar_thin_thin"};case":":for(var p=0;g[w+p]===":";)p++;return{len:1+p,token:"bar_left_repeat"};default:return{len:1,token:"bar_thin"}}}return{len:0}},this.getTokenOf=function(g,w){for(var p=0;p<g.length;p++)if(w.indexOf(g[p])<0)return{len:p,token:g.substring(0,p)};return{len:p,token:g}},this.getToken=function(g,w,p){for(var E=w;E<p&&!this.isWhiteSpace(g[E]);)E++;return g.substring(w,E)},this.isMatch=function(g,w){var p=this.skipWhiteSpace(g);return o(g,p)?0:e.startsWith(g.substring(p),w)?p+w.length:0},this.getPitchFromTokens=function(g){var w={},p={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};if(w.position=p[g[0].token],w.position===void 0)return{warn:"Pitch expected. Found: "+g[0].token};for(g.shift();g.length;)switch(g[0].token){case",":w.position-=7,g.shift();break;case"'":w.position+=7,g.shift();break;default:return w}return w},this.getKeyAccidentals2=function(g){for(var w;g.length>0;){var p;if(g[0].token==="^"){if(p="sharp",g.shift(),g.length===0)return{accs:w,warn:"Expected note name after "+p};switch(g[0].token){case"^":p="dblsharp",g.shift();break;case"/":p="quartersharp",g.shift();break}}else if(g[0].token==="=")p="natural",g.shift();else if(g[0].token==="_"){if(p="flat",g.shift(),g.length===0)return{accs:w,warn:"Expected note name after "+p};switch(g[0].token){case"_":p="dblflat",g.shift();break;case"/":p="quarterflat",g.shift();break}}else return{accs:w};if(g.length===0)return{accs:w,warn:"Expected note name after "+p};switch(g[0].token[0]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":w===void 0&&(w=[]),w.push({acc:p,note:g[0].token[0]}),g[0].token.length===1?g.shift():g[0].token=g[0].token.substring(1);break;default:return{accs:w,warn:"Expected note name after "+p+" Found: "+g[0].token}}}return{accs:w}},this.getKeyAccidental=function(g){var w={"^":"sharp","^^":"dblsharp","=":"natural",_:"flat",__:"dblflat","_/":"quarterflat","^/":"quartersharp"},p=this.skipWhiteSpace(g);if(o(g,p))return{len:0};var E=null;switch(g[p]){case"^":case"_":case"=":E=g[p];break;default:return{len:0}}if(p++,o(g,p))return{len:1,warn:"Expected note name after accidental"};switch(g[p]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:p+1,token:{acc:w[E],note:g[p]}};case"^":case"_":case"/":if(E+=g[p],p++,o(g,p))return{len:2,warn:"Expected note name after accidental"};switch(g[p]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:p+1,token:{acc:w[E],note:g[p]}};default:return{len:2,warn:"Expected note name after accidental"}}break;default:return{len:1,warn:"Expected note name after accidental"}}},this.isWhiteSpace=function(g){return g===" "||g===" "||g===""},this.getMeat=function(g,w,p){var E=g.indexOf("%",w);for(E>=0&&E<p&&(p=E);w<p&&(g[w]===" "||g[w]===" "||g[w]==="");)w++;for(;w<p&&(g[p-1]===" "||g[p-1]===" "||g[p-1]==="");)p--;return{start:w,end:p}};var l=function(g){return g>="A"&&g<="Z"||g>="a"&&g<="z"},h=function(g){return g>="0"&&g<="9"};this.tokenize=function(g,w,p,E){var N=this.getMeat(g,w,p);w=N.start,p=N.end;for(var I=[],O;w<p;){if(g[w]==='"'){for(O=w+1;O<p&&g[O]!=='"';)O++;I.push({type:"quote",token:g.substring(w+1,O),start:w+1,end:O}),O++}else if(l(g[w])){if(O=w+1,E)for(;O<p&&!this.isWhiteSpace(g[O]);)O++;else for(;O<p&&l(g[O]);)O++;I.push({type:"alpha",token:g.substring(w,O),continueId:h(g[O]),start:w,end:O}),w=O+1}else if(g[w]==="."&&h(g[O+1])){O=w+1;for(var V=null,U=null;O<p&&h(g[O]);)O++;U=parseFloat(g.substring(w,O)),I.push({type:"number",token:g.substring(w,O),intt:V,floatt:U,continueId:l(g[O]),start:w,end:O}),w=O+1}else if(h(g[w])||g[w]==="-"&&h(g[O+1])){O=w+1;for(var D=null,me=null;O<p&&h(g[O]);)O++;if(g[O]==="."&&h(g[O+1]))for(O++;O<p&&h(g[O]);)O++;else D=parseInt(g.substring(w,O));me=parseFloat(g.substring(w,O)),I.push({type:"number",token:g.substring(w,O),intt:D,floatt:me,continueId:l(g[O]),start:w,end:O}),w=O+1}else g[w]===" "||g[w]===" "||I.push({type:"punct",token:g[w],start:w,end:w+1}),O=w+1;w=O}return I},this.getVoiceToken=function(g,w,p){for(var E=w;E<p&&this.isWhiteSpace(g[E])||g[E]==="=";)E++;if(g[E]==='"'){var N=g.indexOf('"',E+1);return N===-1||N>=p?{len:1,err:"Missing close quote"}:{len:N-w+1,token:this.translateString(g.substring(E+1,N))}}else{for(var I=E;I<p&&!this.isWhiteSpace(g[I])&&g[I]!=="=";)I++;return{len:I-w+1,token:g.substring(E,I)}}};var f={"`a":"à","'a":"á","^a":"â","~a":"ã",'"a':"ä",oa:"å",aa:"å","=a":"ā",ua:"ă",";a":"ą","`e":"è","'e":"é","^e":"ê",'"e':"ë","=e":"ē",ue:"ĕ",";e":"ę",".e":"ė","`i":"ì","'i":"í","^i":"î",'"i':"ï","=i":"ī",ui:"ĭ",";i":"į","`o":"ò","'o":"ó","^o":"ô","~o":"õ",'"o':"ö","=o":"ō",uo:"ŏ","/o":"ø","`u":"ù","'u":"ú","^u":"û","~u":"ũ",'"u':"ü",ou:"ů","=u":"ū",uu:"ŭ",";u":"ų","`A":"À","'A":"Á","^A":"Â","~A":"Ã",'"A':"Ä",oA:"Å",AA:"Å","=A":"Ā",uA:"Ă",";A":"Ą","`E":"È","'E":"É","^E":"Ê",'"E':"Ë","=E":"Ē",uE:"Ĕ",";E":"Ę",".E":"Ė","`I":"Ì","'I":"Í","^I":"Î","~I":"Ĩ",'"I':"Ï","=I":"Ī",uI:"Ĭ",";I":"Į",".I":"İ","`O":"Ò","'O":"Ó","^O":"Ô","~O":"Õ",'"O':"Ö","=O":"Ō",uO:"Ŏ","/O":"Ø","`U":"Ù","'U":"Ú","^U":"Û","~U":"Ũ",'"U':"Ü",oU:"Ů","=U":"Ū",uU:"Ŭ",";U":"Ų",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",ss:"ß","'c":"ć","^c":"ĉ",uc:"č",cc:"ç",".c":"ċ",cC:"Ç","'C":"Ć","^C":"Ĉ",uC:"Č",".C":"Ċ","~N":"Ñ","~n":"ñ","=s":"š",vs:"š",DH:"Ð",dh:"ð",HO:"Ő",Ho:"ő",HU:"Ű",Hu:"ű","'Y":"Ý","'y":"ý","^Y":"Ŷ","^y":"ŷ",'"Y':"Ÿ",'"y':"ÿ",vS:"Š",vZ:"Ž",vz:"ž"},b={"#":"♯",b:"♭","=":"♮"},S={201:"♯",202:"♭",203:"♮",241:"¡",242:"¢",252:"a",262:"2",272:"o",302:"Â",312:"Ê",322:"Ò",332:"Ú",342:"â",352:"ê",362:"ò",372:"ú",243:"£",253:"«",263:"3",273:"»",303:"Ã",313:"Ë",323:"Ó",333:"Û",343:"ã",353:"ë",363:"ó",373:"û",244:"¤",254:"¬",264:" ́",274:"1⁄4",304:"Ä",314:"Ì",324:"Ô",334:"Ü",344:"ä",354:"ì",364:"ô",374:"ü",245:"¥",255:"-",265:"μ",275:"1⁄2",305:"Å",315:"Í",325:"Õ",335:"Ý",345:"å",355:"í",365:"õ",375:"ý",246:"¦",256:"®",266:"¶",276:"3⁄4",306:"Æ",316:"Î",326:"Ö",336:"Þ",346:"æ",356:"î",366:"ö",376:"þ",247:"§",257:" ̄",267:"·",277:"¿",307:"Ç",317:"Ï",327:"×",337:"ß",347:"ç",357:"ï",367:"÷",377:"ÿ",250:" ̈",260:"°",270:" ̧",300:"À",310:"È",320:"Ð",330:"Ø",340:"à",350:"è",360:"ð",370:"ø",251:"©",261:"±",271:"1",301:"Á",311:"É",321:"Ñ",331:"Ù",341:"á",351:"é",361:"ñ",371:"ù"};this.translateString=function(g){var w=g.split("\\");if(w.length===1)return g;var p=null;return w.forEach(function(E){if(p===null)p=E;else{var N=f[E.substring(0,2)];N!==void 0?p+=N+E.substring(2):(N=S[E.substring(0,3)],N!==void 0?p+=N+E.substring(3):(N=b[E.substring(0,1)],N!==void 0?p+=N+E.substring(1):p+="\\"+E))}}),p},this.getNumber=function(g,w){for(var p=0;w<g.length;)switch(g[w]){case"0":p=p*10,w++;break;case"1":p=p*10+1,w++;break;case"2":p=p*10+2,w++;break;case"3":p=p*10+3,w++;break;case"4":p=p*10+4,w++;break;case"5":p=p*10+5,w++;break;case"6":p=p*10+6,w++;break;case"7":p=p*10+7,w++;break;case"8":p=p*10+8,w++;break;case"9":p=p*10+9,w++;break;default:return{num:p,index:w}}return{num:p,index:w}},this.getFraction=function(g,w){var p=1,E=1;if(g[w]!=="/"){var N=this.getNumber(g,w);p=N.num,w=N.index}if(g[w]==="/")if(w++,g[w]==="/"){for(var I=.5;g[w++]==="/";)I=I/2;return{value:p*I,index:w-1}}else{var O=w,V=this.getNumber(g,w);V.num===0&&O===w&&(V.num=2),V.num!==0&&(E=V.num),w=V.index}return{value:p/E,index:w}};function M(g){const p=/^(\d+)\./.exec(g);return p?p[1]:null}var C=[{match:/,\s*[Tt]he$/,replace:"The "},{match:/,\s*[Aa]$/,replace:"A "},{match:/,\s*[Aa]n$/,replace:"An "}];this.theReverser=function(g){for(var w=0;w<C.length;w++){var p=C[w],E=g.match(p.match);if(E){var N=M(g);N&&(g=g.replace(N+".",""),g=g.trim());var I=E[0].length,O=p.replace+g.substring(0,g.length-I);return N&&(O=N+". "+O),O}}return g},this.stripComment=function(g){var w=g.indexOf("%");return w>=0?e.strip(g.substring(0,w)):e.strip(g)},this.getInt=function(g){var w=parseInt(g);if(isNaN(w))return{digits:0};var p=""+w,E=g.indexOf(p);return{value:w,digits:E+p.length}},this.getFloat=function(g){var w=parseFloat(g);if(isNaN(w))return{digits:0};var p=""+w,E=g.indexOf(p);return{value:w,digits:E+p.length}},this.getMeasurement=function(g){if(g.length===0)return{used:0};var w=1,p="";if(g[0].token==="-")g.shift(),p="-",w++;else if(g[0].type!=="number")return{used:0};if(p+=g.shift().token,g.length===0)return{used:1,value:parseInt(p)};var E=g.shift();if(E.token==="."){if(w++,g.length===0)return{used:w,value:parseInt(p)};if(g[0].type==="number"&&(E=g.shift(),p=p+"."+E.token,w++,g.length===0))return{used:w,value:parseFloat(p)};E=g.shift()}switch(E.token){case"pt":return{used:w+1,value:parseFloat(p)};case"px":return{used:w+1,value:parseFloat(p)};case"cm":return{used:w+1,value:parseFloat(p)/2.54*72};case"in":return{used:w+1,value:parseFloat(p)*72};default:return g.unshift(E),{used:w,value:parseFloat(p)}}};var y=function(g){return g=g.replace(/\\n/g,`
140
+ `),g=g.replace(/\\"/g,'"'),g};this.getBrackettedSubstring=function(g,w,p,E){for(var N=E||g[w],I=w+1,O=!1;I<g.length&&(O||g[I]!==N);)O=g[I]==="\\",++I;return g[I]===N?[I-w+1,y(g.substring(w+1,I)),!0]:(I=w+p,I>g.length-1&&(I=g.length-1),[I-w+1,y(g.substring(w+1,I)),!1])}};return t.prototype.peekLine=function(){return this.lines[this.lineIndex]},t.prototype.nextLine=function(){if(this.lineIndex>0&&(this.multilineVars.iChar+=this.lines[this.lineIndex-1].length+1),this.lineIndex<this.lines.length){var n=this.lines[this.lineIndex];return this.lineIndex++,n}return null},Nu=t,Nu}var Lu,Nv;function py(){if(Nv)return Lu;Nv=1;function e(M,C,y){if(!(!C||M.lines.length===0)){var g=M.deline({lineBreaks:!1}),w=n(g,C);M.lines=t(g,w,y),M.lineBreaks=w}}function t(M,C,y){for(var g=[],w=[],p=[],E=1,N=0;N<C.length;N++){var I=C[N];if(M[I.ogLine].staff){var O=M[I.ogLine].staff[I.staff];if(g[I.line]||(g[I.line]={staff:[]}),!g[I.line].staff[I.staff]){g[I.line].staff[I.staff]={voices:[]},y!==void 0&&I.staff===0&&I.line>0&&(g[I.line].staff[I.staff].barNumber=E);for(var V=Object.keys(O),U=0;U<V.length;U++){var D=V[U]==="voices";V[U]==="meter"&&I.line!==0&&(D=!0),D||(g[I.line].staff[I.staff][V[U]]=O[V[U]])}w[I.staff]&&(g[I.line].staff[I.staff].key=w[I.staff])}g[I.line].staff[I.staff].voices[I.voice]||(g[I.line].staff[I.staff].voices[I.voice]=[]),g[I.line].staff[I.staff].voices[I.voice]=M[I.ogLine].staff[I.staff].voices[I.voice].slice(I.start,I.end+1),p[I.staff*10+I.voice]&&g[I.line].staff[I.staff].voices[I.voice].unshift({el_type:"stem",direction:p[I.staff*10+I.voice].direction});for(var me=g[I.line].staff[I.staff].voices[I.voice],B=me.length-1;B>=0;B--)if(me[B].el_type==="key"){w[I.staff]={root:me[B].root,acc:me[B].acc,mode:me[B].mode,accidentals:me[B].accidentals.filter(function(he){return he.acc!=="natural"})};break}for(B=me.length-1;B>=0;B--)if(me[B].el_type==="stem"){p[I.staff*10+I.voice]={direction:me[B].direction};break}if(y!==void 0&&I.staff===0&&I.voice===0)for(B=0;B<me.length;B++)me[B].el_type==="bar"&&(E++,B===me.length-1?delete me[B].barNumber:me[B].barNumber=E)}else g[I.line]=M[I.ogLine]}for(var ie=0;ie<g.length;ie++)g[ie].staff&&(g[ie].staff=g[ie].staff.filter(function(he){return he!=null}));return g}function n(M,C){for(var y=[],g=0,w=0,p=0,E=0;E<M.length;E++){var N=M[E];if(N.staff){var I=w,O=C[g];g++;for(var V=0;V<N.staff.length;V++)for(var U=N.staff[V],D=0;D<U.voices.length;D++){p=I;for(var me=0,B=0,ie=U.voices[D],he=0,ae=0;ae<ie.length;ae++){var fe=ie[ae];fe.el_type==="bar"&&(O[B]===me&&(y.push({ogLine:E,line:p,staff:V,voice:D,start:he,end:ae}),he=ae+1,p++,w=Math.max(w,p),B++),me++)}y.push({ogLine:E,line:p,staff:V,voice:D,start:he,end:ie.length}),p++,w=Math.max(w,p)}}else y.push({ogLine:E,line:p}),p++,w=Math.max(w,p)}return y}function a(M,C){for(var y=[],g=[],w=0,p=0;p<M.length;p++){var E=M[p],N=w+E;if(N<C)w=N;else{var I=C-w,O=N-C;I<O&&w>0?(y.push(p-1),g.push(Math.round(w-E)),w=E):p<M.length-1&&(y.push(p),g.push(Math.round(w)),w=0)}}return g.push(Math.round(w)),{lineBreaks:y,totals:g}}function o(M){for(var C=[],y=0;y<M.length;y++)C.push(M[y]);return C}function l(M,C,y,g,w,p,E,N,I,O,V){for(var U=O;U<M.length;U++){var D=M[U];y+=D,g+=D;var me=Math.abs(y-C[N]),B=Math.abs(me-p)<C[0]/10;if(B)if(me<p){var ie=o(w),he=o(I);he.push(U-1),ie.push(g-D),V.push({accumulator:y,lineAccumulator:D,lineWidths:ie,lastVariance:Math.abs(y-C[N+1]),highestVariance:Math.max(E,p),currLine:N+1,lineBreaks:he,startIndex:U+1})}else me>p&&U<M.length-1&&(ie=o(w),he=o(I),V.push({accumulator:y,lineAccumulator:g,lineWidths:ie,lastVariance:me,highestVariance:Math.max(E,me),currLine:N,lineBreaks:he,startIndex:U+1}));me>p?(I.push(U-1),N++,E=Math.max(E,p),p=Math.abs(y-C[N]),w.push(g-D),g=D):p=me}w.push(g)}function h(M,C,y,g){for(var w=Math.ceil(M.total/C),p=Math.floor(M.total/w),E=[],N=0;N<w;N++)E.push(p*(N+1));var I=[];I.push({accumulator:0,lineAccumulator:0,lineWidths:[],lastVariance:999999,highestVariance:0,currLine:0,lineBreaks:[],startIndex:0});for(var O=0;O<I.length;)l(M.measureWidths,E,I[O].accumulator,I[O].lineAccumulator,I[O].lineWidths,I[O].lastVariance,I[O].highestVariance,I[O].currLine,I[O].lineBreaks,I[O].startIndex,I),O++;for(N=0;N<I.length;N++){var V=I[N];V.variances=[],V.aveVariance=0;for(var U=0;U<V.lineWidths.length;U++){var D=V.lineWidths[U];V.variances.push(D-E[0]),V.aveVariance+=Math.abs(D-E[0])}V.aveVariance=V.aveVariance/V.lineWidths.length,g.attempts.push({type:"optimizeLineWidths",lineBreaks:V.lineBreaks,variances:V.variances,aveVariance:V.aveVariance,widths:M.measureWidths})}var me=9999999,B=-1;for(N=0;N<I.length;N++)V=I[N],V.aveVariance<me&&(me=V.aveVariance,B=N);return{failed:!1,lineBreaks:I[B].lineBreaks,variance:I[B].highestVariance}}function f(M,C,y){for(var g=[],w=[],p=0,E=!1,N=0;N<M.length;N++)p+=M[N],p>C&&(E=!0),N%y===y-1&&(N!==M.length-1&&g.push(N),w.push(Math.round(p)),p=0);return{failed:E,totals:w,lineBreaks:g}}function b(M,C,y){var g={lineBreaks:M,staffwidth:C};for(var w in y)y.hasOwnProperty(w)&&w!=="wrap"&&w!=="staffwidth"&&(g[w]=y[w]);return{revisedParams:g}}function S(M,C,y){if(C.length===0||y.staffwidth<C[0].left)return{reParse:!1,explanation:"Staff width is narrower than the margin",revisedParams:y};var g=y.scale?Math.max(y.scale,.1):1,w=y.wrap.minSpacing?Math.max(parseFloat(y.wrap.minSpacing),1):1,p=y.wrap.minSpacingLimit?Math.max(parseFloat(y.wrap.minSpacingLimit),1):w-.1,E=y.wrap.maxSpacing?Math.max(parseFloat(y.wrap.maxSpacing),1):void 0;y.wrap.lastLineLimit&&!E&&(E=Math.max(parseFloat(y.wrap.lastLineLimit),1));for(var N=y.wrap.preferredMeasuresPerLine?Math.max(parseInt(y.wrap.preferredMeasuresPerLine,10),0):void 0,I=[],O=[],V=0;V<C.length;V++){var U=C[V],D=y.staffwidth-U.left,me=D/w/g,B=D/E/g,ie=D/p/g,he={widths:U,lineBreakPoint:me,minLineSize:B,attempts:[],staffWidth:y.staffwidth,minWidth:Math.round(ie)},ae=null;if(N){var fe=f(U.measureWidths,me,N);he.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:N,lineBreaks:fe.lineBreaks,failed:fe.failed,totals:fe.totals}),fe.failed||(ae=fe.lineBreaks)}if(!ae){var le=a(U.measureWidths,me);he.attempts.push({type:"Free Form",lineBreaks:le.lineBreaks,totals:le.totals}),ae=le.lineBreaks,ae.length>0&&U.measureWidths.length<25&&(le=h(U,me,ae,he),he.attempts.push({type:"Optimize",failed:le.failed,reason:le.reason,lineBreaks:le.lineBreaks,totals:le.totals}),le.failed||(ae=le.lineBreaks))}I.push(ae),O.push(he)}var Y=y.staffwidth,$=b(I,Y,y);return $.explanation=O,$.reParse=!0,$}return Lu={wrapLines:e,calcLineWraps:S},Lu}var Ou,Lv;function Qi(){if(Lv)return Ou;Lv=1;var e={};return e.FONTEM=360,e.FONTSIZE=30,e.STEP=e.FONTSIZE*93/720,e.SPACE=10,e.TOPNOTE=15,e.STAVEHEIGHT=100,e.INDENT=50,Ou=e,Ou}var Du,Ov;function gy(){if(Ov)return Du;Ov=1;var e,t=Ds();return function(){var n=1,a=128;e=function(p,E){E=E||{};var N,I=E.program||0,O=E.midiTranspose||0;p.visualTranspose&&(O-=p.visualTranspose);var V=E.channel||0,U=!1,D=E.drum||"",me=E.drumBars||1,B=E.drumIntro||0,ie=D!=="",he=!!E.drumOff,ae=[],fe=50;I=parseInt(I,10),O=parseInt(O,10),V=parseInt(V,10),V===10&&(I=a),D=D.split(" "),me=parseInt(me,10),B=parseInt(B,10);var le=p.formatting.bagpipes;le&&(I=71);var Y=[];if(p.formatting.midi){var $=p.formatting.midi;$.program&&$.program.length>0&&(I=$.program[0],$.program.length>1&&(I=$.program[1],V=$.program[0]),U=!0),$.transpose&&(O=$.transpose[0]),$.channel&&(V=$.channel[0],U=!0),$.drum&&(D=$.drum),$.drumbars&&(me=$.drumbars[0]),$.drumon&&(ie=!0),V===10&&(I=a),$.beat&&Y.push({el_type:"beat",beats:$.beat}),$.nobeataccents&&Y.push({el_type:"beataccents",value:!1})}E.qpm?N=parseInt(E.qpm,10):p.metaText.tempo?N=S(p.metaText.tempo,p.getBeatLength()):E.defaultQpm?N=E.defaultQpm:N=180;var ne=[];le&&ne.push({el_type:"bagpipes"}),ne.push({el_type:"instrument",program:I}),V&&ne.push({el_type:"channel",channel:V}),O&&ne.push({el_type:"transpose",transpose:O}),ne.push({el_type:"tempo",qpm:N});for(var we=0;we<Y.length;we++)ne.push(Y[we]);var ye=[],F=[],H=[],W=[0],_e={};_e[0]={el_type:"tempo",qpm:N,timing:0};for(var Te,Re=[],Ie=[],st=!1,wt=p.lines,Ze=0;Ze<wt.length;Ze++){var dt=wt[Ze];if(dt.staff){let Q=function(j){var ce={pppp:[15,10,5,1],ppp:[30,20,10,1],pp:[45,35,20,1],p:[60,50,35,1],mp:[75,65,50,1],mf:[90,80,65,1],f:[105,95,80,1],ff:[120,110,95,1],fff:[127,125,110,1],ffff:[127,125,110,1]},te;if(j.decoration)if(j.decoration.indexOf("pppp")>=0?te="pppp":j.decoration.indexOf("ppp")>=0?te="ppp":j.decoration.indexOf("pp")>=0?te="pp":j.decoration.indexOf("p")>=0?te="p":j.decoration.indexOf("mp")>=0?te="mp":j.decoration.indexOf("mf")>=0?te="mf":j.decoration.indexOf("f")>=0?te="f":j.decoration.indexOf("ff")>=0?te="ff":j.decoration.indexOf("fff")>=0?te="fff":j.decoration.indexOf("ffff")>=0&&(te="ffff"),te&&(Te=ce[te].slice(0),ye[et].push({el_type:"beat",beats:Te.slice(0)}),F[at]=!1,H[at]=!1),j.decoration.indexOf("crescendo(")>=0){var oe=o(rr,je,"crescendo)"),ee=Math.min(127,Te[0]+fe),re=l(rr,je+oe+1,Object.keys(ce));re&&(ee=ce[re][0]),oe>0?F[at]=Math.floor((ee-Te[0])/oe):F[at]=!1,H[at]=!1}else if(j.decoration.indexOf("crescendo)")>=0)F[at]=!1;else if(j.decoration.indexOf("diminuendo(")>=0){var K=o(rr,je,"diminuendo)"),se=Math.max(15,Te[0]-fe),de=l(rr,je+K+1,Object.keys(ce));de&&(se=ce[de][0]),F[at]=!1,K>0?H[at]=Math.floor((se-Te[0])/K):H[at]=!1}else j.decoration.indexOf("diminuendo)")>=0&&(H[at]=!1)};for(var bt=dt.staff,et=0,Nt=0;Nt<bt.length;Nt++){var xt=bt[Nt];if(!(xt.clef&&xt.clef.type==="TAB"))for(var at=0;at<xt.voices.length;at++){var rr=xt.voices[at];if(!ye[et]){ye[et]=[].concat(JSON.parse(JSON.stringify(ne)));var Xt=b(dt.staff,et);Xt&&ye[et].unshift({el_type:"name",trackName:Xt})}if(O&&xt.clef.type==="perc"&&ye[et].push({el_type:"transpose",transpose:0}),xt.clef&&xt.clef.type==="perc"&&!U)for(var Ht=0;Ht<ye[et].length;Ht++)ye[et][Ht].el_type==="instrument"&&(ye[et][Ht].program=a);else xt.key&&y(ye[et],xt.key);xt.meter&&g(ye[et],xt.meter),!st&&ie&&(ye[et].push({el_type:"drum",params:{pattern:D,bars:me,on:ie,intro:B}}),st=!0),xt.clef&&xt.clef.type!=="perc"&&xt.clef.transpose&&(xt.clef.el_type="clef",ye[et].push({el_type:"transpose",transpose:xt.clef.transpose})),xt.clef&&xt.clef.type&&(xt.clef.type.indexOf("-8")>=0?ye[et].push({el_type:"transpose",transpose:-12}):xt.clef.type.indexOf("+8")>=0&&ye[et].push({el_type:"transpose",transpose:12})),p.formatting.midi&&p.formatting.midi.drumoff&&(ye[et].push({el_type:"bar"}),ye[et].push({el_type:"drum",params:{pattern:"",on:!1}}));var nr=0,Ar=0,fr=0,qe=0;Te=[105,95,85,1];for(var je=0;je<rr.length;je++){var Fe=rr[je];switch(Fe.el_type){case"note":if(F[at]&&(Te[0]+=F[at],Te[1]+=F[at],Te[2]+=F[at],ye[et].push({el_type:"beat",beats:Te.slice(0)})),H[at]&&(Te[0]+=H[at],Te[1]+=H[at],Te[2]+=H[at],ye[et].push({el_type:"beat",beats:Te.slice(0)})),Q(Fe),!Fe.rest||Fe.rest.type!=="spacer"){var Ue={elem:Fe,el_type:"note",timing:W[et]};if(Fe.style?Ue.style=Fe.style:ae[et]&&(Ue.style=ae[et]),Ue.duration=Fe.duration===0?.25:Fe.duration,Fe.startTriplet){if(Ar=Fe.tripletMultiplier,fr=Fe.startTriplet*Ar*Fe.duration,Fe.startTriplet!==Fe.tripletR&&je+Fe.tripletR<=rr.length){for(var Qe=0,r=je;r<je+Fe.tripletR;r++)Qe+=rr[r].duration;fr=Ar*Qe}Ue.duration=Ue.duration*Ar,Ue.duration=Math.round(Ue.duration*1e6)/1e6,qe=Ue.duration}else Ar&&(Fe.endTriplet?(Ar=0,Ue.duration=Math.round((fr-qe)*1e6)/1e6):(Ue.duration=Ue.duration*Ar,Ue.duration=Math.round(Ue.duration*1e6)/1e6,qe+=Ue.duration));Fe.rest&&(Ue.rest=Fe.rest),Fe.decoration&&(Ue.decoration=Fe.decoration.slice(0)),Fe.pitches&&(Ue.pitches=t.cloneArray(Fe.pitches)),Fe.gracenotes&&(Ue.gracenotes=t.cloneArray(Fe.gracenotes)),Fe.chord&&(Ue.chord=t.cloneArray(Fe.chord)),ye[et].push(Ue),Fe.style==="rhythm"&&f(ye),nr++,W[et]+=Ue.duration}break;case"key":case"keySignature":y(ye[et],Fe);break;case"meter":g(ye[et],Fe);break;case"clef":Fe.transpose&&ye[et].push({el_type:"transpose",transpose:Fe.transpose}),Fe.type&&(Fe.type.indexOf("-8")>=0?ye[et].push({el_type:"transpose",transpose:-12}):Fe.type.indexOf("+8")>=0&&ye[et].push({el_type:"transpose",transpose:12}));break;case"tempo":N=S(Fe,p.getBeatLength()),ye[et].push({el_type:"tempo",qpm:N,timing:W[et]}),_e[""+W[et]]={el_type:"tempo",qpm:N,timing:W[et]};break;case"bar":nr>0&&ye[et].push({el_type:"bar"}),Q(Fe),nr=0;var c=Fe.type==="bar_right_repeat"||Fe.type==="bar_dbl_repeat",m=Fe.startEnding==="1",x=Fe.type==="bar_left_repeat"||Fe.type==="bar_dbl_repeat"||Fe.type==="bar_right_repeat";if(c){var k=Re[et];k||(k=0);var T=Ie[et];T||(T=ye[et].length);for(var R=k;R<T;R++){var L=Object.assign({},ye[et][R]);L.pitches&&(L.pitches=t.cloneArray(L.pitches)),ye[et].push(L)}Ie[et]=void 0,Re[et]=void 0}m&&(Ie[et]=ye[et].length),x&&(Re[et]=ye[et].length);break;case"style":ae[et]=Fe.head;break;case"timeSignature":ye[et].push(M(Fe));break;case"part":break;case"stem":case"scale":case"break":case"font":break;case"midi":var q=!1;switch(Fe.cmd){case"drumon":ie=!0,q=!0;break;case"drumoff":ie=!1,q=!0;break;case"drum":D=Fe.params,q=!0;break;case"drumbars":me=Fe.params[0],q=!0;break;case"drummap":break;case"channel":Fe.params[0]===10&&ye[et].push({el_type:"instrument",program:a});break;case"program":w(ye[et],{el_type:"instrument",program:Fe.params[0]}),U=!0;break;case"transpose":ye[et].push({el_type:"transpose",transpose:Fe.params[0]});break;case"gchordoff":ye[et].push({el_type:"gchordOn",tacet:!0});break;case"gchordon":ye[et].push({el_type:"gchordOn",tacet:!1});break;case"beat":ye[et].push({el_type:"beat",beats:Fe.params});break;case"nobeataccents":ye[et].push({el_type:"beataccents",value:!1});break;case"beataccents":ye[et].push({el_type:"beataccents",value:!0});break;case"vol":case"volinc":ye[et].push({el_type:Fe.cmd,volume:Fe.params[0]});break;case"swing":case"gchord":case"bassvol":case"chordvol":ye[et].push({el_type:Fe.cmd,param:Fe.params[0]});break;case"bassprog":case"chordprog":ye[et].push({el_type:Fe.cmd,value:Fe.params[0],octaveShift:Fe.params[1]});break;case"gchordbars":ye[et].push({el_type:Fe.cmd,param:Fe.params[0]});break;default:console.log("MIDI seq: midi cmd not handled: ",Fe.cmd,Fe)}q&&(ye[0].push({el_type:"drum",params:{pattern:D,bars:me,intro:B,on:ie}}),st=!0);break;default:console.log("MIDI: element type "+Fe.el_type+" not handled.")}}et++,W[et]||(W[et]=0)}}}}if(h(ye,_e),B)for(var z=p.getPickupLength(),X=0;X<ye.length;X++){for(var Z=0;ye[X][Z].el_type!=="note"&&ye[X].length>Z;)Z++;if(ye[X].length>Z){for(var r=0;r<B;r++)z===0||r<B-1?(ye[X].splice(Z,0,{el_type:"note",rest:{type:"rest"},duration:n},{el_type:"bar"}),Z+=2):ye[X].splice(Z++,0,{el_type:"note",rest:{type:"rest"},duration:n-z});he&&(ie=!1,ye[X].splice(Z++,0,{el_type:"drum",params:{pattern:D,bars:me,intro:B,on:ie}}),he=!1)}}return ye.length>0&&ye[0].length>0&&(ye[0][0].pickupLength=p.getPickupLength()),ye};function o(p,E,N){for(var I=0,O=E+1;O<p.length;O++)if(p[O].el_type==="note"&&I++,p[O].decoration&&p[O].decoration.indexOf(N)>=0)return I;return I}function l(p,E,N){for(var I=Math.min(p.length,E+3),O=E;O<I;O++)if(p[O].el_type==="note"&&p[O].decoration){for(var V=0;V<p[O].decoration.length;V++)if(N.indexOf(p[O].decoration[V])>=0)return p[O].decoration[V]}return null}function h(p,E){if(!(!E||E.length===0))for(var N=Object.keys(E),I=0;I<p.length;I++)for(var O=p[I],V=E[0]?E[0].qpm:0,U=0;U<O.length;U++){var D=O[U];D.el_type==="tempo"&&(V=D.qpm),N.indexOf(""+D.timing)>=0&&V!==E[""+D.timing].qpm&&(V=E[""+D.timing].qpm,D.el_type==="tempo"?(D.qpm=E[""+D.timing].qpm,U++):(p[I].splice(U,0,{el_type:"tempo",qpm:E[""+D.timing].qpm,timing:D.timing}),U+=2))}}function f(p){for(var E=0;E<p.length;E++)for(var N=p[E],I=N.length-1;I>=0&&N[I].el_type!=="bar";)N[I].noChordVoice=!0,I--}function b(p,E){if(!(!p||p.length<=E||!p[E].title))return p[E].title.join(" ")}function S(p,E){var N=.25;p.duration&&(N=p.duration[0]);var I=60;return p.bpm&&(I=p.bpm),N*I/E}function M(p){var E;switch(p.type){case"common_time":E={el_type:"meter",num:4,den:4};break;case"cut_time":E={el_type:"meter",num:2,den:2};break;case"specified":E={el_type:"meter",num:p.value[0].num,den:p.value[0].den};break;default:E={el_type:"meter"}}return n=E.num/E.den,E}function C(p){for(var E=[],N=0;N<p.length;N++)p[N].acc!=="natural"&&E.push(p[N]);return E}function y(p,E){var N;E.root==="HP"?N={el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}:N={el_type:"key",accidentals:C(E.accidentals)},w(p,N)}function g(p,E){var N=M(E);w(p,N)}function w(p,E){for(var N=p.length-1;N>=0;N--)if(p[N].el_type===E.el_type){JSON.stringify(p[N])!==JSON.stringify(E)&&p.push(E);return}p.push(E)}}(),Du=e,Du}var Ru,Dv;function JT(){if(Dv)return Ru;Dv=1;var e=function(S,M,C,y){this.chordTrack=[],this.chordTrackFinished=!1,this.chordChannel=S,this.currentChords=[],this.lastChord,this.chordLastBar,this.chordsOff=!!M,this.gChordTacet=this.chordsOff,this.hasRhythmHead=!1,this.transpose=0,this.lastBarTime=0,this.meter=y,this.tempoChangeFactor=1,this.bassInstrument=C.bassprog&&C.bassprog.length>=1?C.bassprog[0]:0,this.chordInstrument=C.chordprog&&C.chordprog.length>=1?C.chordprog[0]:0,this.bassOctaveShift=C.bassprog&&C.bassprog.length===2?C.bassprog[1]:0,this.chordOctaveShift=C.chordprog&&C.chordprog.length===2?C.chordprog[1]:0,this.boomVolume=C.bassvol&&C.bassvol.length===1?C.bassvol[0]:64,this.chickVolume=C.chordvol&&C.chordvol.length===1?C.chordvol[0]:48,C.gchord&&C.gchord.length>0?this.overridePattern=a(C.gchord[0]):this.overridePattern=void 0};e.prototype.setMeter=function(b){this.meter=b},e.prototype.setTempoChangeFactor=function(b){this.tempoChangeFactor=b},e.prototype.setLastBarTime=function(b){this.lastBarTime=b},e.prototype.setTranspose=function(b){this.transpose=b},e.prototype.setRhythmHead=function(b,S){this.hasRhythmHead=b;var M=[];if(b&&this.lastChord&&this.lastChord.chick)for(var C=0;C<this.lastChord.chick.length;C++){var y=Object.assign({},S.pitches[0]);y.actualPitch=this.lastChord.chick[C],M.push(y)}return M},e.prototype.barEnd=function(b){this.chordTrack.length>0&&!this.chordTrackFinished&&(this.resolveChords(this.lastBarTime,h(b.time)),this.currentChords=[]),this.chordLastBar=this.lastChord},e.prototype.gChordOn=function(b){this.chordsOff||(this.gChordTacet=b.tacet)},e.prototype.paramChange=function(b){switch(b.el_type){case"gchord":b.param&&b.param.length>0?this.overridePattern=a(b.param):this.overridePattern=void 0;break;case"bassprog":this.bassInstrument=b.value,b.octaveShift!=null&&b.octaveShift!=null?this.bassOctaveShift=b.octaveShift:this.bassOctaveShift=0;break;case"chordprog":this.chordInstrument=b.value,b.octaveShift!=null&&b.octaveShift!=null?this.chordOctaveShift=b.octaveShift:this.chordOctaveShift=0;break;case"bassvol":this.boomVolume=b.param;break;case"chordvol":this.chickVolume=b.param;break;default:console.log("unhandled midi param",b)}},e.prototype.finish=function(){this.chordTrackEmpty()||(this.chordTrackFinished=!0)},e.prototype.addTrack=function(b){this.chordTrackEmpty()||b.push(this.chordTrack)},e.prototype.findChord=function(b){if(this.gChordTacet)return"break";if(this.chordTrackFinished||!b.chord||b.chord.length===0)return null;for(var S=0;S<b.chord.length;S++){var M=b.chord[S];if(M.position==="default")return M.name;if(this.breakSynonyms.indexOf(M.name.toLowerCase())>=0)return"break"}return null},e.prototype.interpretChord=function(b){if(b.length!==0){if(b==="break")return{chick:[]};var S=b.substring(0,1);if(S==="("){if(b=b.substring(1,b.length-2),b.length===0)return;S=b.substring(0,1)}var M=this.basses[S];if(M){for(var C=this.transpose;C<-8;)C+=12;for(;C>8;)C-=12;M+=C,M<33?M+=12:M>44&&(M-=12);var y=M;M+=this.bassOctaveShift*12;var g=M-5,w;b.length===1&&(w=this.chordNotes(M,""));var p=b.substring(1),E=p.substring(0,1);E==="b"||E==="♭"?(y--,M--,g--,p=p.substring(1)):(E==="#"||E==="♯")&&(y++,M++,g++,p=p.substring(1));var N=p.split("/");if(w=this.chordNotes(y,N[0]),w.length>=3){var I=w[2]-w[0];g=g+I-7}if(N.length===2){var O=this.basses[N[1].substring(0,1)];if(O){var V=N[1].substring(1),U={"#":1,"♯":1,b:-1,"♭":-1}[V]||0;M=this.basses[N[1].substring(0,1)]+U+C,M+=this.bassOctaveShift*12,g=M}}return{boom:M,boom2:g,chick:w}}}},e.prototype.chordNotes=function(b,S){var M=this.chordIntervals[S];M||(S.slice(0,2).toLowerCase()==="ma"||S[0]==="M"?M=this.chordIntervals.M:S[0]==="m"||S[0]==="-"?M=this.chordIntervals.m:M=this.chordIntervals.M),b+=12,b+=this.chordOctaveShift*12;for(var C=[],y=0;y<M.length;y++)C.push(b+M[y]);return C},e.prototype.writeNote=function(b,S,M,C,y,g){b!==void 0&&this.chordTrack.push({cmd:"note",pitch:b,volume:M,start:this.lastBarTime+C*f(S,this.tempoChangeFactor),duration:f(y,this.tempoChangeFactor),gap:0,instrument:g})},e.prototype.chordTrackEmpty=function(){for(var b=!0,S=0;S<this.chordTrack.length&&b;S++)this.chordTrack[S].cmd==="note"&&(b=!1);return b},e.prototype.resolveChords=function(b,S){if(!this.hasRhythmHead){var M=this.meter.num,C=this.meter.den,y=1/C,g=y/2,w=parseInt(M,10)/parseInt(C,10),p=w-(S-b)/this.tempoChangeFactor;Math.abs(p)<1e-5&&(p=0),(this.currentChords.length===0||this.currentChords[0].beat!==0)&&this.currentChords.unshift({beat:0,chord:this.chordLastBar});var E=o(this.currentChords,8*M/C),N=this.overridePattern?this.overridePattern:this.rhythmPatterns[M+"/"+C];if(p){N=[];for(var I=(S-b)/this.tempoChangeFactor*8,O=0;O<I/2;O+=2)N.push("chick"),N.push("")}if(!N){N=[];for(var O=0;O<8*M/C/2;O++)N.push("chick"),N.push("")}for(var V=!0,U=Math.min(N.length,E.length),O=0;O<U;O++){O>0&&E[O-1]&&E[O]&&E[O-1].boom!==E[O].boom&&(V=!0);var D=N[O],me=D.indexOf("boom")>=0,B=!me&&O!==0&&N[0].indexOf("boom")>=0&&(!E[O-1]||E[O-1].boom!==E[O].boom),ie=t(E[O],D,V,B);me&&(V=!1);for(var he=0;he<ie.length;he++)this.writeNote(ie[he],.125,me||B?this.boomVolume:this.chickVolume,O,g,me||B?this.bassInstrument:this.chordInstrument),B?B=!1:me=!1}}},e.prototype.processChord=function(b){if(!this.chordTrackFinished){var S=this.findChord(b);if(S){var M=this.interpretChord(S);if(M){this.chordTrack.length===0&&this.chordTrack.push({cmd:"program",channel:this.chordChannel,instrument:this.chordInstrument}),this.lastChord=M;var C=l(this.lastBarTime,h(b.time));this.currentChords.push({chord:this.lastChord,beat:C,start:h(b.time)})}}}};function t(b,S,M,C){var y=[];if(!b)return y;S.indexOf("boom")>=0?y.push(M?b.boom:b.boom2):C&&y.push(b.boom);var g=b.chick.length;if(S.indexOf("chick")>=0)for(var w=0;w<g;w++)y.push(b.chick[w]);switch(S){case"DO":y.push(b.chick[0]);break;case"MI":y.push(b.chick[1]);break;case"SOL":y.push(n(b,2));break;case"TI":y.push(n(b,3));break;case"TOP":y.push(n(b,4));break;case"do":y.push(b.chick[0]+12);break;case"mi":y.push(b.chick[1]+12);break;case"sol":y.push(n(b,2)+12);break;case"ti":y.push(n(b,3)+12);break;case"top":y.push(n(b,4)+12);break}return y}function n(b,S){var M=Math.floor(S/b.chick.length),C=b.chick[S%b.chick.length];return C+M*12}function a(b){for(var S=[],M=0;M<b.length;M++){var C=b[M];switch(C){case"z":S.push("");break;case"2":S.push("");break;case"c":S.push("chick");break;case"b":S.push("boom&chick");break;case"f":S.push("boom");break;case"G":S.push("DO");break;case"H":S.push("MI");break;case"I":S.push("SOL");break;case"J":S.push("TI");break;case"K":S.push("TOP");break;case"g":S.push("do");break;case"h":S.push("mi");break;case"i":S.push("sol");break;case"j":S.push("ti");break;case"k":S.push("top");break}}return S}function o(b,S,M){var C=[];if(b.length===0)return C;for(var y=b[0].chord,g=1;g<b.length;g++){for(var w=b[g];C.length<w.beat;)C.push(y);y=w.chord}for(;C.length<S;)C.push(y);return C}function l(b,S){var M=S-b;return M*8}e.prototype.breakSynonyms=["break","(break)","no chord","n.c.","tacet"],e.prototype.basses={A:33,B:35,C:36,D:38,E:40,F:41,G:43},e.prototype.chordIntervals={dim:[0,3,6],"°":[0,3,6],"˚":[0,3,6],dim7:[0,3,6,9],"°7":[0,3,6,9],"˚7":[0,3,6,9],ø7:[0,3,6,10],"m7(b5)":[0,3,6,10],m7b5:[0,3,6,10],"m7♭5":[0,3,6,10],"-7(b5)":[0,3,6,10],"-7b5":[0,3,6,10],"7b5":[0,4,6,10],"7(b5)":[0,4,6,10],"7♭5":[0,4,6,10],"7(b9,b5)":[0,4,6,10,13],"7b9,b5":[0,4,6,10,13],"7(#9,b5)":[0,4,6,10,15],"7#9b5":[0,4,6,10,15],"maj7(b5)":[0,4,6,11],maj7b5:[0,4,6,11],"13(b5)":[0,4,6,10,14,21],"13b5":[0,4,6,10,14,21],m:[0,3,7],"-":[0,3,7],m6:[0,3,7,9],"-6":[0,3,7,9],m7:[0,3,7,10],"-7":[0,3,7,10],"-(b6)":[0,3,7,8],"-b6":[0,3,7,8],"-6/9":[0,3,7,9,14],"-7(b9)":[0,3,7,10,13],"-7b9":[0,3,7,10,13],"-maj7":[0,3,7,11],"-9+7":[0,3,7,11,13],"-11":[0,3,7,11,14,17],m11:[0,3,7,11,14,17],"-maj9":[0,3,7,11,14],"-∆9":[0,3,7,11,14],mM9:[0,3,7,11,14],M:[0,4,7],6:[0,4,7,9],"6/9":[0,4,7,9,14],"6add9":[0,4,7,9,14],69:[0,4,7,9,14],7:[0,4,7,10],9:[0,4,7,10,14],11:[0,7,10,14,17],13:[0,4,7,10,14,21],"7b9":[0,4,7,10,13],"7♭9":[0,4,7,10,13],"7(b9)":[0,4,7,10,13],"7(#9)":[0,4,7,10,15],"7#9":[0,4,7,10,15],"(13)":[0,4,7,10,14,21],"7(9,13)":[0,4,7,10,14,21],"7(#9,b13)":[0,4,7,10,15,20],"7(#11)":[0,4,7,10,14,18],"7#11":[0,4,7,10,14,18],"7(b13)":[0,4,7,10,20],"7b13":[0,4,7,10,20],"9(#11)":[0,4,7,10,14,18],"9#11":[0,4,7,10,14,18],"13(#11)":[0,4,7,10,18,21],"13#11":[0,4,7,10,18,21],maj7:[0,4,7,11],"∆7":[0,4,7,11],Δ7:[0,4,7,11],maj9:[0,4,7,11,14],"maj7(9)":[0,4,7,11,14],"maj7(11)":[0,4,7,11,17],"maj7(#11)":[0,4,7,11,18],"maj7(13)":[0,4,7,14,21],"maj7(9,13)":[0,4,7,11,14,21],"7sus4":[0,5,7,10],m7sus4:[0,3,7,10,17],sus4:[0,5,7],sus2:[0,2,7],"7sus2":[0,2,7,10],"9sus4":[0,5,7,10,14],"13sus4":[0,5,7,10,14,21],aug7:[0,4,8,10],"+7":[0,4,8,10],"+":[0,4,8],"7#5":[0,4,8,10],"7♯5":[0,4,8,10],"7+5":[0,4,8,10],"9#5":[0,4,8,10,14],"9♯5":[0,4,8,10,14],"9+5":[0,4,8,10,14],"-7(#5)":[0,3,8,10],"-7#5":[0,3,8,10],"7(#5)":[0,4,8,10],"7(b9,#5)":[0,4,8,10,13],"7b9#5":[0,4,8,10,13],"maj7(#5)":[0,4,8,11],"maj7#5":[0,4,8,11],"maj7(#5,#11)":[0,4,8,11,18],"maj7#5#11":[0,4,8,11,18],"9(#5)":[0,4,8,10,14],"13(#5)":[0,4,8,10,14,21],"13#5":[0,4,8,10,14,21],5:[0,7],"5(8)":[0,7,12],"5add8":[0,7,12]},e.prototype.rhythmPatterns={"2/2":["boom","","","","chick","","",""],"3/2":["boom","","","","chick","","","","chick","","",""],"4/2":["boom","","","","chick","","","","boom","","","","chick","","",""],"2/4":["boom","","chick",""],"3/4":["boom","","chick","","chick",""],"4/4":["boom","","chick","","boom","","chick",""],"5/4":["boom","","chick","","chick","","boom","","chick",""],"6/4":["boom","","chick","","boom","","chick","","boom","","chick",""],"3/8":["boom","","chick"],"5/8":["boom","chick","chick","boom","chick"],"6/8":["boom","","chick","boom","","chick"],"7/8":["boom","chick","chick","boom","chick","boom","chick"],"9/8":["boom","","chick","boom","","chick","boom","","chick"],"10/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick"],"11/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick","chick"],"12/8":["boom","","chick","boom","","chick","boom","","chick","boom","","chick"]};function h(b){return b/1e6}function f(b,S){return Math.round(b*S*1e6)/1e6}return Ru=e,Ru}var Bu,Rv;function vy(){if(Rv)return Bu;Rv=1;var e={f0:"_C",n0:"=C",s0:"^C",x0:"C",f1:"_D",n1:"=D",s1:"^D",x1:"D",f2:"_E",n2:"=E",s2:"^E",x2:"E",f3:"_F",n3:"=F",s3:"^F",x3:"F",f4:"_G",n4:"=G",s4:"^G",x4:"G",f5:"_A",n5:"=A",s5:"^A",x5:"A",f6:"_B",n6:"=B",s6:"^B",x6:"B",f7:"_c",n7:"=c",s7:"^c",x7:"c",f8:"_d",n8:"=d",s8:"^d",x8:"d",f9:"_e",n9:"=e",s9:"^e",x9:"e",f10:"_f",n10:"=f",s10:"^f",x10:"f",f11:"_g",n11:"=g",s11:"^g",x11:"g",f12:"_a",n12:"=a",s12:"^a",x12:"a",f13:"_b",n13:"=b",s13:"^b",x13:"b",f14:"_c'",n14:"=c'",s14:"^c'",x14:"c'",f15:"_d'",n15:"=d'",s15:"^d'",x15:"d'",f16:"_e'",n16:"=e'",s16:"^e'",x16:"e'"};function t(n){var a=(n.accidental?n.accidental[0]:"x")+n.verticalPos;return e[a]}return Bu=t,Bu}var qu,Bv;function eP(){if(Bv)return qu;Bv=1;var e,t=JT(),n=vy();return function(){var a,o,l,h,f,b=1,S,M,C,y,g,w,p={num:4,den:4},E=128,N,I=!0,O=105,V=95,U=85,D=.25,me,B,ie=0,he,ae={},fe,le=0,Y,$=0,ne=-.001,we=.4;e=function(qe,je,Fe,Ue){je||(je={}),Ue||(Ue={}),a=[],o=[0,0,0,0,0,0,0],h=[],f=je.qpm,b=1,S=void 0,M=void 0,C=void 0,y=void 0,g=0,Y=Fe,p={num:4,den:4},I=!0,O=105,V=95,U=85,D=.25,me=void 0,B=void 0,ie=0,he=[],ae={},fe=1,qe.length>0&&qe[0].length>0&&(le=qe[0][0].pickupLength),je.bassprog!==void 0&&!Ue.bassprog&&(Ue.bassprog=[je.bassprog]),je.bassvol!==void 0&&!Ue.bassvol&&(Ue.bassvol=[je.bassvol]),je.chordprog!==void 0&&!Ue.chordprog&&(Ue.chordprog=[je.chordprog]),je.chordvol!==void 0&&!Ue.chordvol&&(Ue.chordvol=[je.chordvol]),je.gchord!==void 0&&!Ue.gchord&&(Ue.gchord=[je.gchord]),w=new t(qe.length,je.chordsOff,Ue,p),W(qe,je);for(var Qe=0;Qe<qe.length;Qe++){l=0,w.setTranspose(l);var r=qe[Qe];C=[{cmd:"program",channel:Qe,instrument:S}],y=void 0,N=0,w.setLastBarTime(0);var c=!1;(je.voicesOff===!0||je.voicesOff&&je.voicesOff.length&&je.voicesOff.indexOf(Qe)>=0)&&(c=!0);for(var m=0;m<r.length;m++){var x=r[m];switch(x.el_type){case"name":y={cmd:"text",type:"name",text:x.trackName};break;case"note":wt(x,c);break;case"key":o=et(x);break;case"meter":p=x,w.setMeter(p),D=_e(p),nr();break;case"tempo":f?b=x.qpm?f/x.qpm:1:f=x.qpm,w.setTempoChangeFactor(b);break;case"transpose":l=x.transpose,w.setTranspose(l);break;case"bar":w.barEnd(x),a=[],Qe===0&&Ar(qe.length+1),w.setRhythmHead(!1),N=F(x.time),w.setLastBarTime(N);break;case"bagpipes":break;case"instrument":if(S===void 0&&(S=x.program),M=x.program,C.length>0&&C[C.length-1].cmd==="program")C[C.length-1].instrument=x.program;else{var k;for(k=C.length-1;k>=0&&C[k].cmd!=="program";k--);(k<0||C[k].instrument!==x.program)&&C.push({cmd:"program",channel:0,instrument:x.program})}break;case"channel":ye(x.channel);break;case"drum":ae=Ht(x.params),nr();break;case"gchordOn":w.gChordOn(x);break;case"beat":O=x.beats[0],V=x.beats[1],U=x.beats[2];break;case"vol":me=x.volume;break;case"volinc":B=x.volume;break;case"beataccents":I=x.value;break;case"gchord":case"bassprog":case"chordprog":case"bassvol":case"chordvol":case"gchordbars":w.paramChange(x);break;default:console.log("MIDI creation. Unknown el_type: "+x.el_type+`
141
+ `);break}}C[0].instrument===void 0&&(C[0].instrument=S||0),y&&C.unshift(y),h.push(C),w.finish(),he.length>0}return je.detuneOctave&&fr(h,parseInt(je.detuneOctave,10)),w.addTrack(h),he.length>0&&h.push(he),{tempo:f,instrument:S,tracks:h,totalDuration:g}};function ye(qe){for(var je=C.length-1;je>=0;je--)if(C[je].cmd==="program"){C[je].channel=qe;return}}function F(qe){return qe/1e6}function H(qe){return Math.round(qe*b*1e6)/1e6}function W(qe,je){for(var Fe=0;Fe<qe.length;Fe++){for(var Ue=qe[Fe],Qe={},r=je.qpm,c=0,m=1,x=0;x<Ue.length;x++){var k=Ue[x];if(k.el_type==="tempo"){r?m=k.qpm?r/k.qpm:1:r=k.qpm;continue}k.time=c;var T=k.duration?k.duration:0;if(c+=Math.round(T*m*1e6),k.pitches){for(var R=0;R<k.pitches.length;R++){var L=k.pitches[R];if(L){if(L.duration=k.duration,L.startTie)Qe[L.pitch]===void 0?Qe[L.pitch]={el:x,pitch:R}:(Ue[Qe[L.pitch].el].pitches[Qe[L.pitch].pitch].duration+=L.duration,k.pitches[R]=null);else if(L.endTie){var q=Qe[L.pitch];if(q){var z=L.duration;delete Ue[q.el].pitches[q.pitch].startTie,Ue[q.el].pitches[q.pitch].duration+=z,k.pitches[R]=null,delete Qe[L.pitch]}else delete L.endTie}}}delete k.duration}}for(var X in Qe)if(Qe.hasOwnProperty(X)){var Z=Qe[X];delete Ue[Z.el].pitches[Z.pitch].startTie}}}function _e(qe){switch(parseInt(qe.den,10)){case 2:return .5;case 4:return .25;case 8:return qe.num%3===0?.375:.125;case 16:return .125}return .25}function Te(qe,je,Fe){var Ue=Fe-qe;return Ue/je}function Re(qe,je){if(je)return 0;var Fe;if(me!=null)Fe=me,me=void 0;else if(!I)Fe=V;else if(le>qe)Fe=U;else{var Ue=Te(N,_e(p),qe);Ue===0?Fe=O:parseInt(Ue,10)===Ue?Fe=V:Fe=U}return B&&(Fe+=B,B=void 0),Fe<0&&(Fe=0),Fe>127&&(Fe=127),je?0:Fe}function Ie(qe,je){var Fe={};if(qe.decoration)for(var Ue=0;Ue<qe.decoration.length;Ue++)qe.decoration[Ue]==="staccato"?Fe.thisBreakBetweenNotes="staccato":qe.decoration[Ue]==="tenuto"?Fe.thisBreakBetweenNotes="tenuto":qe.decoration[Ue]==="accent"?Fe.velocity=Math.min(127,je*1.5):qe.decoration[Ue]==="trill"?Fe.noteModification="trill":qe.decoration[Ue]==="lowermordent"?Fe.noteModification="lowermordent":qe.decoration[Ue]==="uppermordent"||qe.decoration[Ue]==="mordent"?Fe.noteModification="mordent":qe.decoration[Ue]==="turn"?Fe.noteModification="turn":qe.decoration[Ue]==="roll"&&(Fe.noteModification="roll");return Fe}function st(qe,je){var Fe=je.start,Ue=je.duration,Qe=H(1/32);switch(qe){case"trill":for(var r=2;Ue>0;)C.push({cmd:"note",pitch:je.pitch+r,volume:je.volume,start:Fe,duration:Qe,gap:0,instrument:M,style:"decoration"}),r=r===2?0:2,Ue-=Qe,Fe+=Qe;break;case"mordent":C.push({cmd:"note",pitch:je.pitch,volume:je.volume,start:Fe,duration:Qe,gap:0,instrument:M,style:"decoration"}),Ue-=Qe,Fe+=Qe,C.push({cmd:"note",pitch:je.pitch+2,volume:je.volume,start:Fe,duration:Qe,gap:0,instrument:M,style:"decoration"}),Ue-=Qe,Fe+=Qe,C.push({cmd:"note",pitch:je.pitch,volume:je.volume,start:Fe,duration:Ue,gap:0,instrument:M});break;case"lowermordent":C.push({cmd:"note",pitch:je.pitch,volume:je.volume,start:Fe,duration:Qe,gap:0,instrument:M,style:"decoration"}),Ue-=Qe,Fe+=Qe,C.push({cmd:"note",pitch:je.pitch-2,volume:je.volume,start:Fe,duration:Qe,gap:0,instrument:M,style:"decoration"}),Ue-=Qe,Fe+=Qe,C.push({cmd:"note",pitch:je.pitch,volume:je.volume,start:Fe,duration:Ue,gap:0,instrument:M});break;case"turn":Qe=je.duration/4,C.push({cmd:"note",pitch:je.pitch+2,volume:je.volume,start:Fe,duration:Qe,gap:0,instrument:M,style:"decoration"}),C.push({cmd:"note",pitch:je.pitch,volume:je.volume,start:Fe+Qe,duration:Qe,gap:0,instrument:M,style:"decoration"}),C.push({cmd:"note",pitch:je.pitch-1,volume:je.volume,start:Fe+Qe*2,duration:Qe,gap:0,instrument:M,style:"decoration"}),C.push({cmd:"note",pitch:je.pitch,volume:je.volume,start:Fe+Qe*3,duration:Qe,gap:0,instrument:M,style:"decoration"});break;case"roll":for(;Ue>0;)C.push({cmd:"note",pitch:je.pitch,volume:je.volume,start:Fe,duration:Qe,gap:0,instrument:M,style:"decoration"}),Ue-=Qe*2,Fe+=Qe*2;break}}function wt(qe,je){var Fe=Re(F(qe.time),je);w.processChord(qe);var Ue;if(qe.gracenotes&&qe.pitches&&qe.pitches.length>0&&qe.pitches[0]&&(Ue=Nt(qe.gracenotes,qe.pitches[0].duration),qe.elem&&(qe.elem.midiGraceNotePitches=xt(Ue,F(qe.time),Fe*2/3,M))),qe.elem){var Qe=F(qe.time),r=Qe/D/f*60*1e3;if(qe.elem.currentTrackMilliseconds===void 0)qe.elem.currentTrackMilliseconds=r,qe.elem.currentTrackWholeNotes=Qe;else if(qe.elem.currentTrackMilliseconds.length===void 0)qe.elem.currentTrackMilliseconds!==r&&(qe.elem.currentTrackMilliseconds=[qe.elem.currentTrackMilliseconds,r],qe.elem.currentTrackWholeNotes=[qe.elem.currentTrackWholeNotes,Qe]);else{for(var c=!1,m=0;m<qe.elem.currentTrackMilliseconds.length;m++)qe.elem.currentTrackMilliseconds[m]===r&&(c=!0);c||(qe.elem.currentTrackMilliseconds.push(r),qe.elem.currentTrackWholeNotes.push(Qe))}}if(qe.pitches){var x="",k=Ie(qe,Fe);k.thisBreakBetweenNotes&&(x=k.thisBreakBetweenNotes),k.velocity&&(Fe=k.velocity);var T=qe.pitches;qe.style==="rhythm"&&(T=w.setRhythmHead(!0,qe)),qe.elem&&(qe.elem.midiPitches=[]);for(var R=0;R<T.length;R++){var L=T[R];if(L){L.startSlur&&(ie+=L.startSlur.length),L.endSlur&&(ie-=L.endSlur.length);var q=L.actualPitch?L.actualPitch:bt(L);if(M===E&&Y){var z=n(L);z&&Y[z]&&(q=Y[z].sound)}var X={cmd:"note",pitch:q,volume:Fe,start:F(qe.time),duration:H(L.duration),instrument:M,startChar:qe.elem.startChar,endChar:qe.elem.endChar};if(X=at(X),qe.gracenotes&&(X.duration=X.duration/2,X.start=X.start+X.duration),qe.elem&&qe.elem.midiPitches.push(X),k.noteModification)st(k.noteModification,X);else{switch(ie>0?X.endType="tenuto":x&&(X.endType=x),X.endType){case"tenuto":X.gap=ne;break;case"staccato":var Z=X.duration*we;X.gap=f/60*Z;break;default:X.gap=$;break}C.push(X)}}}C.length-1}var Q=Ze(qe);g=Math.max(g,F(qe.time)+H(Q))}function Ze(qe){return qe.pitches&&qe.pitches.length>0&&qe.pitches[0]?qe.pitches[0].duration:qe.elem?qe.elem.duration:qe.duration}var dt=[0,2,4,5,7,9,11];function bt(qe){if(qe.midipitch!==void 0)return qe.midipitch;var je=qe.pitch;if(qe.accidental)switch(qe.accidental){case"sharp":a[je]=1;break;case"flat":a[je]=-1;break;case"natural":a[je]=0;break;case"dblsharp":a[je]=2;break;case"dblflat":a[je]=-2;break;case"quartersharp":a[je]=.25;break;case"quarterflat":a[je]=-.25;break}var Fe=rr(je)*12+dt[Xt(je)]+60;return a[je]!==void 0?Fe+=a[je]:Fe+=o[Xt(je)],Fe+=l,Fe}function et(qe){var je=[0,0,0,0,0,0,0];if(!qe.accidentals)return je;for(var Fe=0;Fe<qe.accidentals.length;Fe++){var Ue=qe.accidentals[Fe],Qe;switch(Ue.acc){case"flat":Qe=-1;break;case"quarterflat":Qe=-.25;break;case"sharp":Qe=1;break;case"quartersharp":Qe=.25;break;default:Qe=0;break}var r=Ue.note.toLowerCase(),c=Xt(r.charCodeAt(0)-99);je[c]+=Qe}return je}function Nt(qe,je){for(var Fe=0,Ue=[],Qe,r=0;r<qe.length;r++)Qe=qe[r],Fe+=Qe.duration;var c=je/2/Fe;for(r=0;r<qe.length;r++){Qe=qe[r];var m=bt(Qe);if(M===E&&Y){var x=n(Qe);x&&Y[x]&&(m=Y[x].sound)}var k={pitch:m,duration:Qe.duration*c};k=at(k),Ue.push(k)}return Ue}function xt(qe,je,Fe,Ue){var Qe=[];Fe=Math.round(Fe);for(var r=0;r<qe.length;r++){var c=qe[r];C.push({cmd:"note",pitch:c.pitch,volume:Fe,start:je,duration:c.duration,gap:0,instrument:Ue,style:"grace"}),Qe.push({pitch:c.pitch,durationInMeasures:c.duration,volume:Fe,instrument:Ue}),je+=c.duration}return Qe}function at(qe){var je=""+qe.pitch;return je.indexOf(".75")>=0?(qe.pitch=Math.round(qe.pitch),qe.cents=-50):je.indexOf(".25")>=0&&(qe.pitch=Math.round(qe.pitch),qe.cents=50),qe}function rr(qe){return Math.floor(qe/7)}function Xt(qe){return qe=qe%7,qe<0&&(qe+=7),qe}function Ht(qe){if(qe.pattern.length===0||qe.on===!1)return{on:!1};for(var je=qe.pattern[0],Fe=[],Ue="",Qe=0,r=0;r<je.length;r++)if(je[r]==="d"&&Qe++,je[r]==="d"||je[r]==="z")Ue.length!==0?(Fe.push(Ue),Ue=je[r]):Ue=Ue+je[r];else{if(Ue.length===0)return{on:!1};Ue=Ue+je[r]}if(Ue.length!==0&&Fe.push(Ue),qe.pattern.length!==Qe*2+1)return{on:!1};for(var c={on:!0,bars:qe.bars,pattern:[]},m=_e(p),x=0,k=0;k<Fe.length;k++){Ue=Fe[k];for(var T=1,R=!1,L=0,q=1;q<Ue.length;q++)switch(Ue[q]){case"/":L!==0&&(T*=L),L=0,R=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":L=L*10+Ue[q];break;default:return{on:!1}}R?(L===0&&(L=2),T/=L):L&&(T*=L),Ue[0]==="d"?(c.pattern.push({len:T*m,pitch:qe.pattern[1+x],velocity:qe.pattern[1+x+Qe]}),x++):c.pattern.push({len:T*m,pitch:null})}return fe=qe.bars?qe.bars:1,c}function nr(){if(!(!ae||!ae.pattern)){for(var qe=ae,je=0,Fe=p.num/p.den,Ue=0;Ue<qe.pattern.length;Ue++)je+=qe.pattern[Ue].len;var Qe=je/fe/Fe;for(Ue=0;Ue<qe.pattern.length;Ue++)qe.pattern[Ue].len=qe.pattern[Ue].len/Qe;ae=qe}}function Ar(qe){if(!(he.length===0&&!ae.on)){var je=p.num/p.den;if(he.length===0){if(g<je)return;he.push({cmd:"program",channel:qe,instrument:E})}if(ae.on)for(var Fe=N,Ue=0;Ue<ae.pattern.length;Ue++){var Qe=H(ae.pattern[Ue].len);ae.pattern[Ue].pitch&&he.push({cmd:"note",pitch:ae.pattern[Ue].pitch,volume:ae.pattern[Ue].velocity,start:Fe,duration:Qe,gap:0,instrument:E}),Fe+=Qe}}}function fr(qe,je){for(var Fe={},Ue=0;Ue<qe.length;Ue++)for(var Qe=0;Qe<qe[Ue].length;Qe++){var r=qe[Ue][Qe];r.cmd==="note"&&(Fe[r.start]===void 0&&(Fe[r.start]=[]),Fe[r.start].push({track:Ue,event:Qe,pitch:r.pitch}))}var c=Object.keys(Fe);for(Ue=0;Ue<c.length;Ue++){var m=Fe[c[Ue]];if(m.length>1){m=m.sort(function(L,q){return L.pitch-q.pitch});var x=m[m.length-1],k=x.pitch%12,T=!1;for(Qe=0;!T&&Qe<m.length-1;Qe++)m[Qe].pitch%12===k&&(T=!0);if(T){var R=qe[x.track][x.event];R.cents||(R.cents=0),R.cents+=je}}}}}(),qu=e,qu}var Fu,qv;function tP(){if(qv)return Fu;qv=1;function e(b,S){S||(S={});for(var M=!!S.lineBreaks,C=[],y=!1,g=[],w=[],p=[],E=[],N=[],I=[],O=[],V=0;V<b.length;V++){var U=b[V];if(U.staff){if(y&&!U.vskip)for(var D=C[C.length-1],me=0;me<D.staff.length;me++){var B=U.staff[me],ie=D.staff[me];if(B&&(h(B.meter,g[me])||(n(B.meter,B.voices),g[me]=B.meter,delete B.meter),h(B.key,w[me])||(a(B.key,B.voices),w[me]=B.key,delete B.key),B.title&&(ie.abbrevTitle=B.title),h(B.clef,p[me])||(o(B.clef,B.voices),p[me]=B.clef,delete B.clef),h(B.vocalfont,E[me])||(l(B.vocalfont,B.voices,"vocalfont"),E[me]=B.vocalfont,delete B.vocalfont),h(B.gchordfont,N[me])||(l(B.gchordfont,B.voices,"gchordfont"),N[me]=B.gchordfont,delete B.gchordfont),h(B.tripletfont,I[me])||(l(B.tripletfont,B.voices,"tripletfont"),I[me]=B.tripletfont,delete B.tripletfont),h(B.annotationfont,O[me])||(l(B.annotationfont,B.voices,"annotationfont"),O[me]=B.annotationfont,delete B.annotationfont)),B)for(var he=0;he<ie.voices.length;he++){var ae=ie.voices[he],fe=B.voices[he];M&&ae.push({el_type:"break"}),fe&&(ie.voices[he]=ae.concat(fe))}}else{for(var le=0;le<U.staff.length;le++)w[le]=U.staff[le].key,g[le]=U.staff[le].meter,p[le]=U.staff[le].clef;C.push(f(U))}y=!0}else y=!1,C.push(U)}return C}function t(b,S){return b==="abselem"?"abselem":S}function n(b,S){b.el_type="meter",b.startChar=-1,b.endChar=-1;for(var M=0;M<S.length;M++)S[M].unshift(b)}function a(b,S){b.el_type="key",b.startChar=-1,b.endChar=-1;for(var M=0;M<S.length;M++)S[M].unshift(b)}function o(b,S){b.el_type="clef",b.startChar=-1,b.endChar=-1;for(var M=0;M<S.length;M++)S[M].unshift(b)}function l(b,S,M){b.el_type="font",b.type=M,b.startChar=-1,b.endChar=-1;for(var C=0;C<S.length;C++)S[C].unshift(b)}function h(b,S){if(!b)return!0;var M=JSON.stringify(b,t),C=JSON.stringify(S,t);return M===C}function f(b){for(var S={},M=Object.keys(b),C=0;C<M.length;C++)if(M[C]!=="staff")S[M[C]]=b[M[C]];else{S.staff=[];for(var y=0;y<b.staff.length;y++){for(var g={},w=Object.keys(b.staff[y]),p=0;p<w.length;p++)if(w[p]!=="voices")g[w[p]]=b.staff[y][w[p]];else{g.voices=[];for(var E=0;E<b.staff[y].voices.length;E++)g.voices.push([].concat(b.staff[y].voices[E]))}S.staff.push(g)}}return S}return Fu=e,Fu}var zu,Fv;function my(){if(Fv)return zu;Fv=1;var e=Ds(),t=Qi(),n=gy(),a=eP(),o=tP(),l=function(){this.reset=function(){this.version="1.1.0",this.media="screen",this.metaText={},this.metaTextInfo={},this.formatting={},this.lines=[],this.staffNum=0,this.voiceNum=0,this.lineNum=0,this.runningFonts={},delete this.visualTranspose},this.reset();function h(y,g,w,p){for(var E=0;E<p.length;E++)y[w][p[E]]=g[w][p[E]]}this.copyTopInfo=function(y){var g=["tempo","title","header","rhythm","origin","composer","author","partOrder"];h(this,y,"metaText",g),h(this,y,"metaTextInfo",g)},this.copyBottomInfo=function(y){var g=["unalignedWords","book","source","discography","notes","transcription","history","abc-copyright","abc-creator","abc-edited-by","footer"];h(this,y,"metaText",g),h(this,y,"metaTextInfo",g)},this.getBeatLength=function(){var y=this.getMeterFraction(),g=1;return(y.num===6||y.num===9||y.num===12||y.num===3&&y.den===8)&&(g=3),g/y.den};function f(y,g){for(var w=0,p=0;p<y.length;p++)if(y[p].staff)for(var E=0;E<y[p].staff.length;E++)for(var N=0;N<y[p].staff[E].voices.length;N++)for(var I=y[p].staff[E].voices[N],O=1,V=0;V<I.length;V++){var U=I[V].rest&&I[V].rest.type==="spacer";if(I[V].startTriplet&&(O=I[V].tripletMultiplier),I[V].duration&&!U&&I[V].el_type!=="tempo"&&(w+=I[V].duration*O),I[V].endTriplet&&(O=1),w>=g&&(w-=g),I[V].el_type==="bar")return w}return w}this.getPickupLength=function(){var y=this.getBarLength(),g=f(this.lines,y);return g<1e-8||y-g<1e-8?0:g},this.getBarLength=function(){var y=this.getMeterFraction();return y.num/y.den},this.getTotalTime=function(){return this.totalTime},this.getTotalBeats=function(){return this.totalBeats},this.millisecondsPerMeasure=function(y){var g;if(y)g=y;else{var w=this.metaText?this.metaText.tempo:null;g=this.getBpm(w)}g<=0&&(g=1);var p=this.getBeatsPerMeasure(),E=p/g;return E*6e4},this.getBeatsPerMeasure=function(){var y=this.getBeatLength(),g=this.getBarLength();return g/y},this.getMeter=function(){for(var y=0;y<this.lines.length;y++){var g=this.lines[y];if(g.staff)for(var w=0;w<g.staff.length;w++){var p=g.staff[w].meter;if(p)return p}}return{type:"common_time"}},this.getMeterFraction=function(){var y=this.getMeter(),g=4,w=4;return y&&(y.type==="specified"?(g=parseInt(y.value[0].num,10),w=parseInt(y.value[0].den,10)):y.type==="cut_time"?(g=2,w=2):y.type==="common_time"&&(g=4,w=4)),this.meter={num:g,den:w},this.meter},this.getKeySignature=function(){for(var y=0;y<this.lines.length;y++){var g=this.lines[y];if(g.staff){for(var w=0;w<g.staff.length;w++)if(g.staff[w].key)return g.staff[w].key}}return{}},this.getElementFromChar=function(y){for(var g=0;g<this.lines.length;g++){var w=this.lines[g];if(w.staff)for(var p=0;p<w.staff.length;p++)for(var E=w.staff[p],N=0;N<E.voices.length;N++)for(var I=E.voices[N],O=0;O<I.length;O++){var V=I[O];if(V.startChar&&V.endChar&&V.startChar<=y&&V.endChar>y)return V}}return null};function b(y){for(var g,w,p,E,N=y.length-1;N>=0;N--){var I=y[N];I.type==="bar"?(I.top=p,I.nextTop=g,g=p,I.bottom=E,I.nextBottom=w,w=E):I.type==="event"&&(p=I.top,E=I.top+I.height)}}function S(y){var g=[];for(var w in y)y.hasOwnProperty(w)&&g.push(y[w]);return g=g.sort(function(p,E){var N=p.milliseconds-E.milliseconds;return N!==0?N:p.type==="bar"?-1:1}),g}this.addElementToEvents=function(y,g,w,p,E,N,I,O,V,U){if(g.hint)return{isTiedState:void 0,duration:0};var D=g.durationClass?g.durationClass:g.duration;if(g.abcelem.rest&&g.abcelem.rest.type==="spacer"&&(D=0),D>0){for(var me=[],B=0;B<g.elemset.length;B++)g.elemset[B]!==null&&me.push(g.elemset[B]);var ie=g.startTie;if(V!==void 0)y["event"+V].elements.push(me),U&&(y["event"+w]||(y["event"+w]={type:"event",milliseconds:w,line:N,measureNumber:I,top:p,height:E,left:null,width:0,elements:[],startChar:null,endChar:null,startCharArray:[],endCharArray:[]}),y["event"+w].measureStart=!0,U=!1),ie||(V=void 0);else{if(!y["event"+w])y["event"+w]={type:"event",milliseconds:w,line:N,measureNumber:I,top:p,height:E,left:g.x,width:g.w,elements:[me],startChar:g.abcelem.startChar,endChar:g.abcelem.endChar,startCharArray:[g.abcelem.startChar],endCharArray:[g.abcelem.endChar],midiPitches:g.abcelem.midiPitches?e.cloneArray(g.abcelem.midiPitches):[]},g.abcelem.midiGraceNotePitches&&(y["event"+w].midiGraceNotePitches=e.cloneArray(g.abcelem.midiGraceNotePitches));else{if(y["event"+w].left?y["event"+w].left=Math.min(y["event"+w].left,g.x):y["event"+w].left=g.x,y["event"+w].elements.push(me),y["event"+w].startCharArray.push(g.abcelem.startChar),y["event"+w].endCharArray.push(g.abcelem.endChar),y["event"+w].startChar===null&&(y["event"+w].startChar=g.abcelem.startChar),y["event"+w].endChar===null&&(y["event"+w].endChar=g.abcelem.endChar),g.abcelem.midiPitches&&g.abcelem.midiPitches.length){y["event"+w].midiPitches||(y["event"+w].midiPitches=[]);for(var B=0;B<g.abcelem.midiPitches.length;B++)y["event"+w].midiPitches.push(g.abcelem.midiPitches[B])}if(g.abcelem.midiGraceNotePitches&&g.abcelem.midiGraceNotePitches.length){y["event"+w].midiGraceNotePitches||(y["event"+w].midiGraceNotePitches=[]);for(var he=0;he<g.abcelem.midiGraceNotePitches.length;he++)y["event"+w].midiGraceNotePitches.push(g.abcelem.midiGraceNotePitches[he])}}U&&(y["event"+w].measureStart=!0,U=!1)}}return{isTiedState:V,duration:D/O,nextIsBar:U||g.type==="bar"}},this.makeVoicesArray=function(){for(var y=[],g=[],w={},p=0;p<this.engraver.staffgroups.length;p++){var E=this.engraver.staffgroups[p];if(E&&E.staffs&&E.staffs.length>0){var N=E.staffs[0],I=N.absoluteY,O=I-N.top*t.STEP,V=E.staffs[E.staffs.length-1];I=V.absoluteY;for(var U=I-V.bottom*t.STEP,D=U-O,me=E.voices,B=0;B<me.length;B++)if(!(me[B].staff&&me[B].staff.isTabStaff)){var ie=!1;y[B]||(y[B]=[]),g[B]===void 0&&(g[B]=0);for(var he=me[B].children,ae=0;ae<he.length;ae++)he[ae].type==="tempo"&&(w[g[B]]=this.getBpm(he[ae].abcelem)),y[B].push({top:O,height:D,line:E.line,measureNumber:g[B],elem:he[ae]}),he[ae].type==="bar"&&ie&&g[B]++,(he[ae].type==="note"||he[ae].type==="rest")&&(ie=!0)}}}return this.tempoLocations=w,y},this.setupEvents=function(y,g,w,p){p||(p=1);for(var E=[],N={},I=y,O,V=!0,U=this.makeVoicesArray(),D=0,me=0;me<U.length;me++){var B=I,ie=Math.round(B*1e3),he=0,ae=-1,fe=U[me],le=w;g=this.getBeatLength()*le/60;for(var Y=-1,$=0;$<fe.length;$++){var ne=fe[$].measureNumber;Y!==ne&&this.tempoLocations[ne]&&(le=this.tempoLocations[ne],g=p*this.getBeatLength()*le/60,Y=ne);var we=fe[$].elem,ye=this.addElementToEvents(N,we,ie,fe[$].top,fe[$].height,fe[$].line,fe[$].measureNumber,g,O,V);O=ye.isTiedState,V=ye.nextIsBar,B+=ye.duration;var F;if(we.duration>0&&N["event"+ie]&&(F="event"+ie),ie=Math.round(B*1e3),we.type==="bar"){var H=we.abcelem.type,W=H==="bar_right_repeat"||H==="bar_dbl_repeat",_e=we.abcelem.startEnding==="1",Te=H==="bar_left_repeat"||H==="bar_dbl_repeat"||H==="bar_right_repeat";if(W){$>0&&(N[F].endX=we.x),ae===-1&&(ae=$);var Re=0;Y=-1;for(var Ie=he;Ie<ae;Ie++){ne=fe[Ie].measureNumber,Y!==ne&&this.tempoLocations[ne]&&(le=this.tempoLocations[ne],g=p*this.getBeatLength()*le/60,Y=ne);var st=fe[Ie].elem;ye=this.addElementToEvents(N,st,ie,fe[Ie].top,fe[Ie].height,fe[Ie].line,fe[Ie].measureNumber,g,O,V),O=ye.isTiedState,V=ye.nextIsBar,B+=ye.duration,Re=ie,ie=Math.round(B*1e3)}N["event"+Re]&&(N["event"+Re].endX=fe[ae].elem.x),V=!0,ae=-1}_e&&(ae=$),Te&&(he=$)}}D=Math.max(D,ie)}return E=S(N),b(E),C(this.lines,E),E.push({type:"end",milliseconds:D}),this.addUsefulCallbackInfo(E,le*p),E},this.addUsefulCallbackInfo=function(y,g){for(var w=this.millisecondsPerMeasure(g),p=0;p<y.length;p++){var E=y[p];E.millisecondsPerMeasure=w}};function M(y,g){for(;g<y.length&&y[g].left===null;)g++;return y[g]}function C(y,g){if(!(g.length<1)){for(var w=0;w<g.length-1;w++){var p=g[w],E=M(g,w+1);if(p.left!==null){var N=E&&p.top===E.top?E.left:y[p.line].staffGroup.w;p.endX!==void 0?N>p.left&&(p.endX=Math.min(p.endX,N)):p.endX=N}}var I=g[g.length-1];I.endX=y[I.line].staffGroup.w}}this.getBpm=function(y){var g;if(y||(y=this.metaText?this.metaText.tempo:null),y){g=y.bpm;var w=this.getBeatLength(),p=y.duration&&y.duration.length>0?y.duration[0]:w;g=g*p/w}if(!g){g=180;var E=this.getMeterFraction();E&&E.num!==3&&E.num%3===0&&(g=120)}return g},this.setTiming=function(y,g){if(g=g||0,!this.engraver||!this.engraver.staffgroups)return console.log("setTiming cannot be called before the tune is drawn."),this.noteTimings=[],this.noteTimings;var w=this.metaText?this.metaText.tempo:null,p=this.getBpm(w),E=1;y?w&&(E=y/p):y=p;var N=this.getBeatLength(),I=y/60,O=this.getBarLength(),V=O/N*g/I;V&&(V-=this.getPickupLength()/N/I);var U=N*I;return this.noteTimings=this.setupEvents(V,U,y,E),this.noteTimings.length>0?(this.totalTime=this.noteTimings[this.noteTimings.length-1].milliseconds/1e3,this.totalBeats=this.totalTime*I):(this.totalTime=void 0,this.totalBeats=void 0),this.noteTimings},this.setUpAudio=function(y){y||(y={});var g=n(this,y);return a(g,y,this.formatting.percmap,this.formatting.midi)},this.deline=function(y){return o(this.lines,y)},this.findSelectableElement=function(y){return this.engraver&&this.engraver.selectables?this.engraver.findSelectableElement(y):null},this.getSelectableArray=function(){return this.engraver&&this.engraver.selectables?this.engraver.selectables:[]}};return zu=l,zu}var Hu,zv;function rP(){if(zv)return Hu;zv=1;var e=R1(),t=function(B){var ie=this,he={},ae="";B.reset(),this.setVisualTranspose=function(fe){fe&&(B.visualTranspose=fe)},this.cleanUp=function(fe,le,Y){g(B),delete B.runningFonts,a(B),B.metaText.tempo&&B.metaText.tempo.bpm&&!B.metaText.tempo.duration&&(B.metaText.tempo.duration=[B.getBeatLength()]);var $=!1,ne,we,ye;for(ne=0;ne<B.lines.length;ne++)if(B.lines[ne].staff!==void 0){var F=!1;for(we=0;we<B.lines[ne].staff.length;we++)if(B.lines[ne].staff[we]===void 0)$=!0,B.lines[ne].staff[we]=null;else for(ye=0;ye<B.lines[ne].staff[we].voices.length;ye++)B.lines[ne].staff[we].voices[ye]===void 0?B.lines[ne].staff[we].voices[ye]=[]:w(B.lines[ne].staff[we].voices[ye])&&(F=!0);F||(B.lines[ne]=null,$=!0)}if($&&(B.lines=B.lines.filter(function(Ie){return!!Ie}),B.lines.forEach(function(Ie){Ie.staff&&(Ie.staff=Ie.staff.filter(function(st){return!!st}))})),fe)for(;b(B.lines,fe););if(le){for($=!1,ne=0;ne<B.lines.length;ne++)if(B.lines[ne].staff!==void 0)for(we=0;we<B.lines[ne].staff.length;we++){var H=!1;for(ye=0;ye<B.lines[ne].staff[we].voices.length;ye++)p(B.lines[ne].staff[we].voices[ye])&&(H=!0);H||($=!0,B.lines[ne].staff[we]=null)}$&&B.lines.forEach(function(Ie){Ie.staff&&(Ie.staff=Ie.staff.filter(function(st){return!!st}))})}for(h(B.lines),ne=0;ne<B.lines.length;ne++)if(B.lines[ne].staff)for(we=0;we<B.lines[ne].staff.length;we++)delete B.lines[ne].staff[we].workingClef;for(;o(B););for(var ne=0;ne<B.lines.length;ne++){var W=B.lines[ne].staff;if(W)for(B.staffNum=0;B.staffNum<W.length;B.staffNum++)for(W[B.staffNum].clef&&e.fixClef(W[B.staffNum].clef),B.voiceNum=0;B.voiceNum<W[B.staffNum].voices.length;B.voiceNum++){var _e=W[B.staffNum].voices[B.voiceNum];f(_e,B.staffNum,B.voiceNum,Y);for(var Te=0;Te<_e.length;Te++)_e[Te].el_type==="clef"&&e.fixClef(_e[Te]);if(_e.length>0&&_e[_e.length-1].barNumber){var Re=M(B.lines,ne);Re&&(Re.staff[0].barNumber=_e[_e.length-1].barNumber),delete _e[_e.length-1].barNumber}}}return delete B.staffNum,delete B.voiceNum,delete B.lineNum,delete B.potentialStartBeam,delete B.potentialEndBeam,delete B.vskipPending,Y},this.addTieToLastNote=function(fe){var le=C(B);return le&&le.pitches&&le.pitches.length>0?(le.pitches[0].startTie={},fe&&(le.pitches[0].startTie.style="dotted"),!0):!1},this.appendElement=function(fe,le,Y,$){if($.el_type=fe,le!==null&&($.startChar=le),Y!==null&&($.endChar=Y),fe==="note"){var ne=y($);ne>=.25||$.force_end_beam_last&&B.potentialStartBeam!==void 0?O(B):$.end_beam&&B.potentialStartBeam!==void 0?$.rest===void 0?I($,B):O(B):$.rest===void 0&&(B.potentialStartBeam===void 0?$.end_beam||(B.potentialStartBeam=$,delete B.potentialEndBeam):B.potentialEndBeam=$)}else O(B);return delete $.end_beam,delete $.force_end_beam_last,$.rest&&$.rest.type==="invisible"&&delete $.decoration,B.lines.length<=B.lineNum||B.lines[B.lineNum].staff.length<=B.staffNum?!1:(N(ie,B,$,he,ae),!0)},this.appendStartingElement=function(fe,le,Y,$){g(B);var ne;fe==="key"&&(ne=$.impliedNaturals,delete $.impliedNaturals,delete $.explicitAccidentals);var we=Object.assign({},$);if(B.lines[B.lineNum]){var ye=B.lines[B.lineNum].staff;if(ye){ye.length<=B.staffNum&&(ye[B.staffNum]={},ye[B.staffNum].clef=Object.assign({},ye[0].clef),ye[B.staffNum].key=Object.assign({},ye[0].key),ye[0].meter&&(ye[B.staffNum].meter=Object.assign({},ye[0].meter)),ye[B.staffNum].workingClef=Object.assign({},ye[0].workingClef),ye[B.staffNum].voices=[[]]),fe==="clef"&&(ye[B.staffNum].workingClef=we);for(var F=ye[B.staffNum].voices[B.voiceNum],H=0;H<F.length;H++){if(F[H].el_type==="note"||F[H].el_type==="bar"){we.el_type=fe,we.startChar=le,we.endChar=Y,ne&&(we.accidentals=ne.concat(we.accidentals)),F.push(we);return}if(F[H].el_type===fe){we.el_type=fe,we.startChar=le,we.endChar=Y,ne&&(we.accidentals=ne.concat(we.accidentals)),F[H]=we;return}}ye[B.staffNum][fe]=$}}},this.addSubtitle=function(fe,le){E(B,{subtitle:{text:fe,startChar:le.startChar,endChar:le.endChar}})},this.addSpacing=function(fe){B.vskipPending=fe},this.addNewPage=function(fe){E(B,{newpage:fe})},this.addSeparator=function(fe,le,Y,$){E(B,{separator:{spaceAbove:Math.round(fe),spaceBelow:Math.round(le),lineLength:Math.round(Y),startChar:$.startChar,endChar:$.endChar}})},this.addText=function(fe,le){E(B,{text:{text:fe,startChar:le.startChar,endChar:le.endChar}})},this.addCentered=function(fe){E(B,{text:[{text:fe,center:!0}]})},this.changeVoiceScale=function(fe){ie.appendElement("scale",null,null,{size:fe})},this.changeVoiceColor=function(fe){ie.appendElement("color",null,null,{color:fe})},this.startNewLine=function(fe){g(B),fe.currentVoiceName&&(ae=fe.currentVoiceName,he[fe.currentVoiceName]=fe),B.lines[B.lineNum]===void 0?me(ie,B,fe):B.lines[B.lineNum].staff===void 0?(B.lineNum++,this.startNewLine(fe)):B.lines[B.lineNum].staff[B.staffNum]===void 0?D(ie,B,fe):B.lines[B.lineNum].staff[B.staffNum].voices[B.voiceNum]===void 0?U(ie,B,fe):w(B.lines[B.lineNum].staff[B.staffNum].voices[B.voiceNum])?(B.lineNum++,this.startNewLine(fe)):fe.part&&ie.appendElement("part",fe.part.startChar,fe.part.endChar,{title:fe.part.title})},this.setRunningFont=function(fe,le){B.runningFonts[fe]=le},this.setBarNumberImmediate=function(fe){var le=this.getCurrentVoice();if(le&&le.length>0){var Y=le[le.length-1];if(Y.el_type==="bar")Y.barNumber!==void 0&&(Y.barNumber=fe);else return fe-1}return fe},this.hasBeginMusic=function(){for(var fe=0;fe<B.lines.length;fe++)if(B.lines[fe].staff)return!0;return!1},this.isFirstLine=function(fe){for(var le=fe-1;le>=0;le--)if(B.lines[le].staff!==void 0)return!1;return!0},this.getCurrentVoice=function(){var fe=S(B.lines,B.lineNum);if(!fe)return null;var le=fe.staff[B.staffNum];return le&&le.voices[B.voiceNum]!==void 0?le.voices[B.voiceNum]:null},this.setCurrentVoice=function(fe,le,Y){B.staffNum=fe,B.voiceNum=le,ae=Y;for(var $=0;$<B.lines.length;$++)if(B.lines[$].staff&&(B.lines[$].staff[fe]===void 0||B.lines[$].staff[fe].voices[le]===void 0||!w(B.lines[$].staff[fe].voices[le])))return B.lineNum=$,!!(!B.lines[$].staff[fe]||B.lines[$].staff[fe].voices[le]);return B.lineNum=$,!1},this.addMetaText=function(fe,le,Y){B.metaText[fe]===void 0?(B.metaText[fe]=le,B.metaTextInfo[fe]=Y):(typeof B.metaText[fe]=="string"&&typeof le=="string"?B.metaText[fe]+=`
142
+ `+le:(B.metaText[fe]==="string"&&(B.metaText[fe]=[{text:B.metaText[fe]}]),typeof le=="string"&&(le=[{text:le}]),B.metaText[fe]=B.metaText[fe].concat(le)),B.metaTextInfo[fe].endChar=Y.endChar)},this.addMetaTextArray=function(fe,le,Y){B.metaText[fe]===void 0?(B.metaText[fe]=[le],B.metaTextInfo[fe]=Y):(B.metaText[fe].push(le),B.metaTextInfo[fe].endChar=Y.endChar)},this.addMetaTextObj=function(fe,le,Y){B.metaText[fe]=le,B.metaTextInfo[fe]=Y}};function n(B){if(!B||typeof B=="string")return!1;for(var ie=0;ie<B.length;ie++)if(typeof B[ie]!="string")return!1;return!0}function a(B){n(B.metaText.notes)&&(B.metaText.notes=B.metaText.notes.join(`
143
+ `)),n(B.metaText.history)&&(B.metaText.history=B.metaText.history.join(`
144
+ `))}function o(B){for(var ie=!1,he=[],ae=0;ae<B.lines.length;ae++){var fe=B.lines[ae];if(fe.staff)for(var le=0;le<fe.staff.length;le++){for(var Y=fe.staff[le],$=[],ne=0;ne<Y.voices.length;ne++){var we=Y.voices[ne];$.push({hasOverlay:!1,voice:[],snip:[]}),he[ae]=0;for(var ye=0,F=!1,H=-1,W=0;W<we.length;W++){var _e=we[W];if(_e.el_type==="overlay"&&!F){ie=!0,F=!0,H=W,$[ne].hasOverlay=!0;for(var Te=0;Te<ae;Te++)he[Te]&&B.lines[Te].staff&&Y.voices.length>=B.lines[Te].staff[0].voices.length&&B.lines[Te].staff[0].voices.push([{el_type:"note",duration:he[Te],rest:{type:"invisible"},startChar:_e.startChar,endChar:_e.endChar}])}else _e.el_type==="bar"?(F?(F=!1,$[ne].snip.push({start:H,len:W-H}),$[ne].voice.push(_e)):(ye>0&&$[ne].voice.push({el_type:"note",duration:ye,rest:{type:"invisible"},startChar:_e.startChar,endChar:_e.endChar}),$[ne].voice.push(_e)),ye=0):_e.el_type==="note"?F?$[ne].voice.push(_e):(ye+=_e.duration,he[ae]+=_e.duration):(_e.el_type==="scale"||_e.el_type==="stem"||_e.el_type==="overlay"||_e.el_type==="style"||_e.el_type==="transpose"||_e.el_type==="color")&&$[ne].voice.push(_e)}$[ne].hasOverlay&&$[ne].snip.length===0&&$[ne].snip.push({start:H,len:we.length-H})}for(ne=0;ne<$.length;ne++){var Re=$[ne];if(Re.hasOverlay){Re.voice.splice(0,0,{el_type:"stem",direction:"down"}),Y.voices.push(Re.voice);for(var Ie=Re.snip.length-1;Ie>=0;Ie--){var st=Re.snip[Ie];Y.voices[ne].splice(st.start,st.len),Y.voices[ne].splice(st.start+1,0,{el_type:"stem",direction:"auto"});var wt=l(Y.voices[ne],st.start);Y.voices[ne].splice(wt,0,{el_type:"stem",direction:"up"})}for(Ie=0;Ie<Y.voices[Y.voices.length-1].length;Ie++){Y.voices[Y.voices.length-1][Ie]=Object.assign({},Y.voices[Y.voices.length-1][Ie]);var Ze=Y.voices[Y.voices.length-1][Ie];Ze.el_type==="bar"&&Ze.startEnding&&delete Ze.startEnding,Ze.el_type==="bar"&&Ze.endEnding&&delete Ze.endEnding}}}}}return ie}function l(B,ie){for(var he=ie-1;he>0&&B[he].el_type!=="bar";he--);return he}function h(B){for(var ie=!0,he=0;he<B.length;he++){var ae=B[he];if(ae.staff){for(var fe=0;fe<ae.staff.length;fe++){var le=ae.staff[fe];if(le.title){for(var Y=!1,$=0;$<le.title.length;$++)le.title[$]?(le.title[$]=ie?le.title[$].name:le.title[$].subname,le.title[$]?Y=!0:le.title[$]=""):le.title[$]="";Y||delete le.title}}ie=!1}}}function f(B,ie,he,ae){ae[ie]||(ae[ie]=[]),ae[ie][he]||(ae[ie][he]=[]);for(var fe,le=function(Ie,st,wt){if(ae[ie][he][wt]===void 0){for(fe=0;fe<ae[ie][he].length;fe++)if(ae[ie][he][fe]!==void 0){wt=fe;break}if(ae[ie][he][wt]===void 0){var Ze=wt*100+1;Ie.endSlur.forEach(function(et){Ze===et&&--Ze}),ae[ie][he][wt]=[Ze]}}for(var dt,bt=0;bt<st;bt++)dt=ae[ie][he][wt].pop(),Ie.endSlur.push(dt);return ae[ie][he][wt].length===0&&delete ae[ie][he][wt],dt},Y=function(Ie,st,wt,Ze){Ie.startSlur=[],ae[ie][he][wt]===void 0&&(ae[ie][he][wt]=[]);for(var dt=wt*100+1,bt=0;bt<st;bt++)Ze&&(Ze.forEach(function(et){dt===et&&++dt}),Ze.forEach(function(et){dt===et&&++dt}),Ze.forEach(function(et){dt===et&&++dt})),ae[ie][he][wt].forEach(function(et){dt===et&&++dt}),ae[ie][he][wt].forEach(function(et){dt===et&&++dt}),ae[ie][he][wt].push(dt),Ie.startSlur.push({label:dt}),Ie.dottedSlur&&(Ie.startSlur[Ie.startSlur.length-1].style="dotted",delete Ie.dottedSlur),dt++},$=0;$<B.length;$++){var ne=B[$];if(ne.el_type==="note"){if(ne.gracenotes)for(var we=0;we<ne.gracenotes.length;we++){if(ne.gracenotes[we].endSlur){var ye=ne.gracenotes[we].endSlur;ne.gracenotes[we].endSlur=[];for(var F=0;F<ye;F++)le(ne.gracenotes[we],1,20)}ne.gracenotes[we].startSlur&&(fe=ne.gracenotes[we].startSlur,Y(ne.gracenotes[we],fe,20))}if(ne.endSlur&&(fe=ne.endSlur,ne.endSlur=[],le(ne,fe,0)),ne.startSlur&&(fe=ne.startSlur,Y(ne,fe,0)),ne.pitches){for(var H=[],W=0;W<ne.pitches.length;W++)if(ne.pitches[W].endSlur){var _e=ne.pitches[W].endSlur;ne.pitches[W].endSlur=[];for(var Te=0;Te<_e;Te++){var Re=le(ne.pitches[W],1,W+1);H.push(Re)}}for(W=0;W<ne.pitches.length;W++)ne.pitches[W].startSlur&&(fe=ne.pitches[W].startSlur,Y(ne.pitches[W],fe,W+1,H));ne.gracenotes&&ne.pitches[0].endSlur&&ne.pitches[0].endSlur[0]===100&&ne.pitches[0].startSlur&&(ne.gracenotes[0].endSlur?ne.gracenotes[0].endSlur.push(ne.pitches[0].startSlur[0].label):ne.gracenotes[0].endSlur=[ne.pitches[0].startSlur[0].label],ne.pitches[0].endSlur.length===1?delete ne.pitches[0].endSlur:ne.pitches[0].endSlur[0]===100?ne.pitches[0].endSlur.shift():ne.pitches[0].endSlur[ne.pitches[0].endSlur.length-1]===100&&ne.pitches[0].endSlur.pop(),ae[ie][he][1].length===1?delete ae[ie][he][1]:ae[ie][he][1].pop())}}}}function b(B,ie){for(i=0;i<B.length;i++)if(B[i].staff!==void 0)for(s=0;s<B[i].staff.length;s++){var he=[];for(v=0;v<B[i].staff[s].voices.length;v++)for(var ae=B[i].staff[s].voices[v],fe=0,le=0;le<ae.length;le++)if(ae[le].el_type==="bar"){if(fe++,fe>=ie&&le<ae.length-1){var Y=M(B,i);if(!Y){var $=JSON.parse(JSON.stringify(B[i]));B.push(Object.assign({},$)),Y=B[B.length-1];for(var ne=0;ne<Y.staff.length;ne++)for(var we=0;we<Y.staff[ne].voices.length;we++)Y.staff[ne].voices[we]=[]}var ye=le+1,F=B[i].staff[s].voices[v].slice(ye);return B[i].staff[s].voices[v]=B[i].staff[s].voices[v].slice(0,ye),Y.staff[s].voices[v]=he.concat(F.concat(Y.staff[s].voices[v])),!0}}else ae[le].duration||he.push(ae[le])}return!1}function S(B,ie){for(;ie>=0;){if(B[ie].staff)return B[ie];ie--}return null}function M(B,ie){for(ie++;B.length>ie;){if(B[ie].staff)return B[ie];ie++}return null}function C(B){if(!B.lines[B.lineNum]||!B.lines[B.lineNum].staff||!B.lines[B.lineNum].staff[B.staffNum])return null;var ie=B.lines[B.lineNum].staff[B.staffNum].voices[B.voiceNum];if(!ie)return null;for(var he=ie.length-1;he>=0;he--){var ae=ie[he];if(ae.el_type==="note")return ae}return null}function y(B){return B.duration?B.duration:0}function g(B){B.potentialStartBeam&&B.potentialEndBeam&&(B.potentialStartBeam.startBeam=!0,B.potentialEndBeam.endBeam=!0),delete B.potentialStartBeam,delete B.potentialEndBeam}function w(B){for(var ie=0;ie<B.length;ie++)if(B[ie].el_type==="note"||B[ie].el_type==="bar")return!0;return!1}function p(B){for(var ie=0;ie<B.length;ie++)if(B[ie].el_type==="note"&&(B[ie].rest===void 0||B[ie].chord!==void 0))return!0;return!1}function E(B,ie){B.vskipPending&&(ie.vskip=B.vskipPending,delete B.vskipPending),B.lines.push(ie)}function N(B,ie,he,ae,fe){var le=ie.lines[ie.lineNum].staff[ie.staffNum];if(he.pitches!==void 0){var Y=le.workingClef.verticalPos;he.pitches.forEach(function(ne){ne.verticalPos=ne.pitch-Y})}if(he.gracenotes!==void 0){var $=le.workingClef.verticalPos;he.gracenotes.forEach(function(ne){ne.verticalPos=ne.pitch-$})}le.voices.length<=ie.voiceNum&&(ae[fe]||(ae[fe]={}),U(B,ie,ae[fe])),le.voices[ie.voiceNum].push(he)}function I(B,ie){ie.potentialStartBeam.startBeam=!0,B.endBeam=!0,delete ie.potentialStartBeam,delete ie.potentialEndBeam}function O(B){B.potentialStartBeam!==void 0&&B.potentialEndBeam!==void 0&&(B.potentialStartBeam.startBeam=!0,B.potentialEndBeam.endBeam=!0),delete B.potentialStartBeam,delete B.potentialEndBeam}function V(B,ie,he){if(B.runningFonts[ie]){for(var ae=!1,fe=Object.keys(he),le=0;le<fe.length;le++)B.runningFonts[ie][fe[le]]!==he[fe[le]]&&(ae=!0);ae&&(B.lines[B.lineNum].staff[B.staffNum][ie]=he)}B.runningFonts[ie]=he}function U(B,ie,he){var ae=ie.lines[ie.lineNum].staff[ie.staffNum];if(ae.voices[ie.voiceNum]=[],ae.title||(ae.title=[]),ae.title[ie.voiceNum]={name:he.name,subname:he.subname},he.style&&B.appendElement("style",null,null,{head:he.style}),he.stem)B.appendElement("stem",null,null,{direction:he.stem});else if(ie.voiceNum>0){if(ae.voices[0]!==void 0){for(var fe=!1,le=0;le<ae.voices[0].length;le++)ae.voices[0].el_type==="stem"&&(fe=!0);if(!fe){var Y={el_type:"stem",direction:"up"};ae.voices[0].splice(0,0,Y)}}B.appendElement("stem",null,null,{direction:"down"})}he.scale&&B.appendElement("scale",null,null,{size:he.scale}),he.color&&B.appendElement("color",null,null,{color:he.color})}function D(B,ie,he){he.key&&he.key.impliedNaturals&&(he.key.accidentals=he.key.accidentals.concat(he.key.impliedNaturals),delete he.key.impliedNaturals),ie.lines[ie.lineNum].staff[ie.staffNum]={voices:[],clef:he.clef,key:he.key,workingClef:he.clef};var ae=ie.lines[ie.lineNum].staff[ie.staffNum];he.stafflines!==void 0&&(ae.clef.stafflines=he.stafflines,ae.workingClef.stafflines=he.stafflines),he.staffscale&&(ae.staffscale=he.staffscale),he.annotationfont&&V(ie,"annotationfont",he.annotationfont),he.gchordfont&&V(ie,"gchordfont",he.gchordfont),he.tripletfont&&V(ie,"tripletfont",he.tripletfont),he.vocalfont&&V(ie,"vocalfont",he.vocalfont),he.bracket&&(ae.bracket=he.bracket),he.brace&&(ae.brace=he.brace),he.connectBarLines&&(ae.connectBarLines=he.connectBarLines),he.barNumber&&(ae.barNumber=he.barNumber),U(B,ie,he),he.part&&B.appendElement("part",he.part.startChar,he.part.endChar,{title:he.part.title}),he.meter!==void 0&&(ae.meter=he.meter),ie.vskipPending&&(ie.lines[ie.lineNum].vskip=ie.vskipPending,delete ie.vskipPending)}function me(B,ie,he){ie.lines[ie.lineNum]={staff:[]},D(B,ie,he)}return Hu=t,Hu}var Vu,Hv;function _y(){if(Hv)return Vu;Hv=1;var e=Ds(),t=D1(),n=jT(),a=QT(),o=ZT(),l=py(),h=my(),f=rP(),b=function(){var S=new h,M=new f(S),C,y="",g="";this.getTune=function(){var le={formatting:S.formatting,lines:S.lines,media:S.media,metaText:S.metaText,metaTextInfo:S.metaTextInfo,version:S.version,addElementToEvents:S.addElementToEvents,addUsefulCallbackInfo:S.addUsefulCallbackInfo,getTotalTime:S.getTotalTime,getTotalBeats:S.getTotalBeats,getBarLength:S.getBarLength,getBeatLength:S.getBeatLength,getBeatsPerMeasure:S.getBeatsPerMeasure,getBpm:S.getBpm,getMeter:S.getMeter,getMeterFraction:S.getMeterFraction,getPickupLength:S.getPickupLength,getKeySignature:S.getKeySignature,getElementFromChar:S.getElementFromChar,makeVoicesArray:S.makeVoicesArray,millisecondsPerMeasure:S.millisecondsPerMeasure,setupEvents:S.setupEvents,setTiming:S.setTiming,setUpAudio:S.setUpAudio,deline:S.deline,findSelectableElement:S.findSelectableElement,getSelectableArray:S.getSelectableArray};return S.lineBreaks&&(le.lineBreaks=S.lineBreaks),S.visualTranspose&&(le.visualTranspose=S.visualTranspose),le};function w(le,Y,$){le.positioning||(le.positioning={}),le.positioning[Y]=$}function p(le,Y,$){le.fonts||(le.fonts={}),le.fonts[Y]=$}var E={reset:function(){for(var le in this)this.hasOwnProperty(le)&&typeof this[le]!="function"&&delete this[le];this.iChar=0,this.key={accidentals:[],root:"none",acc:"",mode:""},this.meter=null,this.origMeter=null,this.hasMainTitle=!1,this.default_length=.125,this.clef={type:"treble",verticalPos:0},this.octave=0,this.next_note_duration=0,this.start_new_line=!0,this.is_in_header=!0,this.partForNextLine={},this.tempoForNextLine=[],this.havent_set_length=!0,this.voices={},this.staves=[],this.macros={},this.currBarNumber=1,this.barCounter={},this.ignoredDecorations=[],this.score_is_present=!1,this.inEnding=!1,this.inTie=[],this.inTieChord={},this.vocalPosition="auto",this.dynamicPosition="auto",this.chordPosition="auto",this.ornamentPosition="auto",this.volumePosition="auto",this.openSlurs=[],this.freegchord=!1,this.endingHoldOver={}},differentFont:function(le,Y){return this[le].decoration!==Y[le].decoration||this[le].face!==Y[le].face||this[le].size!==Y[le].size||this[le].style!==Y[le].style||this[le].weight!==Y[le].weight},addFormattingOptions:function(le,Y,$){$==="note"?(this.vocalPosition!=="auto"&&w(le,"vocalPosition",this.vocalPosition),this.dynamicPosition!=="auto"&&w(le,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&w(le,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&w(le,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&w(le,"volumePosition",this.volumePosition),this.differentFont("annotationfont",Y)&&p(le,"annotationfont",this.annotationfont),this.differentFont("gchordfont",Y)&&p(le,"gchordfont",this.gchordfont),this.differentFont("vocalfont",Y)&&p(le,"vocalfont",this.vocalfont),this.differentFont("tripletfont",Y)&&p(le,"tripletfont",this.tripletfont)):$==="bar"&&(this.dynamicPosition!=="auto"&&w(le,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&w(le,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&w(le,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&w(le,"volumePosition",this.volumePosition),this.differentFont("measurefont",Y)&&p(le,"measurefont",this.measurefont),this.differentFont("repeatfont",Y)&&p(le,"repeatfont",this.repeatfont))},duplicateStartEndingHoldOvers:function(){this.endingHoldOver={inTie:[],inTieChord:{}};for(var le=0;le<this.inTie.length;le++)if(this.endingHoldOver.inTie.push([]),this.inTie[le])for(var Y=0;Y<this.inTie[le].length;Y++)this.endingHoldOver.inTie[le].push(this.inTie[le][Y]);for(var $ in this.inTieChord)this.inTieChord.hasOwnProperty($)&&(this.endingHoldOver.inTieChord[$]=this.inTieChord[$])},restoreStartEndingHoldOvers:function(){if(this.endingHoldOver.inTie){this.inTie=[],this.inTieChord={};for(var le=0;le<this.endingHoldOver.inTie.length;le++){this.inTie.push([]);for(var Y=0;Y<this.endingHoldOver.inTie[le].length;Y++)this.inTie[le].push(this.endingHoldOver.inTie[le][Y])}for(var $ in this.endingHoldOver.inTieChord)this.endingHoldOver.inTieChord.hasOwnProperty($)&&(this.inTieChord[$]=this.endingHoldOver.inTieChord[$])}}},N=function(le){E.warnings||(E.warnings=[]),E.warnings.push(le)},I=function(le){E.warningObjects||(E.warningObjects=[]),E.warningObjects.push(le)},O=function(le){var Y=le.replace(/\x12/g," ");return Y=Y.replace(/&/g,"&amp;"),Y=Y.replace(/</g,"&lt;"),Y.replace(/>/g,"&gt;")},V=function(le,Y,$){Y||(Y=" ");var ne=Y[$];(ne===" "||!ne)&&(ne="SPACE");var we=O(Y.substring($-64,$))+'<span style="text-decoration:underline;font-size:1.3em;font-weight:bold;">'+ne+"</span>"+O(Y.substring($+1).substring(0,64));N("Music Line:"+C.lineIndex+":"+($+1)+": "+le+": "+we),I({message:le,line:Y,startChar:E.iChar+$,column:$})},U,D;this.getWarnings=function(){return E.warnings},this.getWarningObjects=function(){return E.warningObjects};var me=function(le,Y){if(Y.indexOf("")>=0){y+=Y;return}if(Y=y+Y,y="",!le){V("Can't add words before the first line of music",le,0);return}Y=e.strip(Y),Y[Y.length-1]!=="-"&&(Y=Y+" ");for(var $=[],ne=0,we=!1,ye=function(W){var _e=e.strip(Y.substring(ne,W));if(_e=_e.replace(/\\([-_*|~])/g,"$1"),ne=W+1,_e.length>0){we&&(_e=_e.replace(/~/g," "));var Te=Y[W];return Te!=="_"&&Te!=="-"&&(Te=" "),$.push({syllable:C.translateString(_e),divider:Te}),we=!1,!0}return!1},F=!1,H=0;H<Y.length;H++){switch(Y[H]){case" ":case"":ye(H);break;case"-":!F&&!ye(H)&&$.length>0&&(e.last($).divider="-",$.push({skip:!0,to:"next"}));break;case"_":F||(ye(H),$.push({skip:!0,to:"slur"}));break;case"*":F||(ye(H),$.push({skip:!0,to:"next"}));break;case"|":F||(ye(H),$.push({skip:!0,to:"bar"}));break;case"~":F||(we=!0);break}F=Y[H]==="\\"}le.forEach(function(W){if($.length!==0){if($[0].skip){switch($[0].to){case"next":W.el_type==="note"&&W.pitches!==null&&$.shift();break;case"slur":W.el_type==="note"&&W.pitches!==null&&$.shift();break;case"bar":W.el_type==="bar"&&$.shift();break}W.el_type!=="bar"&&(W.lyric===void 0?W.lyric=[{syllable:"",divider:" "}]:W.lyric.push({syllable:"",divider:" "}))}else if(W.el_type==="note"&&W.rest===void 0){var _e=$.shift();_e.syllable&&(_e.syllable=_e.syllable.replace(/ +/g," ")),W.lyric===void 0?W.lyric=[_e]:W.lyric.push(_e)}}})},B=function(le,Y){if(Y.indexOf("")>=0){g+=Y;return}if(Y=g+Y,g="",!le){V("Can't add symbols before the first line of music",le,0);return}Y=e.strip(Y),Y[Y.length-1]!=="-"&&(Y=Y+" ");for(var $=[],ne=0,we=!1,ye=function(H){var W=e.strip(Y.substring(ne,H));if(ne=H+1,W.length>0){we&&(W=W.replace(/~/g," "));var _e=Y[H];return _e!=="_"&&_e!=="-"&&(_e=" "),$.push({syllable:C.translateString(W),divider:_e}),we=!1,!0}return!1},F=0;F<Y.length;F++)switch(Y[F]){case" ":case"":ye(F);break;case"-":!ye(F)&&$.length>0&&(e.last($).divider="-",$.push({skip:!0,to:"next"}));break;case"_":ye(F),$.push({skip:!0,to:"slur"});break;case"*":ye(F),$.push({skip:!0,to:"next"});break;case"|":ye(F),$.push({skip:!0,to:"bar"});break;case"~":we=!0;break}le.forEach(function(H){if($.length!==0){if($[0].skip)switch($[0].to){case"next":H.el_type==="note"&&H.pitches!==null&&$.shift();break;case"slur":H.el_type==="note"&&H.pitches!==null&&$.shift();break;case"bar":H.el_type==="bar"&&$.shift();break}else if(H.el_type==="note"&&H.rest===void 0){var W=$.shift();H.lyric===void 0?H.lyric=[W]:H.lyric.push(W)}}})},ie=function(le){if(e.startsWith(le,"%%")){var Y=t.addDirective(le.substring(2));Y&&V(Y,le,2);return}var $=le.indexOf("%");if($>=0&&(le=le.substring(0,$)),le=le.replace(/\s+$/,""),le.length!==0){if(y){me(M.getCurrentVoice(),le.substring(2));return}if(g){B(M.getCurrentVoice(),le.substring(2));return}if(le.length<2||le[1]!==":"||D.lineContinuation){D.parseMusic(le);return}var ne=U.parseHeader(le);ne.regular&&D.parseMusic(le),ne.newline&&D.startNewLine(),ne.words&&me(M.getCurrentVoice(),le.substring(2)),ne.symbols&&B(M.getCurrentVoice(),le.substring(2))}};function he(le,Y){le.push({el_type:"hint"});for(var $=0;$<Y.length;$++){var ne=Y[$],we=Object.assign({},ne);if(le.push(we),ne.el_type==="bar")return}}function ae(le,Y){for(var $=0;$<le.length;$++){var ne=le[$],we=Y[$];if(we)for(var ye=0;ye<we.voices.length;ye++){var F=we.voices[ye],H=ne.voices[ye];H&&he(H,F)}}}function fe(){for(var le=0;le<S.lines.length;le++){var Y=S.lines[le].staff;if(Y){for(var $=le+1;$<S.lines.length&&S.lines[$].staff===void 0;)$++;if($<S.lines.length){var ne=S.lines[$].staff;ae(Y,ne)}}}}this.parse=function(le,Y,$){Y||(Y={}),$||($=0),S.reset(),le=le.replace(/\r\n?/g,`
145
+ `)+`
146
+ `;var ne=le.split(`
147
+ \\`);if(ne.length>1){for(var we=1;we<ne.length;we++)for(;ne[we].length>0&&ne[we][0]!==`
148
+ `;)ne[we]=ne[we].substr(1),ne[we-1]+=" ";le=ne.join(" ")}le=le.replace(/\\([ \t]*)(%.*)*\n/g,function(Re,Ie,st){var wt=st?Array(st.length+1).join(" "):"";return Ie+""+wt+`
149
+ `});var ye=le.split(`
150
+ `);e.last(ye).length===0&&ye.pop(),C=new o(ye,E),U=new n(C,V,E,S,M),D=new a(C,V,E,S,M,U),Y.print&&(S.media="print"),E.reset(),E.iChar=$,Y.visualTranspose?(E.globalTranspose=parseInt(Y.visualTranspose),E.globalTranspose===0?E.globalTranspose=void 0:M.setVisualTranspose(Y.visualTranspose)):E.globalTranspose=void 0,Y.lineBreaks&&(E.lineBreaks=Y.lineBreaks),U.reset(C,V,E,S);try{Y.format&&t.globalFormatting(Y.format);for(var F=C.nextLine();F;){if(Y.header_only&&E.is_in_header===!1||Y.stop_on_warning&&E.warnings)throw"normal_abort";var H=E.is_in_header;ie(F),H&&!E.is_in_header&&(M.setRunningFont("annotationfont",E.annotationfont),M.setRunningFont("gchordfont",E.gchordfont),M.setRunningFont("tripletfont",E.tripletfont),M.setRunningFont("vocalfont",E.vocalfont)),F=C.nextLine()}y&&me(M.getCurrentVoice(),""),g&&B(M.getCurrentVoice(),""),E.openSlurs=M.cleanUp(E.barsperstaff,E.staffnonote,E.openSlurs)}catch(Re){if(Re!=="normal_abort")throw Re}var W=11*72,_e=8.5*72;switch(E.papersize){case"legal":W=14*72,_e=8.5*72;break;case"A4":W=11.7*72,_e=8.3*72;break}if(E.landscape){var Te=W;W=_e,_e=Te}S.formatting.pagewidth||(S.formatting.pagewidth=_e),S.formatting.pageheight||(S.formatting.pageheight=W),Y.hint_measures&&fe(),l.wrapLines(S,E.lineBreaks,E.barNumbers)}};return Vu=b,Vu}var Uu,Vv;function iP(){if(Vv)return Uu;Vv=1;var e=Ds(),t=function(n){var a="",o=n.match(/(\s*)/);n=e.strip(n);for(var l=n.split(`
151
+ X:`),h=1;h<l.length;h++)l[h]="X:"+l[h];var f=o?o[0].length:0,b=[];if(l.forEach(function(y){b.push({abc:y,startPos:f}),f+=y.length+1}),b.length>1&&!e.startsWith(b[0].abc,"X:")){var S=b.shift(),M=S.abc.split(`
152
+ `);M.forEach(function(y){e.startsWith(y,"%%")&&(a+=y+`
153
+ `)})}var C=a;return b.forEach(function(y){var g=y.abc.indexOf(`
154
+
155
+ `);g>0&&(y.abc=y.abc.substring(0,g)),y.pure=y.abc,y.abc=a+y.abc,y.title="";var w=y.pure.split("T:");w.length>1&&(w=w[1].split(`
156
+ `),y.title=e.strip(w[0]));var p=y.pure.substring(2,y.pure.indexOf(`
157
+ `));y.id=e.strip(p)}),{header:C,tunes:b}};return Uu=t,Uu}var Gu,Uv;function nP(){if(Uv)return Gu;Uv=1;function e(t,n){this.numLines=t,this.lineSpace=n,this.verticalSize=this.numLines*this.lineSpace;var a=3;this.bar={pitch:a,pitch2:n*t,height:5}}return e.prototype.bypass=function(t){var n=t.staffGroup.voices;return!!(n.length>0&&n[0].isPercussion)},e.prototype.setRelative=function(t,n,a){switch(t.type){case"bar":n.pitch=this.bar.pitch,n.pitch2=this.bar.pitch2,n.height=this.height;break;case"symbol":var o=this.bar.pitch2/2;if(t.name=="dots.dot")return a?(n.pitch=o,!1):(n.pitch=o+this.lineSpace,!0);break}return a},Gu=e,Gu}var Yu,Gv;function by(){if(Gv)return Yu;Gv=1;var e=function(n,a){this.children=[],this.beams=[],this.otherchildren=[],this.w=0,this.duplicate=!1,this.voicenumber=n,this.voicetotal=a,this.bottom=7,this.top=7,this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};return e.prototype.addChild=function(t){if(t.type==="bar"){for(var n=!0,a=0;n&&a<this.children.length;a++)this.children[a].type.indexOf("staff-extra")<0&&this.children[a].type!=="tempo"&&(n=!1);n||(this.beams.push("bar"),this.otherchildren.push("bar"))}this.children[this.children.length]=t,this.setRange(t)},e.prototype.setLimit=function(t,n){var a=n.specialY;a||(a=n),a[t]&&(this.specialY[t]?this.specialY[t]=Math.max(this.specialY[t],a[t]):this.specialY[t]=a[t])},e.prototype.adjustRange=function(t){t.bottom!==void 0&&(this.bottom=Math.min(this.bottom,t.bottom)),t.top!==void 0&&(this.top=Math.max(this.top,t.top))},e.prototype.setRange=function(t){this.adjustRange(t),this.setLimit("tempoHeightAbove",t),this.setLimit("partHeightAbove",t),this.setLimit("volumeHeightAbove",t),this.setLimit("dynamicHeightAbove",t),this.setLimit("endingHeightAbove",t),this.setLimit("chordHeightAbove",t),this.setLimit("lyricHeightAbove",t),this.setLimit("lyricHeightBelow",t),this.setLimit("chordHeightBelow",t),this.setLimit("volumeHeightBelow",t),this.setLimit("dynamicHeightBelow",t)},e.prototype.addOther=function(t){this.otherchildren.push(t),this.setRange(t)},e.prototype.addBeam=function(t){this.beams.push(t)},e.prototype.setWidth=function(t){this.w=t},Yu=e,Yu}var Wu,Yv;function B1(){if(Yv)return Wu;Yv=1;var e=function(t,n,a,o){if(t)for(var l=0;l<t.length;l++){var h=t[l],f=h.getAttribute("highlight");f||(f="fill"),h.setAttribute(f,o);var b=h.getAttribute("class");b||(b=""),b=b.replace(a,""),b=b.replace(n,""),n.length>0&&(b.length>0&&b[b.length-1]!==" "&&(b+=" "),b+=n),h.setAttribute("class",b)}};return Wu=e,Wu}var $u,Wv;function yy(){if(Wv)return $u;Wv=1;var e=B1(),t=function(n,a){n===void 0&&(n="abcjs-note_selected"),a===void 0&&(a="#ff0000"),e(this.elemset,n,"",a)};return $u=t,$u}var Ku,$v;function wy(){if($v)return Ku;$v=1;var e=B1(),t=function(n,a){n===void 0&&(n="abcjs-note_selected"),a===void 0&&(a="#000000"),e(this.elemset,"",n,a)};return Ku=t,Ku}var ju,Kv;function xo(){if(Kv)return ju;Kv=1;var e=yy(),t=wy(),n=function(o,l,h,f,b,S){S||(S={}),this.tuneNumber=b,this.abcelem=o,this.duration=l,this.durationClass=S.durationClassOveride?S.durationClassOveride:this.duration,this.minspacing=h||0,this.x=0,this.children=[],this.heads=[],this.extra=[],this.extraw=0,this.w=0,this.right=[],this.invisible=!1,this.bottom=void 0,this.top=void 0,this.type=f,this.fixed={w:0,t:void 0,b:void 0},this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};return n.prototype.getFixedCoords=function(){return{x:this.x,w:this.fixed.w,t:this.fixed.t,b:this.fixed.b}},n.prototype.addExtra=function(a){this.fixed.w=Math.max(this.fixed.w,a.dx+a.w),this.fixed.t===void 0?this.fixed.t=a.top:this.fixed.t=Math.max(this.fixed.t,a.top),this.fixed.b===void 0?this.fixed.b=a.bottom:this.fixed.b=Math.min(this.fixed.b,a.bottom),a.dx<this.extraw&&(this.extraw=a.dx),this.extra[this.extra.length]=a,this._addChild(a)},n.prototype.addHead=function(a){a.dx<this.extraw&&(this.extraw=a.dx),this.heads[this.heads.length]=a,this.addRight(a)},n.prototype.addRight=function(a){this.fixed.w=Math.max(this.fixed.w,a.dx+a.w),a.top!==void 0&&(this.fixed.t===void 0?this.fixed.t=a.top:this.fixed.t=Math.max(this.fixed.t,a.top)),a.bottom!==void 0&&(this.fixed.b===void 0?this.fixed.b=a.bottom:this.fixed.b=Math.min(this.fixed.b,a.bottom)),a.dx+a.w>this.w&&(this.w=a.dx+a.w),this.right[this.right.length]=a,this._addChild(a)},n.prototype.addFixed=function(a){this._addChild(a)},n.prototype.addFixedX=function(a){this._addChild(a)},n.prototype.addCentered=function(a){var o=a.w/2;-o<this.extraw&&(this.extraw=-o),this.extra[this.extra.length]=a,a.dx+o>this.w&&(this.w=a.dx+o),this.right[this.right.length]=a,this._addChild(a)},n.prototype.setLimit=function(a,o){o[a]&&(this.specialY[a]?this.specialY[a]=Math.max(this.specialY[a],o[a]):this.specialY[a]=o[a])},n.prototype._addChild=function(a){var o=!0;this.abcelem.el_type=="clef"&&a.type=="barNumber"&&(o=!1),a.parent=this,this.children[this.children.length]=a,o&&this.pushTop(a.top),this.pushBottom(a.bottom),this.setLimit("tempoHeightAbove",a),this.setLimit("partHeightAbove",a),this.setLimit("volumeHeightAbove",a),this.setLimit("dynamicHeightAbove",a),this.setLimit("endingHeightAbove",a),this.setLimit("chordHeightAbove",a),this.setLimit("lyricHeightAbove",a),this.setLimit("lyricHeightBelow",a),this.setLimit("chordHeightBelow",a),this.setLimit("volumeHeightBelow",a),this.setLimit("dynamicHeightBelow",a)},n.prototype.pushTop=function(a){a!==void 0&&(this.top===void 0?this.top=a:this.top=Math.max(a,this.top))},n.prototype.pushBottom=function(a){a!==void 0&&(this.bottom===void 0?this.bottom=a:this.bottom=Math.min(a,this.bottom))},n.prototype.setX=function(a){this.x=a;for(var o=0;o<this.children.length;o++)this.children[o].setX(a)},n.prototype.center=function(a,o){var l=(o.x-a.x)/2+a.x;this.x=l-this.w/2;for(var h=0;h<this.children.length;h++)this.children[h].setX(this.x)},n.prototype.setHint=function(){this.hint=!0},n.prototype.highlight=function(a,o){e.bind(this)(a,o)},n.prototype.unhighlight=function(a,o){t.bind(this)(a,o)},ju=n,ju}var Xu,jv;function ts(){if(jv)return Xu;jv=1;var e=function(n,a,o,l,h){switch(h=h||{},this.x=0,this.c=n,this.dx=a,this.w=o,this.pitch=l,this.scalex=h.scalex||1,this.scaley=h.scaley||1,this.type=h.type||"symbol",this.pitch2=h.pitch2,this.linewidth=h.linewidth,this.klass=h.klass,this.anchor=h.anchor?h.anchor:"middle",this.top=l,this.pitch2!==void 0&&this.pitch2>this.top&&(this.top=this.pitch2),this.bottom=l,this.pitch2!==void 0&&this.pitch2<this.bottom&&(this.bottom=this.pitch2),h.thickness&&(this.top+=h.thickness/2,this.bottom-=h.thickness/2),h.stemHeight&&(h.stemHeight>0?this.top+=h.stemHeight:this.bottom+=h.stemHeight),h.dim&&(this.dim=h.dim),h.position&&(this.position=h.position),this.height=h.height?h.height:4,h.top&&(this.top=h.top),h.bottom&&(this.bottom=h.bottom),h.name?this.name=h.name:this.c?this.name=this.c:this.name=this.type,h.realWidth?this.realWidth=h.realWidth:this.realWidth=this.w,this.centerVertically=!1,this.type){case"debug":this.chordHeightAbove=this.height;break;case"lyric":h.position&&h.position==="below"?this.lyricHeightBelow=this.height:this.lyricHeightAbove=this.height;break;case"chord":h.position&&h.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height;break;case"text":this.pitch===void 0?h.position&&h.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height:this.centerVertically=!0;break;case"part":this.partHeightAbove=this.height;break}};return e.prototype.getChordDim=function(){if(this.type==="debug"||!this.chordHeightAbove&&!this.chordHeightBelow)return null;var t=0,n=this.type==="chord"?this.realWidth/2:0,a=this.x-n-t,o=a+this.realWidth+t;return{left:a,right:o}},e.prototype.invertLane=function(t){this.lane===void 0&&(this.lane=0),this.lane=t-this.lane-1},e.prototype.putChordInLane=function(t){this.lane=t,this.chordHeightAbove?this.chordHeightAbove=this.height*1.25*this.lane:this.chordHeightBelow=this.height*1.25*this.lane},e.prototype.getLane=function(){return this.lane===void 0?0:this.lane},e.prototype.setX=function(t){this.x=t+this.dx},Xu=e,Xu}var Qu,Xv;function sP(){if(Xv)return Qu;Xv=1;var e=xo(),t=ts();function n(p){return p!=null&&p.constructor===Object}function a(p,E){for(var N in E)E.hasOwnProperty(N)&&(Array.isArray(E[N])||n(E[N])||(p[N]=E[N]))}function o(p){var E=new e("",0,0,"",0);return a(E,p),E.top=0,E.bottom=-1,p.abcelem&&(E.abcelem={},a(E.abcelem,p.abcelem),E.abcelem.el_type==="note"&&(E.abcelem.el_type="tabNumber")),p.cloned=E,E}function l(p,E){var N=o(p);if(E)for(var I=p.children,O=!0,V=0;V<I.length;V++){var U=I[V],D=new t("",0,0,0,"");a(D,U),O=E.tablature.setRelative(U,D,O),N.children.push(D)}return N}function h(p,E,N){var I="tab.tiny",O=7.5;p.isTabBig&&(I="tab.big",O=10);var V={el_type:"tab",icon:I,Ypos:O};if(O+=p.tabSymbolOffset,!p.hideTabSymbol){var U=new e(V,0,0,"symbol",0);U.x=E;var D=new t(I,0,0,7.5,"tab");D.x=N,U.children.push(D),U.abcelem.el_type=="tab"&&(D.pitch=O)}return U}function f(p){if(p.extra)for(var E=0;E<p.extra.length;E++){var N=p.extra[E];if(N.type=="lyric")return{bottom:N.bottom,height:N.height}}return null}function b(){this.accidentals=null}function S(p){for(var E=0,N=0;N<p.length;N++)p[N].tabNameInfos||E++;return E}function M(p,E,N,I,O){var V=I.num;I.note.quarter!=null&&(V=V.toString(),V+=I.note.quarter);var U=p.semantics.stringToPitch(I.str);N.notes.push({num:V,str:I.str,pitch:I.note.emit()});var D={type:"tabNumber"},me=new t(V,0,0,U+.3,D);return me.x=E,me.isGrace=O,me.isAltered=I.note.isAltered,me}function C(p,E){var N=0;if(p.extra){for(var I=0;I<p.extra.length;I++)if(p.extra[I].c.indexOf("noteheads")>=0){if(N===E)return p.extra[I].x+p.extra[I].w/2;N++}}return-1}function y(p){if(p.abcelem){var E=p.abcelem;if(E.rest)return E.gracenotes}return null}function g(p,E,N){var I=p.semantics.notesToNumber(E,N);if(I.error)return p.setError(I.error),I;if(I.graces&&I.notes){var O=I.notes.length-1;I.notes[O].graces=I.graces}return I}function w(p,E,N,I,O){for(var V=0;V<I.length;V++){var U={el_type:"note",startChar:N.abcelem.startChar,endChar:N.abcelem.endChar,notes:[],grace:!0},D=C(N,V),me=I[V],B=M(p,D,U,me,!0);E.children.push(B),O.push(U)}}return b.prototype.build=function(p,E,N,I,O,V,U){S(E);var D=E[O+I],me=E[U],B=null,ie=null;D.children[0].abcelem.el_type!="clef"&&V!="none"&&D.children.splice(0,0,V);for(var he=0;he<D.children.length;he++){var ae=D.children[he],fe=ae.x,le=fe;switch(ae.isClef&&(me.children.push(h(p,fe,le)),ae.abcelem.type.indexOf("-8")>=0&&(p.semantics.clefTranspose=-12),ae.abcelem.type.indexOf("+8")>=0&&(p.semantics.clefTranspose=12)),ae.type){case"staff-extra key-signature":this.accidentals=ae.abcelem.accidentals,p.semantics.accidentals=this.accidentals;break;case"bar":p.semantics.measureAccidentals={};var Y=!1;he===D.children.length-1&&(Y=!0);var $=l(ae,p);if($.abcelem.barNumber){delete $.abcelem.barNumber;for(var ne=0;ne<$.children.length;ne++)if($.children[ne].type==="barNumber"){$.children.splice(ne,1);break}}$.abcelem.lastBar=Y,me.children.push($),N.push({el_type:ae.abcelem.el_type,type:ae.abcelem.type,endChar:ae.abcelem.endChar,startChar:ae.abcelem.startChar,abselem:$});break;case"rest":var we=y(ae);if(we){if(B=g(p,null,we),B.error)return;Ie={el_type:"note",startChar:ae.abcelem.startChar,endChar:ae.abcelem.endChar,notes:[],grace:!0},w(p,ye,ae,B.graces,N)}break;case"note":var ye=o(ae);ye.x=ae.heads[0].x+ae.heads[0].w/2,ye.lyricDim=f(ae);var F=ae.abcelem.pitches,H=ae.abcelem.gracenotes;if(ye.type="tabNumber",B=g(p,F,H),B.error)return;if(B.graces){var W=B.notes.length-1;B.notes[W].graces=B.graces}ie={el_type:"note",startChar:ae.abcelem.startChar,endChar:ae.abcelem.endChar,notes:[]};for(var _e=0;_e<B.notes.length;_e++){var Te=B.notes[_e];if(Te.graces)for(var Re=0;Re<Te.graces.length;Re++){var Ie={el_type:"note",startChar:ae.abcelem.startChar,endChar:ae.abcelem.endChar,notes:[],grace:!0},st=C(ae,Re),wt=Te.graces[Re],Ze=M(p,st,Ie,wt,!0);ye.children.push(Ze),N.push(Ie)}var dt=M(p,ye.x+ae.heads[_e].dx,ie,Te,!1);ye.children.push(dt)}ie.notes.length>0&&(ie.abselem=ye,N.push(ie),me.children.push(ye));break}}},Qu=b,Qu}var Zu,Qv;function aP(){if(Qv)return Zu;Qv=1;var e=by(),t=sP(),n=Qi();function a(){return{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}}function o(p){for(var E=0,N=0;N<p.children.length;N++){var I=p.children[N];I.specialY&&I.specialY.lyricHeightBelow>E&&(E=I.specialY.lyricHeightBelow)}return E}function l(p,E,N){var I=p.semantics,O=E.controller.getTextSize,V=I.tabInfos(p),U=I.suppress(p),D=!0;if(U&&(D=!1),D){var me=O.calc(V,"tablabelfont","text instrumentname");return N.tabNameInfos={textSize:{height:me.height,width:me.width},name:V},me.height}return 0}function h(p,E){return E[p].isTabStaff?p===E.length-1?!0:!E[p+1].isTabStaff:!1}function f(p){for(var E=0,N=0;N<p.length;N++)p[N].isTabStaff||E++;return E}function b(p,E){for(var N=E;N>=0;N--)if(!p[N].isTabStaff)return N;return-1}function S(p){for(var E=0;E<p.length;E++)if(p[E].isTabStaff){var N=b(p,E);p[E].hasStaff=p[N],p[N].hasTab||(p[N].hasTab=[]),p[N].hasTab.push(p[E])}}function M(p,E){return f(p)===1&&E.voices.length>1}function C(p,E){for(var N=0,I=0,O=!0,V=0;O;){if(!E[N])return-1;if(E[N].isTabStaff||(V=E[N].voices.length),E[N].isTabStaff){if(I++,h(N,E)&&I<V)return N+1}else if(I=0,N>=p&&(N+1==E.length||!E[N+1].isTabStaff))return N+1;if(N++,N>E.length)return-1}}function y(p,E){for(var N=E;N>=0;N--)if(!p[N].isTabStaff)return p[N];return null}function g(p,E){var N=p[E],I=N.children[0].abcelem;return I.el_type==="clef"?null:E==0?"none":p[E-1].children[0]}function w(p,E,N,I){var O=new t,V={clef:{type:"TAB"}},U=p.linePitch*p.nbLines,D=N.staff;if(D){var me=D[0];if(me&&me.clef&&me.clef.stafflines==0){p.setError("No tablatures when stafflines=0");return}D.splice(D.length,0,V)}var B=N.staffGroup,ie=B.voices,he=ie[0],ae=o(he),fe=3,le=I,Y=B.staffs[le],$=U+fe-Y.bottom-ae;Y.isTabStaff&&($=Y.top);var ne={bottom:-1,isTabStaff:!0,specialY:a(),lines:p.nbLines,linePitch:p.linePitch,dy:.15,top:$},we=C(I,B.staffs);if(we!==-1){ne.parentIndex=we-1,B.staffs.splice(we,0,ne),B.height+=U+fe;var ye=y(B.staffs,we),F=1;M(B.staffs,ye)&&(F=ye.voices.length),V.voices=[];for(var H=0;H<F;H++){var W=new e(0,0);H>0&&(W.duplicate=!0);var _e=l(p,E,W)/n.STEP;_e=Math.max(_e,1),B.staffs[I].top+=1,B.height+=_e,W.staff=ne;var Te=ie.length;ie.splice(ie.length,0,W);var Re=g(ie,H+I);V.voices[H]=[],O.build(p,ie,V.voices[H],H,I,Re,Te)}S(B.staffs)}}return Zu=w,Zu}var Ju,Zv;function Sy(){if(Zv)return Ju;Zv=1;var e={__:-2,_:-1,"_/":-.5,"=":0,"":0,"^/":.5,"^":1,"^^":2},t=["C","-","D","-","E","F","-","G","-","A","-","B","c","-","d","-","e","f","-","g","-","a","-","b"];function n(o){var l=o.match(/([_^\/]*)([ABCDEFGabcdefg])(,*)('*)/);if(l&&l.length===5){var h=e[l[1]],f=t.indexOf(l[2]),b=l[4].length-l[3].length;return 48+f+h+b*12}return 0}function a(o){o=parseInt(o,10);var l=Math.floor(o/12),h=o%12,f=t[h];if(f==="-"&&(f="^"+t[h-1]),l>4)for(f=f.toLowerCase(),l-=5;l>0;)f+="'",l--;else for(;l<4;)f+=",",l++;return f}return Ju={noteToMidi:n,midiToNote:a},Ju}var eh,Jv;function xy(){if(Jv)return eh;Jv=1;var{noteToMidi:e,midiToNote:t}=Sy();function n(o,l){var h=e(o);l&&(h+=l);var f=t(h),b=!1,S=!1,M=!1,C=null,y=null,g=!1,w=0;o.startsWith("_")?(b=!0,w=-1,o[1]=="/"?(b=!1,y="v",w=0):o[1]=="_"&&(g=!0,w-=1)):o.startsWith("^")?(S=!0,w=1,o[1]=="/"?(S=!1,y="^",w=0):o[1]=="^"&&(g=!0,w+=1)):o.startsWith("=")&&(C=!0,w=0),M=b||S||y!=null,(M||C)&&(y!=null||g?f=o.slice(2):f=o.slice(1));var p=(f.match(/,/g)||[]).length,E=(f.match(/'/g)||[]).length;this.pitch=h,this.pitchAltered=0,this.name=f,this.acc=w,this.isSharp=S,this.isKeySharp=!1,this.isDouble=g,this.isAltered=M,this.isFlat=b,this.isKeyFlat=!1,this.natural=C,this.quarter=y,this.isLower=this.name==this.name.toLowerCase(),this.name=this.name[0].toUpperCase(),this.hasComma=p,this.isQuoted=E}function a(o){var l=o.name,h=new n(l);return h.pitch=o.pitch,h.hasComma=o.hasComma,h.isLower=o.isLower,h.isQuoted=o.isQuoted,h.isSharp=o.isSharp,h.isKeySharp=o.isKeySharp,h.isFlat=o.isFlat,h.isKeyFlat=o.isKeyFlat,h}return n.prototype.sameNoteAs=function(o){return o.pitch===this.pitch},n.prototype.isLowerThan=function(o){return o.pitch>this.pitch},n.prototype.checkKeyAccidentals=function(o,l){if(!(this.isAltered||this.natural)){if(l[this.name.toUpperCase()])switch(l[this.name.toUpperCase()]){case"__":this.acc=-2,this.pitchAltered=-2;return;case"_":this.acc=-1,this.pitchAltered=-1;return;case"=":this.acc=0,this.pitchAltered=0;return;case"^":this.acc=1,this.pitchAltered=1;return;case"^^":this.acc=2,this.pitchAltered=2;return}else if(o)for(var h=this.name,f=0;f<o.length;f++){var b=o[f];h==b.note.toUpperCase()&&(b.acc=="flat"&&(this.acc=-1,this.isKeyFlat=!0,this.pitchAltered=-1),b.acc=="sharp"&&(this.acc=1,this.isKeySharp=!0,this.pitchAltered=1))}}},n.prototype.getAccidentalEquiv=function(){var o=a(this);return o.isSharp||o.isKeySharp?(o=o.nextNote(),o.isFlat=!0,o.isSharp=!1,o.isKeySharp=!1):(o.isFlat||o.isKeyFlat)&&(o=o.prevNote(),o.isSharp=!0,o.isFlat=!1,o.isKeyFlat=!1),o},n.prototype.nextNote=function(){var o=t(this.pitch+1+this.pitchAltered);return new n(o)},n.prototype.prevNote=function(){var o=t(this.pitch-1+this.pitchAltered);return new n(o)},n.prototype.emitNoAccidentals=function(){var o=this.name;this.isLower&&(o=o.toLowerCase());for(var l=0;l<this.isQuoted;l++)o+="'";for(var h=0;h<this.hasComma;h++)o+=",";return o},n.prototype.emit=function(){var o=this.name;(this.isSharp||this.isKeySharp)&&(o="^"+o,this.isDouble&&(o="^"+o)),(this.isFlat||this.isKeyFlat)&&(o="_"+o,this.isDouble&&(o="_"+o)),this.quarter&&(this.quarter=="^"?o="^/"+o:o="_/"+o),this.natural&&(o="="+o);for(var l=1;l<=this.hasComma;l++)o+=",";if(this.isLower){o=o.toLowerCase();for(var h=1;h<=this.isQuoted;h++)o+="'"}return o},eh=n,eh}var th,em;function oP(){if(em)return th;em=1;var e=xy(),t=["A","B","C","D","E","F","G"];function n(a,o){var l=new e(a),h=new e(o);if(h.isLowerThan(l)){var f=l.emit(),b=h.emit();return{error:"Invalid string Instrument tuning : "+b+" string lower than "+f+" string"}}var S=[],M=t.indexOf(l.name),C=t.indexOf(h.name);if(M==-1||C==-1)return S;for(var y=!1;!y;)S.push(l.emit()),l=l.nextNote(),l.sameNoteAs(h)&&(y=!0);return S}return th=n,th}var rh,tm;function lP(){if(tm)return rh;tm=1;const{noteToMidi:e}=Sy();var t=xy(),n=oP();function a(y){var g=null,w=y.tuning;if(y.capo>0){g=[];for(var p=0;p<w.length;p++){for(var E=new t(w[p]),N=0;N<y.capo;N++)E=E.nextNote();g[p]=E.emit()}}return g}function o(y){var g=[],w=y.tuning;y.capo>0&&(w=y.capoTuning);for(var p=w.length-1,E=0;E<w.length;E++){var N=y.highestNote;E!=w.length-1&&(N=w[E+1]);var I=n(w[E],N);if(I.error)return I;g[p--]=I}return g}function l(y){var g=[];g[0]=[];for(var w=y.strings,p=1;p<w.length;p++)g[p]=w[p-1];return g}function h(y,g){for(var w=0;w<g.length-1;w++){var p=g[w],E=g[w+1];if(p.str==E.str){if(p.str==y.strings.length-1){p.num="?",E.num="?";return}E.num<p.num?(E.str++,E=b(y,E.note,E.str,y.secondPos,y.strings[E.str].length)):(p.str++,p=b(y,p.note,p.str,y.secondPos,y.strings[p.str].length)),g[w]=p,g[w+1]=E}}return null}function f(y,g){for(var w=[],p=0;p<g.length;p++)if(!g[p].endTie){var E=new t(g[p].name,y.clefTranspose);E.checkKeyAccidentals(y.accidentals,y.measureAccidentals);var N=S(y,E);w.push(N)}return h(y,w),w}function b(y,g,w,p,E){var N=y.strings;g.checkKeyAccidentals(y.accidentals,y.measureAccidentals),p&&(N=p);var I=g.emitNoAccidentals(),O=N[w].indexOf(I),V=g.acc;if(O!=-1){if(p&&(O+=E),(g.isFlat||g.acc==-1)&&O==0){var U=g.getAccidentalEquiv();w++,O=N[w].indexOf(U.emit()),V=0}return{num:O+V,str:w,note:g}}return null}function S(y,g){if(g.isAltered||g.natural){var w;g.isFlat?g.isDouble?w="__":w="_":g.isSharp?g.isDouble?w="^^":w="^":g.natural&&(w="="),y.measureAccidentals[g.name.toUpperCase()]=w}for(var p=y.stringPitches.length-1;p>=0;p--)if(g.pitch+g.pitchAltered>=y.stringPitches[p]){var E=g.pitch+g.pitchAltered-y.stringPitches[p];return g.quarter==="^"?E-=.5:g.quarter==="v"&&(E+=.5),{num:Math.round(E),str:y.stringPitches.length-1-p,note:g}}return{num:"?",str:y.stringPitches.length-1,note:g}}C.prototype.stringToPitch=function(y){var g=5.3,w=this.strings.length-1;return g+(w-y)*this.linePitch};function M(y,g){var w={num:"?",str:0,note:g};y.push(w),y.error=g.emit()+": unexpected note for instrument"}C.prototype.notesToNumber=function(y,g){var w,p,E=null,N=null;if(y&&(N=[],y.length>1?(N=f(this,y),N.error&&(E=N.error)):y[0].endTie||(w=new t(y[0].name,this.clefTranspose),w.checkKeyAccidentals(this.accidentals,this.measureAccidentals),p=S(this,w),p?N.push(p):(M(N,w),E=N.error))),E)return N;var I=null;if(g){I=[];for(var O=0;O<g.length;O++)w=new t(g[O].name,this.clefTranspose),w.checkKeyAccidentals(this.accidentals,this.measureAccidentals),p=S(this,w),p?I.push(p):(M(I,w),E=N.error)}return{notes:N,graces:I,error:E}},C.prototype.toString=function(){for(var y=[],g=0;g<this.tuning.length;g++){var w=this.tuning[g].replaceAll(",","").replaceAll("'","").toUpperCase();w[0]==="_"?w=w[1]+"b ":w[0]==="^"&&(w=w[1]+"# "),y.push(w)}return y.join("")},C.prototype.tabInfos=function(y){var g=y.params.label;if(g){var w=g.indexOf("%T"),p="";return w!=-1&&(p=this.toString(),y.capo>0&&(p+=" capo:"+y.capo),g=g.replace("%T",p)),g}return""},C.prototype.suppress=function(y){var g=y.params.suppress;return!!g};function C(y){var g=y.tuning,w=y.capo,p=y.params.highestNote;this.linePitch=y.linePitch,this.highestNote="a'",p&&(this.highestNote=p),this.measureAccidentals={},this.capo=0,w&&(this.capo=parseInt(w,10)),this.transpose=y.transpose?y.transpose:0,this.tuning=g,this.stringPitches=[];for(var E=0;E<this.tuning.length;E++){var N=e(this.tuning[E])+this.capo;this.stringPitches.push(N)}if(this.capo>0&&(this.capoTuning=a(this)),this.strings=o(this),this.strings.error){y.setError(this.strings.error),y.inError=!0;return}this.secondPos=l(this)}return rh=C,rh}var ih,rm;function cP(){if(rm)return ih;rm=1;var e=nP(),t=aP(),n=lP();a.prototype.init=function(l,h,f,b){this.tune=l,this.params=f,this.tuneNumber=h,this.inError=!1,this.abcTune=l,this.linePitch=3,this.nbLines=b.defaultTuning.length,this.isTabBig=b.isTabBig,this.tabSymbolOffset=b.tabSymbolOffset,this.capo=f.capo,this.transpose=f.visualTranspose,this.hideTabSymbol=f.hideTabSymbol,this.tablature=new e(this.nbLines,this.linePitch);var S=f.tuning;S||(S=b.defaultTuning),this.tuning=S,this.semantics=new n(this)},a.prototype.setError=function(l){l&&(this.error=l,this.inError=!0,this.tune.warnings?this.tune.warnings.push(l):this.tune.warnings=[l])},a.prototype.render=function(l,h,f){this.inError||this.tablature.bypass(h)||t(this,l,h,f)};function a(){}var o=function(){return{name:"StringTab",tablature:a}};return ih=o,ih}var nh,im;function Cy(){if(im)return nh;im=1;var e=cP(),t={violin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},fiddle:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},mandolin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},guitar:{name:"StringTab",defaultTuning:["E,","A,","D","G","B","e"],isTabBig:!0,tabSymbolOffset:0},fiveString:{name:"StringTab",defaultTuning:["C,","G,","D","A","e"],isTabBig:!1,tabSymbolOffset:-.95}},n={inited:!1,plugins:{},register:function(a){var o=a.name,l=a.tablature;this.plugins[o]=l},setError:function(a,o){a.warnings?a.warning.push(o):a.warnings=[o]},preparePlugins:function(a,o,l){this.inited||(this.register(new e),this.inited=!0);var h=null;if(l.tablature){var f=l.tablature;h=[];for(var b=0;b<f.length;b++){var S=f[b],M=S.instrument;if(M==null)return this.setError(a,"tablature 'instrument' is missing"),h;var C=t[M],y=null;if(C&&(y=this.plugins[C.name]),y){l.visualTranspose!=0&&(S.visualTranspose=l.visualTranspose),S.abcSrc=l.tablature.abcSrc;var g={classz:y,tuneNumber:o,params:S,instance:null,tabType:C};h.push(g)}else if(M==="")h.push(null);else return this.setError(a,"Undefined tablature plugin: "+M),h}}return h},layoutTablatures:function(o,l){var h=l.tablatures,f=0;if(h&&h.length>0)for(var b=h.length,S=0;S<b;++S)h[S]&&h[S].params.firstStaffOnly&&(h[S].params.suppress=!1);for(var M=0;M<l.lines.length;M++){var C=l.lines[M];if(C.staff&&f++,f>1&&h&&h.length>0)for(var b=h.length,S=0;S<b;++S)h[S].params.firstStaffOnly&&(h[S].params.suppress=!0);var y=C.staff;if(y){for(var g=y.length,w=0;w<y.length;w++)if(h[w]&&w<g){var p=h[w];p.instance==null&&(p.instance=new p.classz,p.instance.init(l,p.tuneNumber,p.params,p.tabType)),p.instance.render(o,C,w)}}}}};return nh=n,nh}var sh,nm;function ec(){if(nm)return sh;nm=1;var e=_y(),t=iP(),n=Cy(),a={};return function(){a.numberOfTunes=function(l){var h=l.split(`
158
+ X:`),f=h.length;return f===0&&(f=1),f};var o=a.TuneBook=function(l){var h=t(l);this.header=h.header,this.tunes=h.tunes};o.prototype.getTuneById=function(l){for(var h=0;h<this.tunes.length;h++)if(this.tunes[h].id===""+l)return this.tunes[h];return null},o.prototype.getTuneByTitle=function(l){for(var h=0;h<this.tunes.length;h++)if(this.tunes[h].title===l)return this.tunes[h];return null},a.parseOnly=function(l,h){for(var f=a.numberOfTunes(l),b=[],S=0;S<f;S++)b.push(1);function M(){}return a.renderEngine(M,b,l,h)},a.renderEngine=function(l,h,f,b){var S=[],M=function(O){return O&&!O.propertyIsEnumerable("length")&&typeof O=="object"&&typeof O.length=="number"};if(!(h===void 0||f===void 0)){M(h)||(h=[h]),b===void 0&&(b={});for(var C=b.startingTune?parseInt(b.startingTune,10):0,y=new o(f),g=new e,w=0;w<h.length;w++){var p=h[w];if(p==="*"||typeof p=="string"&&(p=document.getElementById(p)),p)if(C>=0&&C<y.tunes.length){g.parse(y.tunes[C].abc,b,y.tunes[C].startPos-y.header.length);var E=g.getTune();b.tablature&&(E.tablatures=n.preparePlugins(E,C,b));var N=g.getWarnings();N&&(E.warnings=N);var I=l(p,E,w,y.tunes[C].abc);S.push(I||E)}else p.innerHTML&&(p.innerHTML="");C++}return S}},a.extractMeasures=function(l){for(var h=[],f=new o(l),b=0;b<f.tunes.length;b++){for(var S=f.tunes[b],M=S.abc.split("K:"),C=M[1].split(`
159
+ `),y=M[0]+"K:"+C[0]+`
160
+ `,g=null,w=null,p=null,E=[],N=!1,I=a.parseOnly(S.abc)[0],O=I.getPickupLength()>0,V=0;V<I.lines.length;V++){var U=I.lines[V];if(U.staff)for(var D=0;D<1;D++)for(var me=U.staff[D],B=0;B<1;B++)for(var ie=me.voices[B],he=0;he<ie.length;he++){var ae=ie[he];if(p===null&&ae.startChar>=0&&(p=ae.startChar,ae.chord===void 0?w=g:w=null),ae.chord&&(g=ae),ae.el_type==="bar"){if(N){var fe=S.abc.substring(p,ae.endChar),le={abc:fe};g=w&&w.chord&&w.chord.length>0?w.chord[0].name:null,g&&(le.lastChord=g),ae.startEnding&&(le.startEnding=ae.startEnding),ae.endEnding&&(le.endEnding=ae.endEnding),E.push(le),p=null,N=!1}}else ae.el_type==="note"&&(N=!0)}}h.push({header:y,measures:E,hasPickup:O})}return h}}(),sh=a,sh}var ah,sm;function uP(){if(sm)return ah;sm=1;var e=fy(),{relativeMajor:t,transposeKey:n,relativeMode:a}=hy(),o=uy(),l;return function(){l=function(ie,he,ae){if(he==="TEST")return{keyAccidentals:e,relativeMajor:t,transposeKey:n,relativeMode:a,transposeChordName:o};ae=parseInt(ae,10);var fe=[],le;for(le=0;le<he.length;le++)fe=fe.concat(h(ie,he[le],ae));fe=fe.sort(function(ne,we){return we.start-ne.start});var Y=ie.split("");for(le=0;le<fe.length;le++){var $=fe[le];Y.splice($.start,$.end-$.start,$.note)}return Y.join("")};function h(ie,he,ae){var fe=[],le=he.getKeySignature();if(le.root==="Hp"||le.root==="HP")return fe;fe=fe.concat(f(ie,ae));for(var Y=0;Y<he.lines.length;Y++){var $=he.lines[Y].staff;if($)for(var ne=0;ne<$.length;ne++){var we=$[ne];we.clef.type!=="perc"&&(fe=fe.concat(b(ie,we.voices,we.key,ae)))}}return fe}function f(ie,he){for(var ae=[],fe=ie.split("K:"),le=fe[0].length,Y=1;Y<fe.length;Y++){var $=fe[Y],ne=$.match(/^( *)([A-G])([#b]?)(\w*)/);if(ne){var we=le+2+ne[1].length,ye=ne[2]+ne[3]+ne[4],F=w({root:ne[2],acc:ne[3],mode:ne[4]},he),H=F.root+F.acc+F.mode;ae.push({start:we,end:we+ye.length,note:H})}le+=$.length+2}return ae}function b(ie,he,ae,fe){for(var le=[],Y=w(ae,fe),$=0;$<he.length;$++)le=le.concat(C(ie,he[$],ae.root,S(ae),Y,fe));return le}function S(ie){for(var he={},ae=0;ae<ie.accidentals.length;ae++){var fe=ie.accidentals[ae];fe.acc==="flat"?he[fe.note.toUpperCase()]="_":fe.acc==="sharp"&&(he[fe.note.toUpperCase()]="^")}return he}function M(ie,he,ae){var fe=y.indexOf(ie.root)-y.indexOf(he);return he==="none"&&(fe=y.indexOf(ie.root)),fe===0?ae>2?fe+=7:ae===-12&&(fe-=7):ae>0&&fe<0?fe+=7:ae<0&&fe>0&&(fe-=7),ae>12?fe+=7:ae<-12&&(fe-=7),fe}function C(ie,he,ae,fe,le,Y){for(var $=[],ne=M(le,ae,Y),we={},ye={},F=0;F<he.length;F++){var H=he[F];if(H.chord)for(var W=0;W<H.chord.length;W++){var _e=H.chord[W];if(_e.position==="default"){var Te=le.accidentals.length&&le.accidentals[0].acc==="flat",Re=o(_e.name,Y,Te,!0);Re=Re.replace(/♭/g,"b").replace(/♯/g,"#"),Re!==_e.name&&$.push(me(ie,H.startChar,H.endChar,Re))}}if(H.el_type==="note"&&H.pitches){for(var Ie=0;Ie<H.pitches.length;Ie++){var st=V(H.pitches[Ie].name,ae,fe,we);st.acc&&(we[st.name.toUpperCase()]=st.acc);var wt=p(st,le,ne,ye);wt.acc&&(ye[wt.upper]=wt.acc),$.push(U(ie,H.startChar,H.endChar,wt.acc+wt.name,Ie))}if(H.gracenotes)for(var Ze=0;Ze<H.gracenotes.length;Ze++){var dt=V(H.gracenotes[Ze].name,ae,fe,we);dt.acc&&(we[dt.name.toUpperCase()]=dt.acc);var bt=p(dt,le,ne,we);bt.acc&&(ye[bt.upper]=bt.acc),$.push(D(ie,H.startChar,H.endChar,bt.acc+bt.name,Ze))}}else H.el_type==="bar"?(we={},ye={}):H.el_type==="keySignature"&&(ae=H.root,fe=S(H),le=w(H,Y),ne=M(le,ae,Y))}return $}var y="CDEFGAB",g=[",,,,",",,,",",,",",","","'","''","'''","''''"];function w(ie,he){if(ie.root==="none")return{root:n("C",he),mode:"",acc:"",accidentals:[]};var ae=t(ie.root+ie.acc+ie.mode),fe=n(ae,he),le=a(fe,ie.mode),Y=e(fe);return{root:le[0],mode:ie.mode,acc:le.length>1?le[1]:"",accidentals:Y}}function p(ie,he,ae,fe){for(var le=ie.pitch,Y=y.indexOf(ie.name),$=y.indexOf(he.root),ne=($+le)%7,we=Y+ae,ye=ie.oct;we>6;)ye++,we-=7;for(;we<0;)ye--,we+=7;for(var F=y[ne],H="",W=ie.adj,_e="=",Te=0;Te<he.accidentals.length;Te++)if(he.accidentals[Te].note.toLowerCase()===F.toLowerCase()){W=W+(he.accidentals[Te].acc==="flat"?-1:1),_e=he.accidentals[Te].acc==="flat"?"_":"^";break}switch(W){case-2:H="__";break;case-1:H="_";break;case 0:H="=";break;case 1:H="^";break;case 2:H="^^";break;case-3:var Re={};return Re.pitch=ie.pitch-1,Re.oct=ie.oct,Re.name=y[y.indexOf(ie.name)-1],Re.name||(Re.name="B",Re.oct--),Re.name==="B"||Re.name==="E"?Re.adj=ie.adj+1:Re.adj=ie.adj+2,p(Re,he,ae+1,fe);case 3:var Re={};return Re.pitch=ie.pitch+1,Re.oct=ie.oct,Re.name=y[y.indexOf(ie.name)+1],Re.name||(Re.name="C",Re.oct++),Re.name==="C"||Re.name==="F"?Re.adj=ie.adj-1:Re.adj=ie.adj-2,p(Re,he,ae+1,fe)}switch((fe[F]===H||!fe[F]&&H===_e)&&!ie.courtesy&&(H=""),ye){case 0:F=F+",,,";break;case 1:F=F+",,";break;case 2:F=F+",";break;case 4:F=F.toLowerCase();break;case 5:F=F.toLowerCase()+"'";break;case 6:F=F.toLowerCase()+"''";break;case 7:F=F.toLowerCase()+"'''";break;case 8:F=F.toLowerCase()+"''''";break}return ye>4&&(F=F.toLowerCase()),{acc:H,name:F,upper:F.toUpperCase()}}var E=/([_^=]*)([A-Ga-g])([,']*)/,N=/([_^=]*[A-Ga-g][,']*)(\d*\/*\d*)([\>\<\-\)\.\s\\]*)/,I=/([_^=]*[A-Ga-g][,']*)?(\d*\/*\d*)?([\>\<\-\)]*)?/,O=/(\s*)$/;function V(ie,he,ae,fe){var le=he==="none"?0:y.indexOf(he),Y=ie.match(E),$=Y[2].toUpperCase(),ne=y.indexOf($)-le;ne<0&&(ne+=7);var we=g.indexOf(Y[3]);$===Y[2]&&we--;var ye=fe[$]||ae[$]||"=";return{acc:Y[1],name:$,pitch:ne,oct:we,adj:B(Y[1],ae[$],fe[$]),courtesy:Y[1]===ye}}function U(ie,he,ae,fe,le){var Y=ie.substring(he,ae),$=Y.match(new RegExp(N.source+O.source),"");if($){var ne=$[1].length,we=$[2].length+$[3].length+$[4].length,ye=ae-he-ne-we;he+=ye,ae-=we}else{var F=/([^\[]*)/,H=/\[/,W=/\-?](\d*\/*\d*)?([\>\<\-\)]*)/;if($=Y.match(new RegExp(F.source+H.source+I.source+I.source+I.source+I.source+I.source+I.source+I.source+I.source+W.source+O.source)),$){for(var _e=1+$[1].length,Te=0;Te<le;Te++)$[Te*3+2]&&(_e+=$[Te*3+2].length),$[Te*3+3]&&(_e+=$[Te*3+3].length),$[Te*3+4]&&(_e+=$[Te*3+4].length);he+=_e;var Re=$[le*3+2]?$[le*3+2].length:0;ae=he+Re}}return{start:he,end:ae,note:fe}}function D(ie,he,ae,fe,le){var Y=ie.substring(he,ae),$=/\{/,ne=/\}/,we=/([^\{]*)/,ye=/(\/*)/,F=Y.match(new RegExp(we.source+$.source+ye.source+I.source+ye.source+I.source+ye.source+I.source+ye.source+I.source+ye.source+I.source+ye.source+I.source+ye.source+I.source+ye.source+I.source+ne.source));if(F){for(var H=1+F[1].length,W=0;W<le;W++)F[W*3+2]&&(H+=F[W*3+2].length),F[W*3+3]&&(H+=F[W*3+3].length),F[W*3+4]&&(H+=F[W*3+4].length),F[W*3+5]&&(H+=F[W*3+5].length);F[le*3+2]&&(H+=F[W*3+2].length),he+=H;var _e=F[le*3+3]?F[le*3+3].length:0;_e+=F[le*3+4]?F[le*3+4].length:0,_e+=F[le*3+5]?F[le*3+5].length:0,ae=he+_e}return{start:he,end:ae,note:fe}}function me(ie,he,ae,fe){var le=ie.substring(he,ae).match(/([^"]+)?(".+")+/);return le[1]&&(he+=le[1].length),ae=he+le[2].length,{start:he+1,end:ae-1,note:fe}}function B(ie,he,ae){if(!ie&&ae&&(ie=ae),!ie)return 0;switch(he){case void 0:switch(ie){case"__":return-2;case"_":return-1;case"=":return 0;case"^":return 1;case"^^":return 2;default:return 0}case"_":switch(ie){case"__":return-1;case"_":return 0;case"=":return 1;case"^":return 2;case"^^":return 3;default:return 0}case"^":switch(ie){case"__":return-3;case"_":return-2;case"=":return-1;case"^":return 0;case"^^":return 1;default:return 0}}return 0}}(),ah=l,ah}var oh,am;function hP(){if(am)return oh;am=1;var e=function(a,o,l,h){this.type="BeamElem",this.isflat=!!l,this.isgrace=!!(o&&o==="grace"),this.forceup=!!(this.isgrace||o&&o==="up"),this.forcedown=!!(o&&o==="down"),this.elems=[],this.total=0,this.average=6,this.allrests=!0,this.stemHeight=a,this.beams=[],h&&h.duration?(this.duration=h.duration,h.startTriplet&&(this.duration*=h.tripletMultiplier),this.duration=Math.round(this.duration*1e3)/1e3):this.duration=0};e.prototype.setHint=function(){this.hint=!0},e.prototype.runningDirection=function(n){var a=n.averagepitch;a!==void 0&&(this.total=Math.round(this.total+a),this.count||(this.count=0),this.count++)},e.prototype.add=function(n){var a=n.abcelem.averagepitch;a!==void 0&&(n.abcelem.rest||(this.allrests=!1),n.beam=this,this.elems.push(n),this.total=Math.round(this.total+a),(this.min===void 0||n.abcelem.minpitch<this.min)&&(this.min=n.abcelem.minpitch),(this.max===void 0||n.abcelem.maxpitch>this.max)&&(this.max=n.abcelem.maxpitch))},e.prototype.addBeam=function(n){this.beams.push(n)},e.prototype.setStemDirection=function(){if(this.average=t(this.total,this.count),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var n=6;this.stemsUp=this.average<n}delete this.count,this.total=0},e.prototype.calcDir=function(){if(this.average=t(this.total,this.elems.length),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var n=6;this.stemsUp=this.average<n}for(var a=this.stemsUp?"up":"down",o=0;o<this.elems.length;o++)for(var l=0;l<this.elems[o].heads.length;l++)this.elems[o].heads[l].stemDir=a};function t(n,a){return a?n/a:0}return oh=e,oh}var lh,om;function fP(){if(om)return lh;om=1;var e=function(n,a){this.startVoice=n,this.type=a};return e.prototype.setBottomStaff=function(t){this.endVoice=t,this.startVoice.header&&!this.endVoice.header&&(this.header=this.startVoice.header,delete this.startVoice.header)},e.prototype.continuing=function(t){this.lastContinuedVoice=t},e.prototype.getWidth=function(){return 10},e.prototype.isStartVoice=function(t){return!!(this.startVoice&&this.startVoice.staff&&this.startVoice.staff.voices.length>0&&this.startVoice.staff.voices[0]===t)},lh=e,lh}var ch,lm;function na(){if(lm)return ch;lm=1;var e=Qi(),t={0:{d:[["M",4.83,-14.97],["c",.33,-.03,1.11,0,1.47,.06],["c",1.68,.36,2.97,1.59,3.78,3.6],["c",1.2,2.97,.81,6.96,-.9,9.27],["c",-.78,1.08,-1.71,1.71,-2.91,1.95],["c",-.45,.09,-1.32,.09,-1.77,0],["c",-.81,-.18,-1.47,-.51,-2.07,-1.02],["c",-2.34,-2.07,-3.15,-6.72,-1.74,-10.2],["c",.87,-2.16,2.28,-3.42,4.14,-3.66],["z"],["m",1.11,.87],["c",-.21,-.06,-.69,-.09,-.87,-.06],["c",-.54,.12,-.87,.42,-1.17,.99],["c",-.36,.66,-.51,1.56,-.6,3],["c",-.03,.75,-.03,4.59,0,5.31],["c",.09,1.5,.27,2.4,.6,3.06],["c",.24,.48,.57,.78,.96,.9],["c",.27,.09,.78,.09,1.05,0],["c",.39,-.12,.72,-.42,.96,-.9],["c",.33,-.66,.51,-1.56,.6,-3.06],["c",.03,-.72,.03,-4.56,0,-5.31],["c",-.09,-1.47,-.27,-2.37,-.6,-3.03],["c",-.24,-.48,-.54,-.78,-.93,-.9],["z"]],w:10.78,h:14.959},1:{d:[["M",3.3,-15.06],["c",.06,-.06,.21,-.03,.66,.15],["c",.81,.39,1.08,.39,1.83,.03],["c",.21,-.09,.39,-.15,.42,-.15],["c",.12,0,.21,.09,.27,.21],["c",.06,.12,.06,.33,.06,5.94],["c",0,3.93,0,5.85,.03,6.03],["c",.06,.36,.15,.69,.27,.96],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.12,-.27,.21,-.6,.27,-.96],["c",.03,-.18,.03,-1.59,.03,-4.29],["c",0,-3.87,0,-4.05,-.06,-4.14],["c",-.09,-.15,-.18,-.24,-.39,-.24],["c",-.12,0,-.15,.03,-.21,.06],["c",-.03,.06,-.45,.99,-.96,2.13],["c",-.48,1.14,-.9,2.1,-.93,2.16],["c",-.06,.15,-.21,.24,-.33,.24],["c",-.24,0,-.42,-.18,-.42,-.39],["c",0,-.06,3.27,-7.62,3.33,-7.74],["z"]],w:8.94,h:15.058},2:{d:[["M",4.23,-14.97],["c",.57,-.06,1.68,0,2.34,.18],["c",.69,.18,1.5,.54,2.01,.9],["c",1.35,.96,1.95,2.25,1.77,3.81],["c",-.15,1.35,-.66,2.34,-1.68,3.15],["c",-.6,.48,-1.44,.93,-3.12,1.65],["c",-1.32,.57,-1.8,.81,-2.37,1.14],["c",-.57,.33,-.57,.33,-.24,.27],["c",.39,-.09,1.26,-.09,1.68,0],["c",.72,.15,1.41,.45,2.1,.9],["c",.99,.63,1.86,.87,2.55,.75],["c",.24,-.06,.42,-.15,.57,-.3],["c",.12,-.09,.3,-.42,.3,-.51],["c",0,-.09,.12,-.21,.24,-.24],["c",.18,-.03,.39,.12,.39,.3],["c",0,.12,-.15,.57,-.3,.87],["c",-.54,1.02,-1.56,1.74,-2.79,2.01],["c",-.42,.09,-1.23,.09,-1.62,.03],["c",-.81,-.18,-1.32,-.45,-2.01,-1.11],["c",-.45,-.45,-.63,-.57,-.96,-.69],["c",-.84,-.27,-1.89,.12,-2.25,.9],["c",-.12,.21,-.21,.54,-.21,.72],["c",0,.12,-.12,.21,-.27,.24],["c",-.15,0,-.27,-.03,-.33,-.15],["c",-.09,-.21,.09,-1.08,.33,-1.71],["c",.24,-.66,.66,-1.26,1.29,-1.89],["c",.45,-.45,.9,-.81,1.92,-1.56],["c",1.29,-.93,1.89,-1.44,2.34,-1.98],["c",.87,-1.05,1.26,-2.19,1.2,-3.63],["c",-.06,-1.29,-.39,-2.31,-.96,-2.91],["c",-.36,-.33,-.72,-.51,-1.17,-.54],["c",-.84,-.03,-1.53,.42,-1.59,1.05],["c",-.03,.33,.12,.6,.57,1.14],["c",.45,.54,.54,.87,.42,1.41],["c",-.15,.63,-.54,1.11,-1.08,1.38],["c",-.63,.33,-1.2,.33,-1.83,0],["c",-.24,-.12,-.33,-.18,-.54,-.39],["c",-.18,-.18,-.27,-.3,-.36,-.51],["c",-.24,-.45,-.27,-.84,-.21,-1.38],["c",.12,-.75,.45,-1.41,1.02,-1.98],["c",.72,-.72,1.74,-1.17,2.85,-1.32],["z"]],w:10.764,h:14.97},3:{d:[["M",3.78,-14.97],["c",.3,-.03,1.41,0,1.83,.06],["c",2.22,.3,3.51,1.32,3.72,2.91],["c",.03,.33,.03,1.26,-.03,1.65],["c",-.12,.84,-.48,1.47,-1.05,1.77],["c",-.27,.15,-.36,.24,-.45,.39],["c",-.09,.21,-.09,.36,0,.57],["c",.09,.15,.18,.24,.51,.39],["c",.75,.42,1.23,1.14,1.41,2.13],["c",.06,.42,.06,1.35,0,1.71],["c",-.18,.81,-.48,1.38,-1.02,1.95],["c",-.75,.72,-1.8,1.2,-3.18,1.38],["c",-.42,.06,-1.56,.06,-1.95,0],["c",-1.89,-.33,-3.18,-1.29,-3.51,-2.64],["c",-.03,-.12,-.03,-.33,-.03,-.6],["c",0,-.36,0,-.42,.06,-.63],["c",.12,-.3,.27,-.51,.51,-.75],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.51,.36,-.63,.54,-.6,.87],["c",.06,.54,.54,.9,1.38,.99],["c",.36,.06,.72,.03,.96,-.06],["c",.81,-.27,1.29,-1.23,1.44,-2.79],["c",.03,-.45,.03,-1.95,-.03,-2.37],["c",-.09,-.75,-.33,-1.23,-.75,-1.44],["c",-.33,-.18,-.45,-.18,-1.98,-.18],["c",-1.35,0,-1.41,0,-1.5,-.06],["c",-.18,-.12,-.24,-.39,-.12,-.6],["c",.12,-.15,.15,-.15,1.68,-.15],["c",1.5,0,1.62,0,1.89,-.15],["c",.18,-.09,.42,-.36,.54,-.57],["c",.18,-.42,.27,-.9,.3,-1.95],["c",.03,-1.2,-.06,-1.8,-.36,-2.37],["c",-.24,-.48,-.63,-.81,-1.14,-.96],["c",-.3,-.06,-1.08,-.06,-1.38,.03],["c",-.6,.15,-.9,.42,-.96,.84],["c",-.03,.3,.06,.45,.63,.84],["c",.33,.24,.42,.39,.45,.63],["c",.03,.72,-.57,1.5,-1.32,1.65],["c",-1.05,.27,-2.1,-.57,-2.1,-1.65],["c",0,-.45,.15,-.96,.39,-1.38],["c",.12,-.21,.54,-.63,.81,-.81],["c",.57,-.42,1.38,-.69,2.25,-.81],["z"]],w:9.735,h:14.967},4:{d:[["M",8.64,-14.94],["c",.27,-.09,.42,-.12,.54,-.03],["c",.09,.06,.15,.21,.15,.3],["c",-.03,.06,-1.92,2.31,-4.23,5.04],["c",-2.31,2.73,-4.23,4.98,-4.26,5.01],["c",-.03,.06,.12,.06,2.55,.06],["l",2.61,0],["l",0,-2.37],["c",0,-2.19,.03,-2.37,.06,-2.46],["c",.03,-.06,.21,-.18,.57,-.42],["c",1.08,-.72,1.38,-1.08,1.86,-2.16],["c",.12,-.3,.24,-.54,.27,-.57],["c",.12,-.12,.39,-.06,.45,.12],["c",.06,.09,.06,.57,.06,3.96],["l",0,3.9],["l",1.08,0],["c",1.05,0,1.11,0,1.2,.06],["c",.24,.15,.24,.54,0,.69],["c",-.09,.06,-.15,.06,-1.2,.06],["l",-1.08,0],["l",0,.33],["c",0,.57,.09,1.11,.3,1.53],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.21,-.42,.3,-.96,.3,-1.53],["l",0,-.33],["l",-2.7,0],["c",-2.91,0,-2.85,0,-3.09,-.15],["c",-.18,-.12,-.3,-.39,-.27,-.54],["c",.03,-.06,.18,-.24,.33,-.45],["c",.75,-.9,1.59,-2.07,2.13,-3.03],["c",.33,-.54,.84,-1.62,1.05,-2.16],["c",.57,-1.41,.84,-2.64,.9,-4.05],["c",.03,-.63,.06,-.72,.24,-.81],["l",.12,-.06],["l",.45,.12],["c",.66,.18,1.02,.24,1.47,.27],["c",.6,.03,1.23,-.09,2.01,-.33],["z"]],w:11.795,h:14.994},5:{d:[["M",1.02,-14.94],["c",.12,-.09,.03,-.09,1.08,.06],["c",2.49,.36,4.35,.36,6.96,-.06],["c",.57,-.09,.66,-.06,.81,.06],["c",.15,.18,.12,.24,-.15,.51],["c",-1.29,1.26,-3.24,2.04,-5.58,2.31],["c",-.6,.09,-1.2,.12,-1.71,.12],["c",-.39,0,-.45,0,-.57,.06],["c",-.09,.06,-.15,.12,-.21,.21],["l",-.06,.12],["l",0,1.65],["l",0,1.65],["l",.21,-.21],["c",.66,-.57,1.41,-.96,2.19,-1.14],["c",.33,-.06,1.41,-.06,1.95,0],["c",2.61,.36,4.02,1.74,4.26,4.14],["c",.03,.45,.03,1.08,-.03,1.44],["c",-.18,1.02,-.78,2.01,-1.59,2.7],["c",-.72,.57,-1.62,1.02,-2.49,1.2],["c",-1.38,.27,-3.03,.06,-4.2,-.54],["c",-1.08,-.54,-1.71,-1.32,-1.86,-2.28],["c",-.09,-.69,.09,-1.29,.57,-1.74],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.18,.12,-.36,.3,-.42,.33],["c",-.36,.42,-.18,.99,.36,1.26],["c",.51,.27,1.47,.36,2.01,.27],["c",.93,-.21,1.47,-1.17,1.65,-2.91],["c",.06,-.45,.06,-1.89,0,-2.31],["c",-.15,-1.2,-.51,-2.1,-1.05,-2.55],["c",-.21,-.18,-.54,-.36,-.81,-.39],["c",-.3,-.06,-.84,-.03,-1.26,.06],["c",-.93,.18,-1.65,.6,-2.16,1.2],["c",-.15,.21,-.27,.3,-.39,.3],["c",-.15,0,-.3,-.09,-.36,-.18],["c",-.06,-.09,-.06,-.15,-.06,-3.66],["c",0,-3.39,0,-3.57,.06,-3.66],["c",.03,-.06,.09,-.15,.15,-.18],["z"]],w:10.212,h:14.997},6:{d:[["M",4.98,-14.97],["c",.36,-.03,1.2,0,1.59,.06],["c",.9,.15,1.68,.51,2.25,1.05],["c",.57,.51,.87,1.23,.84,1.98],["c",-.03,.51,-.21,.9,-.6,1.26],["c",-.24,.24,-.45,.39,-.75,.51],["c",-.21,.06,-.27,.06,-.6,.06],["c",-.33,0,-.39,0,-.6,-.06],["c",-.3,-.12,-.51,-.27,-.75,-.51],["c",-.39,-.36,-.57,-.78,-.57,-1.26],["c",0,-.27,0,-.3,.09,-.42],["c",.03,-.09,.18,-.21,.3,-.3],["c",.12,-.09,.3,-.21,.39,-.27],["c",.09,-.06,.21,-.18,.27,-.24],["c",.06,-.12,.09,-.15,.09,-.33],["c",0,-.18,-.03,-.24,-.09,-.36],["c",-.24,-.39,-.75,-.6,-1.38,-.57],["c",-.54,.03,-.9,.18,-1.23,.48],["c",-.81,.72,-1.08,2.16,-.96,5.37],["l",0,.63],["l",.3,-.12],["c",.78,-.27,1.29,-.33,2.1,-.27],["c",1.47,.12,2.49,.54,3.27,1.29],["c",.48,.51,.81,1.11,.96,1.89],["c",.06,.27,.06,.42,.06,.93],["c",0,.54,0,.69,-.06,.96],["c",-.15,.78,-.48,1.38,-.96,1.89],["c",-.54,.51,-1.17,.87,-1.98,1.08],["c",-1.14,.3,-2.4,.33,-3.24,.03],["c",-1.5,-.48,-2.64,-1.89,-3.27,-4.02],["c",-.36,-1.23,-.51,-2.82,-.42,-4.08],["c",.3,-3.66,2.28,-6.3,4.95,-6.66],["z"],["m",.66,7.41],["c",-.27,-.09,-.81,-.12,-1.08,-.06],["c",-.72,.18,-1.08,.69,-1.23,1.71],["c",-.06,.54,-.06,3,0,3.54],["c",.18,1.26,.72,1.77,1.8,1.74],["c",.39,-.03,.63,-.09,.9,-.27],["c",.66,-.42,.9,-1.32,.9,-3.24],["c",0,-2.22,-.36,-3.12,-1.29,-3.42],["z"]],w:9.956,h:14.982},7:{d:[["M",.21,-14.97],["c",.21,-.06,.45,0,.54,.15],["c",.06,.09,.06,.15,.06,.39],["c",0,.24,0,.33,.06,.42],["c",.06,.12,.21,.24,.27,.24],["c",.03,0,.12,-.12,.24,-.21],["c",.96,-1.2,2.58,-1.35,3.99,-.42],["c",.15,.12,.42,.3,.54,.45],["c",.48,.39,.81,.57,1.29,.6],["c",.69,.03,1.5,-.3,2.13,-.87],["c",.09,-.09,.27,-.3,.39,-.45],["c",.12,-.15,.24,-.27,.3,-.3],["c",.18,-.06,.39,.03,.51,.21],["c",.06,.18,.06,.24,-.27,.72],["c",-.18,.24,-.54,.78,-.78,1.17],["c",-2.37,3.54,-3.54,6.27,-3.87,9],["c",-.03,.33,-.03,.66,-.03,1.26],["c",0,.9,0,1.08,.15,1.89],["c",.06,.45,.06,.48,.03,.6],["c",-.06,.09,-.21,.21,-.3,.21],["c",-.03,0,-.27,-.06,-.54,-.15],["c",-.84,-.27,-1.11,-.3,-1.65,-.3],["c",-.57,0,-.84,.03,-1.56,.27],["c",-.6,.18,-.69,.21,-.81,.15],["c",-.12,-.06,-.21,-.18,-.21,-.3],["c",0,-.15,.6,-1.44,1.2,-2.61],["c",1.14,-2.22,2.73,-4.68,5.1,-8.01],["c",.21,-.27,.36,-.48,.33,-.48],["c",0,0,-.12,.06,-.27,.12],["c",-.54,.3,-.99,.39,-1.56,.39],["c",-.75,.03,-1.2,-.18,-1.83,-.75],["c",-.99,-.9,-1.83,-1.17,-2.31,-.72],["c",-.18,.15,-.36,.51,-.45,.84],["c",-.06,.24,-.06,.33,-.09,1.98],["c",0,1.62,-.03,1.74,-.06,1.8],["c",-.15,.24,-.54,.24,-.69,0],["c",-.06,-.09,-.06,-.15,-.06,-3.57],["c",0,-3.42,0,-3.48,.06,-3.57],["c",.03,-.06,.09,-.12,.15,-.15],["z"]],w:10.561,h:15.093},8:{d:[["M",4.98,-14.97],["c",.33,-.03,1.02,-.03,1.32,0],["c",1.32,.12,2.49,.6,3.21,1.32],["c",.39,.39,.66,.81,.78,1.29],["c",.09,.36,.09,1.08,0,1.44],["c",-.21,.84,-.66,1.59,-1.59,2.55],["l",-.3,.3],["l",.27,.18],["c",1.47,.93,2.31,2.31,2.25,3.75],["c",-.03,.75,-.24,1.35,-.63,1.95],["c",-.45,.66,-1.02,1.14,-1.83,1.53],["c",-1.8,.87,-4.2,.87,-6,.03],["c",-1.62,-.78,-2.52,-2.16,-2.46,-3.66],["c",.06,-.99,.54,-1.77,1.8,-2.97],["c",.54,-.51,.54,-.54,.48,-.57],["c",-.39,-.27,-.96,-.78,-1.2,-1.14],["c",-.75,-1.11,-.87,-2.4,-.3,-3.6],["c",.69,-1.35,2.25,-2.25,4.2,-2.4],["z"],["m",1.53,.69],["c",-.42,-.09,-1.11,-.12,-1.38,-.06],["c",-.3,.06,-.6,.18,-.81,.3],["c",-.21,.12,-.6,.51,-.72,.72],["c",-.51,.87,-.42,1.89,.21,2.52],["c",.21,.21,.36,.3,1.95,1.23],["c",.96,.54,1.74,.99,1.77,1.02],["c",.09,0,.63,-.6,.99,-1.11],["c",.21,-.36,.48,-.87,.57,-1.23],["c",.06,-.24,.06,-.36,.06,-.72],["c",0,-.45,-.03,-.66,-.15,-.99],["c",-.39,-.81,-1.29,-1.44,-2.49,-1.68],["z"],["m",-1.44,8.07],["l",-1.89,-1.08],["c",-.03,0,-.18,.15,-.39,.33],["c",-1.2,1.08,-1.65,1.95,-1.59,3],["c",.09,1.59,1.35,2.85,3.21,3.24],["c",.33,.06,.45,.06,.93,.06],["c",.63,0,.81,-.03,1.29,-.27],["c",.9,-.42,1.47,-1.41,1.41,-2.4],["c",-.06,-.66,-.39,-1.29,-.9,-1.65],["c",-.12,-.09,-1.05,-.63,-2.07,-1.23],["z"]],w:10.926,h:14.989},9:{d:[["M",4.23,-14.97],["c",.42,-.03,1.29,0,1.62,.06],["c",.51,.12,.93,.3,1.38,.57],["c",1.53,1.02,2.52,3.24,2.73,5.94],["c",.18,2.55,-.48,4.98,-1.83,6.57],["c",-1.05,1.26,-2.4,1.89,-3.93,1.83],["c",-1.23,-.06,-2.31,-.45,-3.03,-1.14],["c",-.57,-.51,-.87,-1.23,-.84,-1.98],["c",.03,-.51,.21,-.9,.6,-1.26],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.39,.36,.57,.78,.57,1.26],["c",0,.27,0,.3,-.09,.42],["c",-.03,.09,-.18,.21,-.3,.3],["c",-.12,.09,-.3,.21,-.39,.27],["c",-.09,.06,-.21,.18,-.27,.24],["c",-.06,.12,-.06,.15,-.06,.33],["c",0,.18,0,.24,.06,.36],["c",.24,.39,.75,.6,1.38,.57],["c",.54,-.03,.9,-.18,1.23,-.48],["c",.81,-.72,1.08,-2.16,.96,-5.37],["l",0,-.63],["l",-.3,.12],["c",-.78,.27,-1.29,.33,-2.1,.27],["c",-1.47,-.12,-2.49,-.54,-3.27,-1.29],["c",-.48,-.51,-.81,-1.11,-.96,-1.89],["c",-.06,-.27,-.06,-.42,-.06,-.96],["c",0,-.51,0,-.66,.06,-.93],["c",.15,-.78,.48,-1.38,.96,-1.89],["c",.15,-.12,.33,-.27,.42,-.36],["c",.69,-.51,1.62,-.81,2.76,-.93],["z"],["m",1.17,.66],["c",-.21,-.06,-.57,-.06,-.81,-.03],["c",-.78,.12,-1.26,.69,-1.41,1.74],["c",-.12,.63,-.15,1.95,-.09,2.79],["c",.12,1.71,.63,2.4,1.77,2.46],["c",1.08,.03,1.62,-.48,1.8,-1.74],["c",.06,-.54,.06,-3,0,-3.54],["c",-.15,-1.05,-.51,-1.53,-1.26,-1.68],["z"]],w:9.959,h:14.986},"rests.multimeasure":{d:[["M",0,-4],["l",0,16],["l",1,0],["l",0,-5],["l",40,0],["l",0,5],["l",1,0],["l",0,-16],["l",-1,0],["l",0,5],["l",-40,0],["l",0,-5],["z"]],w:42,h:18},"rests.whole":{d:[["M",.06,.03],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.half":{d:[["M",.06,-4.62],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.quarter":{d:[["M",1.89,-11.82],["c",.12,-.06,.24,-.06,.36,-.03],["c",.09,.06,4.74,5.58,4.86,5.82],["c",.21,.39,.15,.78,-.15,1.26],["c",-.24,.33,-.72,.81,-1.62,1.56],["c",-.45,.36,-.87,.75,-.96,.84],["c",-.93,.99,-1.14,2.49,-.6,3.63],["c",.18,.39,.27,.48,1.32,1.68],["c",1.92,2.25,1.83,2.16,1.83,2.34],["c",0,.18,-.18,.36,-.36,.39],["c",-.15,0,-.27,-.06,-.48,-.27],["c",-.75,-.75,-2.46,-1.29,-3.39,-1.08],["c",-.45,.09,-.69,.27,-.9,.69],["c",-.12,.3,-.21,.66,-.24,1.14],["c",-.03,.66,.09,1.35,.3,2.01],["c",.15,.42,.24,.66,.45,.96],["c",.18,.24,.18,.33,.03,.42],["c",-.12,.06,-.18,.03,-.45,-.3],["c",-1.08,-1.38,-2.07,-3.36,-2.4,-4.83],["c",-.27,-1.05,-.15,-1.77,.27,-2.07],["c",.21,-.12,.42,-.15,.87,-.15],["c",.87,.06,2.1,.39,3.3,.9],["l",.39,.18],["l",-1.65,-1.95],["c",-2.52,-2.97,-2.61,-3.09,-2.7,-3.27],["c",-.09,-.24,-.12,-.48,-.03,-.75],["c",.15,-.48,.57,-.96,1.83,-2.01],["c",.45,-.36,.84,-.72,.93,-.78],["c",.69,-.75,1.02,-1.8,.9,-2.79],["c",-.06,-.33,-.21,-.84,-.39,-1.11],["c",-.09,-.15,-.45,-.6,-.81,-1.05],["c",-.36,-.42,-.69,-.81,-.72,-.87],["c",-.09,-.18,0,-.42,.21,-.51],["z"]],w:7.888,h:21.435},"rests.8th":{d:[["M",1.68,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.33,-.09],["c",.39,-.18,1.32,-1.29,1.68,-1.98],["c",.09,-.21,.24,-.3,.39,-.3],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.27,1.11,-1.86,6.42],["c",-1.02,3.48,-1.89,6.39,-1.92,6.42],["c",0,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.15,-.57,1.68,-4.92],["c",.96,-2.67,1.74,-4.89,1.71,-4.89],["l",-.51,.15],["c",-1.08,.36,-1.74,.48,-2.55,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:7.534,h:13.883},"rests.16th":{d:[["M",3.33,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.87,.42],["c",.39,-.18,1.2,-1.23,1.62,-2.07],["c",.06,-.15,.24,-.24,.36,-.24],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.45,1.86,-2.67,10.17],["c",-1.5,5.55,-2.73,10.14,-2.76,10.17],["c",-.03,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.12,-.57,1.44,-4.92],["c",.81,-2.67,1.47,-4.86,1.47,-4.89],["c",-.03,0,-.27,.06,-.54,.15],["c",-1.08,.36,-1.77,.48,-2.58,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.12,0,.18,0,.33,-.09],["c",.33,-.15,1.02,-.93,1.41,-1.59],["c",.12,-.21,.18,-.39,.39,-1.08],["c",.66,-2.1,1.17,-3.84,1.17,-3.87],["c",0,0,-.21,.06,-.42,.15],["c",-.51,.15,-1.2,.33,-1.68,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:9.724,h:21.383},"rests.32nd":{d:[["M",4.23,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.27,-.06],["c",.33,-.21,.99,-1.11,1.44,-1.98],["c",.09,-.24,.21,-.33,.39,-.33],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.57,2.67,-3.21,13.89],["c",-1.8,7.62,-3.3,13.89,-3.3,13.92],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.09,-.57,1.23,-4.92],["c",.69,-2.67,1.26,-4.86,1.29,-4.89],["c",0,-.03,-.12,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.12,.09,.3,.18,.48,.21],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.29,-1.29,1.56,-1.89],["c",.03,-.12,1.23,-4.59,1.23,-4.65],["c",0,-.03,-.18,.03,-.39,.12],["c",-.63,.18,-1.2,.36,-1.74,.45],["c",-.39,.06,-.54,.06,-1.02,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.18,.18,.51,.27,.72,.15],["c",.3,-.12,.69,-.57,1.08,-1.17],["c",.42,-.6,.39,-.51,1.05,-3.03],["c",.33,-1.26,.6,-2.31,.6,-2.34],["c",0,0,-.21,.03,-.45,.12],["c",-.57,.18,-1.14,.33,-1.62,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:11.373,h:28.883},"rests.64th":{d:[["M",5.13,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.54,.3,.75,.18],["c",.24,-.12,.63,-.66,1.08,-1.56],["c",.33,-.66,.39,-.72,.6,-.72],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.69,3.66,-3.54,17.64],["c",-1.95,9.66,-3.57,17.61,-3.57,17.64],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.06,-.57,1.05,-4.95],["c",.6,-2.7,1.08,-4.89,1.08,-4.92],["c",0,0,-.24,.06,-.51,.15],["c",-.66,.24,-1.2,.36,-1.77,.48],["c",-.42,.06,-.57,.06,-1.05,.06],["c",-.69,0,-.87,-.03,-1.35,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.21,.03,.39,-.09,.72,-.42],["c",.45,-.45,1.02,-1.26,1.17,-1.65],["c",.03,-.09,.27,-1.14,.54,-2.34],["c",.27,-1.2,.48,-2.19,.51,-2.22],["c",0,-.03,-.09,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.9,.42],["c",.36,-.18,1.2,-1.26,1.47,-1.89],["c",.03,-.09,.3,-1.2,.57,-2.43],["l",.51,-2.28],["l",-.54,.18],["c",-1.11,.36,-1.8,.48,-2.61,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.21,.21,.54,.3,.75,.18],["c",.36,-.18,.93,-.93,1.29,-1.68],["c",.12,-.24,.18,-.48,.63,-2.55],["l",.51,-2.31],["c",0,-.03,-.18,.03,-.39,.12],["c",-1.14,.36,-2.1,.54,-2.82,.51],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.453,h:36.383},"rests.128th":{d:[["M",6.03,-21.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.21,0,.33,-.06,.54,-.36],["c",.15,-.21,.54,-.93,.78,-1.47],["c",.15,-.33,.18,-.39,.3,-.48],["c",.18,-.09,.45,0,.51,.15],["c",.03,.09,-7.11,42.75,-7.17,42.84],["c",-.03,.03,-.15,.09,-.24,.15],["c",-.18,.06,-.24,.06,-.45,.06],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.03,-.57,.84,-4.98],["c",.51,-2.7,.93,-4.92,.9,-4.92],["c",0,0,-.15,.06,-.36,.12],["c",-.78,.27,-1.62,.48,-2.31,.57],["c",-.15,.03,-.54,.03,-.81,.03],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.63,.48],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.14,-1.11,1.5,-1.83],["c",.12,-.27,.12,-.27,.54,-2.52],["c",.24,-1.23,.42,-2.25,.39,-2.25],["c",0,0,-.24,.06,-.51,.18],["c",-1.26,.39,-2.25,.57,-3.06,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.51,.3,.75,.18],["c",.36,-.15,1.05,-.99,1.41,-1.77],["l",.15,-.3],["l",.42,-2.25],["c",.21,-1.26,.42,-2.28,.39,-2.28],["l",-.51,.15],["c",-1.11,.39,-1.89,.51,-2.7,.51],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.18,.48,.27,.72,.21],["c",.33,-.12,1.14,-1.26,1.41,-1.95],["c",0,-.09,.21,-1.11,.45,-2.34],["c",.21,-1.2,.39,-2.22,.39,-2.28],["c",.03,-.03,0,-.03,-.45,.12],["c",-.57,.18,-1.2,.33,-1.71,.42],["c",-.3,.06,-.51,.06,-.93,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.18,0,.36,-.09,.57,-.33],["c",.33,-.36,.78,-1.14,.93,-1.56],["c",.03,-.12,.24,-1.2,.45,-2.4],["c",.24,-1.2,.42,-2.22,.42,-2.28],["c",.03,-.03,0,-.03,-.39,.09],["c",-1.05,.36,-1.8,.48,-2.58,.48],["c",-.63,0,-.84,-.03,-1.29,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.992,h:43.883},"accidentals.sharp":{d:[["M",5.73,-11.19],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.31],["c",0,1.23,0,2.22,.03,2.22],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.43],["c",0,1.32,0,2.43,.03,2.43],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.52],["c",0,2.28,-.03,2.55,-.06,2.64],["c",-.21,.36,-.72,.36,-.93,0],["c",-.03,-.09,-.06,-.33,-.06,-2.43],["l",0,-2.31],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.43],["c",0,2.58,0,2.52,-.15,2.67],["c",-.06,.09,-.27,.18,-.36,.18],["c",-.12,0,-.33,-.09,-.39,-.18],["c",-.15,-.15,-.15,-.09,-.15,-2.43],["c",0,-1.23,0,-2.22,-.03,-2.22],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.43],["c",0,-1.32,0,-2.43,-.03,-2.43],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.52],["c",0,-2.28,.03,-2.55,.06,-2.64],["c",.21,-.36,.72,-.36,.93,0],["c",.03,.09,.06,.33,.06,2.43],["l",.03,2.31],["l",1.26,-.51],["l",1.26,-.51],["l",0,-2.43],["c",0,-2.28,0,-2.43,.06,-2.55],["c",.06,-.12,.12,-.18,.27,-.24],["z"],["m",-.33,10.65],["l",0,-2.43],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.46],["l",0,2.43],["l",.09,-.03],["c",.06,-.03,.63,-.27,1.29,-.51],["l",1.17,-.48],["l",0,-2.46],["z"]],w:8.25,h:22.462},"accidentals.halfsharp":{d:[["M",2.43,-10.05],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.01],["c",0,1.05,0,1.89,.03,1.89],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.37],["c",0,1.32,0,2.37,.03,2.37],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.25],["c",0,1.95,0,2.28,-.06,2.37],["c",-.06,.12,-.12,.21,-.24,.27],["c",-.27,.12,-.54,.03,-.69,-.24],["c",-.06,-.12,-.06,-.21,-.06,-2.01],["c",0,-1.05,0,-1.89,-.03,-1.89],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.37],["c",0,-1.32,0,-2.37,-.03,-2.37],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.25],["c",0,-2.13,0,-2.28,.06,-2.4],["c",.06,-.12,.12,-.18,.27,-.24],["z"]],w:5.25,h:20.174},"accidentals.nat":{d:[["M",.21,-11.4],["c",.24,-.06,.78,0,.99,.15],["c",.03,.03,.03,.48,0,2.61],["c",-.03,1.44,-.03,2.61,-.03,2.61],["c",0,.03,.75,-.09,1.68,-.24],["c",.96,-.18,1.71,-.27,1.74,-.27],["c",.15,.03,.27,.15,.36,.3],["l",.06,.12],["l",.09,8.67],["c",.09,6.96,.12,8.67,.09,8.67],["c",-.03,.03,-.12,.06,-.21,.09],["c",-.24,.09,-.72,.09,-.96,0],["c",-.09,-.03,-.18,-.06,-.21,-.09],["c",-.03,-.03,-.03,-.48,0,-2.61],["c",.03,-1.44,.03,-2.61,.03,-2.61],["c",0,-.03,-.75,.09,-1.68,.24],["c",-.96,.18,-1.71,.27,-1.74,.27],["c",-.15,-.03,-.27,-.15,-.36,-.3],["l",-.06,-.15],["l",-.09,-7.53],["c",-.06,-4.14,-.09,-8.04,-.12,-8.67],["l",0,-1.11],["l",.15,-.06],["c",.09,-.03,.21,-.06,.27,-.09],["z"],["m",3.75,8.4],["c",0,-.33,0,-.42,-.03,-.42],["c",-.12,0,-2.79,.45,-2.79,.48],["c",-.03,0,-.09,6.3,-.09,6.33],["c",.03,0,2.79,-.45,2.82,-.48],["c",0,0,.09,-4.53,.09,-5.91],["z"]],w:5.4,h:22.8},"accidentals.flat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:6.75,h:18.801},"accidentals.halfflat":{d:[["M",4.83,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.6,-.12,9.06],["c",-.09,5.55,-.15,9.06,-.18,9.12],["c",-.03,.09,-.09,.18,-.15,.27],["c",-.24,.21,-.54,.24,-.81,.06],["c",-.06,-.03,-.27,-.24,-.45,-.42],["c",-.36,-.42,-.66,-.66,-1.8,-1.44],["c",-1.23,-.84,-1.83,-1.32,-2.25,-1.77],["c",-.66,-.78,-.96,-1.56,-.93,-2.46],["c",.09,-1.41,1.11,-2.58,2.4,-2.79],["c",.3,-.06,.84,-.03,1.23,.06],["c",.54,.12,1.08,.33,1.53,.63],["c",.12,.09,.24,.15,.24,.12],["c",0,0,-.12,-8.37,-.18,-9.75],["l",0,-.66],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",-1.65,10.95],["c",-.6,-.18,-1.08,.09,-1.38,.69],["c",-.27,.6,-.36,1.38,-.18,2.07],["c",.12,.42,.42,.99,.72,1.41],["c",.3,.42,.93,1.05,1.56,1.59],["l",.48,.39],["l",0,-.12],["c",.03,-.09,.03,-.48,.06,-.9],["c",.03,-.57,.03,-1.08,0,-2.22],["c",-.03,-1.62,-.03,-1.62,-.24,-2.07],["c",-.21,-.42,-.6,-.75,-1.02,-.84],["z"]],w:6.728,h:18.801},"accidentals.dblflat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"],["m",3,-11],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:12.1,h:18.804},"accidentals.dblsharp":{d:[["M",-.18,-3.96],["c",.06,-.03,.12,-.06,.15,-.06],["c",.09,0,2.76,.27,2.79,.3],["c",.12,.03,.15,.12,.15,.51],["c",.06,.96,.24,1.59,.57,2.1],["c",.06,.09,.15,.21,.18,.24],["l",.09,.06],["l",.09,-.06],["c",.03,-.03,.12,-.15,.18,-.24],["c",.33,-.51,.51,-1.14,.57,-2.1],["c",0,-.39,.03,-.45,.12,-.51],["c",.03,0,.66,-.09,1.44,-.15],["c",1.47,-.15,1.5,-.15,1.56,-.03],["c",.03,.06,0,.42,-.09,1.44],["c",-.09,.72,-.15,1.35,-.15,1.38],["c",0,.03,-.03,.09,-.06,.12],["c",-.06,.06,-.12,.09,-.51,.09],["c",-1.08,.06,-1.8,.3,-2.28,.75],["l",-.12,.09],["l",.09,.09],["c",.12,.15,.39,.33,.63,.45],["c",.42,.18,.96,.27,1.68,.33],["c",.39,0,.45,.03,.51,.09],["c",.03,.03,.06,.09,.06,.12],["c",0,.03,.06,.66,.15,1.38],["c",.09,1.02,.12,1.38,.09,1.44],["c",-.06,.12,-.09,.12,-1.56,-.03],["c",-.78,-.06,-1.41,-.15,-1.44,-.15],["c",-.09,-.06,-.12,-.12,-.12,-.54],["c",-.06,-.93,-.24,-1.56,-.57,-2.07],["c",-.06,-.09,-.15,-.21,-.18,-.24],["l",-.09,-.06],["l",-.09,.06],["c",-.03,.03,-.12,.15,-.18,.24],["c",-.33,.51,-.51,1.14,-.57,2.07],["c",0,.42,-.03,.48,-.12,.54],["c",-.03,0,-.66,.09,-1.44,.15],["c",-1.47,.15,-1.5,.15,-1.56,.03],["c",-.03,-.06,0,-.42,.09,-1.44],["c",.09,-.72,.15,-1.35,.15,-1.38],["c",0,-.03,.03,-.09,.06,-.12],["c",.06,-.06,.12,-.09,.51,-.09],["c",.72,-.06,1.26,-.15,1.68,-.33],["c",.24,-.12,.51,-.3,.63,-.45],["l",.09,-.09],["l",-.12,-.09],["c",-.48,-.45,-1.2,-.69,-2.28,-.75],["c",-.39,0,-.45,-.03,-.51,-.09],["c",-.03,-.03,-.06,-.09,-.06,-.12],["c",0,-.03,-.06,-.63,-.12,-1.38],["c",-.09,-.72,-.15,-1.35,-.15,-1.38],["z"]],w:7.95,h:7.977},"dots.dot":{d:[["M",1.32,-1.68],["c",.09,-.03,.27,-.06,.39,-.06],["c",.96,0,1.74,.78,1.74,1.71],["c",0,.96,-.78,1.74,-1.71,1.74],["c",-.96,0,-1.74,-.78,-1.74,-1.71],["c",0,-.78,.54,-1.5,1.32,-1.68],["z"]],w:3.45,h:3.45},"noteheads.dbl":{d:[["M",-.69,-4.02],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["c",.06,.15,.06,.18,.06,1.41],["l",0,1.23],["l",.12,-.18],["c",.72,-1.26,2.64,-2.31,4.86,-2.64],["c",.81,-.15,1.11,-.15,2.13,-.15],["c",.99,0,1.29,0,2.1,.15],["c",.75,.12,1.38,.27,2.04,.54],["c",1.35,.51,2.34,1.26,2.82,2.1],["l",.12,.18],["l",0,-1.23],["c",0,-1.2,0,-1.26,.06,-1.38],["c",.09,-.18,.15,-.24,.33,-.33],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,3.54],["l",0,3.54],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.38],["l",0,-1.23],["l",-.12,.18],["c",-.48,.84,-1.47,1.59,-2.82,2.1],["c",-.84,.33,-1.71,.54,-2.85,.66],["c",-.45,.06,-2.16,.06,-2.61,0],["c",-1.14,-.12,-2.01,-.33,-2.85,-.66],["c",-1.35,-.51,-2.34,-1.26,-2.82,-2.1],["l",-.12,-.18],["l",0,1.23],["c",0,1.23,0,1.26,-.06,1.38],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-3.54],["c",0,-3.48,0,-3.54,.06,-3.66],["c",.09,-.18,.15,-.24,.33,-.33],["z"],["m",7.71,.63],["c",-.36,-.06,-.9,-.06,-1.14,0],["c",-.3,.03,-.66,.24,-.87,.42],["c",-.6,.54,-.9,1.62,-.75,2.82],["c",.12,.93,.51,1.68,1.11,2.31],["c",.75,.72,1.83,1.2,2.85,1.26],["c",1.05,.06,1.83,-.54,2.1,-1.65],["c",.21,-.9,.12,-1.95,-.24,-2.82],["c",-.36,-.81,-1.08,-1.53,-1.95,-1.95],["c",-.3,-.15,-.78,-.3,-1.11,-.39],["z"]],w:16.83,h:8.145},"noteheads.whole":{d:[["M",6.51,-4.05],["c",.51,-.03,2.01,0,2.52,.03],["c",1.41,.18,2.64,.51,3.72,1.08],["c",1.2,.63,1.95,1.41,2.19,2.31],["c",.09,.33,.09,.9,0,1.23],["c",-.24,.9,-.99,1.68,-2.19,2.31],["c",-1.08,.57,-2.28,.9,-3.75,1.08],["c",-.66,.06,-2.31,.06,-2.97,0],["c",-1.47,-.18,-2.67,-.51,-3.75,-1.08],["c",-1.2,-.63,-1.95,-1.41,-2.19,-2.31],["c",-.09,-.33,-.09,-.9,0,-1.23],["c",.24,-.9,.99,-1.68,2.19,-2.31],["c",1.2,-.63,2.61,-.99,4.23,-1.11],["z"],["m",.57,.66],["c",-.87,-.15,-1.53,0,-2.04,.51],["c",-.15,.15,-.24,.27,-.33,.48],["c",-.24,.51,-.36,1.08,-.33,1.77],["c",.03,.69,.18,1.26,.42,1.77],["c",.6,1.17,1.74,1.98,3.18,2.22],["c",1.11,.21,1.95,-.15,2.34,-.99],["c",.24,-.51,.36,-1.08,.33,-1.8],["c",-.06,-1.11,-.45,-2.04,-1.17,-2.76],["c",-.63,-.63,-1.47,-1.05,-2.4,-1.2],["z"]],w:14.985,h:8.097},"noteheads.half":{d:[["M",7.44,-4.05],["c",.06,-.03,.27,-.03,.48,-.03],["c",1.05,0,1.71,.24,2.1,.81],["c",.42,.6,.45,1.35,.18,2.4],["c",-.42,1.59,-1.14,2.73,-2.16,3.39],["c",-1.41,.93,-3.18,1.44,-5.4,1.53],["c",-1.17,.03,-1.89,-.21,-2.28,-.81],["c",-.42,-.6,-.45,-1.35,-.18,-2.4],["c",.42,-1.59,1.14,-2.73,2.16,-3.39],["c",.63,-.42,1.23,-.72,1.98,-.96],["c",.9,-.3,1.65,-.42,3.12,-.54],["z"],["m",1.29,.87],["c",-.27,-.09,-.63,-.12,-.9,-.03],["c",-.72,.24,-1.53,.69,-3.27,1.8],["c",-2.34,1.5,-3.3,2.25,-3.57,2.79],["c",-.36,.72,-.06,1.5,.66,1.77],["c",.24,.12,.69,.09,.99,0],["c",.84,-.3,1.92,-.93,4.14,-2.37],["c",1.62,-1.08,2.37,-1.71,2.61,-2.19],["c",.36,-.72,.06,-1.5,-.66,-1.77],["z"]],w:10.37,h:8.132},"noteheads.quarter":{d:[["M",6.09,-4.05],["c",.36,-.03,1.2,0,1.53,.06],["c",1.17,.24,1.89,.84,2.16,1.83],["c",.06,.18,.06,.3,.06,.66],["c",0,.45,0,.63,-.15,1.08],["c",-.66,2.04,-3.06,3.93,-5.52,4.38],["c",-.54,.09,-1.44,.09,-1.83,.03],["c",-1.23,-.27,-1.98,-.87,-2.25,-1.86],["c",-.06,-.18,-.06,-.3,-.06,-.66],["c",0,-.45,0,-.63,.15,-1.08],["c",.24,-.78,.75,-1.53,1.44,-2.22],["c",1.2,-1.2,2.85,-2.01,4.47,-2.22],["z"]],w:9.81,h:8.094},"noteheads.slash.nostem":{d:[["M",9.3,-7.77],["c",.06,-.06,.18,-.06,1.71,-.06],["l",1.65,0],["l",.09,.09],["c",.06,.06,.06,.09,.06,.15],["c",-.03,.12,-9.21,15.24,-9.3,15.33],["c",-.06,.06,-.18,.06,-1.71,.06],["l",-1.65,0],["l",-.09,-.09],["c",-.06,-.06,-.06,-.09,-.06,-.15],["c",.03,-.12,9.21,-15.24,9.3,-15.33],["z"]],w:12.81,h:15.63},"noteheads.indeterminate":{d:[["M",.78,-4.05],["c",.12,-.03,.24,-.03,.36,.03],["c",.03,.03,.93,.72,1.95,1.56],["l",1.86,1.5],["l",1.86,-1.5],["c",1.02,-.84,1.92,-1.53,1.95,-1.56],["c",.21,-.12,.33,-.09,.75,.24],["c",.3,.27,.36,.36,.36,.54],["c",0,.03,-.03,.12,-.06,.18],["c",-.03,.06,-.9,.75,-1.89,1.56],["l",-1.8,1.47],["c",0,.03,.81,.69,1.8,1.5],["c",.99,.81,1.86,1.5,1.89,1.56],["c",.03,.06,.06,.15,.06,.18],["c",0,.18,-.06,.27,-.36,.54],["c",-.42,.33,-.54,.36,-.75,.24],["c",-.03,-.03,-.93,-.72,-1.95,-1.56],["l",-1.86,-1.5],["l",-1.86,1.5],["c",-1.02,.84,-1.92,1.53,-1.95,1.56],["c",-.21,.12,-.33,.09,-.75,-.24],["c",-.3,-.27,-.36,-.36,-.36,-.54],["c",0,-.03,.03,-.12,.06,-.18],["c",.03,-.06,.9,-.75,1.89,-1.56],["l",1.8,-1.47],["c",0,-.03,-.81,-.69,-1.8,-1.5],["c",-.99,-.81,-1.86,-1.5,-1.89,-1.56],["c",-.06,-.12,-.09,-.21,-.03,-.36],["c",.03,-.09,.57,-.57,.72,-.63],["z"]],w:9.843,h:8.139},"scripts.ufermata":{d:[["M",-.75,-10.77],["c",.12,0,.45,-.03,.69,-.03],["c",2.91,-.03,5.55,1.53,7.41,4.35],["c",1.17,1.71,1.95,3.72,2.43,6.03],["c",.12,.51,.12,.57,.03,.69],["c",-.12,.21,-.48,.27,-.69,.12],["c",-.12,-.09,-.18,-.24,-.27,-.69],["c",-.78,-3.63,-3.42,-6.54,-6.78,-7.38],["c",-.78,-.21,-1.2,-.24,-2.07,-.24],["c",-.63,0,-.84,0,-1.2,.06],["c",-1.83,.27,-3.42,1.08,-4.8,2.37],["c",-1.41,1.35,-2.4,3.21,-2.85,5.19],["c",-.09,.45,-.15,.6,-.27,.69],["c",-.21,.15,-.57,.09,-.69,-.12],["c",-.09,-.12,-.09,-.18,.03,-.69],["c",.33,-1.62,.78,-3,1.47,-4.38],["c",1.77,-3.54,4.44,-5.67,7.56,-5.97],["z"],["m",.33,7.47],["c",1.38,-.3,2.58,.9,2.31,2.25],["c",-.15,.72,-.78,1.35,-1.47,1.5],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.748,h:11.289},"scripts.dfermata":{d:[["M",-9.63,-.42],["c",.15,-.09,.36,-.06,.51,.03],["c",.12,.09,.18,.24,.27,.66],["c",.78,3.66,3.42,6.57,6.78,7.41],["c",.78,.21,1.2,.24,2.07,.24],["c",.63,0,.84,0,1.2,-.06],["c",1.83,-.27,3.42,-1.08,4.8,-2.37],["c",1.41,-1.35,2.4,-3.21,2.85,-5.22],["c",.09,-.42,.15,-.57,.27,-.66],["c",.21,-.15,.57,-.09,.69,.12],["c",.09,.12,.09,.18,-.03,.69],["c",-.33,1.62,-.78,3,-1.47,4.38],["c",-1.92,3.84,-4.89,6,-8.31,6],["c",-3.42,0,-6.39,-2.16,-8.31,-6],["c",-.48,-.96,-.84,-1.92,-1.14,-2.97],["c",-.18,-.69,-.42,-1.74,-.42,-1.92],["c",0,-.12,.09,-.27,.24,-.33],["z"],["m",9.21,0],["c",1.2,-.27,2.34,.63,2.34,1.86],["c",0,.9,-.66,1.68,-1.5,1.89],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.744,h:11.274},"scripts.sforzato":{d:[["M",-6.45,-3.69],["c",.06,-.03,.15,-.06,.18,-.06],["c",.06,0,2.85,.72,6.24,1.59],["l",6.33,1.65],["c",.33,.06,.45,.21,.45,.51],["c",0,.3,-.12,.45,-.45,.51],["l",-6.33,1.65],["c",-3.39,.87,-6.18,1.59,-6.21,1.59],["c",-.21,0,-.48,-.24,-.51,-.45],["c",0,-.15,.06,-.36,.18,-.45],["c",.09,-.06,.87,-.27,3.84,-1.05],["c",2.04,-.54,3.84,-.99,4.02,-1.02],["c",.15,-.06,1.14,-.24,2.22,-.42],["c",1.05,-.18,1.92,-.36,1.92,-.36],["c",0,0,-.87,-.18,-1.92,-.36],["c",-1.08,-.18,-2.07,-.36,-2.22,-.42],["c",-.18,-.03,-1.98,-.48,-4.02,-1.02],["c",-2.97,-.78,-3.75,-.99,-3.84,-1.05],["c",-.12,-.09,-.18,-.3,-.18,-.45],["c",.03,-.15,.15,-.3,.3,-.39],["z"]],w:13.5,h:7.5},"scripts.staccato":{d:[["M",-.36,-1.47],["c",.93,-.21,1.86,.51,1.86,1.47],["c",0,.93,-.87,1.65,-1.8,1.47],["c",-.54,-.12,-1.02,-.57,-1.14,-1.08],["c",-.21,-.81,.27,-1.65,1.08,-1.86],["z"]],w:2.989,h:3.004},"scripts.tenuto":{d:[["M",-4.2,-.48],["l",.12,-.06],["l",4.08,0],["l",4.08,0],["l",.12,.06],["c",.39,.21,.39,.75,0,.96],["l",-.12,.06],["l",-4.08,0],["l",-4.08,0],["l",-.12,-.06],["c",-.39,-.21,-.39,-.75,0,-.96],["z"]],w:8.985,h:1.08},"scripts.umarcato":{d:[["M",-.15,-8.19],["c",.15,-.12,.36,-.03,.45,.15],["c",.21,.42,3.45,7.65,3.45,7.71],["c",0,.12,-.12,.27,-.21,.3],["c",-.03,.03,-.51,.03,-1.14,.03],["c",-1.05,0,-1.08,0,-1.17,-.06],["c",-.09,-.06,-.24,-.36,-1.17,-2.4],["c",-.57,-1.29,-1.05,-2.34,-1.08,-2.34],["c",0,-.03,-.51,1.02,-1.08,2.34],["c",-.93,2.07,-1.08,2.34,-1.14,2.4],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.06,3.24,-7.32,3.45,-7.71],["c",.03,-.06,.09,-.15,.15,-.15],["z"]],w:7.5,h:8.245},"scripts.dmarcato":{d:[["M",-3.57,.03],["c",.03,0,.57,-.03,1.17,-.03],["c",1.05,0,1.08,0,1.17,.06],["c",.09,.06,.24,.36,1.17,2.4],["c",.57,1.29,1.05,2.34,1.08,2.34],["c",0,.03,.51,-1.02,1.08,-2.34],["c",.93,-2.07,1.08,-2.34,1.14,-2.4],["c",.06,-.03,.15,-.06,.18,-.06],["c",.15,0,.33,.18,.33,.33],["c",0,.09,-3.45,7.74,-3.54,7.83],["c",-.12,.12,-.3,.12,-.42,0],["c",-.09,-.09,-3.54,-7.74,-3.54,-7.83],["c",0,-.09,.12,-.27,.18,-.3],["z"]],w:7.5,h:8.25},"scripts.stopped":{d:[["M",-.27,-4.08],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.5],["l",0,1.47],["l",1.47,0],["l",1.5,0],["l",.15,.06],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.09,.36,0,.54],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.12,.06,-.18,.06,-1.62,.06],["l",-1.47,0],["l",0,1.47],["l",0,1.47],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-1.47],["l",0,-1.47],["l",-1.47,0],["c",-1.44,0,-1.5,0,-1.62,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.47,0],["l",1.47,0],["l",0,-1.47],["c",0,-1.44,0,-1.5,.06,-1.62],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:8.295,h:8.295},"scripts.upbow":{d:[["M",-4.65,-15.54],["c",.12,-.09,.36,-.06,.48,.03],["c",.03,.03,.09,.09,.12,.15],["c",.03,.06,.66,2.13,1.41,4.62],["c",1.35,4.41,1.38,4.56,2.01,6.96],["l",.63,2.46],["l",.63,-2.46],["c",.63,-2.4,.66,-2.55,2.01,-6.96],["c",.75,-2.49,1.38,-4.56,1.41,-4.62],["c",.06,-.15,.18,-.21,.36,-.24],["c",.15,0,.3,.06,.39,.18],["c",.15,.21,.24,-.18,-2.1,7.56],["c",-1.2,3.96,-2.22,7.32,-2.25,7.41],["c",0,.12,-.06,.27,-.09,.3],["c",-.12,.21,-.6,.21,-.72,0],["c",-.03,-.03,-.09,-.18,-.09,-.3],["c",-.03,-.09,-1.05,-3.45,-2.25,-7.41],["c",-2.34,-7.74,-2.25,-7.35,-2.1,-7.56],["c",.03,-.03,.09,-.09,.15,-.12],["z"]],w:9.73,h:15.608},"scripts.downbow":{d:[["M",-5.55,-9.93],["l",.09,-.06],["l",5.46,0],["l",5.46,0],["l",.09,.06],["l",.06,.09],["l",0,4.77],["c",0,5.28,0,4.89,-.18,5.01],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.06,-.09,-.06,-.18,-.06,-2.97],["l",0,-2.85],["l",-4.83,0],["l",-4.83,0],["l",0,2.85],["c",0,2.79,0,2.88,-.06,2.97],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.21,-.06,-4.89],["l",0,-4.77],["z"]],w:11.22,h:9.992},"scripts.turn":{d:[["M",-4.77,-3.9],["c",.36,-.06,1.05,-.06,1.44,.03],["c",.78,.15,1.5,.51,2.34,1.14],["c",.6,.45,1.05,.87,2.22,2.01],["c",1.11,1.08,1.62,1.5,2.22,1.86],["c",.6,.36,1.32,.57,1.92,.57],["c",.9,0,1.71,-.57,1.89,-1.35],["c",.24,-.93,-.39,-1.89,-1.35,-2.1],["l",-.15,-.06],["l",-.09,.15],["c",-.03,.09,-.15,.24,-.24,.33],["c",-.72,.72,-2.04,.54,-2.49,-.36],["c",-.48,-.93,.03,-1.86,1.17,-2.19],["c",.3,-.09,1.02,-.09,1.35,0],["c",.99,.27,1.74,.87,2.25,1.83],["c",.69,1.41,.63,3,-.21,4.26],["c",-.21,.3,-.69,.81,-.99,1.02],["c",-.3,.21,-.84,.45,-1.17,.54],["c",-1.23,.36,-2.49,.15,-3.72,-.6],["c",-.75,-.48,-1.41,-1.02,-2.85,-2.46],["c",-1.11,-1.08,-1.62,-1.5,-2.22,-1.86],["c",-.6,-.36,-1.32,-.57,-1.92,-.57],["c",-.9,0,-1.71,.57,-1.89,1.35],["c",-.24,.93,.39,1.89,1.35,2.1],["l",.15,.06],["l",.09,-.15],["c",.03,-.09,.15,-.24,.24,-.33],["c",.72,-.72,2.04,-.54,2.49,.36],["c",.48,.93,-.03,1.86,-1.17,2.19],["c",-.3,.09,-1.02,.09,-1.35,0],["c",-.99,-.27,-1.74,-.87,-2.25,-1.83],["c",-.69,-1.41,-.63,-3,.21,-4.26],["c",.21,-.3,.69,-.81,.99,-1.02],["c",.48,-.33,1.11,-.57,1.74,-.66],["z"]],w:16.366,h:7.893},"scripts.trill":{d:[["M",-.51,-16.02],["c",.12,-.09,.21,-.18,.21,-.18],["l",-.81,4.02],["l",-.81,4.02],["c",.03,0,.51,-.27,1.08,-.6],["c",.6,-.3,1.14,-.63,1.26,-.66],["c",1.14,-.54,2.31,-.6,3.09,-.18],["c",.27,.15,.54,.36,.6,.51],["l",.06,.12],["l",.21,-.21],["c",.9,-.81,2.22,-.99,3.12,-.42],["c",.6,.42,.9,1.14,.78,2.07],["c",-.15,1.29,-1.05,2.31,-1.95,2.25],["c",-.48,-.03,-.78,-.3,-.96,-.81],["c",-.09,-.27,-.09,-.9,-.03,-1.2],["c",.21,-.75,.81,-1.23,1.59,-1.32],["l",.24,-.03],["l",-.09,-.12],["c",-.51,-.66,-1.62,-.63,-2.31,.03],["c",-.39,.42,-.3,.09,-1.23,4.77],["l",-.81,4.14],["c",-.03,0,-.12,-.03,-.21,-.09],["c",-.33,-.15,-.54,-.18,-.99,-.18],["c",-.42,0,-.66,.03,-1.05,.18],["c",-.12,.06,-.21,.09,-.21,.09],["c",0,-.03,.36,-1.86,.81,-4.11],["c",.9,-4.47,.87,-4.26,.69,-4.53],["c",-.21,-.36,-.66,-.51,-1.17,-.36],["c",-.15,.06,-2.22,1.14,-2.58,1.38],["c",-.12,.09,-.12,.09,-.21,.6],["l",-.09,.51],["l",.21,.24],["c",.63,.75,1.02,1.47,1.2,2.19],["c",.06,.27,.06,.36,.06,.81],["c",0,.42,0,.54,-.06,.78],["c",-.15,.54,-.33,.93,-.63,1.35],["c",-.18,.24,-.57,.63,-.81,.78],["c",-.24,.15,-.63,.36,-.84,.42],["c",-.27,.06,-.66,.06,-.87,.03],["c",-.81,-.18,-1.32,-1.05,-1.38,-2.46],["c",-.03,-.6,.03,-.99,.33,-2.46],["c",.21,-1.08,.24,-1.32,.21,-1.29],["c",-1.2,.48,-2.4,.75,-3.21,.72],["c",-.69,-.06,-1.17,-.3,-1.41,-.72],["c",-.39,-.75,-.12,-1.8,.66,-2.46],["c",.24,-.18,.69,-.42,1.02,-.51],["c",.69,-.18,1.53,-.15,2.31,.09],["c",.3,.09,.75,.3,.99,.45],["c",.12,.09,.15,.09,.15,.03],["c",.03,-.03,.33,-1.59,.72,-3.45],["c",.36,-1.86,.66,-3.42,.69,-3.45],["c",0,-.03,.03,-.03,.21,.03],["c",.21,.06,.27,.06,.48,.06],["c",.42,-.03,.78,-.18,1.26,-.48],["c",.15,-.12,.36,-.27,.48,-.39],["z"],["m",-5.73,7.68],["c",-.27,-.03,-.96,-.06,-1.2,-.03],["c",-.81,.12,-1.35,.57,-1.5,1.2],["c",-.18,.66,.12,1.14,.75,1.29],["c",.66,.12,1.92,-.12,3.18,-.66],["l",.33,-.15],["l",.09,-.39],["c",.06,-.21,.09,-.42,.09,-.45],["c",0,-.03,-.45,-.3,-.75,-.45],["c",-.27,-.15,-.66,-.27,-.99,-.36],["z"],["m",4.29,3.63],["c",-.24,-.39,-.51,-.75,-.51,-.69],["c",-.06,.12,-.39,1.92,-.45,2.28],["c",-.09,.54,-.12,1.14,-.06,1.38],["c",.06,.42,.21,.6,.51,.57],["c",.39,-.06,.75,-.48,.93,-1.14],["c",.09,-.33,.09,-1.05,0,-1.38],["c",-.09,-.39,-.24,-.69,-.42,-1.02],["z"]],w:17.963,h:16.49},"scripts.segno":{d:[["M",-3.72,-11.22],["c",.78,-.09,1.59,.03,2.31,.42],["c",1.2,.6,2.01,1.71,2.31,3.09],["c",.09,.42,.09,1.2,.03,1.5],["c",-.15,.45,-.39,.81,-.66,.93],["c",-.33,.18,-.84,.21,-1.23,.15],["c",-.81,-.18,-1.32,-.93,-1.26,-1.89],["c",.03,-.36,.09,-.57,.24,-.9],["c",.15,-.33,.45,-.6,.72,-.75],["c",.12,-.06,.18,-.09,.18,-.12],["c",0,-.03,-.03,-.15,-.09,-.24],["c",-.18,-.45,-.54,-.87,-.96,-1.08],["c",-1.11,-.57,-2.34,-.18,-2.88,.9],["c",-.24,.51,-.33,1.11,-.24,1.83],["c",.27,1.92,1.5,3.54,3.93,5.13],["c",.48,.33,1.26,.78,1.29,.78],["c",.03,0,1.35,-2.19,2.94,-4.89],["l",2.88,-4.89],["l",.84,0],["l",.87,0],["l",-.03,.06],["c",-.15,.21,-6.15,10.41,-6.15,10.44],["c",0,0,.21,.15,.48,.27],["c",2.61,1.47,4.35,3.03,5.13,4.65],["c",1.14,2.34,.51,5.07,-1.44,6.39],["c",-.66,.42,-1.32,.63,-2.13,.69],["c",-2.01,.09,-3.81,-1.41,-4.26,-3.54],["c",-.09,-.42,-.09,-1.2,-.03,-1.5],["c",.15,-.45,.39,-.81,.66,-.93],["c",.33,-.18,.84,-.21,1.23,-.15],["c",.81,.18,1.32,.93,1.26,1.89],["c",-.03,.36,-.09,.57,-.24,.9],["c",-.15,.33,-.45,.6,-.72,.75],["c",-.12,.06,-.18,.09,-.18,.12],["c",0,.03,.03,.15,.09,.24],["c",.18,.45,.54,.87,.96,1.08],["c",1.11,.57,2.34,.18,2.88,-.9],["c",.24,-.51,.33,-1.11,.24,-1.83],["c",-.27,-1.92,-1.5,-3.54,-3.93,-5.13],["c",-.48,-.33,-1.26,-.78,-1.29,-.78],["c",-.03,0,-1.35,2.19,-2.91,4.89],["l",-2.88,4.89],["l",-.87,0],["l",-.87,0],["l",.03,-.06],["c",.15,-.21,6.15,-10.41,6.15,-10.44],["c",0,0,-.21,-.15,-.48,-.3],["c",-2.61,-1.44,-4.35,-3,-5.13,-4.62],["c",-.9,-1.89,-.72,-4.02,.48,-5.52],["c",.69,-.84,1.68,-1.41,2.73,-1.53],["z"],["m",8.76,9.09],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"],["m",-10.53,2.61],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"]],w:15,h:22.504},"scripts.coda":{d:[["M",-.21,-10.47],["c",.18,-.12,.42,-.06,.54,.12],["c",.06,.09,.06,.18,.06,1.5],["l",0,1.38],["l",.18,0],["c",.39,.06,.96,.24,1.38,.48],["c",1.68,.93,2.82,3.24,3.03,6.12],["c",.03,.24,.03,.45,.03,.45],["c",0,.03,.6,.03,1.35,.03],["c",1.5,0,1.47,0,1.59,.18],["c",.09,.12,.09,.3,0,.42],["c",-.12,.18,-.09,.18,-1.59,.18],["c",-.75,0,-1.35,0,-1.35,.03],["c",0,0,0,.21,-.03,.42],["c",-.24,3.15,-1.53,5.58,-3.45,6.36],["c",-.27,.12,-.72,.24,-.96,.27],["l",-.18,0],["l",0,1.38],["c",0,1.32,0,1.41,-.06,1.5],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.18,-.06,-1.5],["l",0,-1.38],["l",-.18,0],["c",-.39,-.06,-.96,-.24,-1.38,-.48],["c",-1.68,-.93,-2.82,-3.24,-3.03,-6.15],["c",-.03,-.21,-.03,-.42,-.03,-.42],["c",0,-.03,-.6,-.03,-1.35,-.03],["c",-1.5,0,-1.47,0,-1.59,-.18],["c",-.09,-.12,-.09,-.3,0,-.42],["c",.12,-.18,.09,-.18,1.59,-.18],["c",.75,0,1.35,0,1.35,-.03],["c",0,0,0,-.21,.03,-.45],["c",.24,-3.12,1.53,-5.55,3.45,-6.33],["c",.27,-.12,.72,-.24,.96,-.27],["l",.18,0],["l",0,-1.38],["c",0,-1.53,0,-1.5,.18,-1.62],["z"],["m",-.18,6.93],["c",0,-2.97,0,-3.15,-.06,-3.15],["c",-.09,0,-.51,.15,-.66,.21],["c",-.87,.51,-1.38,1.62,-1.56,3.51],["c",-.06,.54,-.12,1.59,-.12,2.16],["l",0,.42],["l",1.2,0],["l",1.2,0],["l",0,-3.15],["z"],["m",1.17,-3.06],["c",-.09,-.03,-.21,-.06,-.27,-.09],["l",-.12,0],["l",0,3.15],["l",0,3.15],["l",1.2,0],["l",1.2,0],["l",0,-.81],["c",-.06,-2.4,-.33,-3.69,-.93,-4.59],["c",-.27,-.39,-.66,-.69,-1.08,-.81],["z"],["m",-1.17,10.14],["l",0,-3.15],["l",-1.2,0],["l",-1.2,0],["l",0,.81],["c",.03,.96,.06,1.47,.15,2.13],["c",.24,2.04,.96,3.12,2.13,3.36],["l",.12,0],["l",0,-3.15],["z"],["m",3.18,-2.34],["l",0,-.81],["l",-1.2,0],["l",-1.2,0],["l",0,3.15],["l",0,3.15],["l",.12,0],["c",1.17,-.24,1.89,-1.32,2.13,-3.36],["c",.09,-.66,.12,-1.17,.15,-2.13],["z"]],w:16.035,h:21.062},"scripts.comma":{d:[["M",1.14,-4.62],["c",.3,-.12,.69,-.03,.93,.15],["c",.12,.12,.36,.45,.51,.78],["c",.9,1.77,.54,4.05,-1.08,6.75],["c",-.36,.63,-.87,1.38,-.96,1.44],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.09,-.18,-.09,-.3,.12,-.6],["c",.96,-1.44,1.44,-2.97,1.38,-4.35],["c",-.06,-.93,-.3,-1.68,-.78,-2.46],["c",-.27,-.39,-.33,-.63,-.24,-.96],["c",.09,-.27,.36,-.54,.66,-.63],["z"]],w:3.042,h:9.237},"scripts.roll":{d:[["M",1.95,-6],["c",.21,-.09,.36,-.09,.57,0],["c",.39,.15,.63,.39,1.47,1.35],["c",.66,.75,.78,.87,1.08,1.05],["c",.75,.45,1.65,.42,2.4,-.06],["c",.12,-.09,.27,-.27,.54,-.6],["c",.42,-.54,.51,-.63,.69,-.63],["c",.09,0,.3,.12,.36,.21],["c",.09,.12,.12,.3,.03,.42],["c",-.06,.12,-3.15,3.9,-3.3,4.08],["c",-.06,.06,-.18,.12,-.27,.18],["c",-.27,.12,-.6,.06,-.99,-.27],["c",-.27,-.21,-.42,-.39,-1.08,-1.14],["c",-.63,-.72,-.81,-.9,-1.17,-1.08],["c",-.36,-.18,-.57,-.21,-.99,-.21],["c",-.39,0,-.63,.03,-.93,.18],["c",-.36,.15,-.51,.27,-.9,.81],["c",-.24,.27,-.45,.51,-.48,.54],["c",-.12,.09,-.27,.06,-.39,0],["c",-.24,-.15,-.33,-.39,-.21,-.6],["c",.09,-.12,3.18,-3.87,3.33,-4.02],["c",.06,-.06,.18,-.15,.24,-.21],["z"]],w:10.817,h:6.125},"scripts.prall":{d:[["M",-4.38,-3.69],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.57,-.84,1.23,-1.83],["c",1.14,-1.68,1.23,-1.83,1.35,-1.89],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["c",-.03,0,-.57,.84,-1.23,1.83],["c",-1.14,1.68,-1.23,1.83,-1.35,1.89],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["z"]],w:15.011,h:7.5},"scripts.arpeggio":{d:[["M",1.5,0],["c",1.5,2,1.5,3,1.5,3],["s",0,1,-2,1.5],["s",-.5,3,1,5.5],["l",1.5,0],["s",-1.75,-2,-1.9,-3.25],["s",2.15,-.6,2.95,-1.6],["s",.45,-1,.5,-1.25],["s",0,-1,-2,-3.9],["l",-1.5,0],["z"]],w:5,h:10},"scripts.mordent":{d:[["M",-.21,-4.95],["c",.27,-.15,.63,0,.75,.27],["c",.06,.12,.06,.24,.06,1.44],["l",0,1.29],["l",.57,-.84],["c",.51,-.75,.57,-.84,.69,-.9],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.83,-1.89],["c",-.81,-.99,-1.5,-1.8,-1.53,-1.86],["c",-.06,-.03,-.06,-.03,-.12,.03],["c",-.06,.06,-.06,.15,-.06,2.28],["c",0,1.95,0,2.25,-.06,2.34],["c",-.18,.45,-.81,.48,-1.05,.03],["c",-.03,-.06,-.06,-.24,-.06,-1.41],["l",0,-1.35],["l",-.57,.84],["c",-.54,.78,-.6,.87,-.72,.93],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.06,-.06,.09,-.09],["c",.06,-.12,.06,-.15,.06,-2.28],["c",0,-1.92,0,-2.22,.06,-2.31],["c",.06,-.15,.15,-.24,.3,-.3],["z"]],w:15.011,h:10.012},"flags.u8th":{d:[["M",-.42,3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",0,.18],["c",0,.3,.06,.84,.12,1.23],["c",.24,1.53,.9,3.12,2.13,5.16],["l",.99,1.59],["c",.87,1.44,1.38,2.34,1.77,3.09],["c",.81,1.68,1.2,3.06,1.26,4.53],["c",.03,1.53,-.21,3.27,-.75,5.01],["c",-.21,.69,-.51,1.5,-.6,1.59],["c",-.09,.12,-.27,.21,-.42,.21],["c",-.15,0,-.42,-.12,-.51,-.21],["c",-.15,-.18,-.18,-.42,-.09,-.66],["c",.15,-.33,.45,-1.2,.57,-1.62],["c",.42,-1.38,.6,-2.58,.6,-3.9],["c",0,-.66,0,-.81,-.06,-1.11],["c",-.39,-2.07,-1.8,-4.26,-4.59,-7.14],["l",-.42,-.45],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["z"]],w:6.692,h:22.59},"flags.u16th":{d:[["M",-.42,7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,.39],["c",.06,1.08,.39,2.19,.99,3.39],["c",.45,.9,.87,1.59,1.95,3.12],["c",1.29,1.86,1.77,2.64,2.22,3.57],["c",.45,.93,.72,1.8,.87,2.64],["c",.06,.51,.06,1.5,0,1.92],["c",-.12,.6,-.3,1.2,-.54,1.71],["l",-.09,.24],["l",.18,.45],["c",.51,1.2,.72,2.22,.69,3.42],["c",-.06,1.53,-.39,3.03,-.99,4.53],["c",-.3,.75,-.36,.81,-.57,.9],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.12,-.75],["c",.66,-1.41,1.02,-2.88,1.08,-4.32],["c",0,-.6,-.03,-1.05,-.18,-1.59],["c",-.3,-1.2,-.99,-2.4,-2.25,-3.87],["c",-.42,-.48,-1.53,-1.62,-2.19,-2.22],["l",-.45,-.42],["l",-.03,1.11],["l",0,1.11],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["z"],["m",1.65,.09],["c",-.3,-.3,-.69,-.72,-.9,-.87],["l",-.33,-.33],["l",0,.15],["c",0,.3,.06,.81,.15,1.26],["c",.27,1.29,.87,2.61,2.04,4.29],["c",.15,.24,.6,.87,.96,1.38],["l",1.08,1.53],["l",.42,.63],["c",.03,0,.12,-.36,.21,-.72],["c",.06,-.33,.06,-1.2,0,-1.62],["c",-.33,-1.71,-1.44,-3.48,-3.63,-5.7],["z"]],w:6.693,h:26.337},"flags.u32nd":{d:[["M",-.42,11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,.36],["c",.09,1.68,.69,3.27,2.07,5.46],["l",.87,1.35],["c",1.02,1.62,1.47,2.37,1.86,3.18],["c",.48,1.02,.78,1.92,.93,2.88],["c",.06,.48,.06,1.5,0,1.89],["c",-.09,.42,-.21,.87,-.36,1.26],["l",-.12,.3],["l",.15,.39],["c",.69,1.56,.84,2.88,.54,4.38],["c",-.09,.45,-.27,1.08,-.45,1.47],["l",-.12,.24],["l",.18,.36],["c",.33,.72,.57,1.56,.69,2.34],["c",.12,1.02,-.06,2.52,-.42,3.84],["c",-.27,.93,-.75,2.13,-.93,2.31],["c",-.18,.15,-.45,.18,-.66,.09],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.06,-.6],["c",.21,-.36,.42,-.9,.57,-1.38],["c",.51,-1.41,.69,-3.06,.48,-4.08],["c",-.15,-.81,-.57,-1.68,-1.2,-2.55],["c",-.72,-.99,-1.83,-2.13,-3.3,-3.33],["l",-.48,-.42],["l",-.03,1.53],["l",0,1.56],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["z"],["m",1.26,-3.96],["c",-.27,-.3,-.54,-.6,-.66,-.72],["l",-.18,-.21],["l",0,.42],["c",.06,.87,.24,1.74,.66,2.67],["c",.36,.87,.96,1.86,1.92,3.18],["c",.21,.33,.63,.87,.87,1.23],["c",.27,.39,.6,.84,.75,1.08],["l",.27,.39],["l",.03,-.12],["c",.12,-.45,.15,-1.05,.09,-1.59],["c",-.27,-1.86,-1.38,-3.78,-3.75,-6.33],["z"],["m",-.27,6.09],["c",-.27,-.21,-.48,-.42,-.51,-.45],["c",-.06,-.03,-.06,-.03,-.06,.21],["c",0,.9,.3,2.04,.81,3.09],["c",.48,1.02,.96,1.77,2.37,3.63],["c",.6,.78,1.05,1.44,1.29,1.77],["c",.06,.12,.15,.21,.15,.18],["c",.03,-.03,.18,-.57,.24,-.87],["c",.06,-.45,.06,-1.32,-.03,-1.74],["c",-.09,-.48,-.24,-.9,-.51,-1.44],["c",-.66,-1.35,-1.83,-2.7,-3.75,-4.38],["z"]],w:6.697,h:32.145},"flags.u64th":{d:[["M",-.42,15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,.36],["c",.06,1.2,.39,2.37,1.02,3.66],["c",.39,.81,.84,1.56,1.8,3.09],["c",.81,1.26,1.05,1.68,1.35,2.22],["c",.87,1.5,1.35,2.79,1.56,4.08],["c",.06,.54,.06,1.56,-.03,2.04],["c",-.09,.48,-.21,.99,-.36,1.35],["l",-.12,.27],["l",.12,.27],["c",.09,.15,.21,.45,.27,.66],["c",.69,1.89,.63,3.66,-.18,5.46],["l",-.18,.39],["l",.15,.33],["c",.3,.66,.51,1.44,.63,2.1],["c",.06,.48,.06,1.35,0,1.71],["c",-.15,.57,-.42,1.2,-.78,1.68],["l",-.21,.27],["l",.18,.33],["c",.57,1.05,.93,2.13,1.02,3.18],["c",.06,.72,0,1.83,-.21,2.79],["c",-.18,1.02,-.63,2.34,-1.02,3.09],["c",-.15,.33,-.48,.45,-.78,.3],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.03,-.54],["c",.75,-1.5,1.23,-3.45,1.17,-4.89],["c",-.06,-1.02,-.42,-2.01,-1.17,-3.15],["c",-.48,-.72,-1.02,-1.35,-1.89,-2.22],["c",-.57,-.57,-1.56,-1.5,-1.92,-1.77],["l",-.12,-.09],["l",0,1.68],["l",0,1.68],["l",-.21,0],["l",-.21,0],["l",0,-15],["z"],["m",.93,-8.07],["c",-.27,-.3,-.48,-.54,-.51,-.54],["c",0,0,0,.69,.03,1.02],["c",.15,1.47,.75,2.94,2.04,4.83],["l",1.08,1.53],["c",.39,.57,.84,1.2,.99,1.44],["c",.15,.24,.3,.45,.3,.45],["c",0,0,.03,-.09,.06,-.21],["c",.36,-1.59,-.15,-3.33,-1.47,-5.4],["c",-.63,-.93,-1.35,-1.83,-2.52,-3.12],["z"],["m",.06,6.72],["c",-.24,-.21,-.48,-.42,-.51,-.45],["l",-.06,-.06],["l",0,.33],["c",0,1.2,.3,2.34,.93,3.6],["c",.45,.9,.96,1.68,2.25,3.51],["c",.39,.54,.84,1.17,1.02,1.44],["c",.21,.33,.33,.51,.33,.48],["c",.06,-.09,.21,-.63,.3,-.99],["c",.06,-.33,.06,-.45,.06,-.96],["c",0,-.6,-.03,-.84,-.18,-1.35],["c",-.3,-1.08,-1.02,-2.28,-2.13,-3.57],["c",-.39,-.45,-1.44,-1.47,-2.01,-1.98],["z"],["m",0,6.72],["c",-.24,-.21,-.48,-.39,-.51,-.42],["l",-.06,-.06],["l",0,.33],["c",0,1.41,.45,2.82,1.38,4.35],["c",.42,.72,.72,1.14,1.86,2.73],["c",.36,.45,.75,.99,.87,1.2],["c",.15,.21,.3,.36,.3,.36],["c",.06,0,.3,-.48,.39,-.75],["c",.09,-.36,.12,-.63,.12,-1.05],["c",-.06,-1.05,-.45,-2.04,-1.2,-3.18],["c",-.57,-.87,-1.11,-1.53,-2.07,-2.49],["c",-.36,-.33,-.84,-.78,-1.08,-1.02],["z"]],w:6.682,h:39.694},"flags.d8th":{d:[["M",5.67,-21.63],["c",.24,-.12,.54,-.06,.69,.15],["c",.06,.06,.21,.36,.39,.66],["c",.84,1.77,1.26,3.36,1.32,5.1],["c",.03,1.29,-.21,2.37,-.81,3.63],["c",-.6,1.23,-1.26,2.13,-3.21,4.38],["c",-1.35,1.53,-1.86,2.19,-2.4,2.97],["c",-.63,.93,-1.11,1.92,-1.38,2.79],["c",-.15,.54,-.27,1.35,-.27,1.8],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",.48,-.3],["c",1.83,-1.11,3.12,-2.1,4.17,-3.12],["c",.78,-.81,1.32,-1.53,1.71,-2.31],["c",.45,-.93,.6,-1.74,.51,-2.88],["c",-.12,-1.56,-.63,-3.18,-1.47,-4.68],["c",-.12,-.21,-.15,-.33,-.06,-.51],["c",.06,-.15,.15,-.24,.33,-.33],["z"]],w:8.492,h:21.691},"flags.ugrace":{d:[["M",6.03,6.93],["c",.15,-.09,.33,-.06,.51,0],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.06,.39,-.03,.54],["c",-.06,.15,-10.89,8.88,-11.07,8.97],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.06,-.39,.03,-.54],["c",.06,-.15,10.89,-8.88,11.07,-8.97],["z"]],w:12.019,h:9.954},"flags.dgrace":{d:[["M",-6.06,-15.93],["c",.18,-.09,.33,-.12,.48,-.06],["c",.18,.09,14.01,8.04,14.1,8.1],["c",.12,.12,.18,.33,.18,.51],["c",-.03,.21,-.15,.39,-.36,.48],["c",-.18,.09,-.33,.12,-.48,.06],["c",-.18,-.09,-14.01,-8.04,-14.1,-8.1],["c",-.12,-.12,-.18,-.33,-.18,-.51],["c",.03,-.21,.15,-.39,.36,-.48],["z"]],w:15.12,h:9.212},"flags.d16th":{d:[["M",6.84,-22.53],["c",.27,-.12,.57,-.06,.72,.15],["c",.15,.15,.33,.87,.45,1.56],["c",.06,.33,.06,1.35,0,1.65],["c",-.06,.33,-.15,.78,-.27,1.11],["c",-.12,.33,-.45,.96,-.66,1.32],["l",-.18,.27],["l",.09,.18],["c",.48,1.02,.72,2.25,.69,3.3],["c",-.06,1.23,-.42,2.28,-1.26,3.45],["c",-.57,.87,-.99,1.32,-3,3.39],["c",-1.56,1.56,-2.22,2.4,-2.76,3.45],["c",-.42,.84,-.66,1.8,-.66,2.55],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,1.14],["l",0,1.11],["l",.27,-.15],["c",1.11,-.57,1.77,-.99,2.52,-1.47],["c",2.37,-1.56,3.69,-3.15,4.05,-4.83],["c",.03,-.18,.03,-.39,.03,-.78],["c",0,-.6,-.03,-.93,-.24,-1.5],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.5],["c",-.06,-.18,-.15,-.36,-.15,-.36],["c",-.03,0,-.03,.03,-.06,.06],["c",-.06,.12,-.96,1.02,-1.95,1.98],["c",-.63,.57,-1.26,1.17,-1.44,1.35],["c",-1.53,1.62,-2.28,2.85,-2.55,4.32],["c",-.03,.18,-.03,.54,-.06,.99],["l",0,.69],["l",.18,-.09],["c",.93,-.54,2.1,-1.29,2.82,-1.83],["c",.69,-.51,1.02,-.81,1.53,-1.29],["c",1.86,-1.89,2.37,-3.66,1.68,-5.82],["z"]],w:8.475,h:22.591},"flags.d32nd":{d:[["M",6.84,-29.13],["c",.27,-.12,.57,-.06,.72,.15],["c",.12,.12,.27,.63,.36,1.11],["c",.33,1.59,.06,3.06,-.81,4.47],["l",-.18,.27],["l",.09,.15],["c",.12,.24,.33,.69,.45,1.05],["c",.63,1.83,.45,3.57,-.57,5.22],["l",-.18,.3],["l",.15,.27],["c",.42,.87,.6,1.71,.57,2.61],["c",-.06,1.29,-.48,2.46,-1.35,3.78],["c",-.54,.81,-.93,1.29,-2.46,3],["c",-.51,.54,-1.05,1.17,-1.26,1.41],["c",-1.56,1.86,-2.25,3.36,-2.37,5.01],["l",0,.33],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,1.35],["l",.03,1.35],["l",.78,-.39],["c",1.38,-.69,2.34,-1.26,3.24,-1.92],["c",1.38,-1.02,2.28,-2.13,2.64,-3.21],["c",.15,-.48,.18,-.72,.18,-1.29],["c",0,-.57,-.06,-.9,-.24,-1.47],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.2],["c",-.09,-.18,-.12,-.21,-.12,-.15],["c",-.03,.09,-1.02,1.08,-2.04,2.04],["c",-1.17,1.08,-1.65,1.56,-2.07,2.04],["c",-.84,.96,-1.38,1.86,-1.68,2.76],["c",-.21,.57,-.27,.99,-.3,1.65],["l",0,.54],["l",.66,-.33],["c",3.57,-1.86,5.49,-3.69,5.94,-5.7],["c",.06,-.39,.06,-1.2,-.03,-1.65],["c",-.06,-.39,-.24,-.9,-.36,-1.2],["z"],["m",-.06,7.2],["c",-.06,-.15,-.12,-.33,-.15,-.45],["l",-.06,-.18],["l",-.18,.21],["l",-1.83,1.83],["c",-.87,.9,-1.77,1.8,-1.95,2.01],["c",-1.08,1.29,-1.62,2.31,-1.89,3.51],["c",-.06,.3,-.06,.51,-.09,.93],["l",0,.57],["l",.09,-.06],["c",.75,-.45,1.89,-1.26,2.52,-1.74],["c",.81,-.66,1.74,-1.53,2.22,-2.16],["c",1.26,-1.53,1.68,-3.06,1.32,-4.47],["z"]],w:8.385,h:29.191},"flags.d64th":{d:[["M",7.08,-32.88],["c",.3,-.12,.66,-.03,.78,.24],["c",.18,.33,.27,2.1,.15,2.64],["c",-.09,.39,-.21,.78,-.39,1.08],["l",-.15,.3],["l",.09,.27],["c",.03,.12,.09,.45,.12,.69],["c",.27,1.44,.18,2.55,-.3,3.6],["l",-.12,.33],["l",.06,.42],["c",.27,1.35,.33,2.82,.21,3.63],["c",-.12,.6,-.3,1.23,-.57,1.8],["l",-.15,.27],["l",.03,.42],["c",.06,1.02,.06,2.7,.03,3.06],["c",-.15,1.47,-.66,2.76,-1.74,4.41],["c",-.45,.69,-.75,1.11,-1.74,2.37],["c",-1.05,1.38,-1.5,1.98,-1.95,2.73],["c",-.93,1.5,-1.38,2.82,-1.44,4.2],["l",0,.42],["l",-.21,0],["l",-.21,0],["l",0,-15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,1.86],["l",0,1.89],["c",0,0,.21,-.03,.45,-.09],["c",2.22,-.39,4.08,-1.11,5.19,-2.01],["c",.63,-.54,1.02,-1.14,1.2,-1.8],["c",.06,-.3,.06,-1.14,-.03,-1.65],["c",-.03,-.18,-.06,-.39,-.09,-.48],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.45,6.15],["c",-.03,-.18,-.06,-.42,-.06,-.54],["l",-.03,-.18],["l",-.33,.3],["c",-.42,.36,-.87,.72,-1.68,1.29],["c",-1.98,1.38,-2.25,1.59,-2.85,2.16],["c",-.75,.69,-1.23,1.44,-1.47,2.19],["c",-.15,.45,-.18,.63,-.21,1.35],["l",0,.66],["l",.39,-.18],["c",1.83,-.9,3.45,-1.95,4.47,-2.91],["c",.93,-.9,1.53,-1.83,1.74,-2.82],["c",.06,-.33,.06,-.87,.03,-1.32],["z"],["m",-.27,4.86],["c",-.03,-.21,-.06,-.36,-.06,-.36],["c",0,-.03,-.12,.09,-.24,.24],["c",-.39,.48,-.99,1.08,-2.16,2.19],["c",-1.47,1.38,-1.92,1.83,-2.46,2.49],["c",-.66,.87,-1.08,1.74,-1.29,2.58],["c",-.09,.42,-.15,.87,-.15,1.44],["l",0,.54],["l",.48,-.33],["c",1.5,-1.02,2.58,-1.89,3.51,-2.82],["c",1.47,-1.47,2.25,-2.85,2.4,-4.26],["c",.03,-.39,.03,-1.17,-.03,-1.71],["z"],["m",-.66,7.68],["c",.03,-.15,.03,-.6,.03,-.99],["l",0,-.72],["l",-.27,.33],["l",-1.74,1.98],["c",-1.77,1.92,-2.43,2.76,-2.97,3.9],["c",-.51,1.02,-.72,1.77,-.75,2.91],["c",0,.63,0,.63,.06,.6],["c",.03,-.03,.3,-.27,.63,-.54],["c",.66,-.6,1.86,-1.8,2.31,-2.31],["c",1.65,-1.89,2.52,-3.54,2.7,-5.16],["z"]],w:8.485,h:32.932},"clefs.C":{d:[["M",.06,-14.94],["l",.09,-.06],["l",1.92,0],["l",1.92,0],["l",.09,.06],["l",.06,.09],["l",0,14.85],["l",0,14.82],["l",-.06,.09],["l",-.09,.06],["l",-1.92,0],["l",-1.92,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"],["m",5.37,0],["c",.09,-.06,.09,-.06,.57,-.06],["c",.45,0,.45,0,.54,.06],["l",.06,.09],["l",0,7.14],["l",0,7.11],["l",.09,-.06],["c",.18,-.18,.72,-.84,.96,-1.2],["c",.3,-.45,.66,-1.17,.84,-1.65],["c",.36,-.9,.57,-1.83,.6,-2.79],["c",.03,-.48,.03,-.54,.09,-.63],["c",.12,-.18,.36,-.21,.54,-.12],["c",.18,.09,.21,.15,.24,.66],["c",.06,.87,.21,1.56,.57,2.22],["c",.51,1.02,1.26,1.68,2.22,1.92],["c",.21,.06,.33,.06,.78,.06],["c",.45,0,.57,0,.84,-.06],["c",.45,-.12,.81,-.33,1.08,-.6],["c",.57,-.57,.87,-1.41,.99,-2.88],["c",.06,-.54,.06,-3,0,-3.57],["c",-.21,-2.58,-.84,-3.87,-2.16,-4.5],["c",-.48,-.21,-1.17,-.36,-1.77,-.36],["c",-.69,0,-1.29,.27,-1.5,.72],["c",-.06,.15,-.06,.21,-.06,.42],["c",0,.24,0,.3,.06,.45],["c",.12,.24,.24,.39,.63,.66],["c",.42,.3,.57,.48,.69,.72],["c",.06,.15,.06,.21,.06,.48],["c",0,.39,-.03,.63,-.21,.96],["c",-.3,.6,-.87,1.08,-1.5,1.26],["c",-.27,.06,-.87,.06,-1.14,0],["c",-.78,-.24,-1.44,-.87,-1.65,-1.68],["c",-.12,-.42,-.09,-1.17,.09,-1.71],["c",.51,-1.65,1.98,-2.82,3.81,-3.09],["c",.84,-.09,2.46,.03,3.51,.27],["c",2.22,.57,3.69,1.8,4.44,3.75],["c",.36,.93,.57,2.13,.57,3.36],["c",0,1.44,-.48,2.73,-1.38,3.81],["c",-1.26,1.5,-3.27,2.43,-5.28,2.43],["c",-.48,0,-.51,0,-.75,-.09],["c",-.15,-.03,-.48,-.21,-.78,-.36],["c",-.69,-.36,-.87,-.42,-1.26,-.42],["c",-.27,0,-.3,0,-.51,.09],["c",-.57,.3,-.81,.9,-.81,2.1],["c",0,1.23,.24,1.83,.81,2.13],["c",.21,.09,.24,.09,.51,.09],["c",.39,0,.57,-.06,1.26,-.42],["c",.3,-.15,.63,-.33,.78,-.36],["c",.24,-.09,.27,-.09,.75,-.09],["c",2.01,0,4.02,.93,5.28,2.4],["c",.9,1.11,1.38,2.4,1.38,3.84],["c",0,1.5,-.3,2.88,-.84,3.96],["c",-.78,1.59,-2.19,2.64,-4.17,3.15],["c",-1.05,.24,-2.67,.36,-3.51,.27],["c",-1.83,-.27,-3.3,-1.44,-3.81,-3.09],["c",-.18,-.54,-.21,-1.29,-.09,-1.74],["c",.15,-.6,.63,-1.2,1.23,-1.47],["c",.36,-.18,.57,-.21,.99,-.21],["c",.42,0,.63,.03,1.02,.21],["c",.42,.21,.84,.63,1.05,1.05],["c",.18,.36,.21,.6,.21,.96],["c",0,.3,0,.36,-.06,.51],["c",-.12,.24,-.27,.42,-.69,.72],["c",-.57,.42,-.69,.63,-.69,1.08],["c",0,.24,0,.3,.06,.45],["c",.12,.21,.3,.39,.57,.54],["c",.42,.18,.87,.21,1.53,.15],["c",1.08,-.15,1.8,-.57,2.34,-1.32],["c",.54,-.75,.84,-1.83,.99,-3.51],["c",.06,-.57,.06,-3.03,0,-3.57],["c",-.12,-1.47,-.42,-2.31,-.99,-2.88],["c",-.27,-.27,-.63,-.48,-1.08,-.6],["c",-.27,-.06,-.39,-.06,-.84,-.06],["c",-.45,0,-.57,0,-.78,.06],["c",-1.14,.27,-2.01,1.17,-2.46,2.49],["c",-.21,.57,-.3,.99,-.33,1.65],["c",-.03,.51,-.06,.57,-.24,.66],["c",-.12,.06,-.27,.06,-.39,0],["c",-.21,-.09,-.21,-.15,-.24,-.75],["c",-.09,-1.92,-.78,-3.72,-2.01,-5.19],["c",-.18,-.21,-.36,-.42,-.39,-.45],["l",-.09,-.06],["l",0,7.11],["l",0,7.14],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.54,.06],["c",-.48,0,-.48,0,-.57,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"]],w:20.31,h:29.97},"clefs.F":{d:[["M",6.3,-7.8],["c",.36,-.03,1.65,0,2.13,.03],["c",3.6,.42,6.03,2.1,6.93,4.86],["c",.27,.84,.36,1.5,.36,2.58],["c",0,.9,-.03,1.35,-.18,2.16],["c",-.78,3.78,-3.54,7.08,-8.37,9.96],["c",-1.74,1.05,-3.87,2.13,-6.18,3.12],["c",-.39,.18,-.75,.33,-.81,.36],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.15,.06,-.21,.51,-.48],["c",3,-1.77,5.13,-3.21,6.84,-4.74],["c",.51,-.45,1.59,-1.5,1.95,-1.95],["c",1.89,-2.19,2.88,-4.32,3.15,-6.78],["c",.06,-.42,.06,-1.77,0,-2.19],["c",-.24,-2.01,-.93,-3.63,-2.04,-4.71],["c",-.63,-.63,-1.29,-1.02,-2.07,-1.2],["c",-1.62,-.39,-3.36,.15,-4.56,1.44],["c",-.54,.6,-1.05,1.47,-1.32,2.22],["l",-.09,.21],["l",.24,-.12],["c",.39,-.21,.63,-.24,1.11,-.24],["c",.3,0,.45,0,.66,.06],["c",1.92,.48,2.85,2.55,1.95,4.38],["c",-.45,.99,-1.41,1.62,-2.46,1.71],["c",-1.47,.09,-2.91,-.87,-3.39,-2.25],["c",-.18,-.57,-.21,-1.32,-.03,-2.28],["c",.39,-2.25,1.83,-4.2,3.81,-5.19],["c",.69,-.36,1.59,-.6,2.37,-.69],["z"],["m",11.58,2.52],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.3,1.17,-.72,2.19,-1.89,1.89],["c",-.99,-.21,-1.5,-1.32,-1.02,-2.25],["c",.18,-.39,.6,-.69,1.02,-.78],["z"],["m",0,7.5],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.21,.87,-.3,1.71,-1.14,1.89],["c",-.87,.21,-1.71,-.3,-1.89,-1.14],["c",-.21,-.84,.3,-1.71,1.14,-1.89],["z"]],w:20.153,h:23.142},"clefs.G":{d:[["M",9.69,-37.41],["c",.09,-.09,.24,-.06,.36,0],["c",.12,.09,.57,.6,.96,1.11],["c",1.77,2.34,3.21,5.85,3.57,8.73],["c",.21,1.56,.03,3.27,-.45,4.86],["c",-.69,2.31,-1.92,4.47,-4.23,7.44],["c",-.3,.39,-.57,.72,-.6,.75],["c",-.03,.06,0,.15,.18,.78],["c",.54,1.68,1.38,4.44,1.68,5.49],["l",.09,.42],["l",.39,0],["c",1.47,.09,2.76,.51,3.96,1.29],["c",1.83,1.23,3.06,3.21,3.39,5.52],["c",.09,.45,.12,1.29,.06,1.74],["c",-.09,1.02,-.33,1.83,-.75,2.73],["c",-.84,1.71,-2.28,3.06,-4.02,3.72],["l",-.33,.12],["l",.03,1.26],["c",0,1.74,-.06,3.63,-.21,4.62],["c",-.45,3.06,-2.19,5.49,-4.47,6.21],["c",-.57,.18,-.9,.21,-1.59,.21],["c",-.69,0,-1.02,-.03,-1.65,-.21],["c",-1.14,-.27,-2.13,-.84,-2.94,-1.65],["c",-.99,-.99,-1.56,-2.16,-1.71,-3.54],["c",-.09,-.81,.06,-1.53,.45,-2.13],["c",.63,-.99,1.83,-1.56,3,-1.53],["c",1.5,.09,2.64,1.32,2.73,2.94],["c",.06,1.47,-.93,2.7,-2.37,2.97],["c",-.45,.06,-.84,.03,-1.29,-.09],["l",-.21,-.09],["l",.09,.12],["c",.39,.54,.78,.93,1.32,1.26],["c",1.35,.87,3.06,1.02,4.35,.36],["c",1.44,-.72,2.52,-2.28,2.97,-4.35],["c",.15,-.66,.24,-1.5,.3,-3.03],["c",.03,-.84,.03,-2.94,0,-3],["c",-.03,0,-.18,0,-.36,.03],["c",-.66,.12,-.99,.12,-1.83,.12],["c",-1.05,0,-1.71,-.06,-2.61,-.3],["c",-4.02,-.99,-7.11,-4.35,-7.8,-8.46],["c",-.12,-.66,-.12,-.99,-.12,-1.83],["c",0,-.84,0,-1.14,.15,-1.92],["c",.36,-2.28,1.41,-4.62,3.3,-7.29],["l",2.79,-3.6],["c",.54,-.66,.96,-1.2,.96,-1.23],["c",0,-.03,-.09,-.33,-.18,-.69],["c",-.96,-3.21,-1.41,-5.28,-1.59,-7.68],["c",-.12,-1.38,-.15,-3.09,-.06,-3.96],["c",.33,-2.67,1.38,-5.07,3.12,-7.08],["c",.36,-.42,.99,-1.05,1.17,-1.14],["z"],["m",2.01,4.71],["c",-.15,-.3,-.3,-.54,-.3,-.54],["c",-.03,0,-.18,.09,-.3,.21],["c",-2.4,1.74,-3.87,4.2,-4.26,7.11],["c",-.06,.54,-.06,1.41,-.03,1.89],["c",.09,1.29,.48,3.12,1.08,5.22],["c",.15,.42,.24,.78,.24,.81],["c",0,.03,.84,-1.11,1.23,-1.68],["c",1.89,-2.73,2.88,-5.07,3.15,-7.53],["c",.09,-.57,.12,-1.74,.06,-2.37],["c",-.09,-1.23,-.27,-1.92,-.87,-3.12],["z"],["m",-2.94,20.7],["c",-.21,-.72,-.39,-1.32,-.42,-1.32],["c",0,0,-1.2,1.47,-1.86,2.37],["c",-2.79,3.63,-4.02,6.3,-4.35,9.3],["c",-.03,.21,-.03,.69,-.03,1.08],["c",0,.69,0,.75,.06,1.11],["c",.12,.54,.27,.99,.51,1.47],["c",.69,1.38,1.83,2.55,3.42,3.42],["c",.96,.54,2.07,.9,3.21,1.08],["c",.78,.12,2.04,.12,2.94,-.03],["c",.51,-.06,.45,-.03,.42,-.3],["c",-.24,-3.33,-.72,-6.33,-1.62,-10.08],["c",-.09,-.39,-.18,-.75,-.18,-.78],["c",-.03,-.03,-.42,0,-.81,.09],["c",-.9,.18,-1.65,.57,-2.22,1.14],["c",-.72,.72,-1.08,1.65,-1.05,2.64],["c",.06,.96,.48,1.83,1.23,2.58],["c",.36,.36,.72,.63,1.17,.9],["c",.33,.18,.36,.21,.42,.33],["c",.18,.42,-.18,.9,-.6,.87],["c",-.18,-.03,-.84,-.36,-1.26,-.63],["c",-.78,-.51,-1.38,-1.11,-1.86,-1.83],["c",-1.77,-2.7,-.99,-6.42,1.71,-8.19],["c",.3,-.21,.81,-.48,1.17,-.63],["c",.3,-.09,1.02,-.3,1.14,-.3],["c",.06,0,.09,0,.09,-.03],["c",.03,-.03,-.51,-1.92,-1.23,-4.26],["z"],["m",3.78,7.41],["c",-.18,-.03,-.36,-.06,-.39,-.06],["c",-.03,0,0,.21,.18,1.02],["c",.75,3.18,1.26,6.3,1.5,9.09],["c",.06,.72,0,.69,.51,.42],["c",.78,-.36,1.44,-.96,1.98,-1.77],["c",1.08,-1.62,1.2,-3.69,.3,-5.55],["c",-.81,-1.62,-2.31,-2.79,-4.08,-3.15],["z"]],w:19.051,h:57.057},"clefs.perc":{d:[["M",5.07,-7.44],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"],["m",6.63,0],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"]],w:21,h:14.97},"tab.big":{d:[["M",20.16,-21.66],["c",.24,-.09,.66,.09,.78,.36],["c",.09,.21,.09,.24,-.18,.54],["c",-.78,.81,-1.86,1.44,-2.94,1.71],["c",-.87,.24,-1.71,.24,-2.55,.03],["l",-.06,-.03],["l",-.18,.99],["c",-.33,1.98,-.75,4.26,-.96,5.04],["c",-.42,1.65,-1.26,3.18,-2.28,4.14],["c",-.57,.57,-1.17,.9,-1.86,1.08],["c",-.18,.06,-.33,.06,-.66,.06],["c",-.54,0,-.78,-.03,-1.23,-.27],["c",-.39,-.18,-.66,-.39,-1.38,-.99],["c",-.3,-.24,-.66,-.51,-.75,-.57],["c",-.21,-.15,-.27,-.24,-.24,-.45],["c",.06,-.27,.36,-.6,.6,-.66],["c",.18,-.03,.33,.06,.9,.57],["c",.48,.42,.72,.57,.93,.69],["c",.66,.33,1.38,.21,1.95,-.36],["c",.63,-.6,1.05,-1.62,1.23,-3],["c",.03,-.18,.09,-.66,.09,-1.11],["c",.09,-1.56,.33,-3.81,.57,-5.49],["c",.06,-.33,.09,-.63,.09,-.63],["c",-.03,-.03,-.81,-.12,-1.02,-.12],["c",-.57,0,-1.32,.12,-1.8,.33],["c",-.87,.3,-1.35,.78,-1.5,1.41],["c",-.18,.63,.09,1.26,.66,1.65],["c",.12,.06,.15,.12,.18,.24],["c",.09,.27,.06,.57,-.09,.75],["c",-.03,.06,-.12,.09,-.27,.15],["c",-.72,.21,-1.44,.15,-2.1,-.18],["c",-.54,-.27,-.96,-.66,-1.2,-1.14],["c",-.39,-.75,-.33,-1.74,.15,-2.52],["c",.27,-.42,.84,-.93,1.41,-1.23],["c",1.17,-.57,2.88,-.9,4.8,-.9],["c",.69,0,.78,0,1.08,.06],["c",.45,.09,1.11,.3,2.07,.6],["c",1.47,.48,1.83,.57,2.55,.54],["c",1.02,-.06,2.04,-.45,2.94,-1.11],["c",.12,-.09,.24,-.18,.27,-.18],["z"],["m",-5.88,13.05],["c",.21,-.03,.81,0,1.08,.06],["c",.48,.12,.9,.42,.99,.69],["c",.03,.09,.03,.15,0,.27],["c",0,.09,-.03,.57,-.06,1.08],["c",-.09,2.19,-.24,5.76,-.39,8.28],["c",-.06,1.53,-.06,1.77,.03,2.01],["c",.09,.18,.15,.24,.3,.3],["c",.24,.12,.54,.06,1.23,-.27],["c",.57,-.27,.66,-.3,.75,-.24],["c",.09,.06,.18,.3,.18,.45],["c",0,.33,-.15,.51,-.45,.63],["c",-.12,.03,-.39,.15,-.6,.27],["c",-1.17,.6,-1.38,.69,-1.8,.72],["c",-.45,.03,-.78,-.09,-1.08,-.39],["c",-.39,-.42,-.66,-1.2,-1.02,-3.12],["c",-.24,-1.23,-.36,-2.07,-.54,-3.75],["l",0,-.18],["l",-.36,.45],["c",-.6,.75,-1.32,1.59,-1.95,2.25],["c",-.15,.18,-.27,.3,-.27,.33],["c",0,0,.06,.09,.15,.18],["c",.24,.33,.6,.57,1.05,.69],["c",.18,.06,.3,.06,.69,.06],["l",.48,.03],["l",.06,.12],["c",.15,.27,.03,.72,-.21,.9],["c",-.18,.12,-.93,.27,-1.41,.27],["c",-.84,0,-1.59,-.3,-1.98,-.84],["l",-.12,-.15],["l",-.45,.42],["c",-.99,.87,-1.53,1.32,-2.16,1.74],["c",-.78,.51,-1.5,.84,-2.1,.93],["c",-.69,.12,-1.2,.03,-1.95,-.42],["c",-.21,-.12,-.51,-.27,-.66,-.36],["c",-.24,-.12,-.3,-.18,-.33,-.24],["c",-.12,-.27,.15,-.78,.45,-.93],["c",.24,-.12,.33,-.09,.9,.18],["c",.6,.3,.84,.39,1.2,.36],["c",.87,-.09,1.77,-.69,3.24,-2.31],["c",2.67,-2.85,4.59,-5.94,5.7,-9.15],["c",.15,-.45,.24,-.63,.42,-.81],["c",.21,-.24,.6,-.45,.99,-.51],["z"],["m",-3.99,16.05],["c",.18,0,.69,-.03,1.17,0],["c",3.27,.03,5.37,.75,6,2.07],["c",.45,.99,.12,2.4,-.81,3.42],["c",-.24,.27,-.57,.57,-.84,.75],["c",-.09,.06,-.18,.09,-.18,.12],["c",0,0,.18,.03,.42,.09],["c",1.23,.3,2.01,.81,2.37,1.59],["c",.27,.54,.3,1.32,.09,2.1],["c",-.12,.36,-.45,1.05,-.69,1.35],["c",-.87,1.17,-2.1,1.92,-3.54,2.25],["c",-.36,.06,-.48,.06,-.96,.06],["c",-.45,0,-.66,0,-.84,-.03],["c",-.84,-.18,-1.47,-.51,-2.07,-1.11],["c",-.33,-.33,-.45,-.51,-.45,-.63],["c",0,-.06,.03,-.15,.06,-.24],["c",.18,-.33,.69,-.6,.93,-.48],["c",.03,.03,.15,.12,.27,.24],["c",.39,.42,.99,.57,1.62,.45],["c",1.05,-.21,1.98,-1.02,2.31,-2.01],["c",.48,-1.53,-.48,-2.55,-2.58,-2.67],["c",-.21,0,-.36,-.03,-.42,-.06],["c",-.15,-.09,-.21,-.51,-.06,-.78],["c",.12,-.27,.24,-.33,.6,-.36],["c",.57,-.06,1.11,-.42,1.5,-.99],["c",.48,-.72,.54,-1.59,.18,-2.31],["c",-.12,-.21,-.45,-.54,-.69,-.69],["c",-.33,-.21,-.93,-.45,-1.35,-.51],["l",-.12,-.03],["l",-.06,.48],["c",-.54,2.94,-1.14,6.24,-1.29,6.75],["c",-.33,1.35,-.93,2.61,-1.65,3.6],["c",-.3,.36,-.81,.9,-1.14,1.14],["c",-.3,.24,-.84,.48,-1.14,.57],["c",-.33,.09,-.96,.09,-1.26,.03],["c",-.45,-.12,-.87,-.39,-1.53,-.96],["c",-.24,-.15,-.51,-.39,-.63,-.48],["c",-.3,-.21,-.33,-.33,-.21,-.63],["c",.12,-.18,.27,-.36,.42,-.45],["c",.27,-.12,.36,-.09,.87,.33],["c",.78,.6,1.08,.75,1.65,.72],["c",.45,-.03,.81,-.21,1.17,-.54],["c",.87,-.9,1.38,-2.85,1.38,-5.37],["c",0,-.6,.03,-1.11,.12,-2.04],["c",.06,-.69,.24,-2.01,.33,-2.58],["c",.06,-.24,.06,-.42,.06,-.42],["c",0,0,-.12,.03,-.21,.09],["c",-1.44,.57,-2.16,1.65,-1.74,2.55],["c",.09,.15,.18,.24,.27,.33],["c",.24,.21,.3,.27,.33,.39],["c",.06,.24,0,.63,-.15,.78],["c",-.09,.12,-.54,.21,-.96,.24],["c",-1.02,.03,-2.01,-.48,-2.43,-1.32],["c",-.21,-.45,-.27,-.9,-.15,-1.44],["c",.06,-.27,.21,-.66,.39,-.93],["c",.87,-1.29,3,-2.22,5.64,-2.43],["z"]],w:19.643,h:43.325},"tab.tiny":{d:[["M",16.02,-17.25],["c",.12,-.09,.15,-.09,.27,-.09],["c",.21,.03,.51,.3,.51,.45],["c",0,.06,-.12,.18,-.3,.36],["c",-1.11,1.08,-2.55,1.59,-3.84,1.41],["c",-.15,-.03,-.33,-.06,-.39,-.09],["c",-.06,-.03,-.09,-.03,-.12,-.03],["c",0,0,-.06,.42,-.15,.93],["c",-.33,2.01,-.66,3.69,-.84,4.26],["c",-.42,1.41,-1.23,2.67,-2.16,3.33],["c",-.27,.18,-.75,.42,-.99,.48],["c",-.3,.09,-.72,.09,-1.02,.06],["c",-.45,-.09,-.84,-.33,-1.53,-.9],["c",-.21,-.18,-.51,-.39,-.63,-.48],["c",-.27,-.21,-.3,-.24,-.3,-.36],["c",0,-.12,.09,-.36,.18,-.45],["c",.09,-.09,.27,-.18,.36,-.18],["c",.12,0,.3,.12,.66,.45],["c",.57,.51,.87,.69,1.23,.72],["c",.93,.06,1.68,-.78,1.98,-2.37],["c",.09,-.39,.15,-.75,.18,-1.53],["c",.06,-.99,.24,-2.79,.42,-4.05],["c",.03,-.3,.06,-.57,.06,-.6],["c",0,-.06,-.03,-.09,-.15,-.12],["c",-.9,-.18,-2.13,.06,-2.76,.57],["c",-.36,.3,-.51,.6,-.51,1.02],["c",0,.45,.15,.75,.48,.99],["c",.06,.06,.15,.18,.18,.24],["c",.12,.24,.03,.63,-.15,.69],["c",-.24,.12,-.6,.15,-.9,.15],["c",-.36,-.03,-.57,-.09,-.87,-.24],["c",-.78,-.36,-1.23,-1.11,-1.2,-1.92],["c",.12,-1.53,1.74,-2.49,4.62,-2.7],["c",1.2,-.09,1.47,-.03,3.33,.57],["c",.9,.3,1.14,.36,1.56,.39],["c",.45,0,.93,-.06,1.38,-.21],["c",.51,-.18,.81,-.33,1.41,-.75],["z"],["m",-4.68,10.38],["c",.39,-.06,.84,0,1.2,.15],["c",.24,.12,.36,.21,.45,.36],["l",.09,.09],["l",-.06,1.41],["c",-.09,2.19,-.18,3.96,-.27,5.49],["c",-.03,.78,-.06,1.59,-.06,1.86],["c",0,.42,0,.48,.06,.57],["c",.06,.18,.18,.24,.36,.27],["c",.18,0,.39,-.06,.84,-.27],["c",.45,-.21,.54,-.24,.63,-.18],["c",.12,.12,.15,.54,.03,.69],["c",-.03,.03,-.15,.12,-.27,.18],["c",-.15,.03,-.3,.12,-.36,.15],["c",-.87,.45,-1.02,.51,-1.26,.57],["c",-.33,.09,-.6,.06,-.84,-.06],["c",-.42,-.18,-.63,-.6,-.87,-1.44],["c",-.3,-1.23,-.57,-2.97,-.66,-4.08],["c",0,-.18,-.03,-.3,-.03,-.33],["l",-.06,.06],["c",-.18,.27,-1.11,1.38,-1.68,2.01],["l",-.33,.33],["l",.06,.09],["c",.06,.15,.27,.33,.48,.42],["c",.27,.18,.51,.24,.96,.27],["l",.39,0],["l",.03,.12],["c",.12,.21,.03,.57,-.15,.69],["c",-.03,.03,-.21,.09,-.36,.15],["c",-.27,.06,-.39,.06,-.75,.06],["c",-.48,0,-.75,-.03,-1.08,-.21],["c",-.21,-.12,-.51,-.36,-.57,-.48],["l",-.03,-.09],["l",-.39,.36],["c",-1.47,1.35,-2.49,1.98,-3.42,2.13],["c",-.54,.09,-.96,-.03,-1.62,-.39],["c",-.21,-.15,-.45,-.27,-.54,-.3],["c",-.18,-.09,-.21,-.21,-.12,-.45],["c",.06,-.27,.33,-.48,.54,-.48],["c",.03,0,.27,.09,.48,.21],["c",.48,.24,.69,.27,.99,.27],["c",.6,-.06,1.17,-.42,2.1,-1.35],["c",2.22,-2.22,4.02,-4.98,4.95,-7.59],["c",.21,-.57,.3,-.78,.48,-.93],["c",.15,-.15,.42,-.27,.66,-.33],["z"],["m",-3.06,12.84],["c",.27,-.03,1.68,0,2.01,.03],["c",1.92,.18,3.15,.69,3.63,1.5],["c",.18,.33,.24,.51,.21,.93],["c",0,.45,-.06,.72,-.24,1.11],["c",-.24,.51,-.69,1.02,-1.17,1.35],["c",-.21,.15,-.21,.15,-.12,.18],["c",.72,.15,1.11,.3,1.5,.57],["c",.39,.24,.63,.57,.75,.96],["c",.09,.3,.09,.96,0,1.29],["c",-.15,.57,-.39,1.05,-.78,1.5],["c",-.66,.75,-1.62,1.32,-2.61,1.53],["c",-.27,.06,-.42,.06,-.84,.06],["c",-.48,0,-.57,0,-.81,-.06],["c",-.6,-.18,-1.05,-.42,-1.47,-.81],["c",-.36,-.39,-.42,-.51,-.3,-.75],["c",.12,-.21,.39,-.39,.6,-.39],["c",.09,0,.15,.03,.33,.18],["c",.12,.12,.27,.24,.36,.27],["c",.96,.48,2.46,-.33,2.82,-1.5],["c",.24,-.81,-.03,-1.44,-.69,-1.77],["c",-.39,-.21,-1.02,-.33,-1.53,-.33],["c",-.18,0,-.21,0,-.27,-.09],["c",-.06,-.09,-.06,-.3,-.03,-.48],["c",.06,-.18,.18,-.36,.33,-.36],["c",.39,-.06,.51,-.09,.72,-.18],["c",.69,-.36,1.11,-1.23,.99,-2.01],["c",-.09,-.51,-.42,-.9,-.93,-1.17],["c",-.24,-.12,-.6,-.27,-.87,-.3],["c",-.09,-.03,-.09,-.03,-.12,.12],["c",0,.09,-.21,1.11,-.42,2.25],["c",-.66,3.75,-.72,3.99,-1.26,5.07],["c",-.9,1.89,-2.25,2.85,-3.48,2.61],["c",-.39,-.09,-.69,-.27,-1.38,-.84],["c",-.63,-.51,-.63,-.48,-.63,-.6],["c",0,-.18,.18,-.48,.39,-.57],["c",.21,-.12,.3,-.09,.81,.33],["c",.15,.15,.39,.3,.54,.36],["c",.18,.12,.27,.12,.48,.15],["c",.99,.06,1.71,-.78,2.04,-2.46],["c",.12,-.66,.18,-1.14,.21,-2.22],["c",.03,-1.23,.12,-2.25,.36,-3.63],["c",.03,-.24,.06,-.45,.06,-.48],["c",-.06,-.03,-.66,.27,-.9,.42],["c",-.06,.06,-.21,.18,-.33,.3],["c",-.57,.57,-.6,1.35,-.06,1.74],["c",.18,.12,.24,.24,.21,.51],["c",-.03,.3,-.15,.42,-.57,.48],["c",-1.11,.24,-2.22,-.42,-2.43,-1.38],["c",-.09,-.45,.03,-1.02,.3,-1.47],["c",.18,-.24,.6,-.63,.9,-.84],["c",.9,-.6,2.28,-1.02,3.69,-1.11],["z"]],w:15.709,h:34.656},"timesig.common":{d:[["M",6.66,-7.83],["c",.72,-.06,1.41,-.03,1.98,.09],["c",1.2,.27,2.34,.96,3.09,1.92],["c",.63,.81,1.08,1.86,1.14,2.73],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,0,-.09,-.12,-.24,-.27],["c",-1.02,-1.11,-2.55,-1.68,-4.08,-1.5],["c",-1.29,.15,-2.04,.69,-2.4,1.74],["c",-.36,.93,-.42,1.89,-.42,5.37],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.63,1.68,1.41,2.07],["c",.81,.39,2.16,.45,3.18,.09],["c",1.29,-.45,2.37,-1.53,3.03,-2.97],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.06,.39,-.42,1.38,-.69,1.89],["c",-.96,1.8,-2.49,2.94,-4.23,3.18],["c",-.99,.12,-2.58,-.06,-3.63,-.45],["c",-.96,-.36,-1.71,-.84,-2.4,-1.5],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.9,-3.45,2.01,-4.56],["c",.69,-.66,1.44,-1.11,2.37,-1.47],["c",.63,-.24,1.47,-.42,2.22,-.48],["z"]],w:13.038,h:15.689},"timesig.cut":{d:[["M",6.24,-10.44],["c",.09,-.06,.09,-.06,.48,-.06],["c",.36,0,.36,0,.45,.06],["l",.06,.09],["l",0,1.23],["l",0,1.26],["l",.27,0],["c",1.26,0,2.49,.45,3.48,1.29],["c",1.05,.87,1.8,2.28,1.89,3.48],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,-.03,-.45,-.51,-.66,-.69],["c",-.87,-.69,-1.83,-1.05,-2.94,-1.11],["l",-.42,0],["l",0,7.17],["l",0,7.14],["l",.42,0],["c",.69,-.03,1.23,-.18,1.86,-.51],["c",1.05,-.51,1.89,-1.47,2.46,-2.7],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.03,.24,-.21,.78,-.39,1.2],["c",-.96,2.37,-2.94,3.9,-5.13,3.9],["l",-.3,0],["l",0,1.26],["l",0,1.23],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.45,.06],["c",-.39,0,-.39,0,-.48,-.06],["l",-.06,-.09],["l",0,-1.29],["l",0,-1.29],["l",-.21,-.03],["c",-1.23,-.21,-2.31,-.63,-3.21,-1.29],["c",-.15,-.09,-.45,-.36,-.66,-.57],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.93,-3.45,2.04,-4.59],["c",.42,-.39,.78,-.66,1.26,-.93],["c",.75,-.45,1.65,-.75,2.61,-.9],["l",.21,-.03],["l",0,-1.29],["l",0,-1.29],["z"],["m",-.06,10.44],["c",0,-5.58,0,-6.99,-.03,-6.99],["c",-.15,0,-.63,.27,-.87,.45],["c",-.45,.36,-.75,.93,-.93,1.77],["c",-.18,.81,-.24,1.8,-.24,4.74],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.66,1.68,1.41,2.07],["c",.12,.06,.3,.12,.33,.15],["l",.09,0],["l",0,-6.96],["z"]],w:13.038,h:20.97},"timesig.imperfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.imperfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},f:{d:[["M",9.93,-14.28],["c",1.53,-.18,2.88,.45,3.12,1.5],["c",.12,.51,0,1.32,-.27,1.86],["c",-.15,.3,-.42,.57,-.63,.69],["c",-.69,.36,-1.56,.03,-1.83,-.69],["c",-.09,-.24,-.09,-.69,0,-.87],["c",.06,-.12,.21,-.24,.45,-.42],["c",.42,-.24,.57,-.45,.6,-.72],["c",.03,-.33,-.09,-.39,-.63,-.42],["c",-.3,0,-.45,0,-.6,.03],["c",-.81,.21,-1.35,.93,-1.74,2.46],["c",-.06,.27,-.48,2.25,-.48,2.31],["c",0,.03,.39,.03,.9,.03],["c",.72,0,.9,0,.99,.06],["c",.42,.15,.45,.72,.03,.9],["c",-.12,.06,-.24,.06,-1.17,.06],["l",-1.05,0],["l",-.78,2.55],["c",-.45,1.41,-.87,2.79,-.96,3.06],["c",-.87,2.37,-2.37,4.74,-3.78,5.91],["c",-1.05,.9,-2.04,1.23,-3.09,1.08],["c",-1.11,-.18,-1.89,-.78,-2.04,-1.59],["c",-.12,-.66,.15,-1.71,.54,-2.19],["c",.69,-.75,1.86,-.54,2.22,.39],["c",.06,.15,.09,.27,.09,.48],["c",0,.24,-.03,.27,-.12,.42],["c",-.03,.09,-.15,.18,-.27,.27],["c",-.09,.06,-.27,.21,-.36,.27],["c",-.24,.18,-.36,.36,-.39,.6],["c",-.03,.33,.09,.39,.63,.42],["c",.42,0,.63,-.03,.9,-.15],["c",.6,-.3,.96,-.96,1.38,-2.64],["c",.09,-.42,.63,-2.55,1.17,-4.77],["l",1.02,-4.08],["c",0,-.03,-.36,-.03,-.81,-.03],["c",-.72,0,-.81,0,-.93,-.06],["c",-.42,-.18,-.39,-.75,.03,-.9],["c",.09,-.06,.27,-.06,1.05,-.06],["l",.96,0],["l",0,-.09],["c",.06,-.18,.3,-.72,.51,-1.17],["c",1.2,-2.46,3.3,-4.23,5.34,-4.5],["z"]],w:16.155,h:19.445},m:{d:[["M",2.79,-8.91],["c",.09,0,.3,-.03,.45,-.03],["c",.24,.03,.3,.03,.45,.12],["c",.36,.15,.63,.54,.75,1.02],["l",.03,.21],["l",.33,-.3],["c",.69,-.69,1.38,-1.02,2.07,-1.02],["c",.27,0,.33,0,.48,.06],["c",.21,.09,.48,.36,.63,.6],["c",.03,.09,.12,.27,.18,.42],["c",.03,.15,.09,.27,.12,.27],["c",0,0,.09,-.09,.18,-.21],["c",.33,-.39,.87,-.81,1.29,-.99],["c",.78,-.33,1.47,-.21,2.01,.33],["c",.3,.33,.48,.69,.6,1.14],["c",.09,.42,.06,.54,-.54,3.06],["c",-.33,1.29,-.57,2.4,-.57,2.43],["c",0,.12,.09,.21,.21,.21],["c",.24,0,.75,-.3,1.2,-.72],["c",.45,-.39,.6,-.45,.78,-.27],["c",.18,.18,.09,.36,-.45,.87],["c",-1.05,.96,-1.83,1.47,-2.58,1.71],["c",-.93,.33,-1.53,.21,-1.8,-.33],["c",-.06,-.15,-.06,-.21,-.06,-.45],["c",0,-.24,.03,-.48,.6,-2.82],["c",.42,-1.71,.6,-2.64,.63,-2.79],["c",.03,-.57,-.3,-.75,-.84,-.48],["c",-.24,.12,-.54,.39,-.66,.63],["c",-.03,.09,-.42,1.38,-.9,3],["c",-.9,3.15,-.84,3,-1.14,3.15],["l",-.15,.09],["l",-.78,0],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.36,-1.38,.84,-2.97],["c",.57,-2.04,.81,-2.97,.84,-3.12],["c",.03,-.54,-.3,-.72,-.84,-.45],["c",-.24,.12,-.57,.42,-.66,.63],["c",-.06,.09,-.51,1.44,-1.05,2.97],["c",-.51,1.56,-.99,2.85,-.99,2.91],["c",-.06,.12,-.21,.24,-.36,.3],["c",-.12,.06,-.21,.06,-.9,.06],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.45,-1.38,.99,-2.97],["c",1.05,-3.18,1.05,-3.18,.93,-3.45],["c",-.12,-.27,-.39,-.3,-.72,-.15],["c",-.54,.27,-1.14,1.17,-1.56,2.4],["c",-.06,.15,-.15,.3,-.18,.36],["c",-.21,.21,-.57,.27,-.72,.09],["c",-.09,-.09,-.06,-.21,.06,-.63],["c",.48,-1.26,1.26,-2.46,2.01,-3.21],["c",.57,-.54,1.2,-.87,1.83,-1.02],["z"]],w:14.687,h:9.126},p:{d:[["M",1.92,-8.7],["c",.27,-.09,.81,-.06,1.11,.03],["c",.54,.18,.93,.51,1.17,.99],["c",.09,.15,.15,.33,.18,.36],["l",0,.12],["l",.3,-.27],["c",.66,-.6,1.35,-1.02,2.13,-1.2],["c",.21,-.06,.33,-.06,.78,-.06],["c",.45,0,.51,0,.84,.09],["c",1.29,.33,2.07,1.32,2.25,2.79],["c",.09,.81,-.09,2.01,-.45,2.79],["c",-.54,1.26,-1.86,2.55,-3.18,3.03],["c",-.45,.18,-.81,.24,-1.29,.24],["c",-.69,-.03,-1.35,-.18,-1.86,-.45],["c",-.3,-.15,-.51,-.18,-.69,-.09],["c",-.09,.03,-.18,.09,-.18,.12],["c",-.09,.12,-1.05,2.94,-1.05,3.06],["c",0,.24,.18,.48,.51,.63],["c",.18,.06,.54,.15,.75,.15],["c",.21,0,.36,.06,.42,.18],["c",.12,.18,.06,.42,-.12,.54],["c",-.09,.03,-.15,.03,-.78,0],["c",-1.98,-.15,-3.81,-.15,-5.79,0],["c",-.63,.03,-.69,.03,-.78,0],["c",-.24,-.15,-.24,-.57,.03,-.66],["c",.06,-.03,.48,-.09,.99,-.12],["c",.87,-.06,1.11,-.09,1.35,-.21],["c",.18,-.06,.33,-.18,.39,-.3],["c",.06,-.12,3.24,-9.42,3.27,-9.6],["c",.06,-.33,.03,-.57,-.15,-.69],["c",-.09,-.06,-.12,-.06,-.3,-.06],["c",-.69,.06,-1.53,1.02,-2.28,2.61],["c",-.09,.21,-.21,.45,-.27,.51],["c",-.09,.12,-.33,.24,-.48,.24],["c",-.18,0,-.36,-.15,-.36,-.3],["c",0,-.24,.78,-1.83,1.26,-2.55],["c",.72,-1.11,1.47,-1.74,2.28,-1.92],["z"],["m",5.37,1.47],["c",-.27,-.12,-.75,-.03,-1.14,.21],["c",-.75,.48,-1.47,1.68,-1.89,3.15],["c",-.45,1.47,-.42,2.34,0,2.7],["c",.45,.39,1.26,.21,1.83,-.36],["c",.51,-.51,.99,-1.68,1.38,-3.27],["c",.3,-1.17,.33,-1.74,.15,-2.13],["c",-.09,-.15,-.15,-.21,-.33,-.3],["z"]],w:14.689,h:13.127},r:{d:[["M",6.33,-9.12],["c",.27,-.03,.93,0,1.2,.06],["c",.84,.21,1.23,.81,1.02,1.53],["c",-.24,.75,-.9,1.17,-1.56,.96],["c",-.33,-.09,-.51,-.3,-.66,-.75],["c",-.03,-.12,-.09,-.24,-.12,-.3],["c",-.09,-.15,-.3,-.24,-.48,-.24],["c",-.57,0,-1.38,.54,-1.65,1.08],["c",-.06,.15,-.33,1.17,-.9,3.27],["c",-.57,2.31,-.81,3.12,-.87,3.21],["c",-.03,.06,-.12,.15,-.18,.21],["l",-.12,.06],["l",-.81,.03],["c",-.69,0,-.81,0,-.9,-.03],["c",-.09,-.06,-.18,-.21,-.18,-.3],["c",0,-.06,.39,-1.62,.9,-3.51],["c",.84,-3.24,.87,-3.45,.87,-3.72],["c",0,-.21,0,-.27,-.03,-.36],["c",-.12,-.15,-.21,-.24,-.42,-.24],["c",-.24,0,-.45,.15,-.78,.42],["c",-.33,.36,-.45,.54,-.72,1.14],["c",-.03,.12,-.21,.24,-.36,.27],["c",-.12,0,-.15,0,-.24,-.06],["c",-.18,-.12,-.18,-.21,-.06,-.54],["c",.21,-.57,.42,-.93,.78,-1.32],["c",.54,-.51,1.2,-.81,1.95,-.87],["c",.81,-.03,1.53,.3,1.92,.87],["l",.12,.18],["l",.09,-.09],["c",.57,-.45,1.41,-.84,2.19,-.96],["z"]],w:9.41,h:9.132},s:{d:[["M",4.47,-8.73],["c",.09,0,.36,-.03,.57,-.03],["c",.75,.03,1.29,.24,1.71,.63],["c",.51,.54,.66,1.26,.36,1.83],["c",-.24,.42,-.63,.57,-1.11,.42],["c",-.33,-.09,-.6,-.36,-.6,-.57],["c",0,-.03,.06,-.21,.15,-.39],["c",.12,-.21,.15,-.33,.18,-.48],["c",0,-.24,-.06,-.48,-.15,-.6],["c",-.15,-.21,-.42,-.24,-.75,-.15],["c",-.27,.06,-.48,.18,-.69,.36],["c",-.39,.39,-.51,.96,-.33,1.38],["c",.09,.21,.42,.51,.78,.72],["c",1.11,.69,1.59,1.11,1.89,1.68],["c",.21,.39,.24,.78,.15,1.29],["c",-.18,1.2,-1.17,2.16,-2.52,2.52],["c",-1.02,.24,-1.95,.12,-2.7,-.42],["c",-.72,-.51,-.99,-1.47,-.6,-2.19],["c",.24,-.48,.72,-.63,1.17,-.42],["c",.33,.18,.54,.45,.57,.81],["c",0,.21,-.03,.3,-.33,.51],["c",-.33,.24,-.39,.42,-.27,.69],["c",.06,.15,.21,.27,.45,.33],["c",.3,.09,.87,.09,1.2,0],["c",.75,-.21,1.23,-.72,1.29,-1.35],["c",.03,-.42,-.15,-.81,-.54,-1.2],["c",-.24,-.24,-.48,-.42,-1.41,-1.02],["c",-.69,-.42,-1.05,-.93,-1.05,-1.47],["c",0,-.39,.12,-.87,.3,-1.23],["c",.27,-.57,.78,-1.05,1.38,-1.35],["c",.24,-.12,.63,-.27,.9,-.3],["z"]],w:6.632,h:8.758},z:{d:[["M",2.64,-7.95],["c",.36,-.09,.81,-.03,1.71,.27],["c",.78,.21,.96,.27,1.74,.3],["c",.87,.06,1.02,.03,1.38,-.21],["c",.21,-.15,.33,-.15,.48,-.06],["c",.15,.09,.21,.3,.15,.45],["c",-.03,.06,-1.26,1.26,-2.76,2.67],["l",-2.73,2.55],["l",.54,.03],["c",.54,.03,.72,.03,2.01,.15],["c",.36,.03,.9,.06,1.2,.09],["c",.66,0,.81,-.03,1.02,-.24],["c",.3,-.3,.39,-.72,.27,-1.23],["c",-.06,-.27,-.06,-.27,-.03,-.39],["c",.15,-.3,.54,-.27,.69,.03],["c",.15,.33,.27,1.02,.27,1.5],["c",0,1.47,-1.11,2.7,-2.52,2.79],["c",-.57,.03,-1.02,-.09,-2.01,-.51],["c",-1.02,-.42,-1.23,-.48,-2.13,-.54],["c",-.81,-.06,-.96,-.03,-1.26,.18],["c",-.12,.06,-.24,.12,-.27,.12],["c",-.27,0,-.45,-.3,-.36,-.51],["c",.03,-.06,1.32,-1.32,2.91,-2.79],["l",2.88,-2.73],["c",-.03,0,-.21,.03,-.42,.06],["c",-.21,.03,-.78,.09,-1.23,.12],["c",-1.11,.12,-1.23,.15,-1.95,.27],["c",-.72,.15,-1.17,.18,-1.29,.09],["c",-.27,-.18,-.21,-.75,.12,-1.26],["c",.39,-.6,.93,-1.02,1.59,-1.2],["z"]],w:8.573,h:8.743},"+":{d:[["M",3.48,-9.3],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.29],["l",0,1.29],["l",1.29,0],["c",1.23,0,1.29,0,1.41,.06],["c",.06,.03,.15,.09,.18,.12],["c",.12,.09,.21,.33,.21,.48],["c",0,.15,-.09,.39,-.21,.48],["c",-.03,.03,-.12,.09,-.18,.12],["c",-.12,.06,-.18,.06,-1.41,.06],["l",-1.29,0],["l",0,1.29],["c",0,1.23,0,1.29,-.06,1.41],["c",-.09,.18,-.15,.24,-.3,.33],["c",-.21,.09,-.39,.09,-.57,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.41],["l",0,-1.29],["l",-1.29,0],["c",-1.23,0,-1.29,0,-1.41,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.26,0],["l",1.29,0],["l",0,-1.29],["c",0,-1.23,0,-1.29,.06,-1.41],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:7.507,h:7.515},",":{d:[["M",1.85,-3.36],["c",.57,-.15,1.17,.03,1.59,.45],["c",.45,.45,.6,.96,.51,1.89],["c",-.09,1.23,-.42,2.46,-.99,3.93],["c",-.3,.72,-.72,1.62,-.78,1.68],["c",-.18,.21,-.51,.18,-.66,-.06],["c",-.03,-.06,-.06,-.15,-.06,-.18],["c",0,-.06,.12,-.33,.24,-.63],["c",.84,-1.8,1.02,-2.61,.69,-3.24],["c",-.12,-.24,-.27,-.36,-.75,-.6],["c",-.36,-.15,-.42,-.21,-.6,-.39],["c",-.69,-.69,-.69,-1.71,0,-2.4],["c",.21,-.21,.51,-.39,.81,-.45],["z"]],w:3.452,h:8.143},"-":{d:[["M",.18,-5.34],["c",.09,-.06,.15,-.06,2.31,-.06],["c",2.46,0,2.37,0,2.46,.21],["c",.12,.21,.03,.42,-.15,.54],["c",-.09,.06,-.15,.06,-2.28,.06],["c",-2.16,0,-2.22,0,-2.31,-.06],["c",-.27,-.15,-.27,-.54,-.03,-.69],["z"]],w:5.001,h:.81},".":{d:[["M",1.32,-3.36],["c",1.05,-.27,2.1,.57,2.1,1.65],["c",0,1.08,-1.05,1.92,-2.1,1.65],["c",-.9,-.21,-1.5,-1.14,-1.26,-2.04],["c",.12,-.63,.63,-1.11,1.26,-1.26],["z"]],w:3.413,h:3.402},"scripts.wedge":{d:[["M",-3.66,-7.44],["c",.06,-.09,0,-.09,.81,.03],["c",1.86,.3,3.84,.3,5.73,0],["c",.78,-.12,.72,-.12,.78,-.03],["c",.15,.15,.12,.24,-.24,.6],["c",-.93,.93,-1.98,2.76,-2.67,4.62],["c",-.3,.78,-.51,1.71,-.51,2.13],["c",0,.15,0,.18,-.06,.27],["c",-.12,.09,-.24,.09,-.36,0],["c",-.06,-.09,-.06,-.12,-.06,-.27],["c",0,-.42,-.21,-1.35,-.51,-2.13],["c",-.69,-1.86,-1.74,-3.69,-2.67,-4.62],["c",-.36,-.36,-.39,-.45,-.24,-.6],["z"]],w:7.49,h:7.752},"scripts.thumb":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.27,1.41,-1.08,2.43,-2.16,2.73],["l",-.18,.06],["l",0,.12],["c",.03,.06,.06,.45,.09,.87],["c",.03,.57,.03,.78,0,.84],["c",-.09,.27,-.39,.48,-.66,.48],["c",-.27,0,-.57,-.21,-.66,-.48],["c",-.03,-.06,-.03,-.27,0,-.84],["c",.03,-.42,.06,-.81,.09,-.87],["l",0,-.12],["l",-.18,-.06],["c",-1.08,-.3,-1.89,-1.32,-2.16,-2.73],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.05,.9],["c",-.15,-.09,-.21,-.09,-.45,-.12],["c",-.15,0,-.3,.03,-.39,.03],["c",-.57,.18,-.9,.72,-1.08,1.74],["c",-.06,.48,-.06,1.8,0,2.28],["c",.15,.9,.42,1.44,.9,1.65],["c",.18,.09,.21,.09,.51,.09],["c",.3,0,.33,0,.51,-.09],["c",.48,-.21,.75,-.75,.9,-1.65],["c",.03,-.27,.03,-.54,.03,-1.14],["c",0,-.6,0,-.87,-.03,-1.14],["c",-.15,-.9,-.45,-1.44,-.9,-1.65],["z"]],w:5.955,h:9.75},"scripts.open":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.33,1.74,-1.47,2.85,-2.91,2.85],["c",-1.44,0,-2.58,-1.11,-2.91,-2.85],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.11,.9],["c",-.21,-.09,-.27,-.09,-.51,-.12],["c",-.3,0,-.42,.03,-.66,.15],["c",-.24,.12,-.51,.39,-.66,.63],["c",-.54,.93,-.63,2.64,-.21,3.81],["c",.21,.54,.51,.9,.93,1.11],["c",.21,.09,.24,.09,.54,.09],["c",.3,0,.33,0,.54,-.09],["c",.42,-.21,.72,-.57,.93,-1.11],["c",.36,-.99,.36,-2.37,0,-3.36],["c",-.21,-.54,-.51,-.9,-.9,-1.11],["z"]],w:5.955,h:7.5},"scripts.longphrase":{d:[["M",1.47,-15.09],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.54,.06,11.25],["l",0,11.25],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-3.39,-.03,-11.25],["l",0,-11.25],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:23.04},"scripts.mediumphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.39,.06,7.5],["l",0,7.5],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-2.28,-.03,-7.5],["l",0,-7.5],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:15.54},"scripts.shortphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.21,.06,3.75],["l",0,3.75],["l",-.42,.09],["c",-.57,.18,-1.65,.45,-1.71,.45],["c",-.03,0,-.03,-.72,-.03,-3.75],["l",0,-3.75],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:8.04},"scripts.snap":{d:[["M",4.5,-3.39],["c",.36,-.03,.96,-.03,1.35,0],["c",1.56,.15,3.15,.9,4.2,2.01],["c",.24,.27,.33,.42,.33,.6],["c",0,.27,.03,.24,-2.46,2.22],["c",-1.29,1.02,-2.4,1.86,-2.49,1.92],["c",-.18,.09,-.3,.09,-.48,0],["c",-.09,-.06,-1.2,-.9,-2.49,-1.92],["c",-2.49,-1.98,-2.46,-1.95,-2.46,-2.22],["c",0,-.18,.09,-.33,.33,-.6],["c",1.05,-1.08,2.64,-1.86,4.17,-2.01],["z"],["m",1.29,1.17],["c",-1.47,-.15,-2.97,.3,-4.14,1.2],["l",-.18,.15],["l",.06,.09],["c",.15,.12,3.63,2.85,3.66,2.85],["c",.03,0,3.51,-2.73,3.66,-2.85],["l",.06,-.09],["l",-.18,-.15],["c",-.84,-.66,-1.89,-1.08,-2.94,-1.2],["z"]],w:10.38,h:6.84}};t["noteheads.slash.whole"]={d:[["M",5,-5],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"],["m",0,-2],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",-4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"]],w:10.81,h:15.63},t["noteheads.slash.quarter"]={d:[["M",9,-6],["l",0,4],["l",-9,9],["l",0,-4],["z"]],w:9,h:9},t["noteheads.harmonic.quarter"]={d:[["M",3.63,-4.02],["c",.09,-.06,.18,-.09,.24,-.03],["c",.03,.03,.87,.93,1.83,2.01],["c",1.5,1.65,1.8,1.98,1.8,2.04],["c",0,.06,-.3,.39,-1.8,2.04],["c",-.96,1.08,-1.8,1.98,-1.83,2.01],["c",-.06,.06,-.15,.03,-.24,-.03],["c",-.12,-.09,-3.54,-3.84,-3.6,-3.93],["c",-.03,-.03,-.03,-.09,-.03,-.15],["c",.03,-.06,3.45,-3.84,3.63,-3.96],["z"]],w:7.5,h:8.165},t["noteheads.triangle.quarter"]={d:[["M",0,4],["l",9,0],["l",-4.5,-9],["z"]],w:9,h:9};var n=function(l){for(var h=[],f=0,b=l.length;f<b;f++){h[f]=[];for(var S=0,M=l[f].length;S<M;S++)h[f][S]=l[f][S]}return h},a=function(l,h,f){for(var b=0,S=l.length;b<S;b++){var M=l[b],C,y;for(C=1,y=M.length;C<y;C++)M[C]*=C%2?h:f}},o={printSymbol:function(l,h,f,b,S){if(!t[f])return null;var M=n(t[f].d);M[0][1]+=l,M[0][2]+=h;for(var C="",y=0;y<M.length;y++)C+=M[y].join(" ");return S.path=C,b.path(S)},getPathForSymbol:function(l,h,f,b,S){if(b=b||1,S=S||1,!t[f])return null;var M=n(t[f].d);return(b!==1||S!==1)&&a(M,b,S),M[0][1]+=l,M[0][2]+=h,M},getSymbolWidth:function(l){return t[l]?t[l].w:0},symbolHeightInPitches:function(l){var h=t[l]?t[l].h:0;return h/e.STEP},getSymbolAlign:function(l){return l.substring(0,7)==="scripts"&&l!=="scripts.roll"?"center":"left"},getYCorr:function(l){switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":return-2;case"timesig.common":case"timesig.cut":return 0;case"flags.d32nd":return-1;case"flags.d64th":return-2;case"flags.u32nd":return 1;case"flags.u64th":return 3;case"rests.whole":return 1;case"rests.half":return-1;case"rests.8th":return-1;case"rests.quarter":return-1;case"rests.16th":return-1;case"rests.32nd":return-1;case"rests.64th":return-1;case"f":case"m":case"p":case"s":case"z":return-4;case"scripts.trill":case"scripts.upbow":case"scripts.downbow":return-2;case"scripts.ufermata":case"scripts.wedge":case"scripts.roll":case"scripts.shortphrase":case"scripts.longphrase":return-1;case"scripts.dfermata":return 1;default:return 0}},setSymbol:function(l,h){t[l]=h}};return ch=o,ch}var uh,cm;function dP(){if(cm)return uh;cm=1;var e=xo(),t=na(),n=ts(),a=function(l,h){var f,b=0;l.el_type="clef";var S=new e(l,0,10,"staff-extra clef",h);switch(S.isClef=!0,l.type){case"treble":f="clefs.G";break;case"tenor":f="clefs.C";break;case"alto":f="clefs.C";break;case"bass":f="clefs.F";break;case"treble+8":f="clefs.G",b=1;break;case"tenor+8":f="clefs.C",b=1;break;case"bass+8":f="clefs.F",b=1;break;case"alto+8":f="clefs.C",b=1;break;case"treble-8":f="clefs.G",b=-1;break;case"tenor-8":f="clefs.C",b=-1;break;case"bass-8":f="clefs.F",b=-1;break;case"alto-8":f="clefs.C",b=-1;break;case"none":return null;case"perc":f="clefs.perc";break;default:S.addFixed(new n("clef="+l.type,0,0,void 0,{type:"debug"}))}var M=5;if(f){var C=t.symbolHeightInPitches(f),y=o(f);if(S.addRight(new n(f,M,t.getSymbolWidth(f),l.clefPos,{top:C+l.clefPos+y,bottom:l.clefPos+y})),b!==0){var g=.6666666666666666,w=(t.getSymbolWidth(f)-t.getSymbolWidth("8")*g)/2,p=b>0?S.top+3:S.bottom-1,E=b>0?S.top+3:S.bottom-3,N=E-2;l.type==="bass-8"&&(p=3,w=0),S.addRight(new n("8",M+w,t.getSymbolWidth("8")*g,p,{scalex:g,scaley:g,top:E,bottom:N}))}}return S};function o(l){switch(l){case"clefs.G":return-5;case"clefs.C":return-4;case"clefs.F":return-4;case"clefs.perc":return-2;default:return 0}}return uh=a,uh}var hh,um;function pP(){if(um)return hh;um=1;var e=xo(),t=na(),n=ts(),a=function(o,l){if(o.el_type="keySignature",!o.accidentals||o.accidentals.length===0)return null;var h=new e(o,0,10,"staff-extra key-signature",l);h.isKeySig=!0;var f=0;return o.accidentals.forEach(function(b){var S,M=0;switch(b.acc){case"sharp":S="accidentals.sharp",M=-3;break;case"natural":S="accidentals.nat";break;case"flat":S="accidentals.flat",M=-1.2;break;case"quartersharp":S="accidentals.halfsharp",M=-2.5;break;case"quarterflat":S="accidentals.halfflat",M=-1.2;break;default:S="accidentals.flat"}h.addRight(new n(S,f,t.getSymbolWidth(S),b.verticalPos,{thickness:t.symbolHeightInPitches(S),top:b.verticalPos+t.symbolHeightInPitches(S)+M,bottom:b.verticalPos+M})),f+=t.getSymbolWidth(S)+2},this),h};return hh=a,hh}var fh,hm;function gP(){if(hm)return fh;hm=1;var e=na(),t=ts(),n=function(a,o,l,h){h||(h={});var f=h.dir!==void 0?h.dir:null,b=h.headx!==void 0?h.headx:0,S=h.extrax!==void 0?h.extrax:0,M=h.flag!==void 0?h.flag:null,C=h.dot!==void 0?h.dot:0,y=h.dotshiftx!==void 0?h.dotshiftx:0,g=h.scale!==void 0?h.scale:1,w=h.accidentalSlot!==void 0?h.accidentalSlot:[],p=h.shouldExtendStem!==void 0?h.shouldExtendStem:!1,E=h.printAccidentals!==void 0?h.printAccidentals:!0,N=l.verticalPos,I,O=0,V=0,U=0;if(o===void 0)a.addFixed(new t("pitch is undefined",0,0,0,{type:"debug"}));else if(o==="")I=new t(null,0,0,N);else{var D=b;if(l.printer_shift){var me=l.printer_shift==="same"?1:0;D=f==="down"?-e.getSymbolWidth(o)*g+me:e.getSymbolWidth(o)*g-me}var B={scalex:g,scaley:g,thickness:e.symbolHeightInPitches(o)*g,name:l.name};if(I=new t(o,D,e.getSymbolWidth(o)*g,N,B),I.stemDir=f,M){var ie=N+(f==="down"?-7:7)*g;p&&(f==="down"&&ie>6&&(ie=6),f==="up"&&ie<6&&(ie=6));var he=f==="down"?b:b+I.w-.6;a.addRight(new t(M,he,e.getSymbolWidth(M)*g,ie,{scalex:g,scaley:g}))}for(V=I.w+y-2+5*C;C>0;C--){var ae=1-Math.abs(N)%2;a.addRight(new t("dots.dot",I.w+y-2+5*C,e.getSymbolWidth("dots.dot"),N+ae))}}if(I&&(I.highestVert=l.highestVert),E&&l.accidental){var fe;switch(l.accidental){case"quartersharp":fe="accidentals.halfsharp";break;case"dblsharp":fe="accidentals.dblsharp";break;case"sharp":fe="accidentals.sharp";break;case"quarterflat":fe="accidentals.halfflat";break;case"flat":fe="accidentals.flat";break;case"dblflat":fe="accidentals.dblflat";break;case"natural":fe="accidentals.nat"}for(var le=!1,Y=S,$=0;$<w.length;$++)if(N-w[$][0]>=6){w[$][0]=N,Y=w[$][1],le=!0;break}le===!1&&(Y-=e.getSymbolWidth(fe)*g+2,w.push([N,Y]),O=e.getSymbolWidth(fe)*g+2);var ne=e.symbolHeightInPitches(fe);a.addExtra(new t(fe,Y,e.getSymbolWidth(fe),N,{scalex:g,scaley:g,top:N+ne/2,bottom:N-ne/2})),U=e.getSymbolWidth(fe)/2}return{notehead:I,accidentalshiftx:O,dotshiftx:V,extraLeft:U}};return fh=n,fh}var dh,fm;function vP(){if(fm)return dh;fm=1;var e=xo(),t=na(),n=ts(),a=function(o,l){o.el_type="timeSignature";var h=new e(o,0,10,"staff-extra time-signature",l);if(o.type==="specified")for(var f=0,b=0;b<o.value.length;b++)if(b!==0&&(h.addRight(new n("+",f+1,t.getSymbolWidth("+"),6,{thickness:t.symbolHeightInPitches("+")})),f+=t.getSymbolWidth("+")+2),o.value[b].den){for(var S=0,M=0;M<o.value[b].num.length;M++)S+=t.getSymbolWidth(o.value[b].num[M]);var C=0;for(M=0;M<o.value[b].num.length;M++)C+=t.getSymbolWidth(o.value[b].den[M]);var y=Math.max(S,C);h.addRight(new n(o.value[b].num,f+(y-S)/2,S,8,{thickness:t.symbolHeightInPitches(o.value[b].num[0])})),h.addRight(new n(o.value[b].den,f+(y-C)/2,C,4,{thickness:t.symbolHeightInPitches(o.value[b].den[0])})),f+=y}else{for(var g=0,w=0;w<o.value[b].num.length;w++)g+=t.getSymbolWidth(o.value[b].num[w]);h.addRight(new n(o.value[b].num,f,g,6,{thickness:t.symbolHeightInPitches(o.value[b].num[0])})),f+=g}else o.type==="common_time"?h.addRight(new n("timesig.common",0,t.getSymbolWidth("timesig.common"),6,{thickness:t.symbolHeightInPitches("timesig.common")})):o.type==="cut_time"?h.addRight(new n("timesig.cut",0,t.getSymbolWidth("timesig.cut"),6,{thickness:t.symbolHeightInPitches("timesig.cut")})):o.type==="tempus_imperfectum"?h.addRight(new n("timesig.imperfectum",0,t.getSymbolWidth("timesig.imperfectum"),6,{thickness:t.symbolHeightInPitches("timesig.imperfectum")})):o.type==="tempus_imperfectum_prolatio"?h.addRight(new n("timesig.imperfectum2",0,t.getSymbolWidth("timesig.imperfectum2"),6,{thickness:t.symbolHeightInPitches("timesig.imperfectum2")})):o.type==="tempus_perfectum"?h.addRight(new n("timesig.perfectum",0,t.getSymbolWidth("timesig.perfectum"),6,{thickness:t.symbolHeightInPitches("timesig.perfectum")})):o.type==="tempus_perfectum_prolatio"?h.addRight(new n("timesig.perfectum2",0,t.getSymbolWidth("timesig.perfectum2"),6,{thickness:t.symbolHeightInPitches("timesig.perfectum2")})):console.log("time signature:",o);return h};return dh=a,dh}var ph,dm;function mP(){if(dm)return ph;dm=1;var e=function(n,a,o){this.type="DynamicDecoration",this.anchor=n,this.dec=a,o==="below"?this.volumeHeightBelow=6:this.volumeHeightAbove=6,this.pitch=void 0};return ph=e,ph}var gh,pm;function _P(){if(pm)return gh;pm=1;var e=function(n,a,o,l){this.type="CrescendoElem",this.anchor1=n,this.anchor2=a,this.dir=o,l==="above"?this.dynamicHeightAbove=6:this.dynamicHeightBelow=6,this.pitch=void 0};return gh=e,gh}var vh,gm;function bP(){if(gm)return vh;gm=1;var e=function(n,a){this.type="GlissandoElem",this.anchor1=n,this.anchor2=a};return vh=e,vh}var mh,vm;function ky(){if(vm)return mh;vm=1;var e=function(n){this.type="TieElem",this.anchor1=n.anchor1,this.anchor2=n.anchor2,n.isGrace&&(this.isGrace=!0),n.fixedY&&(this.fixedY=!0),n.stemDir&&(this.stemDir=n.stemDir),n.voiceNumber!==void 0&&(this.voiceNumber=n.voiceNumber),n.style!==void 0&&(this.dotted=!0),this.internalNotes=[]};return e.prototype.addInternalNote=function(t){this.internalNotes.push(t)},e.prototype.setEndAnchor=function(t){this.anchor2=t,this.anchor1?(this.top=Math.max(this.anchor1.pitch,this.anchor2.pitch)+4,this.bottom=Math.min(this.anchor1.pitch,this.anchor2.pitch)-4):(this.top=this.anchor2.pitch+4,this.bottom=this.anchor2.pitch-4)},e.prototype.setStartX=function(t){this.startLimitX=t},e.prototype.setEndX=function(t){this.endLimitX=t},e.prototype.setHint=function(){this.hint=!0},e.prototype.calcTieDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var t;this.anchor1?t=this.anchor1.pitch:this.anchor2?t=this.anchor2.pitch:t=14,this.anchor1&&this.anchor1.stemDir==="down"&&this.anchor2&&this.anchor2.stemDir==="down"?this.above=!0:this.anchor1&&this.anchor1.stemDir==="up"&&this.anchor2&&this.anchor2.stemDir==="up"?this.above=!1:this.anchor1&&this.anchor2?this.above=t>=6:this.anchor1?this.above=this.anchor1.stemDir==="down":this.anchor2?this.above=this.anchor2.stemDir==="down":this.above=t>=6}},e.prototype.calcSlurDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var t=!1;this.anchor1&&this.anchor1.stemDir==="down"&&(t=!0),this.anchor2&&this.anchor2.stemDir==="down"&&(t=!0);for(var n=0;n<this.internalNotes.length;n++){var a=this.internalNotes[n];a.stemDir==="down"&&(t=!0)}this.above=t}},e.prototype.calcX=function(t,n){this.anchor1?(this.startX=this.anchor1.x,this.anchor1.scalex<1&&(this.startX-=3)):this.startLimitX?this.startX=this.startLimitX.x+this.startLimitX.w:this.anchor2?this.startX=this.anchor2.x-20:this.startX=t,!this.anchor1&&this.dotted&&(this.startX-=3),this.anchor2?this.endX=this.anchor2.x:this.endLimitX?this.endX=this.endLimitX.x:this.endX=n},e.prototype.calcTieY=function(){this.anchor1?this.startY=this.anchor1.pitch:this.anchor2?this.startY=this.anchor2.pitch:this.startY=this.above?14:0,this.anchor2?this.endY=this.anchor2.pitch:this.anchor1?this.endY=this.anchor1.pitch:this.endY=this.above?14:0},e.prototype.calcSlurY=function(){if(this.anchor1&&this.anchor2){this.above&&this.anchor1.stemDir==="up"&&!this.fixedY?(this.startY=(this.anchor1.highestVert+this.anchor1.pitch)/2,this.startX+=this.anchor1.w/2):this.startY=this.anchor1.pitch;var t=this.anchor2.parent.beam&&this.anchor2.parent.beam.stemsUp&&this.anchor2.parent.beam.elems[0]!==this.anchor2.parent,n=(this.anchor2.highestVert+this.anchor2.pitch)/2;if(this.above&&this.anchor2.stemDir==="up"&&!this.fixedY&&!t&&n<this.startY?(this.endY=n,this.endX+=Math.round(this.anchor2.w/2)):this.endY=this.above&&t?this.anchor2.highestVert:this.anchor2.pitch,this.anchor1.scalex===1){var a=!!this.anchor1.parent.beam,o=!!this.anchor2.parent.beam;if(a){var l=this.anchor1.parent===this.anchor1.parent.beam.elems[this.anchor1.parent.beam.elems.length-1];l||(this.above?this.startY=this.anchor1.parent.fixed.t:this.startY=this.anchor1.parent.fixed.b)}if(o){var h=this.anchor2.parent===this.anchor2.parent.beam.elems[0];h||(this.above?this.endY=this.anchor2.parent.fixed.t:this.endY=this.anchor2.parent.fixed.b)}}}else this.anchor1?this.startY=this.endY=this.anchor1.pitch:this.anchor2?this.startY=this.endY=this.anchor2.pitch:(this.startY=this.above?14:0,this.endY=this.above?14:0)},e.prototype.avoidCollisionAbove=function(){if(this.above){for(var t=-50,n=0;n<this.internalNotes.length;n++)this.internalNotes[n].highestVert>t&&(t=this.internalNotes[n].highestVert);t>this.startY&&t>this.endY&&(this.startY=this.endY=t-1)}},e.prototype.getYBounds=function(){var t=10,n=1e3;this.isTie?(this.calcTieDirection(),this.calcX(t,n),this.calcTieY()):(this.calcSlurDirection(),this.calcX(t,n),this.calcSlurY());var a,o;return this.above?(o=Math.min(this.startY,this.endY),a=o+3):(a=Math.min(this.startY,this.endY),o=a-3),[a,o]},mh=e,mh}var _h,mm;function yP(){if(mm)return _h;mm=1;var e=mP(),t=_P(),n=bP(),a=na(),o=ts(),l=ky(),h=function(){this.startDiminuendoX=void 0,this.startCrescendoX=void 0,this.minTop=12,this.minBottom=0},f=function(y,g,w,p,E,N,I,O,V){for(var U,D=0;D<g.length;D++){if(g[D]==="staccato"||g[D]==="tenuto"||g[D]==="accent"&&!V){var me="scripts."+g[D];if(g[D]==="accent"&&(me="scripts.sforzato"),U===void 0?U=I==="down"?w+2:O-2:U=I==="down"?U+2:U-2,g[D]==="accent")I==="up"?U--:U++;else switch(U){case 2:case 4:case 6:case 8:case 10:I==="up"?U--:U++;break}w>9&&U++;var B=p/2;a.getSymbolAlign(me)!=="center"&&(B-=a.getSymbolWidth(me)/2),E.addFixedX(new o(me,B,a.getSymbolWidth(me),U))}if(g[D]==="slide"&&E.heads[0]){var ie=E.heads[0].pitch;ie-=2;var he=new o("",-N-15,0,ie-1),ae=new o("",-N-5,0,ie+1);E.addFixedX(he),E.addFixedX(ae),y.addOther(new l({anchor1:he,anchor2:ae,fixedY:!0}))}}return U===void 0&&(U=w),{above:U,below:E.bottom}},b=function(y,g,w,p){for(var E=0;E<g.length;E++)switch(g[E]){case"p":case"mp":case"pp":case"ppp":case"pppp":case"f":case"ff":case"fff":case"ffff":case"sfz":case"mf":var N=new e(w,g[E],p);y.addOther(N)}},S=function(y,g,w,p,E){function N(){if(p.heads.length===0)return 10;for(var U=p.heads[0].pitch,D=1;D<p.heads.length;D++)U=Math.max(U,p.heads[D].pitch);return U}function I(){if(p.heads.length===0)return 2;for(var U=p.heads[0].pitch,D=1;D<p.heads.length;D++)U=Math.min(U,p.heads[D].pitch);return U}function O(U,D){var me=E==="down"?I()+1:N()+9;E!=="down"&&D===1&&me--;var B=w/2;B+=E==="down"?-5:3;for(var ie=0;ie<D;ie++)me-=1,p.addFixedX(new o(U,B,a.getSymbolWidth(U),me))}for(var V=0;V<y.length;V++)switch(y[V]){case"/":O("flags.ugrace",1);break;case"//":O("flags.ugrace",2);break;case"///":O("flags.ugrace",3);break;case"////":O("flags.ugrace",4);break}},M=function(y,g,w,p,E,N,I,O){function V(ae,fe){ae==="above"?p.above+=fe:p.below-=fe}function U(ae){var fe;return ae==="above"?(fe=p.above,fe<N&&(fe=N)):(fe=p.below,fe>I&&(fe=I)),fe}function D(ae,fe,le){var Y=U(fe),$=2,ne=5;w.addFixedX(new o(ae,g/2,0,Y+$,{type:"decoration",klass:"ornament",thickness:3,anchor:le})),V(fe,ne)}function me(ae,fe){var le=g/2;a.getSymbolAlign(ae)!=="center"&&(le-=a.getSymbolWidth(ae)/2);var Y=a.symbolHeightInPitches(ae)+1,$=U(fe);$=fe==="above"?$+Y/2:$-Y/2,w.addFixedX(new o(ae,le,a.getSymbolWidth(ae),$,{klass:"ornament",thickness:a.symbolHeightInPitches(ae),position:fe})),V(fe,Y)}for(var B={"+":"scripts.stopped",open:"scripts.open",snap:"scripts.snap",wedge:"scripts.wedge",thumb:"scripts.thumb",shortphrase:"scripts.shortphrase",mediumphrase:"scripts.mediumphrase",longphrase:"scripts.longphrase",trill:"scripts.trill",roll:"scripts.roll",irishroll:"scripts.roll",marcato:"scripts.umarcato",dmarcato:"scripts.dmarcato",umarcato:"scripts.umarcato",turn:"scripts.turn",uppermordent:"scripts.prall",pralltriller:"scripts.prall",mordent:"scripts.mordent",lowermordent:"scripts.mordent",downbow:"scripts.downbow",upbow:"scripts.upbow",fermata:"scripts.ufermata",invertedfermata:"scripts.dfermata",breath:",",coda:"scripts.coda",segno:"scripts.segno"},ie=!1,he=0;he<y.length;he++)switch(y[he]){case"0":case"1":case"2":case"3":case"4":case"5":case"D.C.":case"D.S.":D(y[he],E,"middle"),ie=!0;break;case"D.C.alcoda":D("D.C. al coda",E,"end"),ie=!0;break;case"D.C.alfine":D("D.C. al fine",E,"end"),ie=!0;break;case"D.S.alcoda":D("D.S. al coda",E,"end"),ie=!0;break;case"D.S.alfine":D("D.S. al fine",E,"end"),ie=!0;break;case"fine":D("FINE",E,"middle"),ie=!0;break;case"+":case"open":case"snap":case"wedge":case"thumb":case"shortphrase":case"mediumphrase":case"longphrase":case"trill":case"roll":case"irishroll":case"marcato":case"dmarcato":case"turn":case"uppermordent":case"pralltriller":case"mordent":case"lowermordent":case"downbow":case"upbow":case"fermata":case"breath":case"umarcato":case"coda":case"segno":me(B[y[he]],E),ie=!0;break;case"invertedfermata":me(B[y[he]],"below"),ie=!0;break;case"mark":w.klass="mark";break;case"accent":O&&(me("scripts.sforzato",E),ie=!0);break}return ie};function C(y,g,w){for(var p=0;p<y.length;p++)switch(y[p]){case"arpeggio":for(var E=g.abcelem.minpitch-1;E<=g.abcelem.maxpitch;E+=2)g.addExtra(new o("scripts.arpeggio",-a.getSymbolWidth("scripts.arpeggio")*2-w,0,E+2,{klass:"ornament",thickness:a.symbolHeightInPitches("scripts.arpeggio")}));break}}return h.prototype.dynamicDecoration=function(y,g,w,p){for(var E,N,I,O=0;O<g.length;O++)switch(g[O]){case"diminuendo(":this.startDiminuendoX=w,E=void 0;break;case"diminuendo)":E={start:this.startDiminuendoX,stop:w},this.startDiminuendoX=void 0;break;case"crescendo(":this.startCrescendoX=w,N=void 0;break;case"crescendo)":N={start:this.startCrescendoX,stop:w},this.startCrescendoX=void 0;break;case"~(":case"glissando(":this.startGlissandoX=w,I=void 0;break;case"~)":case"glissando)":I={start:this.startGlissandoX,stop:w},this.startGlissandoX=void 0;break}E&&y.addOther(new t(E.start,E.stop,">",p)),N&&y.addOther(new t(N.start,N.stop,"<",p)),I&&y.addOther(new n(I.start,I.stop))},h.prototype.createDecoration=function(y,g,w,p,E,N,I,O,V,U,D){V||(V={ornamentPosition:"above",volumePosition:U?"above":"below",dynamicPosition:U?"above":"below"}),b(y,g,E,V.volumePosition),this.dynamicDecoration(y,g,E,V.dynamicPosition),S(g,w,p,E,I);var me=f(y,g,w,p,E,N,I,O,D);me.above=Math.max(me.above,this.minTop),me.below=Math.min(me.below,O),M(g,p,E,me,V.ornamentPosition,this.minTop,O,D),C(g,E,N)},_h=h,_h}var bh,_m;function wP(){if(_m)return bh;_m=1;var e=function(n,a,o){this.type="EndingElem",this.text=n,this.anchor1=a,this.anchor2=o,this.endingHeightAbove=5,this.pitch=void 0};return bh=e,bh}var yh,bm;function SP(){if(bm)return yh;bm=1;var e=function(t){for(var n=0,a=0;a<t.voices.length;a++){var o=t.voices[a].staff;t.voices[a].duplicate||(n+=o.top,n+=-o.bottom)}return n};return yh=e,yh}var wh,ym;function xP(){if(ym)return wh;ym=1;var e=SP(),t=function(n){this.getTextSize=n,this.voices=[],this.staffs=[],this.brace=void 0,this.bracket=void 0};return t.prototype.setLimit=function(n,a){a.specialY[n]&&(a.staff.specialY[n]?a.staff.specialY[n]=Math.max(a.staff.specialY[n],a.specialY[n]):a.staff.specialY[n]=a.specialY[n])},t.prototype.addVoice=function(n,a,o){var l=this.voices.length;this.voices[l]=n,this.staffs[a]?this.staffs[a].voices.push(l):this.staffs[this.staffs.length]={top:10,bottom:2,lines:o,voices:[l],specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}},n.staff=this.staffs[a]},t.prototype.setHeight=function(){this.height=e(this)},t.prototype.setWidth=function(n){this.w=n;for(var a=0;a<this.voices.length;a++)this.voices[a].setWidth(n)},t.prototype.setStaffLimits=function(n){n.staff.top=Math.max(n.staff.top,n.top),n.staff.bottom=Math.min(n.staff.bottom,n.bottom),this.setLimit("tempoHeightAbove",n),this.setLimit("partHeightAbove",n),this.setLimit("volumeHeightAbove",n),this.setLimit("dynamicHeightAbove",n),this.setLimit("endingHeightAbove",n),this.setLimit("chordHeightAbove",n),this.setLimit("lyricHeightAbove",n),this.setLimit("lyricHeightBelow",n),this.setLimit("chordHeightBelow",n),this.setLimit("volumeHeightBelow",n),this.setLimit("dynamicHeightBelow",n)},wh=t,wh}var Sh,wm;function CP(){if(wm)return Sh;wm=1;var e=xo(),t=ts(),n=function(o,l,h){this.type="TempoElement",this.tempo=o,this.tempo.type="tempo",this.tuneNumber=l,this.totalHeightInPitches=6,this.tempoHeightAbove=this.totalHeightInPitches,this.pitch=void 0,this.tempo.duration&&!this.tempo.suppressBpm&&(this.note=this.createNote(h,o,l))};return n.prototype.setX=function(a){this.x=a},n.prototype.createNote=function(a,o,l){var h=.75,f=o.duration[0],b=new e(o,f,1,"tempo",l),S,M,C;f<=1/32?(C="noteheads.quarter",M="flags.u32nd",S=0):f<=1/16?(C="noteheads.quarter",M="flags.u16th",S=0):f<=3/32?(C="noteheads.quarter",M="flags.u16nd",S=1):f<=1/8?(C="noteheads.quarter",M="flags.u8th",S=0):f<=3/16?(C="noteheads.quarter",M="flags.u8th",S=1):f<=1/4?(C="noteheads.quarter",S=0):f<=3/8?(C="noteheads.quarter",S=1):f<=1/2?(C="noteheads.half",S=0):f<=3/4?(C="noteheads.half",S=1):f<=1?(C="noteheads.whole",S=0):f<=1.5?(C="noteheads.whole",S=1):f<=2?(C="noteheads.dbl",S=0):(C="noteheads.dbl",S=1);var y=a(b,C,{verticalPos:0},{dir:"up",flag:M,dot:S,scale:h}),g=y.notehead;b.addHead(g);var w;if(C!=="noteheads.whole"&&C!=="noteheads.dbl"){var p=.3333333333333333*h,E=5*h,N=g.dx+g.w,I=-.6;w=new t(null,N,0,p,{type:"stem",pitch2:E,linewidth:I}),b.addRight(w)}return b},Sh=n,Sh}var xh,Sm;function kP(){if(Sm)return xh;Sm=1;var e=function(n,a,o){this.type="TripletElem",this.anchor1=a,this.number=n,this.durationClass=("d"+Math.round(a.parent.durationClass*1e3)/1e3).replace(/\./,"-"),this.middleElems=[],this.flatBeams=o.flatBeams};return e.prototype.isClosed=function(){return!!this.anchor2},e.prototype.middleNote=function(t){this.middleElems.push(t)},e.prototype.setCloseAnchor=function(t){this.anchor2=t,(!this.anchor1.parent.beam||this.anchor1.stemDir==="up")&&(this.endingHeightAbove=4)},xh=e,xh}var Ch,xm;function MP(){if(xm)return Ch;xm=1;function e(n){switch(n){case"B#":return"H#";case"B♯":return"H♯";case"B":return"H";case"Bb":return"B";case"B♭":return"B"}return n}function t(n,a,o){var l=n.split(`
161
+ `);for(let h=0;h<l.length;h++){let b=l[h].match(/^([ABCDEFG][♯♭]?)?([^\/]+)?(\/([ABCDEFG][#b♯♭]?))?/);if(!b)continue;let S=b[1]||"",M=b[2]||"",C=b[4]||"";o&&(S=e(S),C=e(C));const y=a?"":"",g=C?"/"+C:"";l[h]=[S,M,g].join(y)}return l.join(`
162
+ `)}return Ch=t,Ch}var kh,Cm;function EP(){if(Cm)return kh;Cm=1;var e=ts(),t=Qi();const n=MP();var a=function(l,h,f,b,S,M,C,y){for(var g=0;g<f.chord.length;g++){var w=f.chord[g].position,p=f.chord[g].rel_position,E=w==="left"||w==="right"||w==="below"||w==="above"||!!p,N,I;E?(N="annotationfont",I="abcjs-annotation"):(N="gchordfont",I="abcjs-chord");var O=l.attr(N,I),V=f.chord[g].name,U;if(typeof V=="string")U=o(V,w,p,E,N,I,O,l,h,f,b,S,M,C,y),b=U.roomTaken,S=U.roomTakenRight;else for(var D=0;D<V.length;D++)U=o(V[D].text,w,p,E,N,I,O,l,h,f,b,S,M,C,y),b=U.roomTaken,S=U.roomTakenRight}return{roomTaken:b,roomTakenRight:S}};function o(l,h,f,b,S,M,C,y,g,w,p,E,N,I,O){for(var V=l.split(`
163
+ `),U=V.length-1;U>=0;U--){var D=V[U],me=0,B;b||(D=n(D,I,O));var ie=y.calc(D,S,M),he=ie.width,ae=ie.height/t.STEP;switch(h){case"left":p+=he+7,me=-p,B=w.averagepitch,g.addExtra(new e(D,me,he+4,B,{type:"text",height:ae,dim:C,position:"left"}));break;case"right":E+=4,me=E,B=w.averagepitch,g.addRight(new e(D,me,he+4,B,{type:"text",height:ae,dim:C,position:"right"}));break;case"below":g.addRight(new e(D,0,0,void 0,{type:"text",position:"below",height:ae,dim:C,realWidth:he}));break;case"above":g.addRight(new e(D,0,0,void 0,{type:"text",position:"above",height:ae,dim:C,realWidth:he}));break;default:if(f){var fe=f.y+3*t.STEP;g.addRight(new e(D,me+f.x,0,w.minpitch+fe/t.STEP,{position:"relative",type:"text",height:ae,dim:C}))}else{var le="above";w.positioning&&w.positioning.chordPosition&&(le=w.positioning.chordPosition),le!=="hidden"&&g.addCentered(new e(D,N/2,he,void 0,{type:"chord",position:le,height:ae,dim:C,realWidth:he}))}}}return{roomTaken:p,roomTakenRight:E}}return kh=a,kh}var Mh,km;function AP(){if(km)return Mh;km=1;var e=xo(),t=hP(),n=fP(),a=dP(),o=pP(),l=gP(),h=vP(),f=yP(),b=wP(),S=na(),M=ts(),C=Qi(),y=xP(),g=CP(),w=ky(),p=kP(),E=by(),N=EP(),I=vy(),O=Ds(),V=function(Y){var $=0;return Y.duration&&($=Y.duration),$},U=!1,D={rest:{0:"rests.whole",1:"rests.half",2:"rests.quarter",3:"rests.8th",4:"rests.16th",5:"rests.32nd",6:"rests.64th",7:"rests.128th",multi:"rests.multimeasure"},note:{"-1":"noteheads.dbl",0:"noteheads.whole",1:"noteheads.half",2:"noteheads.quarter",3:"noteheads.quarter",4:"noteheads.quarter",5:"noteheads.quarter",6:"noteheads.quarter",7:"noteheads.quarter",nostem:"noteheads.quarter"},rhythm:{"-1":"noteheads.slash.whole",0:"noteheads.slash.whole",1:"noteheads.slash.whole",2:"noteheads.slash.quarter",3:"noteheads.slash.quarter",4:"noteheads.slash.quarter",5:"noteheads.slash.quarter",6:"noteheads.slash.quarter",7:"noteheads.slash.quarter",nostem:"noteheads.slash.nostem"},x:{"-1":"noteheads.indeterminate",0:"noteheads.indeterminate",1:"noteheads.indeterminate",2:"noteheads.indeterminate",3:"noteheads.indeterminate",4:"noteheads.indeterminate",5:"noteheads.indeterminate",6:"noteheads.indeterminate",7:"noteheads.indeterminate",nostem:"noteheads.indeterminate"},harmonic:{"-1":"noteheads.harmonic.quarter",0:"noteheads.harmonic.quarter",1:"noteheads.harmonic.quarter",2:"noteheads.harmonic.quarter",3:"noteheads.harmonic.quarter",4:"noteheads.harmonic.quarter",5:"noteheads.harmonic.quarter",6:"noteheads.harmonic.quarter",7:"noteheads.harmonic.quarter",nostem:"noteheads.harmonic.quarter"},triangle:{"-1":"noteheads.triangle.quarter",0:"noteheads.triangle.quarter",1:"noteheads.triangle.quarter",2:"noteheads.triangle.quarter",3:"noteheads.triangle.quarter",4:"noteheads.triangle.quarter",5:"noteheads.triangle.quarter",6:"noteheads.triangle.quarter",7:"noteheads.triangle.quarter",nostem:"noteheads.triangle.quarter"},uflags:{3:"flags.u8th",4:"flags.u16th",5:"flags.u32nd",6:"flags.u64th"},dflags:{3:"flags.d8th",4:"flags.d16th",5:"flags.d32nd",6:"flags.d64th"}},me=function(Y,$,ne){this.decoration=new f,this.getTextSize=Y,this.tuneNumber=$,this.isBagpipes=ne.bagpipes,this.flatBeams=ne.flatbeams,this.graceSlurs=ne.graceSlurs,this.percmap=ne.percmap,this.initialClef=ne.initialClef,this.jazzchords=!!ne.jazzchords,this.accentAbove=!!ne.accentAbove,this.germanAlphabet=!!ne.germanAlphabet,this.reset()};me.prototype.reset=function(){this.slurs={},this.ties=[],this.voiceScale=1,this.voiceColor=void 0,this.slursbyvoice={},this.tiesbyvoice={},this.endingsbyvoice={},this.scaleByVoice={},this.colorByVoice={},this.tripletmultiplier=1,this.abcline=void 0,this.accidentalSlot=void 0,this.accidentalshiftx=void 0,this.dotshiftx=void 0,this.hasVocals=!1,this.minY=void 0,this.partstartelem=void 0,this.startlimitelem=void 0,this.stemdir=void 0},me.prototype.setStemHeight=function(Y){this.stemHeight=Math.round(Y*10/C.STEP)/10},me.prototype.getCurrentVoiceId=function(Y,$){return"s"+Y+"v"+$},me.prototype.pushCrossLineElems=function(Y,$){this.slursbyvoice[this.getCurrentVoiceId(Y,$)]=this.slurs,this.tiesbyvoice[this.getCurrentVoiceId(Y,$)]=this.ties,this.endingsbyvoice[this.getCurrentVoiceId(Y,$)]=this.partstartelem,this.scaleByVoice[this.getCurrentVoiceId(Y,$)]=this.voiceScale,this.voiceColor&&(this.colorByVoice[this.getCurrentVoiceId(Y,$)]=this.voiceColor)},me.prototype.popCrossLineElems=function(Y,$){this.slurs=this.slursbyvoice[this.getCurrentVoiceId(Y,$)]||{},this.ties=this.tiesbyvoice[this.getCurrentVoiceId(Y,$)]||[],this.partstartelem=this.endingsbyvoice[this.getCurrentVoiceId(Y,$)],this.voiceScale=this.scaleByVoice[this.getCurrentVoiceId(Y,$)],this.voiceScale===void 0&&(this.voiceScale=1),this.voiceColor=this.colorByVoice[this.getCurrentVoiceId(Y,$)]},me.prototype.containsLyrics=function(Y){for(var $=0;$<Y.length;$++)for(var ne=0;ne<Y[$].voices.length;ne++)for(var we=0;we<Y[$].voices[ne].length;we++){var ye=Y[$].voices[ne][we];if(ye.lyric){(!ye.positioning||ye.positioning.vocalPosition==="below")&&(this.hasVocals=!0);return}}},me.prototype.createABCLine=function(Y,$,ne){this.minY=2,this.containsLyrics(Y);var we=new y(this.getTextSize);this.tempoSet=!1;for(var ye=0;ye<Y.length;ye++)U&&this.restoreState(),U=!1,this.createABCStaff(we,Y[ye],$,ye,ne);return we},me.prototype.createABCStaff=function(Y,$,ne,we,ye){Y.getTextSize.updateFonts($);for(var F=0;F<$.voices.length;F++){var H=new E(F,$.voices.length);F===0?(H.barfrom=$.connectBarLines==="start"||$.connectBarLines==="continue",H.barto=$.connectBarLines==="continue"||$.connectBarLines==="end"):H.duplicate=!0,$.title&&$.title[F]&&(H.header=$.title[F].replace(/\\n/g,`
164
+ `),H.headerPosition=6+Y.getTextSize.baselineToCenter(H.header,"voicefont","staff-extra voice-name",F,$.voices.length)/C.STEP),$.clef&&$.clef.type==="perc"&&(H.isPercussion=!0);var W=(!this.initialClef||ye===0)&&a($.clef,this.tuneNumber);W&&(F===0&&$.barNumber&&this.addMeasureNumber($.barNumber,W),H.addChild(W),this.startlimitelem=W);var _e=o($.key,this.tuneNumber);if(_e&&(H.addChild(_e),this.startlimitelem=_e),$.meter){$.meter.type==="specified"?this.measureLength=$.meter.value[0].num/$.meter.value[0].den:this.measureLength=1;var Te=h($.meter,this.tuneNumber);H.addChild(Te),this.startlimitelem=Te}H.duplicate&&(H.children=[]);var Re=$.clef.stafflines||$.clef.stafflines===0?$.clef.stafflines:5;Y.addVoice(H,we,Re);var Ie=Re===1;this.createABCVoice($.voices[F],ne,we,F,Ie,H),Y.setStaffLimits(H),F===0&&($.brace==="start"||!Y.brace&&$.brace?(Y.brace||(Y.brace=[]),Y.brace.push(new n(H,"brace"))):$.brace==="end"&&Y.brace?Y.brace[Y.brace.length-1].setBottomStaff(H):$.brace==="continue"&&Y.brace&&Y.brace[Y.brace.length-1].continuing(H),$.bracket==="start"||!Y.bracket&&$.bracket?(Y.bracket||(Y.bracket=[]),Y.bracket.push(new n(H,"bracket"))):$.bracket==="end"&&Y.bracket?Y.bracket[Y.bracket.length-1].setBottomStaff(H):$.bracket==="continue"&&Y.bracket&&Y.bracket[Y.bracket.length-1].continuing(H))}};function B(Y,$){var ne=Y[$];if(ne.el_type!=="note"||!ne.startBeam||ne.endBeam)return{count:1,elem:ne};for(var we=[];$<Y.length&&Y[$].el_type==="note"&&(we.push(Y[$]),!Y[$].endBeam);)$++;return{count:we.length,elem:we}}me.prototype.createABCVoice=function(Y,$,ne,we,ye,F){this.popCrossLineElems(ne,we),this.stemdir=this.isBagpipes?"down":null,this.abcline=Y,this.partstartelem&&(this.partstartelem=new b("",null,null),F.addOther(this.partstartelem));var H=F.voicetotal<2?-1:F.voicenumber;for(var W in this.slurs)this.slurs.hasOwnProperty(W)&&(this.slurs[W]=new w({force:this.slurs[W].force,voiceNumber:H,stemDir:this.slurs[W].stemDir,style:this.slurs[W].dotted}),U&&this.slurs[W].setHint(),F.addOther(this.slurs[W]));for(var _e=0;_e<this.ties.length;_e++)this.ties[_e]=new w({force:this.ties[_e].force,stemDir:this.ties[_e].stemDir,voiceNumber:H,style:this.ties[_e].dotted}),U&&this.ties[_e].setHint(),F.addOther(this.ties[_e]);for(var Te=0;Te<this.abcline.length;Te++)ie(this.abcline[Te]),this.minY=Math.min(this.abcline[Te].minpitch,this.minY);for(var Re=ne===0,Ie=0;Ie<this.abcline.length;){var st=B(this.abcline,Ie),wt=this.createABCElement(Re,ye,F,st.elem);if(wt)for(_e=0;_e<wt.length;_e++){if(!this.tempoSet&&$&&!$.suppress){this.tempoSet=!0;var Ze=new e($,0,0,"tempo",this.tuneNumber,{});Ze.addFixedX(new g($,this.tuneNumber,l)),F.addChild(Ze)}F.addChild(wt[_e])}Ie+=st.count}this.pushCrossLineElems(ne,we)},me.prototype.saveState=function(){this.tiesSave=O.cloneArray(this.ties),this.slursSave=O.cloneHashOfHash(this.slurs),this.slursbyvoiceSave=O.cloneHashOfHash(this.slursbyvoice),this.tiesbyvoiceSave=O.cloneHashOfArrayOfHash(this.tiesbyvoice)},me.prototype.restoreState=function(){this.ties=O.cloneArray(this.tiesSave),this.slurs=O.cloneHashOfHash(this.slursSave),this.slursbyvoice=O.cloneHashOfHash(this.slursbyvoiceSave),this.tiesbyvoice=O.cloneHashOfArrayOfHash(this.tiesbyvoiceSave)},me.prototype.createABCElement=function(Y,$,ne,we){var ye=[];switch(we.el_type){case void 0:ye=this.createBeam($,ne,we);break;case"note":ye[0]=this.createNote(we,!1,$,ne),this.triplet&&this.triplet.isClosed()&&(ne.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1);break;case"bar":ye[0]=this.createBarLine(ne,we,Y),ne.duplicate&&ye.length>0&&(ye[0].invisible=!0);break;case"meter":ye[0]=h(we,this.tuneNumber),this.startlimitelem=ye[0],ne.duplicate&&ye.length>0&&(ye[0].invisible=!0);break;case"clef":if(ye[0]=a(we,this.tuneNumber),!ye[0])return null;ne.duplicate&&ye.length>0&&(ye[0].invisible=!0);break;case"key":var F=o(we,this.tuneNumber);F&&(ye[0]=F,this.startlimitelem=ye[0]),ne.duplicate&&ye.length>0&&(ye[0].invisible=!0);break;case"stem":this.stemdir=we.direction==="auto"?void 0:we.direction;break;case"part":var H=new e(we,0,0,"part",this.tuneNumber),W=this.getTextSize.calc(we.title,"partsfont","part");H.addFixedX(new M(we.title,0,0,void 0,{type:"part",height:W.height/C.STEP})),ye[0]=H;break;case"tempo":var _e=new e(we,0,0,"tempo",this.tuneNumber);_e.addFixedX(new g(we,this.tuneNumber,l)),ye[0]=_e;break;case"style":we.head==="normal"?delete this.style:this.style=we.head;break;case"hint":U=!0,this.saveState();break;case"midi":break;case"scale":this.voiceScale=we.size;break;case"color":this.voiceColor=we.color,ne.color=this.voiceColor;break;default:var Te=new e(we,0,0,"unsupported",this.tuneNumber);Te.addFixed(new M("element type "+we.el_type,0,0,void 0,{type:"debug"})),ye[0]=Te}return ye};function ie(Y){if(Y.pitches){he(Y);for(var $=0,ne=0;ne<Y.pitches.length;ne++)$+=Y.pitches[ne].verticalPos;Y.averagepitch=$/Y.pitches.length,Y.minpitch=Y.pitches[0].verticalPos,Y.maxpitch=Y.pitches[Y.pitches.length-1].verticalPos}}me.prototype.createBeam=function(Y,$,ne){var we=[],ye=new t(this.stemHeight*this.voiceScale,this.stemdir,this.flatBeams,ne[0]);U&&ye.setHint();for(var F=0;F<ne.length;F++)ye.runningDirection(ne[F]);ye.setStemDirection();var H=this.stemdir;for(this.stemdir=ye.stemsUp?"up":"down",F=0;F<ne.length;F++){var W=ne[F],_e=this.createNote(W,!0,Y,$);we.push(_e),ye.add(_e),this.triplet&&this.triplet.isClosed()&&($.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1)}return ye.calcDir(),$.addBeam(ye),this.stemdir=H,we};var he=function(Y){var $;do{$=!0;for(var ne=0;ne<Y.pitches.length-1;ne++)if(Y.pitches[ne].pitch>Y.pitches[ne+1].pitch){$=!1;var we=Y.pitches[ne];Y.pitches[ne]=Y.pitches[ne+1],Y.pitches[ne+1]=we}}while(!$)},ae=function(Y,$,ne,we,ye,F,H,W,_e){for(var Te=ne;Te>11;Te--)Te%2===0&&!we&&Y.addFixed(new M(null,W,(ye+4)*_e,Te,{type:"ledger"}));for(Te=$;Te<1;Te++)Te%2===0&&!we&&Y.addFixed(new M(null,W,(ye+4)*_e,Te,{type:"ledger"}));for(Te=0;Te<F.length;Te++){var Re=ye;H==="down"&&(Re=-Re),Y.addFixed(new M(null,Re+W,(ye+4)*_e,F[Te],{type:"ledger"}))}};me.prototype.addGraceNotes=function(Y,$,ne,we,ye,F,H){var W=.6,_e=3.5/5;ye=Math.round(ye*_e);var Te=null,Re;Y.gracenotes.length>1&&(Te=new t(ye,"grace",F),U&&Te.setHint(),Te.mainNote=ne);var Ie,st=[];for(Ie=Y.gracenotes.length-1;Ie>=0;Ie--)H+=10,st[Ie]=H,Y.gracenotes[Ie].accidental&&(H+=7);for(Ie=0;Ie<Y.gracenotes.length;Ie++){var wt=Y.gracenotes[Ie].verticalPos;Re=Te?null:D.uflags[F?5:3];var Ze=[],dt=l(ne,"noteheads.quarter",Y.gracenotes[Ie],{dir:"up",headx:-st[Ie],extrax:-st[Ie],flag:Re,scale:W*this.voiceScale,accidentalSlot:Ze});dt.notehead.highestVert=dt.notehead.pitch+ye;var bt=dt.notehead;if(this.addSlursAndTies(ne,Y.gracenotes[Ie],bt,$,"up",!0),ne.addExtra(bt),Y.gracenotes[Ie].acciaccatura){var et=Y.gracenotes[Ie].verticalPos+7*W,Nt=Te?5:6;ne.addRight(new M("flags.ugrace",-st[Ie]+Nt,0,et,{scalex:W,scaley:W}))}if(Te){var xt=Y.gracenotes[Ie].duration/2;F&&(xt/=2);var at={heads:[bt],abcelem:{averagepitch:wt,minpitch:wt,maxpitch:wt,duration:xt}};Te.add(at)}else{var rr=wt+.3333333333333333*W,Xt=wt+7*W,Ht=bt.dx+bt.w,nr=-.6;ne.addExtra(new M(null,Ht,0,rr,{type:"stem",pitch2:Xt,linewidth:nr}))}ae(ne,wt,wt,!1,S.getSymbolWidth("noteheads.quarter"),[],!0,bt.dx-1,.6);var Ar=Y.rest&&(Y.rest.type==="spacer"||Y.rest.type==="invisible");Ie===0&&!F&&this.graceSlurs&&!Ar&&$.addOther(new w({anchor1:bt,anchor2:we,isGrace:!0}))}return Te&&(Te.calcDir(),$.addBeam(Te)),H};function fe(Y,$,ne,we,ye,F,H,W,_e){var Te,Re=7,Ie,st,wt;switch(ye&&(F==="down"&&(Re=3),F==="up"&&(Re=11)),H&&(ne<.5||ne<1?Re=7:Re=5),$.rest.type){case"whole":Te=D.rest[0],$.averagepitch=Re,$.minpitch=Re,$.maxpitch=Re,we=0;break;case"rest":$.style==="rhythm"?Te=D.rhythm[-W]:Te=D.rest[-W],$.averagepitch=Re,$.minpitch=Re,$.maxpitch=Re;break;case"invisible":case"invisible-multimeasure":case"spacer":Te="",$.averagepitch=Re,$.minpitch=Re,$.maxpitch=Re;break;case"multimeasure":Te=D.rest.multi,$.averagepitch=Re,$.minpitch=Re,$.maxpitch=Re,we=0;var Ze=S.getSymbolWidth(Te);Y.addHead(new M(Te,Ze,Ze*2,7));var dt=new M(""+$.rest.text,Ze,Ze,16,{type:"multimeasure-text"});Y.addExtra(dt)}if($.rest.type.indexOf("multimeasure")<0&&$.rest.type!=="invisible"){var bt=l(Y,Te,{verticalPos:Re},{dot:we,scale:_e});Ie=bt.notehead,Ie&&(Y.addHead(Ie),st=bt.accidentalshiftx,wt=bt.dotshiftx)}return{noteHead:Ie,roomTaken:st,roomTakenRight:wt}}function le(Y,$){for(var ne=0;ne<Y.length;ne++)if(JSON.stringify(Y[ne])===JSON.stringify($))return;Y.push($)}return me.prototype.addNoteToAbcElement=function(Y,$,ne,we,ye,F,H,W,_e){var Te=0,Re,Ie=0,st=0,wt,Ze,dt=[],bt=[],et=0,Nt=$.averagepitch>=6?"down":"up";we&&(Nt=we),ye=$.style?$.style:ye,(!ye||ye==="normal")&&(ye="note");var xt;F?xt=D[ye].nostem:xt=D[ye][-H],xt||console.log("noteSymbol:",ye,H,F);var at;for(at=Nt==="down"?$.pitches.length-2:1;Nt==="down"?at>=0:at<$.pitches.length;at=Nt==="down"?at-1:at+1){var rr=$.pitches[Nt==="down"?at+1:at-1],Xt=$.pitches[at],Ht=Nt==="down"?rr.pitch-Xt.pitch:Xt.pitch-rr.pitch;Ht<=1&&!rr.printer_shift&&(Xt.printer_shift=Ht?"different":"same",(Xt.verticalPos>11||Xt.verticalPos<1)&&dt.push(Xt.verticalPos-Xt.verticalPos%2),Nt==="down"?Ie=S.getSymbolWidth(xt)+2:Te=S.getSymbolWidth(xt)+2)}var nr=$.pitches.length;for(at=0;at<$.pitches.length;at++){if(!W){var Ar;Nt==="down"&&at!==0||Nt==="up"&&at!==nr-1?Ar=null:Ar=D[Nt==="down"?"dflags":"uflags"][-H]}var fr;if($.pitches[at].style)fr=D[$.pitches[at].style][-H];else if(_e.isPercussion&&this.percmap){fr=xt;var qe=this.percmap[I($.pitches[at])];qe&&qe.noteHead&&D[qe.noteHead]&&(fr=D[qe.noteHead][-H])}else fr=xt;$.pitches[at].highestVert=$.pitches[at].verticalPos;var je=(we==="up"||Nt==="up")&&at===0,Fe=(we==="down"||Nt==="down")&&at===nr-1;if(je||Fe){if(($.startSlur||nr===1)&&($.pitches[at].highestVert=$.pitches[nr-1].verticalPos,V($)<1&&(we==="up"||Nt==="up")&&($.pitches[at].highestVert+=6)),$.startSlur)for($.pitches[at].startSlur||($.pitches[at].startSlur=[]),Ze=0;Ze<$.startSlur.length;Ze++)le($.pitches[at].startSlur,$.startSlur[Ze]);if($.endSlur)for($.pitches[at].highestVert=$.pitches[nr-1].verticalPos,V($)<1&&(we==="up"||Nt==="up")&&($.pitches[at].highestVert+=6),$.pitches[at].endSlur||($.pitches[at].endSlur=[]),Ze=0;Ze<$.endSlur.length;Ze++)le($.pitches[at].endSlur,$.endSlur[Ze])}var Ue=!W&&H<=-1,Qe=l(Y,fr,$.pitches[at],{dir:Nt,extrax:-Ie,flag:Ar,dot:ne,dotshiftx:Te,scale:this.voiceScale,accidentalSlot:bt,shouldExtendStem:!we,printAccidentals:!_e.isPercussion});et=Math.max(S.getSymbolWidth(fr),et),Y.extraw-=Qe.extraLeft,Re=Qe.notehead,Re&&(this.addSlursAndTies(Y,$.pitches[at],Re,_e,Ue?Nt:null,!1),$.gracenotes&&$.gracenotes.length>0&&(Re.bottom=Re.bottom-1),Y.addHead(Re)),Ie+=Qe.accidentalshiftx,st=Math.max(st,Qe.dotshiftx)}if(Ue){var r=Math.round(70*this.voiceScale)/10,c=Nt==="down"?$.minpitch-r:$.minpitch+1/3;c>6&&!we&&(c=6);var m=Nt==="down"?$.maxpitch-1/3:$.maxpitch+r;m<6&&!we&&(m=6);var x=Nt==="down"||Y.heads.length===0?0:Y.heads[0].w,k=Nt==="down"?1:-1;Re&&Re.c==="noteheads.slash.quarter"&&(Nt==="down"?m-=1:c+=1),Re&&Re.c==="noteheads.triangle.quarter"&&(Nt==="down"?m-=.7:c-=1.2),Y.addRight(new M(null,x,0,c,{type:"stem",pitch2:m,linewidth:k,bottom:c-1})),wt=Math.min(c,m)}return{noteHead:Re,roomTaken:Ie,roomTakenRight:st,min:wt,additionalLedgers:dt,dir:Nt,symbolWidth:et}},me.prototype.addLyric=function(Y,$){var ne="";$.lyric.forEach(function(F){var H=F.divider===" "?"":F.divider;ne+=F.syllable+H+`
165
+ `});var we=this.getTextSize.calc(ne,"vocalfont","lyric"),ye=$.positioning?$.positioning.vocalPosition:"below";Y.addCentered(new M(ne,0,we.width,void 0,{type:"lyric",position:ye,height:we.height/C.STEP,dim:this.getTextSize.attr("vocalfont","lyric")}))},me.prototype.createNote=function(Y,$,ne,we){var ye=null,F=0,H=0,W=0,_e=[],Te,Re=V(Y),Ie=!1;Re===0&&(Ie=!0,Re=.25,$=!0);for(var st=Math.floor(Math.log(Re)/Math.log(2)),wt=0,Ze=Math.pow(2,st),dt=Ze/2;Ze<Re;wt++,Ze+=dt,dt/=2);Y.startTriplet&&(this.tripletmultiplier=Y.tripletMultiplier);var bt=Re*this.tripletmultiplier;Y.rest&&Y.rest.type==="multimeasure"&&(bt=1),Y.rest&&Y.rest.type==="invisible-multimeasure"&&(bt=this.measureLength*Y.rest.text);var et=Y.rest?"rest":"note",Nt=new e(Y,bt,1,et,this.tuneNumber,{durationClassOveride:Y.duration*this.tripletmultiplier});if(U&&Nt.setHint(),Y.rest){this.measureLength===Re&&Y.rest.type!=="invisible"&&Y.rest.type!=="spacer"&&Y.rest.type.indexOf("multimeasure")<0&&(Y.rest.type="whole");var xt=fe(Nt,Y,Re,wt,we.voicetotal>1,this.stemdir,ne,st,this.voiceScale);ye=xt.noteHead,F=xt.roomTaken,H=xt.roomTakenRight}else{var at=this.addNoteToAbcElement(Nt,Y,wt,this.stemdir,this.style,Ie,st,$,we);at.min!==void 0&&(this.minY=Math.min(at.min,this.minY)),ye=at.noteHead,F=at.roomTaken,H=at.roomTakenRight,_e=at.additionalLedgers,Te=at.dir,W=at.symbolWidth}if(Y.lyric!==void 0&&this.addLyric(Nt,Y),Y.gracenotes!==void 0&&(F+=this.addGraceNotes(Y,we,Nt,ye,this.stemHeight*this.voiceScale,this.isBagpipes,F)),Y.decoration){var rr=$&&Te!=="up"?Math.min(-3,Nt.bottom-6):Nt.bottom;this.decoration.createDecoration(we,Y.decoration,Nt.top,ye?ye.w:0,Nt,F,Te,rr,Y.positioning,this.hasVocals,this.accentAbove)}if(Y.barNumber&&Nt.addFixed(new M(Y.barNumber,-10,0,0,{type:"barNumber"})),ae(Nt,Y.minpitch,Y.maxpitch,Y.rest,W,_e,Te,-2,1),Y.chord!==void 0){var Xt=N(this.getTextSize,Nt,Y,F,H,W,this.jazzchords,this.germanAlphabet);F=Xt.roomTaken,H=Xt.roomTakenRight}return Y.startTriplet&&(this.triplet=new p(Y.startTriplet,ye,{flatBeams:this.flatBeams})),Y.endTriplet&&this.triplet&&this.triplet.setCloseAnchor(ye),this.triplet&&!Y.startTriplet&&!Y.endTriplet&&!(Y.rest&&Y.rest.type==="spacer")&&this.triplet.middleNote(ye),Nt},me.prototype.addSlursAndTies=function(Y,$,ne,we,ye,F){if($.endTie&&this.ties.length>0){for(var H=!1,W=0;W<this.ties.length;W++)if(this.ties[W].anchor1&&this.ties[W].anchor1.pitch===ne.pitch){this.ties[W].setEndAnchor(ne),we.setRange(this.ties[W]),this.ties.splice(W,1),H=!0;break}H||(this.ties[0].setEndAnchor(ne),we.setRange(this.ties[0]),this.ties.splice(0,1))}var _e=we.voicetotal<2?-1:we.voicenumber;if($.startTie){var Te=new w({anchor1:ne,force:this.stemdir==="down"||this.stemdir==="up",stemDir:this.stemdir,isGrace:F,voiceNumber:_e,style:$.startTie.style});U&&Te.setHint(),this.ties[this.ties.length]=Te,we.addOther(Te),Y.startTie=!0}var Re,Ie;if($.endSlur)for(var st=0;st<$.endSlur.length;st++)Ie=$.endSlur[st],this.slurs[Ie]?(Re=this.slurs[Ie],Re.setEndAnchor(ne),we.setRange(Re),delete this.slurs[Ie]):(Re=new w({anchor2:ne,stemDir:this.stemdir,voiceNumber:_e}),U&&Re.setHint(),we.addOther(Re)),this.startlimitelem&&Re.setStartX(this.startlimitelem);else if(!F)for(var wt in this.slurs)this.slurs.hasOwnProperty(wt)&&this.slurs[wt].addInternalNote(ne);if($.startSlur)for(st=0;st<$.startSlur.length;st++)Ie=$.startSlur[st].label,Re=new w({anchor1:ne,stemDir:this.stemdir,voiceNumber:_e,style:$.startSlur[st].style}),U&&Re.setHint(),this.slurs[Ie]=Re,we.addOther(Re)},me.prototype.addMeasureNumber=function(Y,$){var ne=this.getTextSize.calc(Y,"measurefont","bar-number"),we=0;$.isClef&&(we+=ne.width/2);var ye=ne.width>10&&$.abcelem.type==="treble"?13.5:11;$.addFixed(new M(Y,we,ne.width,ye+ne.height/C.STEP,{type:"barNumber",dim:this.getTextSize.attr("measurefont","bar-number")}))},me.prototype.createBarLine=function(Y,$,ne){var we=new e($,0,10,"bar",this.tuneNumber),ye=null,F=0;$.barNumber&&this.addMeasureNumber($.barNumber,we);var H=$.type==="bar_right_repeat"||$.type==="bar_dbl_repeat",W=$.type!=="bar_left_repeat"&&$.type!=="bar_thick_thin"&&$.type!=="bar_invisible",_e=$.type==="bar_right_repeat"||$.type==="bar_dbl_repeat"||$.type==="bar_left_repeat"||$.type==="bar_thin_thick"||$.type==="bar_thick_thin",Te=$.type==="bar_left_repeat"||$.type==="bar_thick_thin"||$.type==="bar_thin_thin"||$.type==="bar_dbl_repeat",Re=$.type==="bar_left_repeat"||$.type==="bar_dbl_repeat";if(H||Re){for(var Ie in this.slurs)this.slurs.hasOwnProperty(Ie)&&this.slurs[Ie].setEndX(we);this.startlimitelem=we}if(H&&(we.addRight(new M("dots.dot",F,1,7)),we.addRight(new M("dots.dot",F,1,5)),F+=6),W&&(ye=new M(null,F,1,2,{type:"bar",pitch2:10,linewidth:.6}),we.addRight(ye)),$.type==="bar_invisible"&&(ye=new M(null,F,1,2,{type:"none",pitch2:10,linewidth:.6}),we.addRight(ye)),$.decoration&&this.decoration.createDecoration(Y,$.decoration,12,_e?3:1,we,0,"down",2,$.positioning,this.hasVocals,this.accentAbove),_e&&(F+=4,ye=new M(null,F,4,2,{type:"bar",pitch2:10,linewidth:4}),we.addRight(ye),F+=5),this.partstartelem&&$.endEnding&&(this.partstartelem.anchor2=ye,this.partstartelem=null),Te&&(F+=3,ye=new M(null,F,1,2,{type:"bar",pitch2:10,linewidth:.6}),we.addRight(ye)),Re&&(F+=3,we.addRight(new M("dots.dot",F,1,7)),we.addRight(new M("dots.dot",F,1,5))),$.startEnding&&ne){var st=this.getTextSize.calc($.startEnding,"repeatfont","").width;we.minspacing+=st+10,this.partstartelem=new b($.startEnding,ye,null),Y.addOther(this.partstartelem)}return we.extraw-=5,$.chord!==void 0&&N(this.getTextSize,we,$,0,0,0,!1,this.germanAlphabet),we},Mh=me,Mh}var Eh,Mm;function TP(){if(Mm)return Eh;Mm=1;var e="http://www.w3.org/2000/svg";function t(h){this.svg=l(),this.currentGroup=[],h.appendChild(this.svg)}t.prototype.clear=function(){if(this.svg){var h=this.svg.parentNode;this.svg=l(),this.currentGroup=[],h&&(h.innerHTML="",h.appendChild(this.svg))}},t.prototype.setTitle=function(h){var f=document.createElement("title"),b=document.createTextNode(h);f.appendChild(b),this.svg.insertBefore(f,this.svg.firstChild)},t.prototype.setResponsiveWidth=function(h,f){if(this.svg.setAttribute("viewBox","0 0 "+h+" "+f),this.svg.setAttribute("preserveAspectRatio","xMinYMin meet"),this.svg.removeAttribute("height"),this.svg.removeAttribute("width"),this.svg.style.display="inline-block",this.svg.style.position="absolute",this.svg.style.top="0",this.svg.style.left="0",this.svg.parentNode){var b=this.svg.parentNode.getAttribute("class");b?b.indexOf("abcjs-container")<0&&this.svg.parentNode.setAttribute("class",b+" abcjs-container"):this.svg.parentNode.setAttribute("class","abcjs-container"),this.svg.parentNode.style.display="inline-block",this.svg.parentNode.style.position="relative",this.svg.parentNode.style.width="100%";var S=f/h*100;this.svg.parentNode.style["padding-bottom"]=S+"%",this.svg.parentNode.style["vertical-align"]="middle",this.svg.parentNode.style.overflow="hidden"}},t.prototype.setSize=function(h,f){this.svg.setAttribute("width",h),this.svg.setAttribute("height",f)},t.prototype.setAttribute=function(h,f){this.svg.setAttribute(h,f)},t.prototype.setScale=function(h){h!==1?(this.svg.style.transform="scale("+h+","+h+")",this.svg.style["-ms-transform"]="scale("+h+","+h+")",this.svg.style["-webkit-transform"]="scale("+h+","+h+")",this.svg.style["transform-origin"]="0 0",this.svg.style["-ms-transform-origin-x"]="0",this.svg.style["-ms-transform-origin-y"]="0",this.svg.style["-webkit-transform-origin-x"]="0",this.svg.style["-webkit-transform-origin-y"]="0"):(this.svg.style.transform="",this.svg.style["-ms-transform"]="",this.svg.style["-webkit-transform"]="")},t.prototype.insertStyles=function(h){var f=document.createElementNS(e,"style");f.textContent=h,this.svg.insertBefore(f,this.svg.firstChild)},t.prototype.setParentStyles=function(h){for(var f in h)h.hasOwnProperty(f)&&this.svg.parentNode&&(this.svg.parentNode.style[f]=h[f]);if(this.dummySvg){var b=document.querySelector("body");b.removeChild(this.dummySvg),this.dummySvg=null}};function n(h,f,b){var S=b-h;return"M "+h+" "+f+" l "+S+" 0 l 0 1 l "+-S+" 0 z "}function a(h,f,b){var S=b-f;return"M "+h+" "+f+" l 0 "+S+" l 1 0 l 0 "+-S+" z "}t.prototype.rect=function(h){var f=[],b=h.x,S=h.y,M=h.x+h.width,C=h.y+h.height;return f.push(n(b,S,M)),f.push(n(b,C,M)),f.push(a(M,S,C)),f.push(a(b,C,S)),this.path({path:f.join(" "),stroke:"none","data-name":h["data-name"]})},t.prototype.dottedLine=function(h){var f=document.createElementNS(e,"line");f.setAttribute("x1",h.x1),f.setAttribute("x2",h.x2),f.setAttribute("y1",h.y1),f.setAttribute("y2",h.y2),f.setAttribute("stroke",h.stroke),f.setAttribute("stroke-dasharray","5,5"),this.svg.insertBefore(f,this.svg.firstChild)},t.prototype.rectBeneath=function(h){var f=document.createElementNS(e,"rect");f.setAttribute("x",h.x),f.setAttribute("width",h.width),f.setAttribute("y",h.y),f.setAttribute("height",h.height),h.stroke&&f.setAttribute("stroke",h.stroke),h["stroke-opacity"]&&f.setAttribute("stroke-opacity",h["stroke-opacity"]),h.fill&&f.setAttribute("fill",h.fill),h["fill-opacity"]&&f.setAttribute("fill-opacity",h["fill-opacity"]),this.svg.insertBefore(f,this.svg.firstChild)},t.prototype.text=function(h,f,b){var S=document.createElementNS(e,"text");S.setAttribute("stroke","none");for(var M in f)f.hasOwnProperty(M)&&S.setAttribute(M,f[M]);for(var C=(""+h).split(`
166
+ `),y=0;y<C.length;y++){var g=document.createElementNS(e,"tspan");if(g.setAttribute("x",f.x?f.x:0),y!==0&&g.setAttribute("dy","1.2em"),C[y].indexOf("")!==-1){var w=C[y].split("");if(g.textContent=w[0],w[1]){var p=document.createElementNS(e,"tspan");p.setAttribute("dy","-0.3em"),p.setAttribute("style","font-size:0.7em"),p.textContent=w[1],g.appendChild(p)}if(w[2]){var E=w[1]?"0.4em":"0.1em",N=document.createElementNS(e,"tspan");N.setAttribute("dy",E),N.setAttribute("style","font-size:0.7em"),N.textContent=w[2],g.appendChild(N)}}else g.textContent=C[y];S.appendChild(g)}return b?b.appendChild(S):this.append(S),S},t.prototype.richTextLine=function(h,f,b,S,M,C){var y=document.createElementNS(e,"text");y.setAttribute("stroke","none"),y.setAttribute("class",S),y.setAttribute("x",f),y.setAttribute("y",b),y.setAttribute("text-anchor",M),y.setAttribute("dominant-baseline","middle");for(var g=0;g<h.length;g++){for(var w=h[g],p=document.createElementNS(e,"tspan"),E=Object.keys(w.attrs),N=0;N<E.length;N++){var I=w.attrs[E[N]];I!==""&&p.setAttribute(E[N],I)}p.textContent=w.content,y.appendChild(p)}return C?C.appendChild(y):this.append(y),y},t.prototype.guessWidth=function(h,f){var b=this.createDummySvg(),S=this.text(h,f,b),M;try{M=S.getBBox(),isNaN(M.height)||!M.height?M={width:f["font-size"]/2,height:f["font-size"]+2}:M={width:M.width,height:M.height}}catch{M={width:f["font-size"]/2,height:f["font-size"]+2}}return b.removeChild(S),M},t.prototype.createDummySvg=function(){if(!this.dummySvg){this.dummySvg=l();var h=["display: block !important;","height: 1px;","width: 1px;","position: absolute;"];this.dummySvg.setAttribute("style",h.join(""));var f=document.querySelector("body");f.appendChild(this.dummySvg)}return this.dummySvg};var o={};t.prototype.getTextSize=function(h,f,b){if(typeof h=="number"&&(h=""+h),!h||h.match(/^\s+$/))return{width:0,height:0};var S;if(h.length<20&&(S=h+JSON.stringify(f),o[S]))return o[S];var M=!b;b||(b=this.text(h,f));var C;try{C=b.getBBox(),isNaN(C.height)||!C.height?C=this.guessWidth(h,f):C={width:C.width,height:C.height}}catch{C=this.guessWidth(h,f)}return M&&(this.currentGroup.length>0?this.currentGroup[0].removeChild(b):this.svg.removeChild(b)),S&&(o[S]=C),C},t.prototype.openGroup=function(h){h=h||{};var f=document.createElementNS(e,"g");return h.klass&&f.setAttribute("class",h.klass),h.fill&&f.setAttribute("fill",h.fill),h.stroke&&f.setAttribute("stroke",h.stroke),h["data-name"]&&f.setAttribute("data-name",h["data-name"]),h.prepend?this.prepend(f):this.append(f),this.currentGroup.unshift(f),f},t.prototype.closeGroup=function(){var h=this.currentGroup.shift();return h&&h.children.length===0?(h.parentElement.removeChild(h),null):h},t.prototype.path=function(h){var f=document.createElementNS(e,"path");for(var b in h)h.hasOwnProperty(b)&&(b==="path"?f.setAttributeNS(null,"d",h.path):b==="klass"?f.setAttributeNS(null,"class",h[b]):h[b]!==void 0&&f.setAttributeNS(null,b,h[b]));return this.append(f),f},t.prototype.pathToBack=function(h){var f=document.createElementNS(e,"path");for(var b in h)h.hasOwnProperty(b)&&(b==="path"?f.setAttributeNS(null,"d",h.path):b==="klass"?f.setAttributeNS(null,"class",h[b]):f.setAttributeNS(null,b,h[b]));return this.prepend(f),f},t.prototype.lineToBack=function(h){for(var f=document.createElementNS(e,"line"),b=Object.keys(h),S=0;S<b.length;S++)f.setAttribute(b[S],h[b[S]]);return this.prepend(f),f},t.prototype.append=function(h){this.currentGroup.length>0?this.currentGroup[0].appendChild(h):this.svg.appendChild(h)},t.prototype.prepend=function(h){this.currentGroup.length>0?this.currentGroup[0].appendChild(h):this.svg.insertBefore(h,this.svg.firstChild)},t.prototype.setAttributeOnElement=function(h,f){for(var b in f)f.hasOwnProperty(b)&&h.setAttributeNS(null,b,f[b])},t.prototype.moveElementToChild=function(h,f){h.appendChild(f)};function l(){var h=document.createElementNS(e,"svg");return h.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),h.setAttribute("role","img"),h.setAttribute("fill","currentColor"),h.setAttribute("stroke","currentColor"),h}return Eh=t,Eh}var Ah,Em;function PP(){if(Em)return Ah;Em=1;var e=Qi(),t=TP(),n=function(a){this.paper=new t(a),this.controller=null,this.space=3*e.SPACE,this.padding={},this.reset(),this.firefox112=navigator.userAgent.indexOf("Firefox/112.0")>=0};return n.prototype.reset=function(){this.paper.clear(),this.y=0,this.abctune=null,this.path=null,this.isPrint=!1,this.lineThickness=0,this.initVerticalSpace()},n.prototype.newTune=function(a){this.abctune=a,this.setVerticalSpace(a.formatting),this.isPrint=a.media==="print",this.setPadding(a)},n.prototype.setLineThickness=function(a){this.lineThickness=a},n.prototype.setPaddingOverride=function(a){this.paddingOverride={top:a.paddingtop,bottom:a.paddingbottom,right:a.paddingright,left:a.paddingleft}},n.prototype.setPadding=function(a){function o(l,h,f,b,S){a.formatting[f]!==void 0?l.padding[h]=a.formatting[f]:l.paddingOverride[h]!==void 0?l.padding[h]=l.paddingOverride[h]:l.isPrint?l.padding[h]=b:l.padding[h]=S}o(this,"top","topmargin",38,15),o(this,"bottom","botmargin",38,15),o(this,"left","leftmargin",68,15),o(this,"right","rightmargin",68,15)},n.prototype.adjustNonScaledItems=function(a){this.padding.top/=a,this.padding.bottom/=a,this.padding.left/=a,this.padding.right/=a,this.abctune.formatting.headerfont.size/=a,this.abctune.formatting.footerfont.size/=a},n.prototype.initVerticalSpace=function(){this.spacing={composer:7.56,graceBefore:8.67,graceInside:10.67,graceAfter:16,info:0,lineSkipFactor:1.1,music:7.56,paragraphSkipFactor:.4,parts:11.33,slurHeight:1,staffSeparation:61.33,staffTopMargin:0,stemHeight:26.67+10,subtitle:3.78,systemStaffSeparation:48,text:18.9,title:7.56,top:30.24,vocal:0,words:0}},n.prototype.setVerticalSpace=function(a){a.staffsep!==void 0&&(this.spacing.staffSeparation=a.staffsep*4/3),a.composerspace!==void 0&&(this.spacing.composer=a.composerspace*4/3),a.partsspace!==void 0&&(this.spacing.parts=a.partsspace*4/3),a.textspace!==void 0&&(this.spacing.text=a.textspace*4/3),a.musicspace!==void 0&&(this.spacing.music=a.musicspace*4/3),a.titlespace!==void 0&&(this.spacing.title=a.titlespace*4/3),a.sysstaffsep!==void 0&&(this.spacing.systemStaffSeparation=a.sysstaffsep*4/3),a.stafftopmargin!==void 0&&(this.spacing.staffTopMargin=a.stafftopmargin*4/3),a.subtitlespace!==void 0&&(this.spacing.subtitle=a.subtitlespace*4/3),a.topspace!==void 0&&(this.spacing.top=a.topspace*4/3),a.vocalspace!==void 0&&(this.spacing.vocal=a.vocalspace*4/3),a.wordsspace!==void 0&&(this.spacing.words=a.wordsspace*4/3)},n.prototype.calcY=function(a){return this.y-a*e.STEP},n.prototype.moveY=function(a,o){o===void 0&&(o=1),this.y+=a*o},n.prototype.absolutemoveY=function(a){this.y=a},Ah=n,Ah}var Th,Am;function IP(){if(Am)return Th;Am=1;function e(t,n,a,o,l,h){var f=t.text;this.rows=[];var b;n&&this.rows.push({move:n});var S=a.calc("textfont","defined-text");if(f==="")this.rows.push({move:S.attr["font-size"]*2});else if(typeof f=="string")this.rows.push({move:S.attr["font-size"]/2}),this.rows.push({left:o,text:f,font:"textfont",klass:"defined-text",anchor:"start",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),b=h.calc(f,"textfont","defined-text"),this.rows.push({move:b.height});else if(f){for(var M=0,C=o,y="textfont",g=0;g<f.length;g++)f[g].font?y=f[g].font:y="textfont",this.rows.push({left:C,text:f[g].text,font:y,klass:"defined-text",anchor:"start",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),b=h.calc(f[g].text,a.calc(y,"defined-text").font,"defined-text"),C+=b.width+b.height/2,M=Math.max(M,b.height);this.rows.push({move:M})}else if(t.length===1){var w=l/2;this.rows.push({left:w,text:t[0].text,font:"textfont",klass:"defined-text",anchor:"middle",startChar:t.startChar,endChar:t.endChar,absElemType:"freeText",name:"free-text"}),b=h.calc(t[0].text,"textfont","defined-text"),this.rows.push({move:b.height})}}return Th=e,Th}var Ph,Tm;function NP(){if(Tm)return Ph;Tm=1;function e(t,n,a){this.rows=[],t&&this.rows.push({move:t}),this.rows.push({separator:n,absElemType:"separator"}),a&&this.rows.push({move:a})}return Ph=e,Ph}var Ih,Pm;function LP(){if(Pm)return Ih;Pm=1;function e(t,n,a,o,l,h){this.rows=[],t&&this.rows.push({move:t});var f=n.titleleft?"start":"middle",b=n.titleleft?l:o;this.rows.push({left:b,text:a.text,font:"subtitlefont",klass:"text subtitle",anchor:f,startChar:a.startChar,endChar:a.endChar,absElemType:"subtitle",name:"subtitle"});var S=h.calc(a.text,"subtitlefont","text subtitle");this.rows.push({move:S.height})}return Ih=e,Ih}var Nh,Im;function q1(){if(Im)return Nh;Im=1;function e(t,n,a){if(n.text){n.marginLeft||(n.marginLeft=0),n.klass||(n.klass=""),n.anchor||(n.anchor="start"),n.info||(n.info={startChar:-2,endChar:-2}),n.marginTop&&t.push({move:n.marginTop});var o={left:n.marginLeft,text:n.text,font:n.font,anchor:n.anchor,startChar:n.info.startChar,endChar:n.info.endChar,"dominant-baseline":n["dominant-baseline"]};n.absElemType&&(o.absElemType=n.absElemType),!n.inGroup&&n.klass&&(o.klass=n.klass),n.name&&(o.name=n.name),t.push(o);var l=a.calc("A",n.font,n.klass),h=n.text.split(`
167
+ `).length;if(n.text[n.text.length-1]===`
168
+ `&&h--,!n.noMove){var f=l.height*1.1*h;t.push({move:Math.round(f)}),n.marginBottom&&t.push({move:n.marginBottom})}}}return Nh=e,Nh}var Lh,Nm;function My(){if(Nm)return Lh;Nm=1;const e=q1();function t(n,a,o,l,h,f,b,S){var M=S.calc("i",o,l);if(a==="")n.push({move:M.height});else{if(typeof a=="string"){e(n,{marginLeft:f,text:a,font:o,klass:l,marginTop:b.marginTop,anchor:b.anchor,absElemType:b.absElemType,info:b.info,name:h},S);return}b.marginTop&&n.push({move:b.marginTop});var C=0,y={left:f,anchor:b.anchor,phrases:[]};l&&(y.klass=l),n.push(y);for(var g=0;g<a.length;g++){var w=a[g],p=w.font?w.font:S.attr(o,l).font,E={content:w.text};p&&(E.attrs={"font-family":S.getFamily(p.face),"font-size":p.size,"font-weight":p.weight,"font-style":p.style,"font-decoration":p.decoration}),y.phrases.push(E);var N=S.calc(w.text,p,l);C=Math.max(C,N.height),w.text[w.text.length-1]===" "&&M.width}n.push({move:C})}}return Lh=t,Lh}var Oh,Lm;function OP(){if(Lm)return Oh;Lm=1;const e=q1(),t=My();function n(a,o,l,h,f,b,S,M,C,y){if(this.rows=[],a.header&&b){var g=y.calc("X","headerfont","abcjs-header abcjs-meta-top").height;e(this.rows,{marginLeft:S,text:a.header.left,font:"headerfont",klass:"header meta-top",marginTop:-g,info:o.header,name:"header"},y),e(this.rows,{marginLeft:S+f/2,text:a.header.center,font:"headerfont",klass:"header meta-top",marginTop:-g,anchor:"middle",info:o.header,name:"header"},y),e(this.rows,{marginLeft:S+f,text:a.header.right,font:"headerfont",klass:"header meta-top",marginTop:-g,anchor:"end",info:o.header,name:"header"},y)}b&&this.rows.push({move:M.top});var w=l.titleleft?"start":"middle",p=l.titleleft?S:S+f/2;if(a.title){var E=C?"abcjs-title":"";t(this.rows,a.title,"titlefont",E,"title",p,{marginTop:M.title,anchor:w,absElemType:"title",info:o.title},y)}if(h.length)for(var N=0;N<h.length&&h[N].subtitle;){var E=C?"abcjs-text abcjs-subtitle":"";t(this.rows,h[N].subtitle.text,"subtitlefont",E,"subtitle",p,{marginTop:M.subtitle,anchor:w,absElemType:"subtitle",info:h[N].subtitle},y),N++}if(a.rhythm||a.origin||a.composer){if(this.rows.push({move:M.composer}),a.rhythm&&a.rhythm.length>0){var I=!!(a.composer||a.origin),E=C?"abcjs-rhythm":"";e(this.rows,{marginLeft:S,text:a.rhythm,font:"infofont",klass:E,absElemType:"rhythm",noMove:I,info:o.rhythm,name:"rhythm"},y)}a.composer&&a.composer,a.origin&&a.origin;var O=a.composer?a.composer:"";if(a.origin&&(typeof O=="string"&&typeof a.origin=="string"?O+=" ("+a.origin+")":typeof O=="string"&&typeof a.origin!="string"?(O=[{text:O}],O.push({text:" ("}),O=O.concat(a.origin),O.push({text:")"})):(O.push({text:" ("}),O=O.concat(a.origin),O.push({text:")"}))),O){var E=C?"abcjs-composer":"";t(this.rows,O,"composerfont",E,"composer",S+f,{anchor:"end",absElemType:"composer",info:o.composer,ingroup:!0},y)}}if(a.author&&a.author.length>0){var E=C?"abcjs-author":"";t(this.rows,a.author,"composerfont",E,"author",S+f,{anchor:"end",absElemType:"author",info:o.author},y)}if(a.partOrder&&a.partOrder.length>0){var E=C?"abcjs-part-order":"";t(this.rows,a.partOrder,"partsfont",E,"part-order",S,{absElemType:"partOrder",info:o.partOrder,anchor:"start"},y)}}return Oh=n,Oh}var Dh,Om;function DP(){if(Om)return Dh;Om=1;const e=q1(),t=My();function n(l,h,f,b,S,M,C){this.rows=[],l.unalignedWords&&l.unalignedWords.length>0&&this.unalignedWords(l.unalignedWords,b,S,M,C),this.extraText(l,b,S,M,C),l.footer&&f&&this.footer(l.footer,h,b,C)}n.prototype.unalignedWords=function(l,h,f,b,S){var M=b?"abcjs-unaligned-words":"",C="wordsfont",y=S.calc("i",C,M);this.rows.push({move:f.words}),o(this.rows,"",l,h,C,"unalignedWords","unalignedWords",M,"unalignedWords",f,b,S),this.rows.push({move:y.height})};function a(l,h,f,b,S,M,C){f&&(h&&(typeof f=="string"?f=h+f:f=[{text:h}].concat(f)),S=M?"abcjs-extra-text "+S:"",t(l,f,"historyfont",S,"description",b,{absElemType:"extraText",anchor:"start"},C))}function o(l,h,f,b,S,M,C,y,g,w,p,E){if(f){y=p?"abcjs-extra-text "+y:"";var N=E.calc("A",S,y);if(typeof f=="string")h&&(f=h+`
169
+ `+f),e(l,{marginLeft:b,text:f,font:S,absElemType:"extraText",name:g,"dominant-baseline":"middle",klass:y},E);else{l.push({startGroup:C,klass:y,name:g}),l.push({move:w.info}),h&&(e(l,{marginLeft:b,text:h,font:S,absElemType:"extraText",name:g,"dominant-baseline":"middle"},E),l.push({move:N.height*3/4}));for(var I=0;I<f.length;I++)t(l,f[I],S,"",g,b,{anchor:"start"},E),I<f.length-1&&typeof f[I]=="string"&&typeof f[I+1]!="string"&&l.push({move:N.height*3/4});l.push({endGroup:C,absElemType:M,startChar:-1,endChar:-1,name:g}),l.push({move:N.height})}}}return n.prototype.extraText=function(l,h,f,b,S){a(this.rows,"Book: ",l.book,h,"abcjs-book",b,S),a(this.rows,"Source: ",l.source,h,"abcjs-source",b,S),a(this.rows,"Discography: ",l.discography,h,"abcjs-discography",b,S),o(this.rows,"Notes:",l.notes,h,"historyfont","extraText","notes","abcjs-notes","description",f,b,S),a(this.rows,"Transcription: ",l.transcription,h,"abcjs-transcription",b,S),o(this.rows,"History:",l.history,h,"historyfont","extraText","history","abcjs-history","description",f,b,S),a(this.rows,"Copyright: ",l["abc-copyright"],h,"abcjs-copyright",b,S),a(this.rows,"Creator: ",l["abc-creator"],h,"abcjs-creator",b,S),a(this.rows,"Edited By: ",l["abc-edited-by"],h,"abcjs-edited-by",b,S)},n.prototype.footer=function(l,h,f,b){var S="header meta-bottom",M="footerfont";this.rows.push({startGroup:"footer",klass:S}),e(this.rows,{marginLeft:f,text:l.left,font:M,klass:S,name:"footer"},b),e(this.rows,{marginLeft:f+h/2,text:l.center,font:M,klass:S,anchor:"middle",name:"footer"},b),e(this.rows,{marginLeft:f+h,text:l.right,font:M,klass:S,anchor:"end",name:"footer"},b)},Dh=n,Dh}var Rh,Dm;function Ey(){if(Dm)return Rh;Dm=1;function e(n,a,o,l){if(n.indexOf(a)===0){var h=n.replace(a,""),f=parseInt(h,10);""+f===h&&(o[l]=f)}}function t(n,a){var o=[];if(n.absEl.elemset){for(var l={},h=0;h<n.absEl.elemset.length;h++){var f=n.absEl.elemset[h];if(f)for(var b=f.getAttribute("class").split(" "),S=0;S<b.length;S++)l[b[S]]=!0}for(var M=0;M<Object.keys(l).length;M++)o.push(Object.keys(l)[M])}for(var C={},y=0;y<o.length;y++)e(o[y],"abcjs-v",C,"voice"),e(o[y],"abcjs-l",C,"line"),e(o[y],"abcjs-m",C,"measure");n.staffPos&&(C.staffPos=n.staffPos);for(var g=a.target;g&&g.dataset&&!g.dataset.name&&g.tagName.toLowerCase()!=="svg";)g=g.parentNode;for(var w=a.target;w&&w.dataset&&!w.dataset.index&&w.tagName.toLowerCase()!=="svg";)w=w.parentNode;return w&&w.dataset&&(C.name=w.dataset.name,C.clickedName=g.dataset.name,C.parentClasses=w.classList),g&&g.classList&&(C.clickedClasses=g.classList),C.selectableElement=n.svgEl,{classes:o,analysis:C}}return Rh=t,Rh}var Bh,Rm;function RP(){if(Rm)return Bh;Rm=1;var e=Qi(),t=Ey();function n(B,ie){if(B.rangeHighlight=O,B.dragging)for(var he=0;he<B.selectables.length;he++){var ae=B.selectables[he];ae.svgEl.getAttribute("selectable")==="true"&&(ae.svgEl.setAttribute("tabindex",0),ae.svgEl.setAttribute("data-index",he),ae.svgEl.addEventListener("keydown",l.bind(B)),ae.svgEl.addEventListener("keyup",h.bind(B)),ae.svgEl.addEventListener("focus",o.bind(B)))}for(var fe=0;fe<ie.length;fe++)ie[fe].addEventListener("touchstart",g.bind(B),{passive:!0}),ie[fe].addEventListener("touchmove",w.bind(B),{passive:!0}),ie[fe].addEventListener("touchend",p.bind(B),{passive:!0}),ie[fe].addEventListener("mousedown",g.bind(B)),ie[fe].addEventListener("mousemove",w.bind(B)),ie[fe].addEventListener("mouseup",p.bind(B))}function a(B){var ie=1,he=1,ae=B.target.closest("svg"),fe=0;ae&&ae.viewBox&&ae.viewBox.baseVal&&(ae.viewBox.baseVal.width!==0&&(ie=ae.viewBox.baseVal.width/ae.clientWidth),ae.viewBox.baseVal.height!==0&&(he=ae.viewBox.baseVal.height/ae.clientHeight),fe=ae.viewBox.baseVal.y);var le=B.target&&B.target.tagName==="svg",Y,$;return le?(Y=B.offsetX,$=B.offsetY):(Y=B.layerX,$=B.layerY),Y=Y*ie,$=$*he,[Y,$+fe]}function o(B){this.dragMechanism==="keyboard"&&this.dragYStep!==0&&this.dragTarget&&N.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,B),this.dragYStep=0}function l(B){switch(B.keyCode){case 38:case 40:B.preventDefault()}}function h(B){var ie=!1,he=B.target.dataset.index;switch(B.keyCode){case 13:case 32:ie=!0,this.dragTarget=this.selectables[he],this.dragIndex=he,this.dragMechanism="keyboard",p.bind(this)(B);break;case 38:ie=!0,this.dragTarget=this.selectables[he],this.dragIndex=he,this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep--,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*e.STEP+")"));break;case 40:ie=!0,this.dragTarget=this.selectables[he],this.dragIndex=he,this.dragMechanism="keyboard",this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep++,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*e.STEP+")"));break;case 9:this.dragYStep!==0&&p.bind(this)(B);break}ie&&B.preventDefault()}function f(B,ie){if(!ie)return-1;for(var he=0;he<B.length;he++)if(ie.dataset.index===B[he].svgEl.dataset.index)return he;return-1}function b(B,ie,he){for(var ae=9999999,fe=-1,le=0;le<B.selectables.length&&ae>0;le++){var Y=B.selectables[le];if(B.getDim(Y),Y.dim.left<ie&&Y.dim.right>ie&&Y.dim.top<he&&Y.dim.bottom>he)fe=le,ae=0;else if(Y.dim.top<he&&Y.dim.bottom>he){var $=Math.min(Math.abs(Y.dim.left-ie),Math.abs(Y.dim.right-ie));$<ae&&(ae=$,fe=le)}else if(Y.dim.left<ie&&Y.dim.right>ie){var ne=Math.min(Math.abs(Y.dim.top-he),Math.abs(Y.dim.bottom-he));ne<ae&&(ae=ne,fe=le)}else{var we=Math.abs(ie-Y.dim.left)>Math.abs(ie-Y.dim.right)?Math.abs(ie-Y.dim.right):Math.abs(ie-Y.dim.left),ye=Math.abs(he-Y.dim.top)>Math.abs(he-Y.dim.bottom)?Math.abs(he-Y.dim.bottom):Math.abs(he-Y.dim.top),F=Math.sqrt(we*we+ye*ye);F<ae&&(ae=F,fe=le)}}return fe>=0&&ae<=12?fe:-1}function S(B,ie,he){if(B.x<=ie.offsetX&&B.x+B.width>=ie.offsetX&&B.y<=ie.offsetY&&B.y+B.height>=ie.offsetY)return[ie.offsetX,ie.offsetY];var ae=Math.abs(ie.layerY/he-ie.offsetY);return ae<3?[ie.offsetX,ie.offsetY]:[ie.layerX,ie.layerY]}function M(B){if(!B)return null;if(B.tagName==="svg")return B;if(!B.getAttribute)return null;for(var ie=B.getAttribute("selectable");!ie;)B.parentElement?(B=B.parentElement,B.tagName==="svg"?ie=!0:ie=B.getAttribute("selectable")):ie=!0;return B}function C(B,ie){var he,ae,fe,le=f(B.selectables,M(ie.target));return le>=0?(fe=S(B.selectables[le].svgEl.getBBox(),ie,B.scale),he=fe[0],ae=fe[1]):(fe=a(ie),he=fe[0],ae=fe[1],le=b(B,he,ae)),{x:he,y:ae,clickedOn:le}}function y(B){if(!(!B||!B.target||!B.touches||B.touches.length<1)){var ie=B.target.getBoundingClientRect(),he=B.touches[0].pageX-ie.left,ae=B.touches[0].pageY-ie.top;B.touches[0].offsetX=he,B.touches[0].offsetY=ae,B.touches[0].layerX=B.touches[0].pageX,B.touches[0].layerY=B.touches[0].pageY}}function g(B){var ie=B;B.type==="touchstart"&&(y(B),B.touches.length>0&&(ie=B.touches[0]));var he=C(this,ie);he.clickedOn>=0&&(B.type==="touchstart"||B.button===0)&&this.selectables[he.clickedOn]&&(this.dragTarget=this.selectables[he.clickedOn],this.dragIndex=he.clickedOn,this.dragMechanism="mouse",this.dragMouseStart={x:he.x,y:he.y},this.dragging&&this.dragTarget.isDraggable&&(D(this.renderer.paper,"abcjs-dragging-in-progress"),this.dragTarget.absEl.highlight(void 0,this.dragColor)))}function w(B){var ie=B;if(B.type==="touchmove"&&(y(B),B.touches.length>0&&(ie=B.touches[0])),this.lastTouchMove=B,!(!this.dragTarget||!this.dragging||!this.dragTarget.isDraggable||this.dragMechanism!=="mouse"||!this.dragMouseStart)){var he=C(this,ie),ae=Math.round((he.y-this.dragMouseStart.y)/e.STEP);ae!==this.dragYStep&&(this.dragYStep=ae,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+ae*e.STEP+")"))}}function p(B){var ie=B;B.type==="touchend"&&this.lastTouchMove&&(y(this.lastTouchMove),this.lastTouchMove&&this.lastTouchMove.touches&&this.lastTouchMove.touches.length>0&&(ie=this.lastTouchMove.touches[0])),this.dragTarget&&(I.bind(this)(),this.dragTarget.absEl&&this.dragTarget.absEl.highlight&&(this.selected=[this.dragTarget.absEl],this.dragTarget.absEl.highlight(void 0,this.selectionColor)),N.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,ie),this.dragTarget.svgEl&&this.dragTarget.svgEl.focus&&(this.dragTarget.svgEl.focus(),this.dragTarget=null,this.dragIndex=-1),me(this.renderer.svg,"abcjs-dragging-in-progress"))}function E(B){B>=0&&B<this.selectables.length&&(this.dragTarget=this.selectables[B],this.dragIndex=B,this.dragMechanism="keyboard",p.bind(this)({target:this.dragTarget.svgEl}))}function N(B,ie,he,ae,fe){for(var le=t(B,fe),Y=le.classes,$=le.analysis,ne=0;ne<this.listeners.length;ne++)this.listeners[ne](B.absEl.abcelem,B.absEl.tuneNumber,Y.join(" "),$,{step:ie,max:he,index:ae,setSelection:E.bind(this)},fe)}function I(){for(var B=0;B<this.selected.length;B++)this.selected[B].unhighlight(void 0,this.renderer.foregroundColor);this.selected=[]}function O(B,ie){I.bind(this)();for(var he=0;he<this.staffgroups.length;he++)for(var ae=this.staffgroups[he].voices,fe=0;fe<ae.length;fe++)for(var le=ae[fe].children,Y=0;Y<le.length;Y++){var $=le[Y].abcelem.startChar,ne=le[Y].abcelem.endChar;(ie>$&&B<ne||ie===B&&ie===ne)&&(this.selected[this.selected.length]=le[Y],le[Y].highlight(void 0,this.selectionColor))}}function V(B){var ie=B.getAttribute("class");ie||(ie="");for(var he=ie.split(" "),ae={},fe=0;fe<he.length;fe++)ae[he[fe]]=!0;return ae}function U(B,ie){var he=[];for(var ae in ie)ie.hasOwnProperty(ae)&&he.push(ae);B.setAttribute("class",he.join(" "))}function D(B,ie){if(B){var he=V(B.svg);he[ie]=!0,U(B.svg,he)}}function me(B,ie){if(B){var he=V(B.svg);delete he[ie],U(B.svg,he)}}return Bh=n,Bh}var qh,Bm;function F1(){if(Bm)return qh;Bm=1;function e(t,n,a,o,l){return n+(o-n)/(a-t)*(l-t)}return qh=e,qh}var Fh,qm;function BP(){if(qm)return Fh;qm=1;var e=ts(),t=Qi(),n=F1(),a=function(y){if(!(y.elems.length===0||y.allrests)){var g=f(y.stemsUp,y.isgrace),w=y.elems[0],p=y.elems[y.elems.length-1],E=0,N=y.stemsUp?w.abcelem.maxpitch:w.abcelem.minpitch;E=l(w,y.stemsUp,N,E),E=l(p,y.stemsUp,N,E),E=Math.max(y.stemHeight,E+3);var I=S(y.average,y.elems.length,E,y.stemsUp,w.abcelem.averagepitch,p.abcelem.averagepitch,y.isflat,y.min,y.max,y.isgrace),O=b(y.stemsUp,w,p);y.addBeam({startX:O[0],endX:O[1],startY:I[0],endY:I[1],dy:g});for(var V=C(y.elems,y.stemsUp,y.beams[0],y.isgrace,g),U=0;U<V.length;U++)y.addBeam(V[U]);M(y.elems,y.stemsUp,y.beams[0],g,y.mainNote)}},o=function(y){return y===void 0?0:Math.floor(Math.log(y)/Math.log(2))};function l(y,g,w,p){if(!y.children)return p;for(var E=0;E<y.children.length;E++){var N=y.children[E];g&&N.top!==void 0&&N.c==="flags.ugrace"?p=Math.max(p,N.top-w):!g&&N.bottom!==void 0&&N.c==="flags.ugrace"&&(p=Math.max(p,w-N.bottom+7))}return p}function h(y,g,w,p){if(p)return 0;var E=y-g,N=w/2;return E>N&&(E=N),E<-N&&(E=-N),E}function f(y,g){var w=y?t.STEP:-t.STEP;return g&&(w=w*.4),w}function b(y,g,w){var p=g.heads[y?0:g.heads.length-1],E=w.heads[y?0:w.heads.length-1],N=p.x;y&&(N+=p.w-.6);var I=E.x;return I+=y?E.w:.6,[N,I]}function S(y,g,w,p,E,N,I,O,V,U){var D=w-2,me=w-2,B=Math.round(p?Math.max(y+D,V+me):Math.min(y-D,O-me)),ie=h(E,N,g,I),he=B+Math.floor(ie/2),ae=B+Math.floor(-ie/2);return U||(p&&B<6||!p&&B>6)&&(he=6,ae=6),[he,ae]}function M(y,g,w,p,E){for(var N=0;N<y.length;N++){var I=y[N];if(!I.abcelem.rest){var O=!I.addExtra,V=O?E:I,U=I.heads[g?0:I.heads.length-1],D=1/5,me=U.pitch+(g?D:-D),B=g?U.w:0;O||(B+=U.dx);var ie=U.x+B,he=n(w.startX,w.startY,w.endX,w.endY,ie),ae=g?-.6:.6;g||(he-=p/2/t.STEP),O&&(B+=I.heads[0].dx),U.c==="noteheads.slash.quarter"&&(g?me+=1:me-=1);var fe=new e(null,B,0,me,{type:"stem",pitch2:he,linewidth:ae});fe.setX(V.x),V.addRight(fe)}}}function C(y,g,w,p,E){for(var N=[],I=[],O=0;O<y.length;O++){var V=y[O];if(!V.abcelem.rest){var U=V.heads[g?0:V.heads.length-1],D=U.x+(g?U.w:0),me=n(w.startX,w.startY,w.endX,w.endY,D),B=g?-1.5:1.5;p&&(B=B*2/3);var ie=V.abcelem.duration;ie===0&&(ie=.25);for(var he=o(ie);he<-3;he++){var ae=-4-he;if(I[ae]?I[ae].single=!1:I[ae]={x:D+(g?-.6:0),y:me+B*(ae+1),durlog:he,single:!0},O>0&&V.abcelem.beambr&&V.abcelem.beambr<=ae+1){I[ae].split||(I[ae].split=[I[ae].x]);var fe=b(g,y[O-1],V);I[ae].split[I[ae].split.length-1]>=fe[0]&&(fe[0]+=V.w),I[ae].split.push(fe[0]),I[ae].split.push(fe[1])}}for(var le=I.length-1;le>=0;le--)if(O===y.length-1||o(y[O+1].abcelem.duration)>-le-4){var Y=D,$=me+B*(le+1);I[le].single&&(Y=O===0?D+5:D-5,$=n(w.startX,w.startY,w.endX,w.endY,Y)+B*(le+1));var ne={startX:I[le].x,endX:Y,startY:I[le].y,endY:$,dy:E};if(I[le].split!==void 0){var we=I[le].split;ne.endX<=we[we.length-1]&&(we[we.length-1]-=V.w),we.push(ne.endX),ne.split=I[le].split}N.push(ne),I=I.slice(0,le)}}}return N}return Fh=a,Fh}var zh,Fm;function qP(){if(Fm)return zh;Fm=1;var e=F1();function t(l){if(l.anchor1&&l.anchor2){l.hasBeam=!!l.anchor1.parent.beam&&l.anchor1.parent.beam===l.anchor2.parent.beam;var h=l.anchor1.parent.beam;if(l.hasBeam&&(h.elems[0]!==l.anchor1.parent||h.elems[h.elems.length-1]!==l.anchor2.parent)&&(l.hasBeam=!1),l.hasBeam){var f=n(h)?l.anchor1.x+l.anchor1.w:l.anchor1.x;l.yTextPos=a(f,l.anchor2.x,h),l.yTextPos+=n(h)?3:-2,l.xTextPos=o(f,l.anchor2.x),l.top=l.yTextPos+1,l.bottom=l.yTextPos-2,n(h)&&(l.endingHeightAbove=4)}else{l.startNote=Math.max(l.anchor1.parent.top,9)+4,l.endNote=Math.max(l.anchor2.parent.top,9)+4,l.anchor1.parent.type==="rest"&&l.anchor2.parent.type!=="rest"?l.startNote=l.endNote:l.anchor2.parent.type==="rest"&&l.anchor1.parent.type!=="rest"&&(l.endNote=l.startNote);for(var b=0,S=0;S<l.middleElems.length;S++)b=Math.max(b,l.middleElems[S].top);b+=4,(b>l.startNote||b>l.endNote)&&(l.startNote=b,l.endNote=b),l.flatBeams&&(l.startNote=Math.max(l.startNote,l.endNote),l.endNote=Math.max(l.startNote,l.endNote)),l.yTextPos=l.startNote+(l.endNote-l.startNote)/2,l.xTextPos=l.anchor1.x+(l.anchor2.x+l.anchor2.w-l.anchor1.x)/2,l.top=l.yTextPos+1}}delete l.middleElems,delete l.flatBeams}function n(l){return l.stemsUp}function a(l,h,f){if(f.beams.length===0)return 0;f=f.beams[0];var b=l+(h-l)/2;return e(f.startX,f.startY,f.endX,f.endY,b)}function o(l,h){return l+(h-l)/2}return zh=t,zh}var Hh,zm;function FP(){if(zm)return Hh;zm=1;var e=BP(),t=F1(),n=qP(),a=function(M){for(var C=0;C<M.beams.length;C++)if(M.beams[C].type==="BeamElem"){e(M.beams[C]),o(M.beams[C]);for(var y=0;y<M.beams[C].elems.length;y++)M.adjustRange(M.beams[C].elems[y])}for(M.staff.specialY.chordLines=h(M.children),C=0;C<M.otherchildren.length;C++){var g=M.otherchildren[C];g.type==="TripletElem"&&(n(g),M.adjustRange(g))}M.staff.top=Math.max(M.staff.top,M.top),M.staff.bottom=Math.min(M.staff.bottom,M.bottom)};function o(M){for(var C=1.5,y=0;y<M.elems.length;y++){var g=M.elems[y];if(g.top)for(var w=S(g,M),p=0;p<g.children.length;p++){var E=g.children[p];if(E.klass==="ornament"&&E.position!=="below"&&E.bottom-C<w){var N=w-E.bottom+C;E.bottom+=N,E.top+=N,E.pitch+=N,w=g.top=E.top}}}}function l(M,C){var y=C.getChordDim();if(y){for(var g=0;g<M.length;g++){var w=M[g]<y.left;if(w){g>0&&C.putChordInLane(g),M[g]=y.right;return}}M.push(y.right),C.putChordInLane(M.length-1)}}function h(M){var C=[0],y=[0],g,w,p;for(g=0;g<M.length;g++){for(w=0;w<M[g].children.length;w++)p=M[g].children[w],p.chordHeightAbove&&l(C,p);for(w=M[g].children.length-1;w>=0;w--)p=M[g].children[w],p.chordHeightBelow&&l(y,p)}return(C.length>1||y.length>1)&&b(M,C.length,y.length),{above:C.length,below:y.length}}function f(M){for(var C=0,y=0;y<M.children.length;y++){var g=M.children[y];g.chordHeightBelow&&C++}return C}function b(M,C,y){for(var g=0;g<M.length;g++){f(M[g]);for(var w=0;w<M[g].children.length;w++){var p=M[g].children[w];p.chordHeightAbove&&p.invertLane(C)}}}function S(M,C){return C=C.beams[0],t(C.startX,C.startY,C.endX,C.endY,M.x)}return Hh=a,Hh}var Vh,Hm;function zP(){if(Hm)return Vh;Hm=1;var e=Qi(),t=function(C,y){for(var g,w=0;w<y.staffs.length;w++){var p=y.staffs[w],E={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0};if(C.showDebug&&C.showDebug.indexOf("box")>=0&&(p.originalTop=p.top,p.originalBottom=p.bottom),a(p,E,"lyricHeightAbove"),a(p,E,"chordHeightAbove",p.specialY.chordLines.above),p.specialY.endingHeightAbove&&(p.specialY.chordHeightAbove?p.top+=2:p.top+=p.specialY.endingHeightAbove+n,E.endingHeightAbove=p.top),p.specialY.dynamicHeightAbove&&p.specialY.volumeHeightAbove?(p.top+=Math.max(p.specialY.dynamicHeightAbove,p.specialY.volumeHeightAbove)+n,E.dynamicHeightAbove=p.top,E.volumeHeightAbove=p.top):(a(p,E,"dynamicHeightAbove"),a(p,E,"volumeHeightAbove")),a(p,E,"partHeightAbove"),a(p,E,"tempoHeightAbove"),p.specialY.lyricHeightBelow&&(p.specialY.lyricHeightBelow+=C.spacing.vocal/e.STEP,E.lyricHeightBelow=p.bottom,p.bottom-=p.specialY.lyricHeightBelow+n),p.specialY.chordHeightBelow){E.chordHeightBelow=p.bottom;var N=p.specialY.chordHeightBelow;p.specialY.chordLines.below&&(N*=p.specialY.chordLines.below),p.bottom-=N+n}p.specialY.volumeHeightBelow&&p.specialY.dynamicHeightBelow?(E.volumeHeightBelow=p.bottom,E.dynamicHeightBelow=p.bottom,p.bottom-=Math.max(p.specialY.volumeHeightBelow,p.specialY.dynamicHeightBelow)+n):p.specialY.volumeHeightBelow?(E.volumeHeightBelow=p.bottom,p.bottom-=p.specialY.volumeHeightBelow+n):p.specialY.dynamicHeightBelow&&(E.dynamicHeightBelow=p.bottom,p.bottom-=p.specialY.dynamicHeightBelow+n),C.showDebug&&C.showDebug.indexOf("box")>=0&&(p.positionY=E);for(var I=0;I<p.voices.length;I++){var O=y.voices[p.voices[I]];o(E,O,C.spacing)}if(g!==void 0){var V=p.top-10,U=g+V,D=C.spacing.systemStaffSeparation/e.STEP,me=D-U;me>0&&(p.top+=me)}p.top+=C.spacing.staffTopMargin/e.STEP,g=2-p.bottom}},n=1;function a(C,y,g,w){if(C.specialY[g]){var p=C.specialY[g];w&&(p*=w),C.top+=p+n,y[g]=C.top}}function o(C,y,g){var w,p;for(w=0;w<y.children.length;w++)p=y.children[w],l(C,p,g);for(w=0;w<y.otherchildren.length;w++)switch(p=y.otherchildren[w],p.type){case"CrescendoElem":h(C,p);break;case"DynamicDecoration":f(C,p);break;case"EndingElem":b(C,p);break;case"TieElem":var E=p.getYBounds();y.staff.top=Math.max(y.staff.top,E[0]),y.staff.top=Math.max(y.staff.top,E[1]),y.staff.bottom=Math.min(y.staff.bottom,E[0]),y.staff.bottom=Math.min(y.staff.bottom,E[1]);break}}function l(C,y,g){for(var w=0;w<y.children.length;w++){var p=y.children[w];for(var E in y.specialY)y.specialY.hasOwnProperty(E)&&p[E]&&(p.pitch=C[E],p.top===void 0&&(p.type==="TempoElement"?S(C,p):M(C,p,g),y.pushTop(p.top),y.pushBottom(p.bottom)))}}function h(C,y){y.dynamicHeightAbove?y.pitch=C.dynamicHeightAbove:y.pitch=C.dynamicHeightBelow}function f(C,y){y.volumeHeightAbove?y.pitch=C.volumeHeightAbove:y.pitch=C.volumeHeightBelow}function b(C,y){y.pitch=C.endingHeightAbove-2}function S(C,y){if(y.pitch=C.tempoHeightAbove,y.top=C.tempoHeightAbove,y.bottom=C.tempoHeightAbove,y.note){var g=y.pitch-y.totalHeightInPitches+1;y.note.top=g,y.note.bottom=g;for(var w=0;w<y.note.children.length;w++){var p=y.note.children[w];p.top+=g,p.bottom+=g,p.pitch+=g,p.pitch2!==void 0&&(p.pitch2+=g)}}}function M(C,y,g){switch(y.type){case"part":y.top=C.partHeightAbove+y.height,y.bottom=C.partHeightAbove;break;case"text":case"chord":y.chordHeightAbove?(y.top=C.chordHeightAbove,y.bottom=C.chordHeightAbove):(y.top=C.chordHeightBelow,y.bottom=C.chordHeightBelow);break;case"lyric":y.lyricHeightAbove?(y.top=C.lyricHeightAbove,y.bottom=C.lyricHeightAbove):(y.top=C.lyricHeightBelow+g.vocal/e.STEP,y.bottom=C.lyricHeightBelow+g.vocal/e.STEP,y.pitch-=g.vocal/e.STEP);break;case"debug":y.top=C.chordHeightAbove,y.bottom=C.chordHeightAbove;break}(y.pitch===void 0||y.top===void 0)&&console.error("RelativeElement position not set.",y.type,y.pitch,y.top,C)}return Vh=t,Vh}var Uh,Vm;function HP(){if(Vm)return Uh;Vm=1;var e=function(){};e.beginLayout=function(a,o){o.i=0,o.durationindex=0,o.startx=a,o.minx=a,o.nextx=a,o.spacingduration=0},e.layoutEnded=function(a){return a.i>=a.children.length},e.getNextX=function(a){return Math.max(a.minx,a.nextx)},e.getSpacingUnits=function(a){return Math.sqrt(a.spacingduration*8)},e.layoutOneItem=function(a,o,l,h,f){var b=l.children[l.i];if(!b)return 0;var S=a-l.minx,M=l.durationindex+b.duration>0?h:0;if(b.abcelem.el_type==="note"&&!b.abcelem.rest&&l.voicenumber!==0&&f){var C=f.children[f.i],y=C&&(b.abcelem.maxpitch<=C.abcelem.maxpitch+1&&b.abcelem.maxpitch>=C.abcelem.minpitch-1||b.abcelem.minpitch<=C.abcelem.maxpitch+1&&b.abcelem.minpitch>=C.abcelem.minpitch-1);if(y&&b.abcelem.minpitch===C.abcelem.minpitch&&b.abcelem.maxpitch===C.abcelem.maxpitch&&C.heads&&C.heads.length>0&&b.heads&&b.heads.length>0&&C.heads[0].c===b.heads[0].c&&(y=!1),y){var g=C.heads&&C.heads.length>0?C.heads[0].realWidth:C.fixed.w;b.adjustedWidth||(b.adjustedWidth=g+b.w),b.w=b.adjustedWidth;for(var w=0;w<b.children.length;w++){var p=b.children[w];p.name.indexOf("accidental")<0&&(p.adjustedWidth||(p.adjustedWidth=p.dx+g),p.dx=p.adjustedWidth)}}}var E=t(b,M);return S<E&&(l.i===0||b.type!=="bar"||l.children[l.i-1].type!=="part"&&l.children[l.i-1].type!=="tempo")&&(a+=E-S),b.setX(a),l.spacingduration=b.duration,l.minx=a+n(b),l.i!==l.children.length-1&&(l.minx+=b.minspacing),this.updateNextX(a,o,l),a},e.shiftRight=function(a,o){var l=o.children[o.i];l&&(l.setX(l.x+a),o.minx+=a,o.nextx+=a)},e.updateNextX=function(a,o,l){l.nextx=a+o*this.getSpacingUnits(l)},e.updateIndices=function(a){this.layoutEnded(a)||(a.durationindex+=a.children[a.i].duration,a.children[a.i].type==="bar"&&(a.durationindex=Math.round(a.durationindex*64)/64),a.i++)};function t(a,o){var l=0;return(a.type==="note"||a.type==="bar")&&(l=o),-a.extraw+l}function n(a){return a.w}return Uh=e,Uh}var Gh,Um;function VP(){if(Um)return Gh;Um=1;var e=HP();function t(h){for(var f=0,b=0;b<h.length;b++){var S=h[b];if(S.children.length>0){var M=S.children.length-1,C=S.children[M];if(C.abcelem.el_type==="bar"){var y=C.children[0].x;y>f?f=y:C.children[0].x=f}}}}var n=function(h,f,b,S,M){var C=1e-7,y=0,g=1e3,w=M;S.startx=w;var p,E=0;for(b&&console.log("init layout",h),p=0;p<S.voices.length;p++)e.beginLayout(w,S.voices[p]);for(var N=0;!a(S.voices);){for(E=null,p=0;p<S.voices.length;p++)!e.layoutEnded(S.voices[p])&&(!E||o(S.voices[p])<E)&&(E=o(S.voices[p]));var I=[],O=[];for(p=0;p<S.voices.length;p++){var V=o(S.voices[p]);V-E>C?O.push(S.voices[p]):I.push(S.voices[p])}N=0;var U=0;for(p=0;p<I.length;p++)e.getNextX(I[p])>w&&(w=e.getNextX(I[p]),N=e.getSpacingUnits(I[p]),U=I[p].spacingduration);y+=N,g=Math.min(g,N),b&&console.log("currentduration: ",E,y,g);var D=void 0;for(p=0;p<I.length;p++){var me=I[p];me.voicenumber===0&&(D=p);var B=D!==void 0&&I[D].voicenumber!==me.voicenumber?I[D]:void 0;l(me,B)||(B=void 0);var ie=e.layoutOneItem(w,h,me,f,B),he=ie-w;if(he>0){w=ie;for(var ae=0;ae<p;ae++)e.shiftRight(he,I[ae])}}for(p=0;p<O.length;p++)O[p].spacingduration-=U,e.updateNextX(w,h,O[p]);for(p=0;p<I.length;p++){var fe=I[p];e.updateIndices(fe)}}for(p=0;p<S.voices.length;p++)e.getNextX(S.voices[p])>w&&(w=e.getNextX(S.voices[p]),N=e.getSpacingUnits(S.voices[p]));return t(S.voices),y+=N,S.setWidth(w),{spacingUnits:y,minSpace:g}};function a(h){for(var f=0;f<h.length;f++)if(!e.layoutEnded(h[f]))return!1;return!0}function o(h){return h.durationindex-(h.children[h.i]&&h.children[h.i].duration>0?0:5e-7)}function l(h,f){return!h||!h.staff||!h.staff.voices||h.staff.voices.length===0||!f||!f.staff||!f.staff.voices||f.staff.voices.length===0?!1:h.staff.voices[0]===f.staff.voices[0]}return Gh=n,Gh}var Yh,Gm;function Ay(){if(Gm)return Yh;Gm=1;function e(o,l,h,f,b){var S=o.padding.left,M=0,C,y;for(C=0;C<h.length;C++)h[C].header&&(y=l.calc(h[C].header,"voicefont",""),M=Math.max(M,y.width));if(M=t(M,f,l),M=t(M,b,l),M){var g=l.calc("A","voicefont","");M+=g.width}S+=M;var w=0;return w=n(f,S,w),w=n(b,S,w),S+w}function t(o,l,h){if(l){for(var f=0;f<l.length;f++)if(l[f].header){var b=h.calc(l[f].header,"voicefont","");o=Math.max(o,b.width)}}return o}function n(o,l,h){if(o)for(var f=0;f<o.length;f++)a(l,o[f]),h=Math.max(h,o[f].getWidth());return h}function a(o,l){l.x=o}return Yh=e,Yh}var Wh,Ym;function UP(){if(Ym)return Wh;Ym=1;var e=Ay();function t(a,o,l){var h=e(a,o.getTextSize,o.voices,o.brace,o.bracket),f=n(o,l.minPadding),b=f.totalDuration,S=f.minSpacing,M=S*b;l.minWidth&&(M=Math.max(M,l.minWidth));var C=l.minPadding?l.minPadding/2:2;o.startx=h,o.w=M+h;for(var y=0;y<o.voices.length;y++){var g=o.voices[y];g.startx=h,g.w=M+h;for(var w=h,p=!1,E=0,N=0;N<g.children.length;N++){var I=g.children[N];p||(I.duration!==0?(p=!0,E=(M+h-w)/b,o.gridStart=w):(I.x=w,w+=I.w+I.minspacing)),p&&(l.align==="center"?I.x=w+I.duration*E/2-I.w/2:I.duration===0?I.x=w+1-I.w:I.x=w+C-I.extraw,w+=I.duration*E);for(var O=0;O<I.children.length;O++){var V=I.children[O],U=V.dx?V.dx:0;V.x=I.x+U}}o.gridEnd=w}return M}function n(a,o){for(var l=0,h=0,f=0;f<a.voices.length;f++){for(var b=0,S=a.voices[f],M=0;M<S.children.length;M++){var C=S.children[M];if(b+=C.duration,C.duration){var y=(C.w+o)/C.duration;l=Math.max(l,y)}}h=Math.max(h,b)}return{totalDuration:h,minSpacing:l}}return Wh=t,Wh}var $h,Wm;function GP(){if(Wm)return $h;Wm=1;var e=FP(),t=zP(),n=VP(),a=Ay(),o=UP(),l=function(S,M,C,y,g,w){var p,E,N=C;for(p=0;p<M.lines.length;p++)if(E=M.lines[p],E.staff){var I;w!==void 0?I=o(S,E.staffGroup,w):I=h(S,N,y,E.staffGroup,M.formatting,p===M.lines.length-1,!1),Math.round(I)>Math.round(N)&&(N=I,g&&(p=-1))}for(p=0;p<M.lines.length;p++)if(E=M.lines[p],E.staffGroup&&E.staffGroup.voices){for(var O=0;O<E.staffGroup.voices.length;O++)e(E.staffGroup.voices[O]);t(S,E.staffGroup)}for(p=0;p<M.lines.length;p++)E=M.lines[p],E.staffGroup&&E.staffGroup.setHeight();return N},h=function(S,M,C,y,g,w,p){for(var E=a(S,y.getTextSize,y.voices,y.brace,y.bracket),N=C,I=0;I<8;I++){var O=n(N,S.minPadding,p,y,E);if(N=f(w,g.stretchlast,M+S.padding.left,y.w,N,O.spacingUnits,O.minSpace,S.padding.left+S.padding.right),N===null)break}return b(y.voices),y.w-E};function f(S,M,C,y,g,w,p,E){if(S)if(M===void 0){if(y/C<.66)return null}else{var N=1-(y+E)/C,I=N<M;if(!I)return null}if(Math.abs(C-y)<2)return null;var O=w*g,V=y-O;return w>0?(g=(C-V)/w,g*p>50&&(g=50/p),g):null}function b(S){for(var M=0;M<S.length;M++)for(var C=S[M],y=1;y<C.children.length-1;y++){var g=C.children[y];if(g.abcelem.rest&&(g.abcelem.rest.type==="whole"||g.abcelem.rest.type==="multimeasure")){var w=C.children[y-1],p=C.children[y+1];g.center(w,p)}}}return $h=l,$h}var Kh,$m;function YP(){if($m)return Kh;$m=1;var e=function(n){this.shouldAddClasses=n.shouldAddClasses,this.reset()};return e.prototype.reset=function(){this.lineNumber=null,this.voiceNumber=null,this.measureNumber=null,this.measureTotalPerLine=[],this.noteNumber=null},e.prototype.incrLine=function(){this.lineNumber===null?this.lineNumber=0:this.lineNumber++,this.voiceNumber=null,this.measureNumber=null,this.noteNumber=null},e.prototype.incrVoice=function(){this.voiceNumber===null?this.voiceNumber=0:this.voiceNumber++,this.measureNumber=null,this.noteNumber=null},e.prototype.isInMeasure=function(){return this.measureNumber!==null},e.prototype.newMeasure=function(){this.measureNumber&&(this.measureTotalPerLine[this.lineNumber]=this.measureNumber),this.measureNumber=null,this.noteNumber=null},e.prototype.startMeasure=function(){this.measureNumber=0,this.noteNumber=0},e.prototype.incrMeasure=function(){this.measureNumber++,this.noteNumber=0},e.prototype.incrNote=function(){this.noteNumber++},e.prototype.measureTotal=function(){for(var t=0,n=0;n<this.lineNumber;n++)t+=this.measureTotalPerLine[n]?this.measureTotalPerLine[n]:0;return this.measureNumber&&(t+=this.measureNumber),t},e.prototype.getCurrent=function(t){return{line:this.lineNumber,measure:this.measureNumber,measureTotal:this.measureTotal(),voice:this.voiceNumber,note:this.noteNumber}},e.prototype.generate=function(t){if(!this.shouldAddClasses)return"";var n=[];if(t&&t.length>0&&n.push(t),t==="abcjs-tab-number")return n.join(" ");if(t==="text instrument-name")return"abcjs-text abcjs-instrument-name";if(this.lineNumber!==null&&n.push("l"+this.lineNumber),this.measureNumber!==null&&n.push("m"+this.measureNumber),this.measureNumber!==null&&n.push("mm"+this.measureTotal()),this.voiceNumber!==null&&n.push("v"+this.voiceNumber),t&&(t.indexOf("note")>=0||t.indexOf("rest")>=0||t.indexOf("lyric")>=0)&&this.noteNumber!==null&&n.push("n"+this.noteNumber),n.length>0){n=n.join(" "),n=n.split(" ");for(var a=0;a<n.length;a++)n[a].indexOf("abcjs-")!==0&&n[a].length>0&&(n[a]="abcjs-"+n[a])}return n.join(" ")},Kh=e,Kh}var jh,Km;function WP(){if(Km)return jh;Km=1;var e=function(n,a){this.formatting=n,this.classes=a};return e.prototype.updateFonts=function(t){t.gchordfont&&(this.formatting.gchordfont=t.gchordfont),t.tripletfont&&(this.formatting.tripletfont=t.tripletfont),t.annotationfont&&(this.formatting.annotationfont=t.annotationfont),t.vocalfont&&(this.formatting.vocalfont=t.vocalfont)},e.prototype.getFamily=function(t){return t[0]==='"'&&t[t.length-1]==='"'?t.substring(1,t.length-1):t},e.prototype.calc=function(t,n){var a;typeof t=="string"?(a=this.formatting[t],a?a={face:a.face,size:Math.round(a.size*4/3),decoration:a.decoration,style:a.style,weight:a.weight,box:a.box}:a={face:"Arial",size:Math.round(12*4/3),decoration:"underline",style:"normal",weight:"normal"}):a={face:t.face,size:Math.round(t.size*4/3),decoration:t.decoration,style:t.style,weight:t.weight,box:t.box};var o=this.formatting.fontboxpadding?this.formatting.fontboxpadding:.1;a.padding=a.size*o;var l={"font-size":a.size,"font-style":a.style,"font-family":this.getFamily(a.face),"font-weight":a.weight,"text-decoration":a.decoration,class:this.classes.generate(n)};return{font:a,attr:l}},jh=e,jh}var Xh,jm;function $P(){if(jm)return Xh;jm=1;var e=function(n,a){this.getFontAndAttr=n,this.svg=a};return e.prototype.updateFonts=function(t){this.getFontAndAttr.updateFonts(t)},e.prototype.attr=function(t,n){return this.getFontAndAttr.calc(t,n)},e.prototype.getFamily=function(t){return t[0]==='"'&&t[t.length-1]==='"'?t.substring(1,t.length-1):t},e.prototype.calc=function(t,n,a,o){var l;typeof n=="string"?l=this.attr(n,a):l={font:{face:n.face,size:n.size,decoration:n.decoration,style:n.style,weight:n.weight},attr:{"font-size":n.size,"font-style":n.style,"font-family":this.getFamily(n.face),"font-weight":n.weight,"text-decoration":n.decoration,class:this.getFontAndAttr.classes.generate(a)}};var h=this.svg.getTextSize(t,l.attr,o);return l.font.box?{height:h.height+l.font.padding*4,width:h.width+l.font.padding*4}:h},e.prototype.baselineToCenter=function(t,n,a,o,l){var h=this.calc(t,n,a).height,f=this.attr(n,a).font.size;return h*.5+(l-o-2)*f},Xh=e,Xh}var Qh,Xm;function za(){if(Xm)return Qh;Xm=1;var e=function(){for(var t=0,n,a=arguments[t++],o=[],l,h,f,b;a;){if(l=/^[^\x25]+/.exec(a))o.push(l[0]);else if(l=/^\x25{2}/.exec(a))o.push("%");else if(l=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(a)){if((n=arguments[l[1]||t++])==null||n==null)throw"Too few arguments.";if(/[^s]/.test(l[7])&&typeof n!="number")throw"Expecting number but found "+typeof n;switch(l[7]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":n=parseInt(n);break;case"e":n=l[6]?n.toExponential(l[6]):n.toExponential();break;case"f":n=l[6]?parseFloat(n).toFixed(l[6]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&l[6]?n.substring(0,l[6]):n;break;case"u":n=Math.abs(n);break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase();break}n=/[def]/.test(l[7])&&l[2]&&n>0?"+"+n:n,f=l[3]?l[3]=="0"?"0":l[3][1]:" ",b=l[5]-String(n).length,h=l[5]?str_repeat(f,b):"",o.push(l[4]?n+h:h+n)}else throw"Huh ?!";a=a.substring(l[0].length)}return o.join("")};return Qh=e,Qh}var Zh,Qm;function rs(){if(Qm)return Zh;Qm=1;function e(t){return parseFloat(t.toFixed(2))}return Zh=e,Zh}var Jh,Zm;function sa(){if(Zm)return Jh;Zm=1;var e=rs();function t(n,a,o){var l=a.y;if(a.phrases){var S=n.paper.richTextLine(a.phrases,a.x,a.y,a.klass,a.anchor);return S}if(a.lane){var h=a.dim.font.size*.25;l+=(a.dim.font.size+h)*a.lane}var f;a.dim?(f=a.dim,f.attr.class=a.klass):f=n.controller.getFontAndAttr.calc(a.type,a.klass),a.anchor&&(f.attr["text-anchor"]=a.anchor),a["dominant-baseline"]&&(f.attr["dominant-baseline"]=a["dominant-baseline"]),f.attr.x=a.x,f.attr.y=l,a.centerVertically||(f.attr.y+=f.font.size),a.type==="debugfont"&&(console.log("Debug msg: "+a.text),f.attr.stroke="#ff0000"),a.cursor&&(f.attr.cursor=a.cursor);var b=a.text.replace(/\n\n/g,`
170
+
171
+ `);b=b.replace(/^\n/,` 
172
+ `),f.font.box&&(o||n.paper.openGroup({klass:f.attr.class,fill:n.foregroundColor,"data-name":a.name}),f.attr["text-anchor"]==="end"?f.attr.x-=f.font.padding:f.attr["text-anchor"]==="start"&&(f.attr.x+=f.font.padding),f.attr.y+=f.font.padding,delete f.attr.class),a.noClass&&delete f.attr.class,f.attr.x=e(f.attr.x),f.attr.y=e(f.attr.y),a.name&&(f.attr["data-name"]=a.name);var S=n.paper.text(b,f.attr);if(f.font.box){var M=S.getBBox(),C=0;f.attr["text-anchor"]==="middle"?C=M.width/2+f.font.padding:f.attr["text-anchor"]==="end"&&(C=M.width+f.font.padding*2);var y=0;a.centerVertically&&(y=M.height-f.font.padding),n.paper.rect({"data-name":"box",x:Math.round(a.x-C),y:Math.round(l-y),width:Math.round(M.width+f.font.padding*2),height:Math.round(M.height+f.font.padding*2)}),o||(S=n.paper.closeGroup())}return S}return Jh=t,Jh}var ef,Jm;function KP(){if(Jm)return ef;Jm=1;var e=za(),t=Qi(),n=sa();function a(b,S,M){var C=S.startVoice.staff.absoluteY-t.STEP*10;return S.endVoice&&S.endVoice.staff?S.endY=S.endVoice.staff.absoluteY-t.STEP*2:S.lastContinuedVoice&&S.lastContinuedVoice.staff?S.endY=S.lastContinuedVoice.staff.absoluteY-t.STEP*2:S.endY=S.startVoice.staff.absoluteY-t.STEP*2,f(b,S.x,C,S.endY,S.type,S.header,M)}function o(b,S,M,C,y){S+=t.STEP;var g=t.STEP*.75,w=t.STEP*.75,p=C-M,E=e("M %f %f l %f %f l %f %f l %f %f z",S,M-w,0,p+w*2,g,0,0,-(p+w*2)),N=t.STEP*2,I=t.STEP;return E+=e("M %f %f q %f %f %f %f q %f %f %f %f z",S+g,M-w,N*.6,I*.2,N,-I,-N*.1,I*.3,-N,I+t.STEP),E+=e("M %f %f q %f %f %f %f q %f %f %f %f z",S+g,M+w+p,N*.6,-I*.2,N,I,-N*.1,-I*.3,-N,-I-t.STEP),b.paper.path({path:E,stroke:b.foregroundColor,fill:b.foregroundColor,class:b.controller.classes.generate(y),"data-name":y})}function l(b,S,M,C,y){var g=C-M,w=h(S,M,[7.5,-8,21,0,18.5,-10.5,7.5],[0,g/5.5,g/3.14,g/2,g/2.93,g/4.88,0]);return w+=h(S,M,[0,17.5,-7.5,6.6,-5,20,0],[g/2,g/1.46,g/1.22,g,g/1.19,g/1.42,g/2]),b.paper.path({path:w,stroke:b.foregroundColor,fill:b.foregroundColor,class:b.controller.classes.generate(y),"data-name":y})}function h(b,S,M,C){return e("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",b+M[0],S+C[0],b+M[1],S+C[1],b+M[2],S+C[2],b+M[3],S+C[3],b+M[4],S+C[4],b+M[5],S+C[5],b+M[6],S+C[6])}var f=function(b,S,M,C,y,g,w){var p;if(g){b.paper.openGroup({klass:b.controller.classes.generate("staff-extra voice-name"),"data-name":y});var E=M+(C-M)/2;E=E-b.controller.getTextSize.baselineToCenter(g,"voicefont","staff-extra voice-name",0,1),n(b,{x:b.padding.left,y:E,text:g,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0})}return y==="brace"?p=l(b,S,M,C,y):y==="bracket"&&(p=o(b,S,M,C,y)),g&&(p=b.paper.closeGroup()),w.wrapSvgEl({el_type:y,startChar:-1,endChar:-1},p),p};return ef=a,ef}var tf,e_;function S0(){if(e_)return tf;e_=1;function e(t,n,a){var o=t.paper.path(n);return o}return tf=e,tf}var rf,t_;function jP(){if(t_)return rf;t_=1;var e=za(),t=S0(),n=rs();function a(p,E,N){(!E.anchor1||!E.anchor2||!E.anchor1.heads||!E.anchor2.heads||E.anchor1.heads.length===0||E.anchor2.heads.length===0)&&window.console.error("Glissando Element not set.");var I=4,O=p.calcY(E.anchor1.heads[0].pitch),V=p.calcY(E.anchor2.heads[0].pitch),U=E.anchor1.x+E.anchor1.w/2,D=E.anchor2.x+E.anchor2.w/2,me=o(U,O,D,V),B=E.anchor1.w/2+I,ie=E.anchor2.w/2+I,he=l(U,O,D,V),ae=h(O,he,B);h(V,he,-ie);var fe=f(me-B-ie),le=w(p,U+B,ae,fe,he);return N.wrapSvgEl({el_type:"glissando",startChar:-1,endChar:-1},le),[le]}function o(p,E,N,I){var O=N-p,V=I-E;return Math.sqrt(O*O+V*V)}function l(p,E,N,I){return(I-E)/(N-p)}function h(p,E,N){return n(p+N*E)}function f(p){var E=5;return Math.max(2,Math.floor((p-E*2)/6))}var b=[[3.5,-4.8]],S=[[1.5,-1],[.3,-.3],[-3.5,3.8]],M=[[-1.5,2]],C=[[3,4],[3,-4]],y=[[-3,4],[-3,-4]];function g(p,E){for(var N="",I=0;I<p.length;I++)N+="l"+p[I][0]+" "+h(p[I][1],E,p[I][0]);return N}var w=function(p,E,N,I,O){var V=e("M %f %f",E,N);V+=g(b,O);var U;for(U=0;U<I;U++)V+=g(C,O);for(V+=g(S,O),U=0;U<I;U++)V+=g(y,O);return V+=g(M,O)+"z",t(p,{path:V,highlight:"stroke",stroke:p.foregroundColor,class:p.controller.classes.generate("decoration"),"data-name":"glissando"})};return rf=a,rf}var nf,r_;function XP(){if(r_)return nf;r_=1;var e=za(),t=S0(),n=rs();function a(l,h,f){h.pitch===void 0&&window.console.error("Crescendo Element y-coordinate not set.");var b=l.calcY(h.pitch)+4,S=8,M=h.anchor1?h.anchor1.x:0,C=h.anchor2?h.anchor2.x:800,y;return h.dir==="<"?y=o(l,b+S/2,b,b+S/2,b+S,M,C):y=o(l,b,b+S/2,b+S,b+S/2,M,C),f.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1},y),[y]}var o=function(l,h,f,b,S,M,C){h=n(h),f=n(f),b=n(b),S=n(S),M=n(M),C=n(C);var y=e("M %f %f L %f %f M %f %f L %f %f",M,h,C,f,M,b,C,S);return t(l,{path:y,highlight:"stroke",stroke:l.foregroundColor,class:l.controller.classes.generate("dynamics decoration"),"data-name":"dynamics"})};return nf=a,nf}var sf,i_;function z1(){if(i_)return sf;i_=1;var e=rs();function t(){this.ingroup=!1}t.prototype.beginGroup=function(a,o){this.paper=a,this.controller=o,this.path=[],this.lastM=[0,0],this.ingroup=!0,this.paper.openGroup()},t.prototype.isInGroup=function(){return this.ingroup},t.prototype.addPath=function(a){if(a=a||[],a.length!==0){a[0][0]="m",a[0][1]=e(a[0][1]-this.lastM[0]),a[0][2]=e(a[0][2]-this.lastM[1]),this.lastM[0]+=a[0][1],this.lastM[1]+=a[0][2],this.path.push(a[0]);for(var o=1,l=a.length;o<l;o++)a[o][0]==="m"&&(this.lastM[0]+=a[o][1],this.lastM[1]+=a[o][2]),this.path.push(a[o])}},t.prototype.endGroup=function(a,o){this.ingroup=!1;for(var l="",h=0;h<this.path.length;h++)l+=this.path[h].join(" ");this.path=[];var f=this.paper.closeGroup();return f&&(f.setAttribute("class",this.controller.classes.generate(a)),f.setAttribute("fill",this.controller.renderer.foregroundColor),f.setAttribute("stroke","none"),f.setAttribute("data-name",o)),f};var n=new t;return sf=n,sf}var af,n_;function Ty(){if(n_)return af;n_=1;var e=sa(),t=na(),n=z1();function a(l,h,f,b,S){var M,C;if(!b)return null;if(b.length>1&&b.indexOf(".")<0){var y=n.isInGroup()?"":S.klass;l.paper.openGroup({"data-name":S.name,klass:y});for(var g=0,w=0;w<b.length;w++){var p=b[w];C=t.getYCorr(p),M=t.printSymbol(h+g,l.calcY(f+C),p,l.paper,{stroke:S.stroke,fill:S.fill}),M?w<b.length-1&&(g+=o(p,b[w+1],t.getSymbolWidth(p))):e(l,{x:h,y:l.y,text:"no symbol:"+b,type:"debugfont",klass:"debug-msg",anchor:"start"},!1)}var E=l.paper.closeGroup();return E}else return C=t.getYCorr(b),n.isInGroup()?M=t.printSymbol(h,l.calcY(f+C),b,l.paper,{"data-name":S.name}):M=t.printSymbol(h,l.calcY(f+C),b,l.paper,{klass:S.klass,stroke:S.stroke,fill:S.fill,"data-name":S.name}),M||(e(l,{x:h,y:l.y,text:"no symbol:"+b,type:"debugfont",klass:"debug-msg",anchor:"start"},!1),null)}function o(l,h,f){var b=f;return l==="f"&&h==="f"&&(b=b*2/3),l==="p"&&h==="p"&&(b=b*5/6),l==="f"&&h==="z"&&(b=b*5/8),b}return af=a,af}var of,s_;function QP(){if(s_)return of;s_=1;var e=Ty();function t(n,a,o){a.pitch===void 0&&window.console.error("Dynamic Element y-coordinate not set.");var l=1,h=1,f=e(n,a.anchor.x,a.pitch,a.dec,{scalex:l,scaley:h,klass:n.controller.classes.generate("decoration dynamics"),fill:n.foregroundColor,stroke:"none",name:"dynamics"});return o.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1,decoration:a.dec},f),[f]}return of=t,of}var lf,a_;function ZP(){if(a_)return lf;a_=1;var e=za(),t=sa(),n=S0(),a=rs();function o(f,b,S){f.paper.openGroup({klass:f.controller.classes.generate("triplet "+b.durationClass),"data-name":"triplet"}),b.hasBeam||h(f,b.anchor1.x,b.startNote,b.anchor2.x+b.anchor2.w,b.endNote),t(f,{x:b.xTextPos,y:f.calcY(b.yTextPos-1),text:""+b.number,type:"tripletfont",anchor:"middle",centerVertically:!0,noClass:!0,name:""+b.number},!0);var M=f.paper.closeGroup();return S.wrapSvgEl({el_type:"triplet",startChar:-1,endChar:-1},M),M}function l(f,b,S,M){return e("M %f %f L %f %f",a(f),a(b),a(S),a(M))}function h(f,b,S,M,C){S=f.calcY(S),C=f.calcY(C);var y=5,g="";g+=l(b,S,b,S+y),g+=l(M,C,M,C+y);var w=b+(M-b)/2,p=8,E=(C-S)/(M-b),N=w-p,I=S+(N-b)*E;g+=l(b,S,N,I);var O=w+p,V=S+(O-b)*E;g+=l(O,V,M,C),n(f,{path:g,stroke:f.foregroundColor,"data-name":"triplet-bracket"})}return lf=o,lf}var cf,o_;function JP(){if(o_)return cf;o_=1;var e=za(),t=sa(),n=S0(),a=rs();function o(l,h,f,b,S){h.pitch===void 0&&window.console.error("Ending Element y-coordinate not set.");var M=a(l.calcY(h.pitch)),C=20,y="";h.anchor1&&(f=a(h.anchor1.x+h.anchor1.w),y+=e("M %f %f L %f %f ",f,M,f,a(M+C))),h.anchor2&&(b=a(h.anchor2.x),y+=e("M %f %f L %f %f ",b,M,b,a(M+C))),y+=e("M %f %f L %f %f ",f,M,b,M),l.paper.openGroup({klass:l.controller.classes.generate("ending"),"data-name":"ending"}),n(l,{path:y,stroke:l.foregroundColor,fill:l.foregroundColor,"data-name":"line"}),h.anchor1&&t(l,{x:a(f+5),y:a(l.calcY(h.pitch-.5)),text:h.text,type:"repeatfont",klass:"ending",anchor:"start",noClass:!0,name:h.text});var g=l.paper.closeGroup();return S.wrapSvgEl({el_type:"ending",startChar:-1,endChar:-1},g),[g]}return cf=o,cf}var uf,l_;function eI(){if(l_)return uf;l_=1;var e=za(),t=rs();function n(l,h,f,b,S){a(h,f,b);var M="";h.anchor1?M+="abcjs-start-m"+h.anchor1.parent.counters.measure+"-n"+h.anchor1.parent.counters.note:M+="abcjs-start-edge",h.anchor2?M+=" abcjs-end-m"+h.anchor2.parent.counters.measure+"-n"+h.anchor2.parent.counters.note:M+=" abcjs-end-edge",h.hint&&(M="abcjs-hint");var C=h.fixedY?1.5:0,y=o(l,h.startX,h.endX,h.startY+C,h.endY+C,h.above,M,h.isTie,h.dotted),g=-1;h.anchor1&&!h.isTie&&(g=h.anchor1.parent.abcelem.startChar-1);var w=-1;return h.anchor2&&!h.isTie&&(w=h.anchor2.parent.abcelem.endChar+1),S.wrapSvgEl({el_type:"slur",startChar:g,endChar:w},y),[y]}var a=function(l,h,f){!l.anchor1||!l.anchor2||l.anchor1.pitch===l.anchor2.pitch&&l.internalNotes.length===0?l.isTie=!0:l.isTie=!1,l.isTie?(l.calcTieDirection(),l.calcX(h,f),l.calcTieY()):(l.calcSlurDirection(),l.calcX(h,f),l.calcSlurY()),l.avoidCollisionAbove()},o=function(l,h,f,b,S,M,C,y,g){var w=y?1.2:1.5;h=t(h+6),f=t(f+4),b=b+(M?w:-w),S=S+(M?w:-w);var p=t(l.calcY(b)),E=t(l.calcY(S)),N=f-h,I=E-p,O=Math.sqrt(N*N+I*I),V=N/O,U=I/O,D=O/3.5,me=y?10:25,B=(M?-1:1)*Math.min(me,Math.max(4,D)),ie=t(h+D*V-B*U),he=t(p+D*U+B*V),ae=t(f-D*V-B*U),fe=t(E-D*U+B*V),le=2;C?C+=" slur":C="slur",C+=y?" tie":" legato";var Y;if(g){C+=" dotted";var $=e("M %f %f C %f %f %f %f %f %f",h,p,ie,he,ae,fe,f,E);Y=l.paper.path({path:$,stroke:l.foregroundColor,fill:"none","stroke-dasharray":"5 5",class:l.controller.classes.generate(C),"data-name":y?"tie":"slur"})}else{var ne=e("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",h,p,ie,he,ae,fe,f,E,t(ae-le*U),t(fe+le*V),t(ie-le*U),t(he+le*V),h,p);Y=l.paper.path({path:ne,stroke:"none",fill:l.foregroundColor,class:l.controller.classes.generate(C),"data-name":y?"tie":"slur"})}return Y};return uf=n,uf}var hf,c_;function tI(){if(c_)return hf;c_=1;var e=S0(),t=rs();function n(h,f){if(f.beams.length!==0){for(var b="",S=0;S<f.beams.length;S++){var M=f.beams[S];if(M.split){for(var C=o(h,M.startX,M.startY,M.endX,M.endY),y=[],g=0;g<M.split.length;g+=2)y.push([M.split[g],M.split[g+1]]);for(g=0;g<y.length;g++){var w=l(M.startX,M.startY,C,y[g][0]),p=l(M.startX,M.startY,C,y[g][1]);b+=a(h,y[g][0],w,y[g][1],p,M.dy)}}else b+=a(h,M.startX,M.startY,M.endX,M.endY,M.dy)}var E=("abcjs-d"+f.duration).replace(/\./g,"-"),N=h.controller.classes.generate("beam-elem "+E),I=e(h,{path:b,stroke:"none",fill:h.foregroundColor,class:N});return[I]}}function a(h,f,b,S,M,C){b=t(h.calcY(b)),M=t(h.calcY(M)),f=t(f),S=t(S);var y=t(b+C),g=t(M+C);return"M"+f+" "+b+" L"+S+" "+M+"L"+S+" "+g+" L"+f+" "+y+"z"}function o(h,f,b,S,M){return(M-b)/(S-f)}function l(h,f,b,S){var M=S-h;return f+M*b}return hf=n,hf}var ff,u_;function Py(){if(u_)return ff;u_=1;var e=z1(),t=rs();function n(a,o,l,h,f,b,S){if(l<0||h<f){var M=t(f);f=t(h),h=M}else h=t(h),f=t(f);o=t(o);var C=t(o+l);if(a.firefox112){o+=l/2;var g={x1:o,x2:o,y1:h,y2:f,stroke:a.foregroundColor,"stroke-width":Math.abs(l)};return b&&(g.class=b),S&&(g["data-name"]=S),a.paper.lineToBack(g)}for(var y=[["M",o,h],["L",o,f],["L",C,f],["L",C,h],["z"]],g={path:""},w=0;w<y.length;w++)g.path+=y[w].join(" ");return b&&(g.class=b),S&&(g["data-name"]=S),e.isInGroup()||(g.stroke="none",g.fill=a.foregroundColor),a.paper.pathToBack(g)}return ff=n,ff}var df,h_;function rI(){if(h_)return df;h_=1;var e=za(),t=rs();function n(a,o,l,h,f,b,S){var M=a.foregroundColor;o=t(o),l=t(l);var C=t(h-S),y=t(h+S);if(a.firefox112){h+=S/2;var g={x1:o,x2:l,y1:h,y2:h,stroke:a.foregroundColor,"stroke-width":Math.abs(S*2)};return f&&(g.class=f),b&&(g["data-name"]=b),a.paper.lineToBack(g)}var w=e("M %f %f L %f %f L %f %f L %f %f z",o,C,l,C,l,y,o,y),p={path:w,stroke:"none",fill:M};b&&(p["data-name"]=b),f&&(p.class=f);var E=a.paper.pathToBack(p);return E}return df=n,df}var pf,f_;function Iy(){if(f_)return pf;f_=1;var e=rI();function t(n,a,o,l,h,f,b){var S=n.calcY(l);return e(n,a,o,S,h,f,b)}return pf=t,pf}var gf,d_;function Ny(){if(d_)return gf;d_=1;var e=sa(),t=Py(),n=Iy(),a=Ty();function o(h,f,b){f.pitch===void 0&&window.console.error(f.type+" Relative Element y-coordinate not set.");var S=h.calcY(f.pitch);switch(f.type){case"symbol":if(f.c===null)return null;var M="symbol";f.klass&&(M+=" "+f.klass),f.graphelem=a(h,f.x,f.pitch,f.c,{scalex:f.scalex,scaley:f.scaley,klass:h.controller.classes.generate(M),name:f.name});break;case"debug":f.graphelem=e(h,{x:f.x,y:h.calcY(15),text:""+f.c,type:"debugfont",klass:h.controller.classes.generate("debug-msg"),anchor:"start",centerVertically:!1,dim:f.dim},!1);break;case"tabNumber":var C="middle",y="tabnumberfont",g="abcjs-tab-number";f.isGrace&&(y="tabgracefont",S+=2.5,g="tab-grace"),f.graphelem=e(h,{x:f.x,y:S,text:""+f.c,type:y,klass:h.controller.classes.generate(g),anchor:C,centerVertically:!1,dim:f.dim,cursor:"default"},!1);break;case"barNumber":f.graphelem=e(h,{x:f.x,y:S,text:""+f.c,type:"measurefont",klass:h.controller.classes.generate("bar-number"),anchor:"middle",dim:f.dim,name:"bar-number"},!0);break;case"lyric":f.graphelem=e(h,{x:f.x,y:S,text:f.c,type:"vocalfont",klass:h.controller.classes.generate("lyric"),anchor:"middle",dim:f.dim,name:"lyric"},!1);break;case"chord":f.graphelem=e(h,{x:f.x,y:S,text:f.c,type:"gchordfont",klass:h.controller.classes.generate("chord"),anchor:"middle",dim:f.dim,lane:f.getLane(),name:"chord"},!1);break;case"decoration":f.graphelem=e(h,{x:f.x,y:S+6,text:f.c,type:"annotationfont",klass:h.controller.classes.generate("annotation"),anchor:f.anchor,centerVertically:!0,dim:f.dim},!1);break;case"text":f.graphelem=e(h,{x:f.x,y:S,text:f.c,type:"annotationfont",klass:h.controller.classes.generate("annotation"),anchor:"start",centerVertically:f.centerVertically,dim:f.dim,lane:f.getLane(),name:"annotation"},!1);break;case"multimeasure-text":f.graphelem=e(h,{x:f.x+f.w/2,y:S,text:f.c,type:"tempofont",klass:h.controller.classes.generate("rest"),anchor:"middle",centerVertically:!1,dim:f.dim},!1);break;case"part":f.graphelem=e(h,{x:f.x,y:S,text:f.c,type:"partsfont",klass:h.controller.classes.generate("part"),anchor:"start",dim:f.dim,name:f.c},!0);break;case"bar":f.graphelem=t(h,f.x,f.linewidth+h.lineThickness,S,b||h.calcY(f.pitch2),null,"bar");break;case"stem":var w=f.linewidth>0?f.linewidth+h.lineThickness:f.linewidth-h.lineThickness;f.graphelem=t(h,f.x,w,S,h.calcY(f.pitch2),"abcjs-stem","stem");break;case"ledger":f.graphelem=n(h,f.x,f.x+f.w,f.pitch,"abcjs-ledger","ledger",.35+h.lineThickness);break}return f.scalex!==1&&f.graphelem&&l(h.paper,f.graphelem,f.scalex,f.scaley,f.x,S),f.graphelem}function l(h,f,b,S,M,C){h.setAttributeOnElement(f,{style:"transform:scale("+b+","+S+");transform-origin:"+M+"px "+C+"px;"})}return gf=o,gf}var vf,p_;function iI(){if(p_)return vf;p_=1;var e=Ny(),t=sa();function n(a,o){var l=o.x;o.pitch===void 0&&window.console.error("Tempo Element y-coordinate not set."),o.tempo.el_type="tempo";var h=a.calcY(o.pitch)+2,f,b;if(o.tempo.preString){f=t(a,{x:l,y:h,text:o.tempo.preString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"pre"},!0),b=a.controller.getTextSize.calc(o.tempo.preString,"tempofont","tempo",f);var S=b.width,M=S/o.tempo.preString.length;l+=S+M}if(o.note){o.note.setX(l);for(var C=0;C<o.note.children.length;C++)e(a,o.note.children[C],l);l+=o.note.w+5;var y="= "+o.tempo.bpm;f=t(a,{x:l,y:h,text:y,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"beats"}),b=a.controller.getTextSize.calc(y,"tempofont","tempo",f);var g=b.width,w=g/y.length;l+=g+w}o.tempo.postString&&t(a,{x:l,y:h,text:o.tempo.postString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"post"},!0)}return vf=n,vf}var mf,g_;function nI(){if(g_)return mf;g_=1;var e=iI(),t=Ny(),n=Qi(),a=B1(),o=z1();function l(h,f,b,S,M){if(!f.invisible){var C=f.children.length>0&&f.children[0].type==="TempoElement";f.elemset=[],o.beginGroup(h.paper,h.controller);for(var y=0;y<f.children.length;y++){var g=f.children[y];switch(g.type){case"TempoElement":e(h,g);break;default:var w=t(h,g,b);g.type==="symbol"&&g.c&&g.c.indexOf("notehead")>=0&&w.setAttribute("class","abcjs-notehead")}}var p=f.type;if((f.type==="note"||f.type==="rest")&&(f.counters=h.controller.classes.getCurrent(),p+=" d"+Math.round(f.durationClass*1e3)/1e3,p=p.replace(/\./g,"-"),f.abcelem.pitches))for(var E=0;E<f.abcelem.pitches.length;E++)p+=" p"+f.abcelem.pitches[E].pitch;var N=o.endGroup(p,f.type);if(N){if(f.cloned&&(f.cloned.overrideClasses=N.className.baseVal),f.overrideClasses){var I=N.classList&&N.classList.length>0?N.classList[0]+" ":"";N.setAttribute("class",I+f.overrideClasses)}if(C)f.startChar=f.abcelem.startChar,f.endChar=f.abcelem.endChar,S.add(f,N,!1,M);else{f.elemset.push(N);var O=!1;(f.type==="note"||f.type==="tabNumber")&&(O=!0),S.add(f,N,O,M)}}else f.elemset.length>0&&S.add(f,f.elemset[0],f.type==="note",M);if(f.klass&&a(f.elemset,"mark","","#00ff00"),f.hint&&a(f.elemset,"abcjs-hint","",null),f.abcelem.abselem=f,f.heads&&f.heads.length>0){f.notePositions=[];for(var V=0;V<f.heads.length;V++)f.notePositions.push({x:f.heads[V].x+f.heads[V].w/2,y:M.zero-f.heads[V].pitch*n.STEP})}}}return mf=l,mf}var _f,v_;function sI(){if(v_)return _f;v_=1;var e=jP(),t=XP(),n=QP(),a=ZP(),o=JP(),l=eI(),h=tI(),f=sa(),b=nI();function S(C,y,g,w,p){var E=y.w-1;C.staffbottom=y.staff.bottom;var N=C.foregroundColor;if(y.color&&(C.foregroundColor=y.color),y.header){var I=f(C,{x:C.padding.left,y:C.calcY(y.headerPosition),text:y.header,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0,name:"voice-name"},!0);w.wrapSvgEl({el_type:"voiceName",startChar:-1,endChar:-1,text:y.header},I)}var O,V,U=!1;for(O=0;O<y.children.length;O++){V=y.children[O],(V.type==="note"||V.type==="rest")&&(U=!0);var D=!1;V.type!=="staff-extra"&&!C.controller.classes.isInMeasure()&&(C.controller.classes.startMeasure(),D=!0),y.staff.isTabStaff&&(V.invisible=!1,V.type=="bar"&&V.abcelem.lastBar&&(g=y.topLine)),b(C,V,y.barto||O===y.children.length-1?g:0,w,p),(V.type==="note"||M(V))&&C.controller.classes.incrNote(),V.type==="bar"&&!D&&U&&C.controller.classes.incrMeasure()}for(C.controller.classes.startMeasure(),O=0;O<y.beams.length;O++){var me=y.beams[O];me==="bar"?C.controller.classes.incrMeasure():h(C,me,w)}for(C.controller.classes.startMeasure(),O=0;O<y.otherchildren.length;O++)if(V=y.otherchildren[O],V==="bar")C.controller.classes.incrMeasure();else switch(V.type){case"GlissandoElem":V.elemset=e(C,V,w);break;case"CrescendoElem":V.elemset=t(C,V,w);break;case"DynamicDecoration":V.elemset=n(C,V,w);break;case"TripletElem":a(C,V,w);break;case"EndingElem":V.elemset=o(C,V,y.startx+10,E,w);break;case"TieElem":V.elemset=l(C,V,y.startx+10,E,w);break;default:console.log(V),b(C,V,y.startx+10,E,w,p)}C.foregroundColor=N}function M(C){return C.type!=="rest"?!1:!!(C.abcelem&&C.abcelem.rest&&C.abcelem.rest.type!=="spacer")}return _f=S,_f}var bf,m_;function aI(){if(m_)return bf;m_=1;var e=Iy();function t(n,a,o,l,h,f){var b="abcjs-top-line",S=2;h&&(S=h),n.paper.openGroup({prepend:!0,klass:n.controller.classes.generate("abcjs-staff")});var M=0,C=0;if(l===1)e(n,a,o,6,b,null,f+n.lineThickness),M=n.calcY(10),C=n.calcY(2);else for(var y=l-1;y>=0;y--){var g=(y+1)*S;C=n.calcY(g),M===0&&(M=C),e(n,a,o,g,b,null,f+n.lineThickness),b=void 0}return n.paper.closeGroup(),[M,C]}return bf=t,bf}var yf,__;function oI(){if(__)return yf;__=1;function e(t,n,a){var o=t.paper.rectBeneath(n);return a&&t.paper.text(a,{x:0,y:n.y+7,"text-anchor":"start","font-size":"14px",fill:"rgba(0,0,255,.4)",stroke:"rgba(0,0,255,.4)"}),o}return yf=e,yf}var wf,b_;function lI(){if(b_)return wf;b_=1;function e(t,n){var a="rgba(0,0,0,255)",o="rgba(0,0,0,0)",l=Math.round(t.y),h=t.controller.width,f=(h-n)/2,b=f+n,S="M "+f+" "+l+" L "+b+" "+l+" L "+b+" "+(l+1)+" L "+f+" "+(l+1)+" L "+f+" "+l+" z";t.paper.pathToBack({path:S,stroke:o,fill:a,class:t.controller.classes.generate("defined-text")})}return wf=e,wf}var Sf,y_;function Ly(){if(y_)return Sf;y_=1;var e=lI(),t=sa();function n(a,o,l){for(var h=0;h<o.rows.length;h++){var f=o.rows[h];if(f.absmove)a.absolutemoveY(f.absmove);else if(f.move)a.moveY(f.move);else if(f.text||f.phrases){var b=f.left?f.left:0,S=t(a,{x:b,y:a.y,text:f.text,phrases:f.phrases,"dominant-baseline":f["dominant-baseline"],type:f.font,klass:f.klass,name:f.name,anchor:f.anchor});f.absElemType&&l.wrapSvgEl({el_type:f.absElemType,name:f.name,startChar:f.startChar,endChar:f.endChar,text:f.text},S)}else if(f.separator)e(a,f.separator);else if(f.startGroup)a.paper.openGroup({klass:f.klass,"data-name":f.name});else if(f.endGroup){var M=a.paper.closeGroup();f.absElemType&&l.wrapSvgEl({el_type:f.absElemType,name:f.name,startChar:f.startChar,endChar:f.endChar,text:""},M)}}}return Sf=n,Sf}var xf,w_;function cI(){if(w_)return xf;w_=1;var e=Qi(),t=KP(),n=sI(),a=aI(),o=oI(),l=Py(),h=Ly();function f(M,C,y,g){for(var w,p=M.y,E=0;E<C.staffs.length;E++){var N=C.staffs[E];M.moveY(e.STEP,N.top),N.absoluteY=M.y,M.showDebug&&(M.showDebug.indexOf("box")>=0&&N.voices&&S(M,C.voices,N.voices),M.showDebug.indexOf("grid")>=0&&(M.paper.dottedLine({x1:M.padding.left,x2:M.padding.left+M.controller.width,y1:p,y2:p,stroke:"#0000ff"}),o(M,{x:M.padding.left,y:M.calcY(N.originalTop),width:M.controller.width,height:M.calcY(N.originalBottom)-M.calcY(N.originalTop),fill:M.foregroundColor,stroke:M.foregroundColor,"fill-opacity":.1,"stroke-opacity":.1}),w=0,Y(N,"chordHeightAbove"),Y(N,"chordHeightBelow"),Y(N,"dynamicHeightAbove"),Y(N,"dynamicHeightBelow"),Y(N,"endingHeightAbove"),Y(N,"lyricHeightAbove"),Y(N,"lyricHeightBelow"),Y(N,"partHeightAbove"),Y(N,"tempoHeightAbove"),Y(N,"volumeHeightAbove"),Y(N,"volumeHeightBelow"))),M.moveY(e.STEP,-N.bottom),M.showDebug&&M.showDebug.indexOf("grid")>=0&&M.paper.dottedLine({x1:M.padding.left,x2:M.padding.left+M.controller.width,y1:M.y,y2:M.y,stroke:"#0000aa"})}for(var I,O,V=2,U=0,D=0;D<C.voices.length;D++){var me=C.voices[D].staff,B=C.voices[D].tabNameInfos;if(M.y=me.absoluteY,M.controller.classes.incrVoice(),!C.voices[D].duplicate){if(I||(I=M.calcY(10)),O=M.calcY(V),me.lines!==0){me.linePitch&&(V=me.linePitch),M.controller.classes.newMeasure();var ie=a(M,C.startx,C.w,me.lines,me.linePitch,.35);O=ie[1],me.bottomLine=O,me.topLine=ie[0],me.hasTab&&(U=me.topLine),me.hasStaff&&(U=me.hasStaff.topLine,C.voices[D].barto=!0,C.voices[D].topLine=I)}b(M,me.absoluteY,C.brace,D,y),b(M,me.absoluteY,C.bracket,D,y)}n(M,C.voices[D],U,y,{top:p,zero:M.y,height:C.height*e.STEP});var he=0;if(B){var ae={rows:[]};ae.rows.push({absmove:O+2});var fe=8;ae.rows.push({left:C.startx+fe,text:B.name,font:"tablabelfont",klass:"text instrument-name",anchor:"start"}),ae.rows.push({move:B.textSize.height}),h(M,ae),he=B.textSize.height}M.controller.classes.newMeasure(),C.voices[D].duplicate||(U=M.calcY(2+he))}M.controller.classes.newMeasure();var le=C.staffs.length;le>1&&(I=C.staffs[0].topLine,O=C.staffs[le-1].bottomLine,l(M,C.startx,.6,I,O,null)),M.y=p;function Y($,ne){var we=["rgb(207,27,36)","rgb(168,214,80)","rgb(110,161,224)","rgb(191,119,218)","rgb(195,30,151)","rgb(31,170,177)","rgb(220,166,142)"];if($.positionY&&$.positionY[ne]){var ye=$.specialY[ne]*e.STEP;ne==="chordHeightAbove"&&$.specialY.chordLines&&$.specialY.chordLines.above&&(ye*=$.specialY.chordLines.above),ne==="chordHeightBelow"&&$.specialY.chordLines&&$.specialY.chordLines.below&&(ye*=$.specialY.chordLines.below),o(M,{x:M.padding.left,y:M.calcY($.positionY[ne]),width:M.controller.width,height:ye,fill:we[w],stroke:we[w],"fill-opacity":.4,"stroke-opacity":.4},ne.substr(0,4)),w+=1,w>6&&(w=0)}}}function b(M,C,y,g,w){if(y)for(var p=0;p<y.length;p++)y[p].isStartVoice(g)&&(y[p].startY=C-e.STEP*10,y[p].elemset=t(M,y[p],w))}function S(M,C,y){for(var g=0;g<y.length;g++)for(var w=C[y[g]].children,p=0;p<w.length;p++){var E=w[p],N=E.getFixedCoords();if(!(E.invisible||N.t===void 0||N.b===void 0)){var I=(N.t-N.b)*e.STEP;o(M,{x:N.x,y:M.calcY(N.t),width:N.w,height:I,fill:"#88e888","fill-opacity":.4,stroke:"#4aa93d","stroke-opacity":.8});for(var O=0;O<E.children.length;O++){var V=E.children[O],U=V.getChordDim();if(U){var D=M.calcY(V.pitch);D+=V.dim.font.size*V.getLane(),o(M,{x:U.left,y:D,width:U.right-U.left,height:V.dim.font.size,fill:"none",stroke:"#4aa93d","stroke-opacity":.8})}}}}}return xf=f,xf}var Cf,S_;function uI(){if(S_)return Cf;S_=1;function e(t,n,a,o){var l=(n+t.padding.left+t.padding.right)*a,h=(t.y+t.padding.bottom)*a;if(t.isPrint&&(h=Math.max(h,1056)),t.ariaLabel!==""){var f="Sheet Music";t.abctune&&t.abctune.metaText&&t.abctune.metaText.title&&(f+=' for "'+t.abctune.metaText.title+'"'),t.paper.setTitle(f);var b=t.ariaLabel?t.ariaLabel:f;t.paper.setAttribute("aria-label",b)}var S=["-webkit-touch-callout: none;","-webkit-user-select: none;","-khtml-user-select: none;","-moz-user-select: none;","-ms-user-select: none;","user-select: none;"];t.paper.insertStyles(".abcjs-dragging-in-progress text, .abcjs-dragging-in-progress tspan {"+S.join(" ")+"}");var M={overflow:"hidden"};o==="resize"?t.paper.setResponsiveWidth(l,h):(M.width="",M.height=h+"px",a<1?(M.width=l+"px",t.paper.setSize(l/a,h/a)):t.paper.setSize(l,h)),t.paper.setScale(a),t.paper.setParentStyles(M)}return Cf=e,Cf}var kf,x_;function hI(){if(x_)return kf;x_=1;var e=yy(),t=wy();function n(a,o,l){this.elements=[],this.paper=a,this.tuneNumber=l,this.selectTypes=o}return n.prototype.getElements=function(){return this.elements},n.prototype.add=function(a,o,l,h){if(this.canSelect(a)){var f;this.selectTypes===void 0?f={selectable:!1,"data-index":this.elements.length}:f={selectable:!0,tabindex:0,"data-index":this.elements.length},this.paper.setAttributeOnElement(o,f);var b={absEl:a,svgEl:o,isDraggable:l};h!==void 0&&(b.staffPos=h),this.elements.push(b)}},n.prototype.canSelect=function(a){return this.selectTypes===!1||!a||!a.abcelem?!1:this.selectTypes===!0?!0:this.selectTypes===void 0?a.abcelem.el_type==="note"||a.abcelem.el_type==="tabNumber":this.selectTypes.indexOf(a.abcelem.el_type)>=0},n.prototype.wrapSvgEl=function(a,o){var l={tuneNumber:this.tuneNumber,abcelem:a,elemset:[o],highlight:e,unhighlight:t};this.add(l,o,!1)},kf=n,kf}var Mf,C_;function fI(){if(C_)return Mf;C_=1;var e=cI(),t=uI(),n=Ly(),a=Qi(),o=hI();function l(b,S,M,C,y,g,w,p,E,N){var I=new o(b.paper,p,E),O={};S.shouldAddClasses&&(O.klass="abcjs-meta-top"),b.paper.openGroup(O),b.moveY(b.padding.top),n(b,M.topText,I),b.paper.closeGroup(),b.moveY(b.spacing.music);for(var V=[],U=0;U<M.lines.length;U++){S.incrLine();var D=M.lines[U];if(D.staff){S.shouldAddClasses&&(O.klass="abcjs-staff-wrapper abcjs-l"+S.lineNumber),b.paper.openGroup(O),D.vskip&&b.moveY(D.vskip),V.length>=1&&f(b,b.spacing.staffSeparation,V[V.length-1],D.staffGroup);var me=h(b,D.staffGroup,I,U);me.line=N+U,V.push(me),b.paper.closeGroup()}else D.nonMusic&&(S.shouldAddClasses&&(O.klass="abcjs-non-music"),b.paper.openGroup(O),n(b,D.nonMusic,I),b.paper.closeGroup())}return S.reset(),M.bottomText&&M.bottomText.rows&&M.bottomText.rows.length>0&&(S.shouldAddClasses&&(O.klass="abcjs-meta-bottom"),b.paper.openGroup(O),b.moveY(24),n(b,M.bottomText,I),b.paper.closeGroup()),t(b,y,w,g),{staffgroups:V,selectables:I.getElements()}}function h(b,S,M,C){e(b,S,M,C);var y=S.height*a.STEP;return b.y+=y,S}function f(b,S,M,C){var y=M.staffs[M.staffs.length-1],g=-(y.bottom-2),w=C.staffs[0].top-10,p=w+g,E=p*a.STEP;E<S&&b.moveY(S-E)}return Mf=l,Mf}var Ef,k_;function dI(){if(k_)return Ef;k_=1;var e=Ey();function t(n){for(var a=n;a&&a.attributes&&a.tagName.toLowerCase()!=="svg"&&!a.attributes.selectable;)a=a.parentNode;if(a&&a.attributes&&a.attributes.selectable){var o=a.attributes["data-index"].nodeValue;if(o&&(o=parseInt(o,10),o>=0&&o<this.selectables.length)){var l=this.selectables[o],h=e(l,n);return h.index=o,h.element=l,h}}return null}return Ef=t,Ef}var Af,M_;function Oy(){if(M_)return Af;M_=1;var e=Qi(),t=AP(),n=PP(),a=IP(),o=NP(),l=LP(),h=OP(),f=DP(),b=RP(),S=GP(),M=YP(),C=WP(),y=$P(),g=fI(),w=Cy(),p=dI(),E=function(O,V){V=V||{},this.findSelectableElement=p,this.oneSvgPerLine=V.oneSvgPerLine,this.selectionColor=V.selectionColor,this.dragColor=V.dragColor?V.dragColor:V.selectionColor,this.dragging=!!V.dragging,this.selectTypes=V.selectTypes,this.responsive=V.responsive,this.space=3*e.SPACE,this.initialClef=V.initialClef,this.timeBasedLayout=V.timeBasedLayout,this.expandToWidest=!!V.expandToWidest,this.scale=V.scale?parseFloat(V.scale):0,this.classes=new M({shouldAddClasses:V.add_classes}),this.scale>.1||(this.scale=void 0),V.staffwidth?(this.staffwidthScreen=V.staffwidth,this.staffwidthPrint=V.staffwidth):(this.staffwidthScreen=740,this.staffwidthPrint=680),this.listeners=[],V.clickListener&&this.addSelectListener(V.clickListener),this.renderer=new n(O),this.renderer.setPaddingOverride(V),V.showDebug&&(this.renderer.showDebug=V.showDebug),V.jazzchords&&(this.jazzchords=V.jazzchords),V.accentAbove&&(this.accentAbove=V.accentAbove),V.germanAlphabet&&(this.germanAlphabet=V.germanAlphabet),V.lineThickness&&(this.lineThickness=V.lineThickness),this.renderer.controller=this,this.renderer.foregroundColor=V.foregroundColor?V.foregroundColor:"currentColor",V.ariaLabel!==void 0&&(this.renderer.ariaLabel=V.ariaLabel),this.renderer.minPadding=V.minPadding?V.minPadding:0,this.reset()};E.prototype.reset=function(){this.selected=[],this.staffgroups=[],this.engraver&&this.engraver.reset(),this.engraver=null,this.renderer.reset(),this.dragTarget=null,this.dragIndex=-1,this.dragMouseStart={x:-1,y:-1},this.dragYStep=0,this.lineThickness&&this.renderer.setLineThickness(this.lineThickness)},E.prototype.engraveABC=function(O,V,U){O[0]===void 0&&(O=[O]),this.reset();for(var D=0;D<O.length;D++)V===void 0&&(V=D),this.getFontAndAttr=new C(O[D].formatting,this.classes),this.getTextSize=new y(this.getFontAndAttr,this.renderer.paper),this.engraveTune(O[D],V,U)},E.prototype.adjustNonScaledItems=function(O){this.width/=O,this.renderer.adjustNonScaledItems(O)},E.prototype.getMeasureWidths=function(O){this.reset(),this.getFontAndAttr=new C(O.formatting,this.classes),this.getTextSize=new y(this.getFontAndAttr,this.renderer.paper);var V=this.jazzchords;this.setupTune(O,0),this.constructTuneElements(O),S(this.renderer,O,0,this.space,this.timeBasedLayout);for(var U=[],D,me=!0,B=0;B<O.lines.length;B++){var ie=O.lines[B];if(ie.staff){if(me&&(D={left:0,measureWidths:[],total:0},U.push(D),me=!1),ie.staffGroup.voices.length>0)for(var he=ie.staffGroup.voices[0],ae=!1,fe=0,le=0;le<he.children.length;le++){var Y=he.children[le];!ae&&!Y.isClef&&!Y.isKeySig&&(ae=!0,D.left=Y.x,fe=Y.x),Y.type==="bar"&&(D.measureWidths.push(Y.x-fe),D.total+=Y.x-fe,fe=Y.x)}}else me=!0}return this.jazzchords=V,U},E.prototype.setupTune=function(O,V){this.classes.reset(),O.formatting.jazzchords!==void 0&&(this.jazzchords=O.formatting.jazzchords),O.formatting.accentAbove!==void 0&&(this.accentAbove=O.formatting.accentAbove),this.renderer.newTune(O),this.engraver=new t(this.getTextSize,V,{bagpipes:O.formatting.bagpipes,flatbeams:O.formatting.flatbeams,graceSlurs:O.formatting.graceSlurs!==!1,percmap:O.formatting.percmap,initialClef:this.initialClef,jazzchords:this.jazzchords,timeBasedLayout:this.timeBasedLayout,accentAbove:this.accentAbove,germanAlphabet:this.germanAlphabet}),this.engraver.setStemHeight(this.renderer.spacing.stemHeight),this.engraver.measureLength=O.getMeterFraction().num/O.getMeterFraction().den,O.formatting.staffwidth?this.width=O.formatting.staffwidth*1.33:this.width=this.renderer.isPrint?this.staffwidthPrint:this.staffwidthScreen;var U=O.formatting.scale?O.formatting.scale:this.scale;return this.responsive==="resize"&&(U=void 0),U===void 0&&(U=this.renderer.isPrint?.75:1),this.adjustNonScaledItems(U),U},E.prototype.constructTuneElements=function(O){O.topText=new h(O.metaText,O.metaTextInfo,O.formatting,O.lines,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize);var V,U,D=!1,me=!1;for(V=0;V<O.lines.length;V++)if(U=O.lines[V],U.staff)me=!0,U.staffGroup=this.engraver.createABCLine(U.staff,D?null:O.metaText.tempo,V),D=!0;else if(U.subtitle){if(me){var B=this.width/2+this.renderer.padding.left;U.nonMusic=new l(this.renderer.spacing.subtitle,O.formatting,U.subtitle,B,this.renderer.padding.left,this.getTextSize)}}else U.text!==void 0?(me=!0,U.nonMusic=new a(U.text,U.vskip,this.getFontAndAttr,this.renderer.padding.left,this.width,this.getTextSize)):U.separator!==void 0&&U.separator.lineLength&&(me=!0,U.nonMusic=new o(U.separator.spaceAbove,U.separator.lineLength,U.separator.spaceBelow));O.bottomText=new f(O.metaText,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize)},E.prototype.engraveTune=function(O,V,U){var D=this.jazzchords,me=this.setupTune(O,V);this.constructTuneElements(O);var B=S(this.renderer,O,this.width,this.space,this.expandToWidest,this.timeBasedLayout);if(this.expandToWidest&&B>this.width+1&&(O.topText=new h(O.metaText,O.metaTextInfo,O.formatting,O.lines,B,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize),O.lines&&O.lines.length>0))for(var ie=O.lines.length,he=0;he<ie;++he){var ae=O.lines[he];if(ae.nonMusic&&ae.nonMusic.rows&&ae.nonMusic.rows.length>0)for(var fe=ae.nonMusic.rows.length,le=0;le<fe;++le){var Y=ae.nonMusic.rows[le];Y.left&&(ae.subtitle?Y.left=B/2+this.renderer.padding.left:ae.text&&ae.text.length>0&&ae.text[0].center&&(Y.left=B/2+this.renderer.padding.left))}}O.tablatures&&w.layoutTablatures(this.renderer,O);var $=g(this.renderer,this.classes,O,this.width,B,this.responsive,me,this.selectTypes,V,U);if(this.staffgroups=$.staffgroups,this.selectables=$.selectables,this.oneSvgPerLine){var ne=this.renderer.paper.svg.parentNode;this.svgs=N(this.renderer,ne,O.metaText.title,this.responsive,me)}else this.svgs=[this.renderer.paper.svg];b(this,this.svgs),this.jazzchords=D};function N(O,V,U,D,me){U||(U="Untitled");var B=V.querySelector("svg");D==="resize"&&(V.style.paddingBottom="");for(var ie=B.querySelector("style"),he=D==="resize"?B.viewBox.baseVal.width:B.getAttribute("width"),ae=V.querySelectorAll("svg > g"),fe=0,le=[],Y=0;Y<ae.length;Y++){var $=ae[Y],ne=$.getBBox(),we=ne.y-fe,ye=ne.height+we,F=document.createElement("div"),H="overflow: hidden;";D!=="resize"&&(H+="height:"+ye*me+"px;"),F.setAttribute("style",H);var W=I(B),_e='Sheet Music for "'+U+'" section '+(Y+1);W.setAttribute("aria-label",_e),D!=="resize"&&W.setAttribute("height",ye),D==="resize"&&(W.style.position="");var Te=O.firefox112?ye+1:ye;W.setAttribute("viewBox","0 "+fe+" "+he+" "+Te),W.appendChild(ie.cloneNode(!0));var Re=document.createElement("title");Re.innerText=_e,W.appendChild(Re),W.appendChild($),F.appendChild(W),le.push(W),V.appendChild(F),fe=ne.y+ne.height}return V.removeChild(B),le}function I(O){for(var V="http://www.w3.org/2000/svg",U=document.createElementNS(V,"svg"),D=0;D<O.attributes.length;D++){var me=O.attributes[D];me.name!=="height"&&me.name!="aria-label"&&U.setAttribute(me.name,me.value)}return U}return E.prototype.getDim=function(O){if(!O.dim){var V=O.svgEl.getBBox();O.dim={left:Math.round(V.x),top:Math.round(V.y),right:Math.round(V.x+V.width),bottom:Math.round(V.y+V.height)}}return O.dim},E.prototype.addSelectListener=function(O){this.listeners[this.listeners.length]=O},Af=E,Af}var Tf,E_;function Dy(){if(E_)return Tf;E_=1;var e=ec();my();var t=Oy(),n=_y(),a=py(),o={};function l(){var S=window.innerWidth;for(var M in o)if(o.hasOwnProperty(M)){var C=o[M],y=C.offsetLeft;S-=y*2,C.style.width=S+"px"}}try{window.addEventListener("resize",l),window.addEventListener("orientationChange",l)}catch{}function h(S,M,C,y,g){C.viewportHorizontal?(S.innerHTML='<div class="abcjs-inner"></div>',C.scrollHorizontal?(S.style.overflowX="auto",S.style.overflowY="hidden"):S.style.overflow="hidden",o[S.id]=S,S=S.children[0]):C.viewportVertical?(S.innerHTML='<div class="abcjs-inner scroll-amount"></div>',S.style.overflowX="hidden",S.style.overflowY="auto",S=S.children[0]):S.innerHTML="";var w=new t(S,C);if(w.engraveABC(M,y,g),M.engraver=w,C.viewportVertical||C.viewportHorizontal){var p=S.parentNode;p.style.width=S.style.width}}var f=function(S,M,C,y,g){var w={},p;if(C){for(p in C)C.hasOwnProperty(p)&&(w[p]=C[p]);w.warnings_id&&w.tablature&&(w.tablature.warning_id=w.warnings_id)}if(y)for(p in y)y.hasOwnProperty(p)&&(p==="listener"?y[p].highlight&&(w.clickListener=y[p].highlight):w[p]=y[p]);if(g)for(p in g)g.hasOwnProperty(p)&&(w[p]=g[p]);function E(N,I,O,V){var U=!1;return N==="*"&&(U=!0,N=document.createElement("div"),N.setAttribute("style","visibility: hidden;"),document.body.appendChild(N)),!U&&w.wrap&&w.staffwidth?(I=b(N,I,O,V,w),I):(w.afterParsing&&w.afterParsing(I,O,V),h(N,I,w,O,0),U&&N.parentNode.removeChild(N),null)}return e.renderEngine(E,S,M,w)};function b(S,M,C,y,g){var w=new t(S,g),p=w.getMeasureWidths(M),E=a.calcLineWraps(M,p,g);if(E.reParse){var N=new n;N.parse(y,E.revisedParams),M=N.getTune();var I=N.getWarnings();I&&(M.warnings=I)}return g.afterParsing&&g.afterParsing(M,C,y),h(S,M,E.revisedParams,C,0),M.explanation=E.explanation,M}return Tf=f,Tf}var Pf,A_;function pI(){if(A_)return Pf;A_=1;var e=ec(),t=Oy(),n=function(a,o){function l(h,f,b,S){h=document.createElement("div"),h.setAttribute("style","visibility: hidden;"),document.body.appendChild(h);var M=new t(h,o),C=M.getMeasureWidths(f);return h.parentNode.removeChild(h),{sections:C}}return e.renderEngine(l,"*",a,o)};return Pf=n,Pf}var If,T_;function H1(){if(T_)return If;T_=1;var e={};return If=e,If}var Nf,P_;function gI(){if(P_)return Nf;P_=1;var e=H1(),t=function(n,a,o,l){e[a]||(e[a]={});var h=e[a];return h[o]||(h[o]=new Promise(function(f,b){var S=new XMLHttpRequest;let M=n+a+"-mp3/"+o+".mp3";S.open("GET",M,!0),S.responseType="arraybuffer",S.onload=function(){if(S.status!==200){b(Error("Can't load sound at "+M+" status="+S.status));return}var C=function(g){f({instrument:a,name:o,status:"loaded",audioBuffer:g})},y=l.decodeAudioData(S.response,C,function(){b(Error("Can't decode sound at "+M))});y&&typeof y.catch=="function"&&y.catch(b)},S.onerror=function(){b(Error("Can't load sound at "+M))},S.send()}).catch(f=>{throw console.error("Didn't load note",a,o,":",f.message),f})),h[o]};return Nf=t,Nf}var Lf,I_;function V1(){if(I_)return Lf;I_=1;var e=["acoustic_grand_piano","bright_acoustic_piano","electric_grand_piano","honkytonk_piano","electric_piano_1","electric_piano_2","harpsichord","clavinet","celesta","glockenspiel","music_box","vibraphone","marimba","xylophone","tubular_bells","dulcimer","drawbar_organ","percussive_organ","rock_organ","church_organ","reed_organ","accordion","harmonica","tango_accordion","acoustic_guitar_nylon","acoustic_guitar_steel","electric_guitar_jazz","electric_guitar_clean","electric_guitar_muted","overdriven_guitar","distortion_guitar","guitar_harmonics","acoustic_bass","electric_bass_finger","electric_bass_pick","fretless_bass","slap_bass_1","slap_bass_2","synth_bass_1","synth_bass_2","violin","viola","cello","contrabass","tremolo_strings","pizzicato_strings","orchestral_harp","timpani","string_ensemble_1","string_ensemble_2","synth_strings_1","synth_strings_2","choir_aahs","voice_oohs","synth_choir","orchestra_hit","trumpet","trombone","tuba","muted_trumpet","french_horn","brass_section","synth_brass_1","synth_brass_2","soprano_sax","alto_sax","tenor_sax","baritone_sax","oboe","english_horn","bassoon","clarinet","piccolo","flute","recorder","pan_flute","blown_bottle","shakuhachi","whistle","ocarina","lead_1_square","lead_2_sawtooth","lead_3_calliope","lead_4_chiff","lead_5_charang","lead_6_voice","lead_7_fifths","lead_8_bass_lead","pad_1_new_age","pad_2_warm","pad_3_polysynth","pad_4_choir","pad_5_bowed","pad_6_metallic","pad_7_halo","pad_8_sweep","fx_1_rain","fx_2_soundtrack","fx_3_crystal","fx_4_atmosphere","fx_5_brightness","fx_6_goblins","fx_7_echoes","fx_8_scifi","sitar","banjo","shamisen","koto","kalimba","bagpipe","fiddle","shanai","tinkle_bell","agogo","steel_drums","woodblock","taiko_drum","melodic_tom","synth_drum","reverse_cymbal","guitar_fret_noise","breath_noise","seashore","bird_tweet","telephone_ring","helicopter","applause","gunshot","percussion"];return Lf=e,Lf}var Of,N_;function vI(){if(N_)return Of;N_=1;var e=V1(),t=function(n){for(var a=[],o=0;o<n.tracks.length;o++)a.push([]);var l=e[0];return n.tracks.forEach(function(h,f){h.forEach(function(b){switch(b.cmd){case"note":var S=b.instrument!==void 0?e[b.instrument]:l;if(b.duration>0){var M=b.gap?b.gap:0,C=b.duration;M=Math.min(M,C*2/3);var y={pitch:b.pitch,instrument:S,start:Math.round(b.start*1e6)/1e6,end:Math.round((b.start+C-M)*1e6)/1e6,volume:b.volume};b.startChar&&(y.startChar=b.startChar),b.endChar&&(y.endChar=b.endChar),b.style&&(y.style=b.style),b.cents&&(y.cents=b.cents),a[f].push(y)}break;case"program":l=e[b.instrument];break;case"text":break;default:console.log("Unhandled midi event",b)}})}),a};return Of=t,Of}var Df,L_;function tc(){if(L_)return Df;L_=1;function e(t){if(t)window.abcjsAudioContext=t;else if(!window.abcjsAudioContext){var n=window.AudioContext||window.webkitAudioContext;if(n)window.abcjsAudioContext=new n;else return!1}return window.abcjsAudioContext.state!=="suspended"}return Df=e,Df}var Rf,O_;function Co(){if(O_)return Rf;O_=1;var e=tc();function t(){return window.abcjsAudioContext||e(),window.abcjsAudioContext}return Rf=t,Rf}var Bf,D_;function rc(){if(D_)return Bf;D_=1;var e=Co();function t(){if(!window.Promise||!window.AudioContext&&!window.webkitAudioContext&&!navigator.mozAudioContext&&!navigator.msAudioContext)return!1;var n=e();if(n)return n.resume!==void 0}return Bf=t,Bf}var qf,R_;function U1(){if(R_)return qf;R_=1;var e={21:"A0",22:"Bb0",23:"B0",24:"C1",25:"Db1",26:"D1",27:"Eb1",28:"E1",29:"F1",30:"Gb1",31:"G1",32:"Ab1",33:"A1",34:"Bb1",35:"B1",36:"C2",37:"Db2",38:"D2",39:"Eb2",40:"E2",41:"F2",42:"Gb2",43:"G2",44:"Ab2",45:"A2",46:"Bb2",47:"B2",48:"C3",49:"Db3",50:"D3",51:"Eb3",52:"E3",53:"F3",54:"Gb3",55:"G3",56:"Ab3",57:"A3",58:"Bb3",59:"B3",60:"C4",61:"Db4",62:"D4",63:"Eb4",64:"E4",65:"F4",66:"Gb4",67:"G4",68:"Ab4",69:"A4",70:"Bb4",71:"B4",72:"C5",73:"Db5",74:"D5",75:"Eb5",76:"E5",77:"F5",78:"Gb5",79:"G5",80:"Ab5",81:"A5",82:"Bb5",83:"B5",84:"C6",85:"Db6",86:"D6",87:"Eb6",88:"E6",89:"F6",90:"Gb6",91:"G6",92:"Ab6",93:"A6",94:"Bb6",95:"B6",96:"C7",97:"Db7",98:"D7",99:"Eb7",100:"E7",101:"F7",102:"Gb7",103:"G7",104:"Ab7",105:"A7",106:"Bb7",107:"B7",108:"C8",109:"Db8",110:"D8",111:"Eb8",112:"E8",113:"F8",114:"Gb8",115:"G8",116:"Ab8",117:"A8",118:"Bb8",119:"B8",120:"C9",121:"Db9"};return qf=e,qf}var Ff,B_;function mI(){if(B_)return Ff;B_=1;var e=function(n){return window.URL.createObjectURL(t(n.audioBuffers))};function t(n){var a=n[0],o=a.numberOfChannels,l=a.length*o*2+44,h=new ArrayBuffer(l),f=new DataView(h),b=[],S,M,C=0,y=0;for(w(1179011410),w(l-8),w(1163280727),w(544501094),w(16),g(1),g(o),w(a.sampleRate),w(a.sampleRate*2*o),g(o*2),g(16),w(1635017060),w(l-y-4),S=0;S<o;S++)b.push(a.getChannelData(S));for(;y<l;){for(S=0;S<b.length;S++)M=Math.max(-1,Math.min(1,b[S][C])),M=(.5+M<0?M*32768:M*32767)|0,f.setInt16(y,M,!0),y+=2;C++}return new Blob([h],{type:"audio/wav"});function g(p){f.setUint16(y,p,!0),y+=2}function w(p){f.setUint32(y,p,!0),y+=4}}return Ff=e,Ff}var zf,q_;function Ry(){if(q_)return zf;q_=1;function e(t){return Math.pow(2,t/1200)}return zf=e,zf}var Hf,F_;function _I(){if(F_)return Hf;F_=1;var e=H1(),t=U1(),n=Ry();function a(l,h,f,b,S,M,C,y,g){var w=window.OfflineAudioContext||window.webkitOfflineAudioContext,p=f.len*f.tempoMultiplier;M&&(p+=M/1e3),p-=y,p<0&&(p=.005);var E=new w(2,Math.floor((p+C)*h),h),N=t[f.pitch];if(!e[f.instrument])return g&&g("placeNote skipped (instrument empty): "+f.instrument+":"+N),Promise.resolve();var I=e[f.instrument][N];return I?I.then(function(O){var V=E.createBufferSource();V.buffer=O.audioBuffer;var U=f.volume/96*S;V.gainNode=E.createGain(),f.pan&&E.createStereoPanner&&(V.panNode=E.createStereoPanner(),V.panNode.pan.setValueAtTime(f.pan,0)),V.gainNode.gain.value=U,V.gainNode.gain.linearRampToValueAtTime(V.gainNode.gain.value,p),V.gainNode.gain.linearRampToValueAtTime(0,p+C),f.cents&&(V.playbackRate.value=n(f.cents)),V.panNode?(V.panNode.connect(E.destination),V.gainNode.connect(V.panNode)):V.gainNode.connect(E.destination),V.connect(V.gainNode),V.start(0),V.noteOff?V.noteOff(p+C):V.stop(p+C);var D;return E.oncomplete=function(me){if(me.renderedBuffer&&me.renderedBuffer.getChannelData)for(var B=0;B<b.length;B++){var ie=b[B]*f.tempoMultiplier;M&&(ie-=M/1e3),ie<0&&(ie=0),ie=Math.floor(ie*h),o(l,me.renderedBuffer,ie)}g&&g("placeNote: "+f.instrument+":"+N),D()},E.startRendering(),new Promise(function(me){D=me})}).catch(function(O){return g&&g("placeNote catch: "+O.message),Promise.resolve()}):(g&&g("placeNote skipped: "+f.instrument+":"+N),Promise.resolve())}var o=function(l,h,f){for(var b=0;b<2;b++)for(var S=h.getChannelData(b),M=l.getChannelData(b),C=0;C<S.length;C++)M[C+f]+=S[C]};return Hf=a,Hf}var Vf,z_;function G1(){if(z_)return Vf;z_=1;var e=gI(),t=vI(),n=tc(),a=Co(),o=rc(),l=U1(),h=V1(),f=mI(),b=_I(),S=H1(),M="MIDI is not supported in this browser.",C="https://paulrosen.github.io/midi-js-soundfonts/abcjs/",y="https://paulrosen.github.io/midi-js-soundfonts/FluidR3_GM/",g="https://paulrosen.github.io/midi-js-soundfonts/MusyngKite/";function w(){var p=this;p.audioBufferPossible=void 0,p.directSource=[],p.startTimeSec=void 0,p.pausedTimeSec=void 0,p.audioBuffers=[],p.duration=void 0,p.isRunning=!1,p.options=void 0,p.pickupLength=0,p.init=function(I){I||(I={}),I.options&&(p.options=I.options),n(I.audioContext);var O=a().currentTime;if(p.debugCallback=I.debugCallback,p.debugCallback&&p.debugCallback("init called"),p.audioBufferPossible=p._deviceCapable(),!p.audioBufferPossible)return Promise.reject({status:"NotSupported",message:M});var V=I.options?I.options:{};p.soundFontUrl=V.soundFontUrl?V.soundFontUrl:y,p.soundFontUrl[p.soundFontUrl.length-1]!=="/"&&(p.soundFontUrl+="/"),V.soundFontVolumeMultiplier||V.soundFontVolumeMultiplier===0?p.soundFontVolumeMultiplier=V.soundFontVolumeMultiplier:p.soundFontUrl===y||p.soundFontUrl===g?p.soundFontVolumeMultiplier=3:p.soundFontUrl===C?p.soundFontVolumeMultiplier=.4:p.soundFontVolumeMultiplier=1,V.programOffsets?p.programOffsets=V.programOffsets:p.soundFontUrl===C?p.programOffsets={bright_acoustic_piano:20,honkytonk_piano:20,electric_piano_1:30,electric_piano_2:30,harpsichord:40,clavinet:20,celesta:20,glockenspiel:40,vibraphone:30,marimba:35,xylophone:30,tubular_bells:35,dulcimer:30,drawbar_organ:20,percussive_organ:25,rock_organ:20,church_organ:40,reed_organ:40,accordion:40,harmonica:40,acoustic_guitar_nylon:20,acoustic_guitar_steel:30,electric_guitar_jazz:25,electric_guitar_clean:15,electric_guitar_muted:35,overdriven_guitar:25,distortion_guitar:20,guitar_harmonics:30,electric_bass_finger:15,electric_bass_pick:30,fretless_bass:40,violin:105,viola:50,cello:40,contrabass:60,trumpet:10,trombone:90,alto_sax:20,tenor_sax:20,clarinet:20,flute:50,banjo:50,woodblock:20}:p.programOffsets={};var U=V.fadeLength!==void 0?parseInt(V.fadeLength,10):NaN;if(p.fadeLength=isNaN(U)?200:U,U=V.noteEnd!==void 0?parseInt(V.noteEnd,10):NaN,p.noteEnd=isNaN(U)?0:U,p.pan=V.pan,p.meterSize=1,I.visualObj){p.flattened=I.visualObj.setUpAudio(V);var D=I.visualObj.getMeterFraction();D.den&&(p.meterSize=I.visualObj.getMeterFraction().num/I.visualObj.getMeterFraction().den),p.pickupLength=I.visualObj.getPickupLength()}else if(I.sequence)p.flattened=I.sequence;else return Promise.reject(new Error("Must pass in either a visualObj or a sequence"));p.millisecondsPerMeasure=I.millisecondsPerMeasure?I.millisecondsPerMeasure:I.visualObj?I.visualObj.millisecondsPerMeasure(p.flattened.tempo):1e3,p.beatsPerMeasure=I.visualObj?I.visualObj.getBeatsPerMeasure():4,p.sequenceCallback=V.sequenceCallback,p.callbackContext=V.callbackContext,p.onEnded=V.onEnded,p.meterFraction=I.visualObj?I.visualObj.getMeterFraction():{den:1};var me={},B=[],ie=[],he=h[0];p.flattened.tracks.forEach(function($){$.forEach(function(ne){if(ne.cmd==="program"&&h[ne.instrument]&&(he=h[ne.instrument]),ne.pitch!==void 0){var we=ne.pitch,ye=l[we],F=ne.instrument!==void 0?h[ne.instrument]:he;if(ye)if(me[F]||(me[F]={}),!S[F]||!S[F][ye])me[F][ye]=!0;else{var H=F+":"+ye;B.indexOf(H)<0&&B.push(H)}else{var W=F+":"+ye;console.log("Can't find note: ",we,W),ie.indexOf(W)<0&&ie.push(W)}}})}),p.debugCallback&&p.debugCallback("note gathering time = "+Math.floor((a().currentTime-O)*1e3)+"ms"),O=a().currentTime;var ae=[];Object.keys(me).forEach(function($){Object.keys(me[$]).forEach(function(ne){ae.push({instrument:$,note:ne})})}),p.debugCallback&&p.debugCallback("notes "+JSON.stringify(ae));for(var fe=[],le=256,Y=0;Y<ae.length;Y+=le)fe.push(ae.slice(Y,Y+le));return new Promise(function($,ne){var we={cached:B,error:ie,loaded:[]},ye=0,F=function(){p.debugCallback&&p.debugCallback("loadBatch idx="+ye+" len="+fe.length),ye<fe.length?p._loadBatch(fe[ye],p.soundFontUrl,O).then(function(H){p.debugCallback&&p.debugCallback("loadBatch then"),O=a().currentTime,H&&(H.error&&(we.error=we.error.concat(H.error)),H.loaded&&(we.loaded=we.loaded.concat(H.loaded))),ye++,F()},ne):(p.debugCallback&&p.debugCallback("resolve init"),$(we))};F()})},p._loadBatch=function(I,O,V,U){var D=[];return I.forEach(function(me){p.debugCallback&&p.debugCallback("getNote "+me.instrument+":"+me.note),D.push(e(O,me.instrument,me.note,a()))}),Promise.all(D).then(function(me){p.debugCallback&&p.debugCallback("mp3 load time = "+Math.floor((a().currentTime-V)*1e3)+"ms");for(var B=[],ie=[],he=[],ae=[],fe=0;fe<me.length;fe++){var le=me[fe],Y=le.instrument+":"+le.name;le.status==="loaded"?B.push(Y):le.status==="pending"?he.push(Y):le.status==="cached"?ie.push(Y):ae.push(Y+" "+le.message)}if(he.length>0){if(p.debugCallback&&p.debugCallback("pending "+JSON.stringify(he)),U?U=U*2:U=50,U<9e4)return new Promise(function(we,ye){setTimeout(function(){var F=[];for(fe=0;fe<he.length;fe++)Y=he[fe].split(":"),F.push({instrument:Y[0],note:Y[1]});p.debugCallback&&p.debugCallback("retry "+JSON.stringify(F)),p._loadBatch(F,O,V,U).then(function(H){we(H)}).catch(function(H){ye(H)})},U)});for(var $=[],ne=0;ne<I.length;ne++)$.push(I[ne].instrument+"/"+I[ne].note);return p.debugCallback&&p.debugCallback("loadBatch timeout"),Promise.reject(new Error("timeout attempting to load: "+$.join(", ")))}else return p.debugCallback&&p.debugCallback("loadBatch resolve"),Promise.resolve({loaded:B,cached:ie,error:ae})}).catch(function(me){p.debugCallback&&p.debugCallback("loadBatch catch "+me.message)})},p.prime=function(){var I=p.fadeLength/1e3;return p.isRunning=!1,p.audioBufferPossible?(p.debugCallback&&p.debugCallback("prime called"),new Promise(function(O){var V=a().currentTime,U=p.millisecondsPerMeasure/1e3/p.meterSize;if(p.duration=p.flattened.totalDuration*U,p.duration<=0)return p.audioBuffers=[],O({status:"empty",seconds:0});p.duration+=I;var D=Math.floor(a().sampleRate*p.duration);p.stop();var me=t(p.flattened);p.options.swing&&N(me,p.options.swing,p.meterFraction,p.pickupLength),p.sequenceCallback&&p.sequenceCallback(me,p.callbackContext);var B=E(me.length,p.pan),ie={};me.forEach(function(we,ye){var F=B&&B.length>ye?B[ye]:0;we.forEach(function(H){var W=H.instrument+":"+H.pitch+":"+H.volume+":"+Math.round((H.end-H.start)*1e3)/1e3+":"+F+":"+U+":"+(H.cents?H.cents:0);p.debugCallback&&p.debugCallback("noteMapTrack "+W),ie[W]||(ie[W]=[]),ie[W].push(H.start)})});for(var he=[],ae=a().createBuffer(2,D,a().sampleRate),fe=0;fe<Object.keys(ie).length;fe++){var le=Object.keys(ie)[fe],Y=le.split(":"),$=Y[6]!==void 0?parseFloat(Y[6]):0;Y={instrument:Y[0],pitch:parseInt(Y[1],10),volume:parseInt(Y[2],10),len:parseFloat(Y[3]),pan:parseFloat(Y[4]),tempoMultiplier:parseFloat(Y[5]),cents:$},he.push(b(ae,a().sampleRate,Y,ie[le],p.soundFontVolumeMultiplier,p.programOffsets[Y.instrument],I,p.noteEnd/1e3,p.debugCallback))}p.audioBuffers=[ae],p.debugCallback&&(p.debugCallback("sampleRate = "+a().sampleRate),p.debugCallback("totalSamples = "+D),p.debugCallback("creationTime = "+Math.floor((a().currentTime-V)*1e3)+"ms"));function ne(we){var ye=we&&we.audioBuffers&&we.audioBuffers.length>0?we.audioBuffers[0].duration:0;return{status:a().state,duration:ye}}Promise.all(he).then(function(){a().state==="suspended"?a().resume().then(function(){O(ne(p))}):a().state==="interrupted"?a().suspend().then(function(){a().resume().then(function(){O(ne(p))})}):O(ne(p))})})):Promise.reject(new Error(M))};function E(I,O){if(O==null)return null;var V=[];if(O.length){for(var U=0;U<I;U++)if(U<O.length){var D=parseFloat(O[U]);D<-1?D=-1:D>1&&(D=1),V.push(D)}else V.push(0);return V}else{var me=parseFloat(O);if(me*(I-1)>2)return null;for(var B=I%2===0,ie=B?0-me/2:0,he=ie+me,ae=0;ae<I;ae++)B=ae%2===0,B?(V.push(ie),ie-=me):(V.push(he),he+=me);return V}}p.start=function(){if(!p.audioBufferPossible)throw new Error(M);p.debugCallback&&p.debugCallback("start called");var I=p.pausedTimeSec?p.pausedTimeSec:0;p._kickOffSound(I),p.startTimeSec=a().currentTime-I,p.pausedTimeSec=void 0,p.debugCallback&&p.debugCallback("MIDI STARTED",p.startTimeSec)},p.pause=function(){if(!p.audioBufferPossible)throw new Error(M);return p.debugCallback&&p.debugCallback("pause called"),p.pausedTimeSec=p.stop(),p.pausedTimeSec},p.resume=function(){p.start()},p.seek=function(I,O){var V;switch(O){case"seconds":V=I;break;case"beats":V=I*p.millisecondsPerMeasure/p.beatsPerMeasure/1e3;break;default:V=(p.duration-p.fadeLength/1e3)*I;break}if(!p.audioBufferPossible)throw new Error(M);p.debugCallback&&p.debugCallback("seek called sec="+V),p.isRunning?(p.stop(),p._kickOffSound(V)):p.pausedTimeSec=V,p.pausedTimeSec=V},p.stop=function(){p.isRunning=!1,p.pausedTimeSec=void 0,p.directSource.forEach(function(O){try{O.stop()}catch(V){console.log("direct source didn't stop:",V)}}),p.directSource=[];var I=a().currentTime-p.startTimeSec;return I},p.finished=function(){p.startTimeSec=void 0,p.pausedTimeSec=void 0,p.isRunning=!1},p.download=function(){return f(p)},p.getAudioBuffer=function(){return p.audioBuffers[0]},p.getIsRunning=function(){return p.isRunning},p._deviceCapable=function(){return o()?!0:(console.warn(M),p.debugCallback&&p.debugCallback(M),!1)},p._kickOffSound=function(I){p.isRunning=!0,p.directSource=[],p.audioBuffers.forEach(function(O,V){p.directSource[V]=a().createBufferSource(),p.directSource[V].buffer=O,p.directSource[V].connect(a().destination)}),p.directSource.forEach(function(O){O.start(0,I)}),p.onEnded&&(p.directSource[0].onended=function(){p.onEnded(p.callbackContext)})};function N(I,O,V,U){if(!(V.den!=4&&V.den!=8)&&(O=parseFloat(O),!(isNaN(O)||O<=50))){O>75&&(O=75),O=O/50-1;var D=0,me=.25;V.den===8&&(me=me/2);for(var B=me/2,ie=B*O,he=0;he<I.length;he++)for(var ae=I[he],fe=0;fe<ae.length;fe++){var le=ae[fe];if((le.start-U)%B==0&&(le.start-U)%me!=0&&(fe==0||ae[fe-1].start<=ae[fe].start-B)&&(fe==ae.length-1||ae[fe+1].start>=ae[fe].start+B)){var Y=le.start;le.start+=ie,le.volume*=1+D,fe>0&&ae[fe-1].end==Y&&(ae[fe-1].end=le.start,ae[fe-1].volume*=1-D)}}}}}return Vf=w,Vf}var Uf,H_;function By(){if(H_)return Uf;H_=1;var e=function(){var t=this;t.tracks=[],t.totalDuration=0,t.currentInstrument=[],t.starts=[],t.addTrack=function(){return t.tracks.push([]),t.currentInstrument.push(0),t.starts.push(0),t.tracks.length-1},t.setInstrument=function(n,a){t.tracks[n].push({channel:0,cmd:"program",instrument:a}),t.currentInstrument[n]=a},t.appendNote=function(n,a,o,l,h){var f={cmd:"note",duration:o,gap:0,instrument:t.currentInstrument[n],pitch:a,start:t.starts[n],volume:l};h&&(f.cents=h),t.tracks[n].push(f),t.starts[n]+=o,t.totalDuration=Math.max(t.totalDuration,t.starts[n])}};return Uf=e,Uf}var Gf,V_;function bI(){if(V_)return Gf;V_=1;var e=`
173
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 700" preserveAspectRatio="xMidYMid meet">
174
+ <g transform="translate(0,700) scale(0.1,-0.1)" >
175
+ <path d="M3111 6981 c-20 -37 -90 -55 -364 -96 -120 -18 -190 -33 -244 -55
176
+ -42 -17 -124 -42 -182 -56 -78 -18 -119 -34 -157 -60 -28 -19 -86 -46 -128
177
+ -60 -43 -13 -107 -42 -144 -64 -37 -23 -84 -46 -106 -52 -21 -7 -56 -29 -79
178
+ -50 -22 -22 -61 -50 -86 -63 -26 -13 -67 -40 -91 -60 -24 -20 -65 -47 -90 -60
179
+ -25 -13 -53 -31 -61 -41 -8 -9 -32 -30 -54 -46 -75 -54 -486 -460 -512 -507
180
+ -15 -25 -48 -69 -75 -98 -26 -28 -48 -57 -48 -63 0 -6 -18 -29 -39 -53 -21
181
+ -23 -56 -71 -77 -107 -20 -36 -50 -80 -65 -97 -16 -18 -33 -52 -40 -75 -12
182
+ -47 -47 -115 -84 -166 -13 -18 -30 -56 -38 -83 -8 -27 -34 -80 -56 -118 -33
183
+ -53 -46 -91 -62 -167 -12 -63 -34 -127 -59 -179 -42 -84 -60 -166 -60 -270 0
184
+ -90 26 -122 125 -154 54 -17 96 -19 430 -20 305 -1 381 2 430 14 82 22 140 51
185
+ 153 78 6 12 22 47 37 77 14 30 38 77 54 103 15 27 34 73 40 103 7 30 28 78 48
186
+ 107 19 28 44 74 55 101 10 28 34 67 53 87 18 20 49 61 68 90 19 30 44 63 57
187
+ 74 13 11 36 40 52 65 59 94 232 270 306 313 20 11 57 37 82 58 25 20 70 52
188
+ 100 72 30 19 66 47 79 61 13 14 49 35 80 46 30 12 80 37 111 56 31 19 95 45
189
+ 143 58 48 12 110 37 139 55 63 40 127 55 323 76 83 9 208 28 279 41 156 29
190
+ 165 29 330 4 453 -71 514 -84 606 -130 31 -16 83 -36 116 -45 32 -9 84 -34
191
+ 115 -56 31 -21 82 -48 113 -60 32 -11 72 -33 89 -48 18 -16 59 -45 92 -65 33
192
+ -21 74 -51 90 -66 17 -15 49 -40 73 -54 52 -32 65 -61 50 -113 -8 -31 -61 -90
193
+ -277 -308 -300 -303 -361 -382 -369 -481 -2 -29 0 -66 6 -81 13 -40 88 -138
194
+ 115 -151 12 -6 54 -26 92 -44 l70 -33 945 -2 c520 -1 975 2 1012 7 64 8 191
195
+ 50 231 76 11 7 33 34 50 60 22 34 42 51 65 58 l32 9 0 1101 0 1102 -32 9 c-21
196
+ 7 -44 26 -64 55 -60 84 -77 97 -140 110 -44 9 -76 10 -127 2 -59 -9 -77 -17
197
+ -134 -62 -37 -28 -172 -155 -301 -281 -129 -127 -249 -237 -267 -245 -25 -10
198
+ -41 -11 -71 -2 -58 15 -112 45 -124 69 -6 11 -35 35 -64 54 -28 18 -58 41 -66
199
+ 50 -8 9 -41 35 -75 58 -33 22 -77 56 -99 75 -21 18 -64 46 -95 61 -31 14 -73
200
+ 39 -93 55 -20 15 -70 40 -110 55 -40 15 -97 44 -127 64 -29 21 -78 44 -107 53
201
+ -30 8 -77 31 -105 51 -42 28 -73 39 -173 60 -68 14 -154 39 -196 58 -95 43
202
+ -131 51 -343 76 -209 24 -242 32 -279 70 l-30 29 -328 0 c-312 0 -330 -1 -339
203
+ -19z"></path>
204
+ <path d="M254 2875 c-89 -16 -107 -26 -145 -78 -32 -44 -62 -66 -91 -67 -17 0
205
+ -18 -61 -18 -1140 l0 -1140 24 0 c16 0 41 -17 72 -50 40 -42 61 -55 117 -72
206
+ l69 -21 82 23 c44 12 96 30 114 39 18 9 148 132 290 272 141 141 267 261 279
207
+ 268 51 26 86 14 176 -61 32 -26 62 -48 66 -48 5 0 36 -25 70 -55 34 -30 74
208
+ -61 89 -69 15 -8 37 -28 50 -45 12 -17 50 -45 84 -62 34 -17 78 -44 98 -60 19
209
+ -16 61 -37 93 -48 32 -11 81 -37 107 -56 27 -20 76 -45 109 -56 33 -12 75 -31
210
+ 93 -44 62 -45 93 -58 191 -82 54 -12 130 -37 168 -54 68 -29 180 -58 226 -59
211
+ 62 0 183 -64 183 -96 0 -12 88 -14 639 -14 l639 0 12 30 c18 44 76 66 233 89
212
+ 89 14 160 30 200 47 34 15 106 42 159 60 54 18 112 44 130 57 47 35 85 52 146
213
+ 67 29 7 76 28 105 48 29 20 77 48 107 63 30 15 66 39 80 54 14 15 50 40 81 56
214
+ 31 15 78 46 104 69 26 22 61 46 79 54 17 7 43 26 56 42 14 16 41 41 60 56 64
215
+ 48 380 362 408 405 15 23 40 51 55 63 15 12 36 38 46 58 11 21 37 57 58 82 22
216
+ 25 49 62 62 83 13 20 38 56 57 78 19 23 50 74 69 113 19 39 46 86 59 104 14
217
+ 18 34 62 46 98 12 36 32 77 45 92 31 38 60 97 80 167 9 33 26 76 37 95 29 50
218
+ 47 103 68 206 10 52 32 117 51 155 29 56 33 74 34 140 0 94 -10 108 -101 138
219
+ -61 20 -83 21 -463 21 -226 0 -421 -4 -451 -10 -63 -12 -86 -30 -110 -85 -10
220
+ -22 -33 -63 -52 -92 -21 -31 -42 -80 -53 -123 -11 -44 -32 -93 -56 -128 -20
221
+ -32 -47 -83 -59 -115 -12 -32 -37 -77 -56 -100 -19 -23 -50 -65 -69 -94 -19
222
+ -29 -44 -57 -54 -63 -11 -5 -29 -27 -42 -47 -52 -85 -234 -277 -300 -315 -25
223
+ -15 -53 -38 -62 -51 -9 -14 -42 -39 -74 -57 -32 -18 -75 -48 -95 -66 -21 -18
224
+ -59 -44 -85 -58 -26 -13 -72 -40 -100 -59 -35 -24 -78 -41 -128 -52 -47 -11
225
+ -99 -31 -139 -56 -69 -42 -94 -49 -391 -110 -245 -51 -425 -66 -595 -50 -168
226
+ 16 -230 27 -330 61 -47 16 -123 35 -170 44 -98 17 -123 25 -172 58 -20 14 -71
227
+ 37 -114 53 -44 15 -95 40 -115 56 -20 16 -70 42 -110 59 -40 16 -88 45 -108
228
+ 63 -20 19 -55 46 -78 61 -24 14 -49 35 -55 47 -7 11 -34 33 -60 49 -50 31 -65
229
+ 61 -53 102 4 13 130 147 281 298 236 238 277 283 299 335 15 32 35 71 46 86
230
+ 12 18 19 44 19 76 0 42 -8 63 -53 138 -92 151 11 139 -1207 141 -798 2 -1030
231
+ 0 -1086 -11z"></path>
232
+ </g>
233
+ </svg>
234
+ `;return Gf=e,Gf}var Yf,U_;function yI(){if(U_)return Yf;U_=1;var e=`
235
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-play-svg">
236
+ <g>
237
+ <polygon points="4 0 23 12.5 4 25"/>
238
+ </g>
239
+ </svg>
240
+ `;return Yf=e,Yf}var Wf,G_;function wI(){if(G_)return Wf;G_=1;var e=`
241
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-pause-svg">
242
+ <g>
243
+ <rect width="8.23" height="25"/>
244
+ <rect width="8.23" height="25" x="17"/>
245
+ </g>
246
+ </svg>
247
+ `;return Wf=e,Wf}var $f,Y_;function SI(){if(Y_)return $f;Y_=1;var e=`
248
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="abcjs-loading-svg">
249
+ <circle cx="50" cy="50" fill="none" stroke-width="20" r="35" stroke-dasharray="160 55"></circle>
250
+ </svg>
251
+ `;return $f=e,$f}var Kf,W_;function xI(){if(W_)return Kf;W_=1;var e=`
252
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25">
253
+ <g>
254
+ <polygon points="5 12.5 24 0 24 25"/>
255
+ <rect width="3" height="25" x="0" y="0"/>
256
+ </g>
257
+ </svg>
258
+ `;return Kf=e,Kf}var jf,$_;function qy(){if($_)return jf;$_=1;var e=rc(),t=tc(),n=Co(),a=bI(),o=yI(),l=wI(),h=SI(),f=xI();function b(g,w){var p=this;if(typeof g=="string"){var E=g;if(g=document.querySelector(E),!g)throw new Error('Cannot find element "'+E+'" in the DOM.')}else if(!(g instanceof HTMLElement))throw new Error("The first parameter must be a valid element or selector in the DOM.");if(p.parent=g,p.options={},w&&(p.options=Object.assign({},w)),p.options.ac&&t(p.options.ac),S(p.parent,p.options),y(p),p.disable=function(I){var O=p.parent.querySelector(".abcjs-inline-audio");I?O.classList.add("abcjs-disabled"):O.classList.remove("abcjs-disabled")},p.setWarp=function(I,O){var V=p.parent.querySelector(".abcjs-midi-tempo");V.value=Math.round(O),p.setTempo(I)},p.setTempo=function(I){var O=p.parent.querySelector(".abcjs-midi-current-tempo");O&&(O.innerHTML=Math.round(I))},p.resetAll=function(){for(var I=p.parent.querySelectorAll(".abcjs-pushed"),O=0;O<I.length;O++){var V=I[O];V.classList.remove("abcjs-pushed")}},p.pushPlay=function(I){var O=p.parent.querySelector(".abcjs-midi-start");O&&(I?O.classList.add("abcjs-pushed"):O.classList.remove("abcjs-pushed"))},p.pushLoop=function(I){var O=p.parent.querySelector(".abcjs-midi-loop");O&&(I?O.classList.add("abcjs-pushed"):O.classList.remove("abcjs-pushed"))},p.setProgress=function(I,O){var V=p.parent.querySelector(".abcjs-midi-progress-background"),U=p.parent.querySelector(".abcjs-midi-progress-indicator");if(!(!V||!U)){var D=V.clientWidth,me=D*I;U.style.left=me+"px";var B=p.parent.querySelector(".abcjs-midi-clock");if(B){var ie=O*I/1e3,he=Math.floor(ie/60),ae=Math.floor(ie%60),fe=ae<10?"0"+ae:ae;B.innerHTML=he+":"+fe}}},p.options.afterResume){var N=!1;p.options.ac?N=p.options.ac.state!=="suspended":n()&&(N=n().state!=="suspended"),N&&p.options.afterResume()}}function S(g,w){var p=!!w.loopHandler,E=!!w.restartHandler,N=!!w.playHandler||!!w.playPromiseHandler,I=!!w.progressHandler,O=!!w.warpHandler,V=w.hasClock!==!1,U=`<div class="abcjs-inline-audio">
259
+ `;if(p){var D=w.repeatTitle?w.repeatTitle:"Click to toggle play once/repeat.",me=w.repeatAria?w.repeatAria:D;U+='<button type="button" class="abcjs-midi-loop abcjs-btn" title="'+D+'" aria-label="'+me+'">'+a+`</button>
260
+ `}if(E){var B=w.restartTitle?w.restartTitle:"Click to go to beginning.",ie=w.restartAria?w.restartAria:B;U+='<button type="button" class="abcjs-midi-reset abcjs-btn" title="'+B+'" aria-label="'+ie+'">'+f+`</button>
261
+ `}if(N){var he=w.playTitle?w.playTitle:"Click to play/pause.",ae=w.playAria?w.playAria:he;U+='<button type="button" class="abcjs-midi-start abcjs-btn" title="'+he+'" aria-label="'+ae+'">'+o+l+h+`</button>
262
+ `}if(I){var fe=w.randomTitle?w.randomTitle:"Click to change the playback position.",le=w.randomAria?w.randomAria:fe;U+='<button type="button" class="abcjs-midi-progress-background" title="'+fe+'" aria-label="'+le+`"><span class="abcjs-midi-progress-indicator"></span></button>
263
+ `}if(V&&(U+=`<span class="abcjs-midi-clock"></span>
264
+ `),O){var Y=w.warpTitle?w.warpTitle:"Change the playback speed.",$=w.warpAria?w.warpAria:Y,ne=w.bpm?w.bpm:"BPM";U+='<span class="abcjs-tempo-wrapper"><label><input class="abcjs-midi-tempo" type="number" min="1" max="300" value="100" title="'+Y+'" aria-label="'+$+'">%</label><span>&nbsp;(<span class="abcjs-midi-current-tempo"></span> '+ne+`)</span></span>
265
+ `}U+='<div class="abcjs-css-warning" style="font-size: 12px;color:red;border: 1px solid red;text-align: center;width: 300px;margin-top: 4px;font-weight: bold;border-radius: 4px;">CSS required: load abcjs-audio.css</div>',U+=`</div>
266
+ `,g.innerHTML=U}function M(g,w,p,E,N){var I=!0;if(n()?I=n().state==="suspended":t(),!e())throw{status:"NotSupported",message:"This browser does not support audio."};(I||N)&&p&&p.classList.add("abcjs-loading"),I?n().resume().then(function(){E?E().then(function(O){C(g,w,p,N)}):C(g,w,p,N)}):C(g,w,p,N)}function C(g,w,p,E){E?g(w).then(function(){p&&p.classList.remove("abcjs-loading")}):(g(w),p&&p.classList.remove("abcjs-loading"))}function y(g){var w=!!g.options.loopHandler,p=!!g.options.restartHandler,E=!!g.options.playHandler||!!g.options.playPromiseHandler,N=!!g.options.progressHandler,I=!!g.options.warpHandler,O=g.parent.querySelector(".abcjs-midi-start");w&&g.parent.querySelector(".abcjs-midi-loop").addEventListener("click",function(V){M(g.options.loopHandler,V,O,g.options.afterResume)}),p&&g.parent.querySelector(".abcjs-midi-reset").addEventListener("click",function(V){M(g.options.restartHandler,V,O,g.options.afterResume)}),E&&O.addEventListener("click",function(V){M(g.options.playPromiseHandler||g.options.playHandler,V,O,g.options.afterResume,!!g.options.playPromiseHandler)}),N&&g.parent.querySelector(".abcjs-midi-progress-background").addEventListener("click",function(V){M(g.options.progressHandler,V,O,g.options.afterResume)}),I&&g.parent.querySelector(".abcjs-midi-tempo").addEventListener("change",function(V){M(g.options.warpHandler,V,O,g.options.afterResume)})}return jf=b,jf}var Xf,K_;function CI(){if(K_)return Xf;K_=1;var e=By(),t=G1(),n=Co();function a(l,h,f,b,S){for(var M=new e,C=0;C<l.length;C++){var y=l[C],g=M.addTrack();if(M.setInstrument(g,y.instrument),C===0&&h)for(var w=0;w<h.length;w++){var p=h[w];M.appendNote(g,p.pitch,1/64,p.volume,p.cents)}M.appendNote(g,y.pitch,y.duration,y.volume,y.cents)}var E=n();return E.state==="suspended"?E.resume().then(function(){return o(M,f,b,S)}):o(M,f,b,S)}function o(l,h,f,b){var S=new t;return S.init({sequence:l,millisecondsPerMeasure:h,options:{soundFontUrl:f},debugCallback:b}).then(function(){return S.prime()}).then(function(){return S.start(),Promise.resolve()})}return Xf=a,Xf}var Qf,j_;function Fy(){if(j_)return Qf;j_=1;var e=qy(),t=G1(),n=O1(),a=Co();function o(){var l=this;l.warp=100,l.cursorControl=null,l.visualObj=null,l.timer=null,l.midiBuffer=null,l.options=null,l.currentTempo=null,l.control=null,l.isLooping=!1,l.isStarted=!1,l.isLoaded=!1,l.isLoading=!1,l.load=function(f,b,S){S||(S={}),S.displayPlay===void 0&&(S.displayPlay=!0),S.displayProgress===void 0&&(S.displayProgress=!0),l.control=new e(f,{loopHandler:S.displayLoop?l.toggleLoop:void 0,restartHandler:S.displayRestart?l.restart:void 0,playPromiseHandler:S.displayPlay?l.play:void 0,progressHandler:S.displayProgress?l.randomAccess:void 0,warpHandler:S.displayWarp?l.onWarp:void 0,afterResume:l.init}),l.cursorControl=b,l.disable(!0)},l.disable=function(f){l.control&&l.control.disable(f)},l.setTune=function(f,b,S){return l.visualObj=f,l.disable(!1),l.options=S||{},l.control&&(l.pause(),l.setProgress(0,1),l.control.resetAll(),l.restart(),l.isStarted=!1),l.isLooping=!1,b?l.go():Promise.resolve({status:"no-audio-context"})},l.go=function(){l.isLoading=!0;var f=l.visualObj.millisecondsPerMeasure()*100/l.warp;l.currentTempo=Math.round(l.visualObj.getBeatsPerMeasure()/f*6e4),l.control&&l.control.setTempo(l.currentTempo),l.percent=0;var b;return l.midiBuffer||(l.midiBuffer=new t),a().resume().then(function(S){return l.midiBuffer.init({visualObj:l.visualObj,options:l.options,millisecondsPerMeasure:f})}).then(function(S){return b=S,l.midiBuffer.prime()}).then(function(){var S=16;return l.cursorControl&&l.cursorControl.beatSubdivisions!==void 0&&parseInt(l.cursorControl.beatSubdivisions,10)>=1&&parseInt(l.cursorControl.beatSubdivisions,10)<=64&&(S=parseInt(l.cursorControl.beatSubdivisions,10)),l.timer=new n(l.visualObj,{beatCallback:l.beatCallback,eventCallback:l.eventCallback,lineEndCallback:l.lineEndCallback,qpm:l.currentTempo,extraMeasuresAtBeginning:l.cursorControl?l.cursorControl.extraMeasuresAtBeginning:void 0,lineEndAnticipation:l.cursorControl?l.cursorControl.lineEndAnticipation:0,beatSubdivisions:S}),l.cursorControl&&l.cursorControl.onReady&&typeof l.cursorControl.onReady=="function"&&l.cursorControl.onReady(l),l.isLoaded=!0,l.isLoading=!1,Promise.resolve({status:"created",notesStatus:b})})},l.destroy=function(){l.timer&&(l.timer.reset(),l.timer.stop(),l.timer=null),l.midiBuffer&&(l.midiBuffer.stop(),l.midiBuffer=null),l.setProgress(0,1),l.control&&l.control.resetAll()},l.play=function(){return l.runWhenReady(l._play,void 0)};function h(f){return new Promise(function(b){setTimeout(b,f)})}l.runWhenReady=function(f,b){return l.visualObj?l.isLoading?h(500).then(function(){return l.isLoading?l.runWhenReady(f,b):f(b)}):l.isLoaded?f(b):l.go().then(function(){return f(b)}):Promise.resolve({status:"loading"})},l._play=function(){return a().resume().then(function(){return l.isStarted=!l.isStarted,l.isStarted?(l.cursorControl&&l.cursorControl.onStart&&typeof l.cursorControl.onStart=="function"&&l.cursorControl.onStart(),l.midiBuffer.start(),l.timer.start(l.percent),l.control&&l.control.pushPlay(!0)):l.pause(),Promise.resolve({status:"ok"})})},l.pause=function(){l.timer&&(l.timer.pause(),l.midiBuffer.pause(),l.control&&l.control.pushPlay(!1))},l.toggleLoop=function(){l.isLooping=!l.isLooping,l.control&&l.control.pushLoop(l.isLooping)},l.restart=function(){l.timer&&(l.timer.setProgress(0),l.midiBuffer.seek(0))},l.randomAccess=function(f){return l.runWhenReady(l._randomAccess,f)},l._randomAccess=function(f){var b=f.target.classList.contains("abcjs-midi-progress-indicator")?f.target.parentNode:f.target,S=(f.x-b.getBoundingClientRect().left)/b.offsetWidth;return S<0&&(S=0),S>1&&(S=1),l.seek(S),Promise.resolve({status:"ok"})},l.seek=function(f,b){l.timer&&l.midiBuffer&&(l.timer.setProgress(f,b),l.midiBuffer.seek(f,b))},l.setWarp=function(f){if(parseInt(f,10)>0){l.warp=parseInt(f,10);var b=l.isStarted,S=l.percent;return l.destroy(),l.isStarted=!1,l.go().then(function(){return l.setProgress(S,l.midiBuffer.duration*1e3),l.control&&l.control.setWarp(l.currentTempo,l.warp),b?l.play().then(function(){return l.seek(S),Promise.resolve()}):(l.seek(S),Promise.resolve())})}return Promise.resolve()},l.onWarp=function(f){var b=f.target.value;return l.setWarp(b)},l.setProgress=function(f,b){l.percent=f,l.control&&l.control.setProgress(f,b)},l.finished=function(){if(l.timer.reset(),l.isLooping)return l.timer.start(0),l.midiBuffer.finished(),l.midiBuffer.start(),"continue";l.timer.stop(),l.isStarted&&(l.control&&l.control.pushPlay(!1),l.isStarted=!1,l.midiBuffer.finished(),l.cursorControl&&l.cursorControl.onFinished&&typeof l.cursorControl.onFinished=="function"&&l.cursorControl.onFinished(),l.setProgress(0,1))},l.beatCallback=function(f,b,S,M){var C=f/b;l.setProgress(C,S),l.cursorControl&&l.cursorControl.onBeat&&typeof l.cursorControl.onBeat=="function"&&l.cursorControl.onBeat(f,b,S,M)},l.eventCallback=function(f){if(f)l.cursorControl&&l.cursorControl.onEvent&&typeof l.cursorControl.onEvent=="function"&&l.cursorControl.onEvent(f);else return l.finished()},l.lineEndCallback=function(f,b){l.cursorControl&&l.cursorControl.onLineEnd&&typeof l.cursorControl.onLineEnd=="function"&&l.cursorControl.onLineEnd(f,b)},l.getUrl=function(){return l.midiBuffer.download()},l.download=function(f){var b=l.getUrl(),S=document.createElement("a");document.body.appendChild(S),S.setAttribute("style","display: none;"),S.href=b,S.download=f||"output.wav",S.click(),window.URL.revokeObjectURL(b),document.body.removeChild(S)}}return Qf=o,Qf}var Zf,X_;function zy(){if(X_)return Zf;X_=1;var e=Ry(),t;return function(){function n(y,g){for(var w in g)g.hasOwnProperty(w)&&y.setAttribute(w,g[w]);return y}function a(){this.trackstrings="",this.trackcount=0,this.noteOnAndChannel="%90",this.noteOffAndChannel="%80"}a.prototype.setTempo=function(y){this.trackcount===0&&(this.startTrack(),this.track+="%00%FF%51%03"+S(Math.round(6e7/y),6),this.endTrack())},a.prototype.setGlobalInfo=function(y,g,w,p){if(this.trackcount===0){this.startTrack();var E=Math.round(6e7/y);this.track+="%00%FF%51%03"+S(E,6),w&&(this.track+=h(w)),p&&(this.track+=f(p)),g&&(this.track+=l(g,"%01")),this.endTrack()}},a.prototype.startTrack=function(){this.noteWarped={},this.track="",this.trackName="",this.trackInstrument="",this.silencelength=0,this.trackcount++,this.instrument&&this.setInstrument(this.instrument)},a.prototype.endTrack=function(){this.track=this.trackName+this.trackInstrument+this.track;var y=S(this.track.length/3+4,8);this.track="MTrk"+y+this.track+"%00%FF%2F%00",this.trackstrings+=this.track},a.prototype.setText=function(y,g){switch(y){case"name":this.trackName=l(g,"%03");break}},a.prototype.setInstrument=function(y){this.trackInstrument="%00%C0"+S(y,2),this.instrument=y},a.prototype.setChannel=function(y,g){this.channel=y;var w="%00%B"+this.channel.toString(16);this.track+=w+"%79%00",this.track+=w+"%40%00",this.track+=w+"%5B%30",g||(g=0),g=Math.round((g+1)*64),this.track+=w+"%0A"+S(g,2),this.track+=w+"%07%64",this.noteOnAndChannel="%9"+this.channel.toString(16),this.noteOffAndChannel="%8"+this.channel.toString(16)};var o=4096;a.prototype.startNote=function(y,g,w){if(this.track+=C(this.silencelength),this.silencelength=0,w){this.track+="%e"+this.channel.toString(16);var p=Math.round(e(w)*o);this.track+=M(8192+p),this.track+=C(0),this.noteWarped[y]=!0}this.track+=this.noteOnAndChannel,this.track+="%"+y.toString(16)+S(g,2)},a.prototype.endNote=function(y){this.track+=C(this.silencelength),this.silencelength=0,this.noteWarped[y]&&(this.track+="%e"+this.channel.toString(16),this.track+=M(8192),this.track+=C(0),this.noteWarped[y]=!1),this.track+=this.noteOffAndChannel,this.track+="%"+y.toString(16)+"%00"},a.prototype.addRest=function(y){this.silencelength+=y,this.silencelength<0&&(this.silencelength=0)},a.prototype.getData=function(){return"data:audio/midi,MThd%00%00%00%06%00%01"+S(this.trackcount,4)+"%01%e0"+this.trackstrings},a.prototype.embed=function(y,g){var w=this.getData(),p=n(document.createElement("a"),{href:w});if(p.innerHTML="download midi",y.insertBefore(p,y.firstChild),!g){var E=n(document.createElement("embed"),{src:w,type:"video/quicktime",controller:"true",autoplay:"false",loop:"false",enablejavascript:"true",style:"display:block; height: 20px;"});y.insertBefore(E,y.firstChild)}};function l(y,g){for(var w="",p=0;p<y.length;p++)w+=S(y.charCodeAt(p),2);return"%00%FF"+g+S(w.length/3,2)+w}function h(y){if(!y||!y.accidentals)return"";for(var g="%00%FF%59%02",w=0,p=256,E=0;E<y.accidentals.length;E++)y.accidentals[E].acc==="sharp"?w++:y.accidentals[E].acc==="flat"&&p--;var N=S(p!==256?p:w,2),I=y.mode==="m"?"%01":"%00";return g+N+I}function f(y){var g="%00%FF%58%04"+S(y.num,2),w={1:0,2:1,4:2,8:3,16:4,32:5},p=w[y.den];if(!p)return"";g+=S(p,2);var E;switch(y.num+"/"+y.den){case"2/4":case"3/4":case"4/4":case"5/4":E=24;break;case"6/4":E=72;break;case"2/2":case"3/2":case"4/2":E=48;break;case"3/8":case"6/8":case"9/8":case"12/8":E=36;break}return E?(g+=S(E,2),g+"%08"):""}function b(y){for(var g="",w=0;w<y.length;w+=2)g+="%",g+=y.substr(w,2);return g}function S(y,g){var w=y.toString(16);for(w=w.split(".")[0];w.length<g;)w="0"+w;return w.length>g&&(w=w.substring(0,g)),b(w)}function M(y){y=Math.round(y);var g=y%128,w=y-g;return S(w*2+g,4)}function C(y){var g=0,w=[];for(y=Math.round(y);y!==0;)w.push(y&127),y=y>>7;for(var p=w.length-1;p>=0;p--){g=g<<8;var E=w[p];p!==0&&(E=E|128),g=g|E}var N=g.toString(16).length;return N+=N%2,S(g,N)}t=function(){return new a}}(),Zf=t,Zf}var Jf,Q_;function kI(){if(Q_)return Jf;Q_=1;var e=zy(),t;return function(){var n=1920;t=function(l,h){h===void 0&&(h={});var f=l.setUpAudio(h),b=e(),S=l.metaText?l.metaText.title:void 0;S&&S.length>128&&(S=S.substring(0,124)+"...");var M=l.getKeySignature(),C=l.getMeterFraction(),y=f.tempo,g=y/60;if(C.den==8){var w=l.millisecondsPerMeasure();y=6e4/(w/C.num)/2,g=y/60}b.setGlobalInfo(y,S,M,C);for(var p=0;p<f.tracks.length;p++){b.startTrack();for(var E={},N=0;N<f.tracks[p].length;N++){var I=f.tracks[p][N];switch(I.cmd){case"text":b.setText(I.type,I.text);break;case"program":var O=0;h.pan&&h.pan.length>p&&(O=h.pan[p]),I.instrument===128?(b.setChannel(9,O),b.setInstrument(0)):(b.setChannel(I.channel,O),b.setInstrument(I.instrument));break;case"note":var V=I.gap*g,U=I.start,D=U+I.duration-V;E[U]||(E[U]=[]),E[U].push({pitch:I.pitch,volume:I.volume,cents:I.cents}),E[D]||(E[D]=[]),E[D].push({pitch:I.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+I.cmd)}}a(b,E,n),b.endTrack()}return b.getData()};function a(o,l,h){for(var f=Object.keys(l),b=0;b<f.length;b++)f[b]=parseFloat(f[b]);f.sort(function(p,E){return p-E});for(var S=0,M=0;M<f.length;M++){var C=l[f[M]];if(f[M]>S){var y=(f[M]-S)*h;o.addRest(y),S=f[M]}for(var g=0;g<C.length;g++){var w=C[g];w.volume?o.startNote(w.pitch,w.volume,w.cents):o.endNote(w.pitch)}}}}(),Jf=t,Jf}var ed,Z_;function MI(){if(Z_)return ed;Z_=1;var e=ec(),t=kI(),n=function(l,h){var f={};if(h)for(var b in h)h.hasOwnProperty(b)&&(f[b]=h[b]);f.generateInline=!1;function S(M,C,y){var g=t(C,f);switch(f.midiOutputType){case"encoded":return g;case"binary":var w=g.replace("data:audio/midi,","");w=w.replace(/MThd/g,"%4d%54%68%64"),w=w.replace(/MTrk/g,"%4d%54%72%6b");for(var p=new ArrayBuffer(w.length/3),E=new Uint8Array(p),N=0;N<w.length/3;N++){var I=N*3+1,O=parseInt(w.substring(I,I+2),16);E[N]=O}return E;case"link":default:return o(C,f,g,y)}}return typeof l=="string"?e.renderEngine(S,"*",l,f):S(null,l,0)};function a(l){var h={};return l&&h.toString.call(l)==="[object Function]"}var o=function(l,h,f,b){var S=["abcjs-download-midi","abcjs-midi-"+b];h.downloadClass&&S.push(h.downloadClass);var M='<div class="'+S.join(" ")+'">';h.preTextDownload&&(M+=h.preTextDownload);var C=l.metaText&&l.metaText.title?l.metaText.title:"Untitled",y;h.downloadLabel&&a(h.downloadLabel)?y=h.downloadLabel(l,b):h.downloadLabel?y=h.downloadLabel.replace(/%T/,C):y='Download MIDI for "'+C+'"',C=C.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_");var g=h.fileName?h.fileName:C+".midi";return M+='<a download="'+g+'" href="'+f+'">'+y+"</a>",h.postTextDownload&&(M+=h.postTextDownload),M+"</div>"};return ed=n,ed}var td,J_;function Hy(){if(J_)return td;J_=1;try{if(typeof window.CustomEvent!="function"){var e=function(n,a){a=a||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(n,a.bubbles,a.cancelable,a.detail),o};e.prototype=window.Event.prototype,window.CustomEvent=e}}catch{}var t=function(n){typeof n=="string"?this.textarea=document.getElementById(n):this.textarea=n,this.initialText=this.textarea.value,this.isDragging=!1};return t.prototype.addSelectionListener=function(n){this.textarea.onmousemove=function(a){this.isDragging&&n.fireSelectionChanged()}},t.prototype.addChangeListener=function(n){this.changelistener=n,this.textarea.onkeyup=function(){n.fireChanged()},this.textarea.onmousedown=function(){this.isDragging=!0,n.fireSelectionChanged()},this.textarea.onmouseup=function(){this.isDragging=!1,n.fireChanged()},this.textarea.onchange=function(){n.fireChanged()}},t.prototype.getSelection=function(){return{start:this.textarea.selectionStart,end:this.textarea.selectionEnd}},t.prototype.setSelection=function(n,a){if(this.textarea.setSelectionRange)this.textarea.setSelectionRange(n,a);else if(this.textarea.createTextRange){var o=this.textarea.createTextRange();o.collapse(!0),o.moveEnd("character",a),o.moveStart("character",n),o.select()}this.textarea.focus()},t.prototype.getString=function(){return this.textarea.value},t.prototype.setString=function(n){this.textarea.value=n,this.initialText=this.getString(),this.changelistener&&this.changelistener.fireChanged()},t.prototype.getElem=function(){return this.textarea},td=t,td}var rd,e3;function EI(){if(e3)return rd;e3=1;var e=Ds(),t=Fy(),n=rc(),a=Dy(),o=Hy();function l(f){var b={},S;if(f.abcjsParams)for(S in f.abcjsParams)f.abcjsParams.hasOwnProperty(S)&&(b[S]=f.abcjsParams[S]);if(f.midi_options)for(S in f.midi_options)f.midi_options.hasOwnProperty(S)&&(b[S]=f.midi_options[S]);if(f.parser_options)for(S in f.parser_options)f.parser_options.hasOwnProperty(S)&&(b[S]=f.parser_options[S]);if(f.render_options)for(S in f.render_options)f.render_options.hasOwnProperty(S)&&(b[S]=f.render_options[S]);return b.tablature&&f.warnings_id&&(b.tablature.warnings_id=f.warnings_id),b}var h=function(f,b){this.abcjsParams=l(b),b.indicate_changed&&(this.indicate_changed=!0),typeof f=="string"?this.editarea=new o(f):this.editarea=f,this.editarea.addSelectionListener(this),this.editarea.addChangeListener(this),b.canvas_id?this.div=b.canvas_id:b.paper_id?this.div=b.paper_id:(this.div=document.createElement("DIV"),this.editarea.getElem().parentNode.insertBefore(this.div,this.editarea.getElem())),typeof this.div=="string"&&(this.div=document.getElementById(this.div)),b.selectionChangeCallback&&(this.selectionChangeCallback=b.selectionChangeCallback),this.clientClickListener=this.abcjsParams.clickListener,this.abcjsParams.clickListener=this.highlight.bind(this),b.synth&&n()&&(this.synth={el:b.synth.el,cursorControl:b.synth.cursorControl,options:b.synth.options}),b.generate_midi&&(this.generate_midi=b.generate_midi,this.abcjsParams.generateDownload&&(typeof b.midi_download_id=="string"?this.downloadMidi=document.getElementById(b.midi_download_id):b.midi_download_id&&(this.downloadMidi=b.midi_download_id)),this.abcjsParams.generateInline!==!1&&(typeof b.midi_id=="string"?this.inlineMidi=document.getElementById(b.midi_id):b.midi_id&&(this.inlineMidi=b.midi_id))),b.warnings_id?typeof b.warnings_id=="string"?this.warningsdiv=document.getElementById(b.warnings_id):this.warningsdiv=b.warnings_id:b.generate_warnings&&(this.warningsdiv=document.createElement("div"),this.div.parentNode.insertBefore(this.warningsdiv,this.div)),this.onchangeCallback=b.onchange,this.currentAbc="",this.tunes=[],this.bReentry=!1,this.parseABC(),this.modelChanged(),this.addClassName=function(S,M){var C=function(y,g){var w=y.className;return w.length>0&&(w===g||new RegExp("(^|\\s)"+g+"(\\s|$)").test(w))};return C(S,M)||(S.className+=(S.className?" ":"")+M),S},this.removeClassName=function(S,M){return S.className=e.strip(S.className.replace(new RegExp("(^|\\s+)"+M+"(\\s+|$)")," ")),S},this.setReadOnly=function(S){var M="abc_textarea_readonly",C=this.editarea.getElem();S?(C.setAttribute("readonly","yes"),this.addClassName(C,M)):(C.removeAttribute("readonly"),this.removeClassName(C,M))}};return h.prototype.redrawMidi=function(){if(this.generate_midi&&!this.midiPause){var f=new window.CustomEvent("generateMidi",{detail:{tunes:this.tunes,abcjsParams:this.abcjsParams,downloadMidiEl:this.downloadMidi,inlineMidiEl:this.inlineMidi,engravingEl:this.div}});window.dispatchEvent(f)}if(this.synth){var b=this.synth.synthControl;this.synth.synthControl||(this.synth.synthControl=new t,this.synth.synthControl.load(this.synth.el,this.synth.cursorControl,this.synth.options)),this.synth.synthControl.setTune(this.tunes[0],b,this.synth.options)}},h.prototype.modelChanged=function(){if(!this.bReentry){this.bReentry=!0;try{this.timerId=null,this.synth&&this.synth.synthControl&&this.synth.synthControl.disable(!0),this.tunes=a(this.div,this.currentAbc,this.abcjsParams),this.tunes.length>0&&(this.warnings=this.tunes[0].warnings),this.redrawMidi()}catch(f){console.error("ABCJS error: ",f),this.warnings||(this.warnings=[]),this.warnings.push(f.message)}this.warningsdiv&&(this.warningsdiv.innerHTML=this.warnings?this.warnings.join("<br />"):"No errors"),this.updateSelection(),this.bReentry=!1}},h.prototype.paramChanged=function(f){if(f)for(var b in f)f.hasOwnProperty(b)&&(this.abcjsParams[b]=f[b]);this.currentAbc="",this.fireChanged()},h.prototype.synthParamChanged=function(f){if(this.synth){if(this.synth.options={},f)for(var b in f)f.hasOwnProperty(b)&&(this.synth.options[b]=f[b]);this.currentAbc="",this.fireChanged()}},h.prototype.parseABC=function(){var f=this.editarea.getString();return f===this.currentAbc?(this.updateSelection(),!1):(this.currentAbc=f,!0)},h.prototype.updateSelection=function(){var f=this.editarea.getSelection();try{this.tunes.length>0&&this.tunes[0].engraver&&this.tunes[0].engraver.rangeHighlight(f.start,f.end)}catch{}this.selectionChangeCallback&&this.selectionChangeCallback(f.start,f.end)},h.prototype.fireSelectionChanged=function(){this.updateSelection()},h.prototype.setDirtyStyle=function(f){if(this.indicate_changed!==void 0){var b=function(y,g){var w=function(p,E){var N=p.className;return N.length>0&&(N===E||new RegExp("(^|\\s)"+E+"(\\s|$)").test(N))};return w(y,g)||(y.className+=(y.className?" ":"")+g),y},S=function(y,g){return y.className=e.strip(y.className.replace(new RegExp("(^|\\s+)"+g+"(\\s+|$)")," ")),y},M="abc_textarea_dirty",C=this.editarea.getElem();f?b(C,M):S(C,M)}},h.prototype.fireChanged=function(){if(!this.bIsPaused&&this.parseABC()){var f=this;this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){f.modelChanged()},300);var b=this.isDirty();this.wasDirty!==b&&(this.wasDirty=b,this.setDirtyStyle(b)),this.onchangeCallback&&this.onchangeCallback(this)}},h.prototype.setNotDirty=function(){this.editarea.initialText=this.editarea.getString(),this.wasDirty=!1,this.setDirtyStyle(!1)},h.prototype.isDirty=function(){return this.indicate_changed===void 0?!1:this.editarea.initialText!==this.editarea.getString()},h.prototype.highlight=function(f,b,S,M,C,y){this.editarea.setSelection(f.startChar,f.endChar),this.selectionChangeCallback&&this.selectionChangeCallback(f.startChar,f.endChar),this.clientClickListener&&this.clientClickListener(f,b,S,M,C,y)},h.prototype.pause=function(f){this.bIsPaused=f,f||this.fireChanged()},h.prototype.millisecondsPerMeasure=function(){return!this.synth||!this.synth.synthControl||!this.synth.synthControl.visualObj?0:this.synth.synthControl.visualObj.millisecondsPerMeasure()},h.prototype.pauseMidi=function(f){this.midiPause=f,f||this.redrawMidi()},rd=h,rd}var id,t3;function AI(){if(t3)return id;t3=1;var e=WT(),t=$T(),n=ec(),a=gy(),o=uP(),l={};l.signature="abcjs-basic v"+e,Object.keys(t).forEach(function(O){l[O]=t[O]}),Object.keys(n).forEach(function(O){l[O]=n[O]}),l.renderAbc=Dy(),l.tuneMetrics=pI(),l.TimingCallbacks=O1();var h=na();l.setGlyph=h.setSymbol,l.strTranspose=o;var f=G1(),b=V1(),S=U1(),M=By(),C=qy(),y=tc(),g=Co(),w=rc(),p=CI(),E=Fy(),N=MI(),I=zy();return l.synth={CreateSynth:f,instrumentIndexToName:b,pitchToNoteName:S,SynthController:E,SynthSequence:M,CreateSynthControl:C,registerAudioContext:y,activeAudioContext:g,supportsAudio:w,playEvent:p,getMidiFile:N,sequence:a,midiRenderer:I},l.Editor=EI(),l.EditArea=Hy(),id=l,id}var TI=AI();const PI=Fl(TI),II=Vr({name:"MusicScoreRenderer",props:{abcString:{type:String,required:!0}},mounted(){PI.renderAbc("abc",this.abcString)}}),NI={id:"abc"};function LI(e,t,n,a,o,l){return St(),Pt("div",NI)}const OI=Ur(II,[["render",LI]]);function DI(){const e=[];for(let t=0;t<5;t++)e.push(Rl[Math.floor(Math.random()*Rl.length)]);return e}const RI=Vr({name:"IdentifyKeyView",components:{RadioMultipleChoice:Bl,MusicScoreRenderer:OI},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"IdentifyKeyView"),a=ii(n),o=Lt("");a.question.value=new Vy(e.data);const l=Sr(()=>a.question.value),h=Sr(()=>{var b,S;const M=DI();return M.includes(((b=l.value)==null?void 0:b.key)||"")||(M[Math.floor(Math.random()*M.length)]=((S=l.value)==null?void 0:S.key)||""),M});return{...n,...a,answer:o,question:l,choices:h,submit:()=>{}}}}),BI={"data-viewable":"IdentifyKeyView"};function qI(e,t,n,a,o,l){const h=hr("MusicScoreRenderer"),f=hr("RadioMultipleChoice");return St(),Pt("div",BI,[e.question?(St(),Pt(qr,{key:0},[xr(h,{"key-signature":`X:1
267
+ K:${e.question.key}
268
+ ||`,"abc-string":"''"},null,8,["key-signature"]),t[0]||(t[0]=Qr(" This signature is for the major key: _____ ")),xr(f,{"choice-list":e.choices},null,8,["choice-list"])],64)):Or("",!0)])}const FI=Ur(RI,[["render",qI]]),Rl=["C","G","D","A","E","B","F#","C#","F","Bb","Eb","Ab","Db","Gb","Cb"],Y1=class Sl extends fi{constructor(t){super(t),rt(this,"key"),this.key=Sl.getKey(t[0].key)}static getKey(t){return Rl[t]}isCorrect(t){return console.log(`answer: ${JSON.stringify(t)}, key: ${this.key}`),this.key===t.choiceList[t.selection]}dataShapes(){return Sl.dataShapes}views(){return Sl.views}};rt(Y1,"dataShapes",[{name:di.SIGHTSING_IdentifyKey,fields:[{name:"key",type:br.NUMBER,validator:{test:e=>{const t=parseInt(e);return t>=0&&t<=Rl.length?{msg:"",status:ur.ok}:{msg:"Please enter a number between 0 and 11",status:ur.error}}}}]}]);rt(Y1,"views",[FI]);let Vy=Y1;const Uy=new Ns("sightSing",[Vy]),zI=Vr({name:"LetterQuestionView",props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"LetterQuestionView"),a=ii(n),o=Lt(null);a.question.value=new Gy(e.data);const l=Sr(()=>a.question.value),h=f=>{var b;if(!l.value)return;const S=f.key.toLowerCase(),M=l.value.letter.toLowerCase();if(S===M){(b=o.value)==null||b.classList.add("pressed");const C=y=>{var g;y.key.toLowerCase()===M&&((g=o.value)==null||g.classList.remove("pressed"),a.submitAnswer(S),window.removeEventListener("keyup",C))};window.addEventListener("keyup",C)}else a.submitAnswer(S)};return Nn(()=>{window.addEventListener("keypress",h)}),ql(()=>{window.removeEventListener("keypress",h)}),{...a,...n,letterDisplay:o,question:l}}}),HI={"data-viewable":"LetterQuestionView"};function VI(e,t,n,a,o,l){return St(),Pt("div",HI,[e.question?(St(),Pt(qr,{key:0},[t[0]||(t[0]=ht("p",{class:"text-h5"},"Type this letter!",-1)),ht("div",{ref:"letterDisplay",class:"letter-display"},ir(e.question.letter),513)],64)):Or("",!0)])}const UI=Ur(zI,[["render",VI],["__scopeId","data-v-4ae4db54"]]),GI=function(){const e=[];for(let t=0;t<26;t++)e.push({letter:String.fromCharCode(65+t)});return e},x0=class Bd extends fi{constructor(t){super(t),rt(this,"letter"),this.letter=t[0].letter}evaluate(t,n){return{isCorrect:this.isCorrect(t),performance:this.displayedSkill(t,n)}}displayedSkill(t,n){return this.isCorrect(t)?n<3e3?1:1-(n-3e3)/7e3*.75:0}dataShapes(){return Bd.dataShapes}views(){return Bd.views}isCorrect(t){const n=t.toLowerCase()===this.letter.toLowerCase();return console.log(`singleLetter Q isCorrect: ${n}`),n}};rt(x0,"dataShapes",[{name:di.TYPING_singleLetter,fields:[{name:"letter",type:br.STRING,validator:{instructions:"Enter a single letter",test:function(e){return!e||e.length!==1||!/[a-zA-Z]/.test(e)?{status:ur.error,msg:"Input must be a single letter"}:{status:ur.ok,msg:""}}}}]}]);rt(x0,"views",[UI]);rt(x0,"acceptsUserData",!0);rt(x0,"seedData",GI());let Gy=x0;const YI=Vr({name:"FallingLettersView",props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"FallingLettersView"),a=ii(n),o=Lt(null),l=Lt([]),h=Lt(!1),f=Lt(""),b=Lt(30),S=Lt(0),M=Lt([]),C=Lt([]),y=Lt({currentSpeed:2,letterId:0,gameLoop:null,lastSpawn:0,lastUpdate:0,spawnInterval:1e3}),g=()=>{M.value=Array.from({length:7},(V,U)=>({id:U,left:20+U*Math.random()*30-10,height:100+Math.random()*120,scale:1+Math.random()*2}))},w=()=>{if(!o.value)return;const V={id:y.value.letterId++,char:String.fromCharCode(65+Math.floor(Math.random()*26)),x:Math.random()*(o.value.clientWidth-30),y:-30};l.value.push(V)},p=()=>{h.value=!0,f.value="You Win!",a.submitAnswer({lettersTyped:S.value,win:!0,percentage:1})},E=()=>{var V;h.value=!0,f.value="Game Over!",a.submitAnswer({lettersTyped:S.value,percentage:b.value/(((V=a.question.value)==null?void 0:V.gameLength)||30),win:!1})},N=V=>{if(h.value)return;const U=(V-y.value.lastUpdate)/1e3;if(y.value.lastUpdate=V,b.value-=U,a.question.value&&(y.value.currentSpeed+=a.question.value.acceleration*U),b.value<=0){p();return}V-y.value.lastSpawn>=y.value.spawnInterval&&(w(),y.value.lastSpawn=V,y.value.spawnInterval=Math.max(500,y.value.spawnInterval-10)),o.value&&(l.value=l.value.filter(D=>(D.y+=y.value.currentSpeed,D.y>o.value.clientHeight?(E(),!1):!0))),y.value.gameLoop=requestAnimationFrame(N)},I=V=>{if(h.value)return;const U=V.key.toUpperCase(),D=l.value.findIndex(me=>me.char===U);D!==-1&&(C.value.push({id:Date.now(),x:l.value[D].x,y:l.value[D].y}),setTimeout(()=>{C.value=C.value.filter(me=>me.id!==C.value[C.value.length-1].id)},300),l.value.splice(D,1),S.value++)},O=()=>{if(!a.question.value){n.logger.error("Question not initialized");return}b.value=a.question.value.gameLength,S.value=0,l.value=[],h.value=!1,f.value="",y.value={currentSpeed:a.question.value.initialSpeed,letterId:0,gameLoop:null,lastSpawn:performance.now(),lastUpdate:performance.now(),spawnInterval:a.question.value.spawnInterval*1e3},y.value.gameLoop=requestAnimationFrame(N)};return Nn(()=>{try{a.question.value=new Yy(e.data),a.maxAttemptsPerView.value=1,window.addEventListener("keypress",I),g(),O()}catch(V){n.logger.error("Error initializing game:",V)}}),ql(()=>{window.removeEventListener("keypress",I),y.value.gameLoop&&cancelAnimationFrame(y.value.gameLoop)}),{...a,gameArea:o,letters:l,gameOver:h,gameOverMessage:f,timeLeft:b,score:S,treePositions:M,explosions:C}}}),WI={class:"game-container"},$I={class:"stats"},KI={class:"time"},jI={class:"score"},XI={ref:"gameArea",class:"game-area"},QI={class:"letter-text"},ZI={class:"trees"},JI={key:0,class:"game-over"};function eN(e,t,n,a,o,l){return St(),Pt("div",WI,[ht("div",$I,[ht("div",KI,"Time: "+ir(e.timeLeft.toFixed(1))+"s",1),ht("div",jI,"Score: "+ir(e.score),1)]),ht("div",XI,[(St(!0),Pt(qr,null,An(e.letters,h=>(St(),Pt("div",{key:h.id,class:"falling-letter",style:ei({left:h.x+"px",top:h.y+"px"})},[t[0]||(t[0]=ht("div",{class:"meteor-effect"},null,-1)),ht("span",QI,ir(h.char),1)],4))),128)),(St(!0),Pt(qr,null,An(e.explosions,h=>(St(),Pt("div",{key:h.id,class:"explosion",style:ei({left:h.x+"px",top:h.y+"px"})},[(St(),Pt(qr,null,An(12,f=>ht("div",{key:f,class:"particle"})),64))],4))),128)),t[2]||(t[2]=ht("div",{class:"grass-container"},[ht("div",{class:"grass"}),ht("div",{class:"grass-overlay"})],-1)),ht("div",ZI,[(St(!0),Pt(qr,null,An(e.treePositions,h=>(St(),Pt("div",{key:h.id,class:"tree",style:ei({left:`${h.left}%`,height:`${h.height}px`,transform:`scale(${h.scale})`})},t[1]||(t[1]=[ht("div",{class:"tree-crown"},null,-1),ht("div",{class:"tree-trunk"},null,-1)]),4))),128))])],512),e.gameOver?(St(),Pt("div",JI,ir(e.gameOverMessage),1)):Or("",!0)])}const tN=Ur(YI,[["render",eN],["__scopeId","data-v-3c9f2af5"]]),rN=function(){return[{gameLength:30,initialSpeed:2,acceleration:.1,spawnInterval:1}]},C0=class qd extends fi{constructor(t){super(t),rt(this,"gameLength"),rt(this,"initialSpeed"),rt(this,"acceleration"),rt(this,"spawnInterval"),this.gameLength=t[0].gameLength,this.initialSpeed=t[0].initialSpeed,this.acceleration=t[0].acceleration,this.spawnInterval=t[0].spawnInterval}evaluate(t){return{isCorrect:this.isCorrect(t),performance:this.displayedSkill(t)}}displayedSkill(t){return t.win?1:t.percentage}dataShapes(){return qd.dataShapes}views(){return qd.views}isCorrect(t){return t.win}};rt(C0,"dataShapes",[{name:di.TYPING_fallingLetters,fields:[{name:"gameLength",type:br.NUMBER},{name:"initialSpeed",type:br.NUMBER},{name:"acceleration",type:br.NUMBER},{name:"spawnInterval",type:br.NUMBER,validator:{instructions:"How often should a new letter spawn? (in seconds)",test:e=>typeof e=="string"?parseFloat(e)>0?{status:ur.ok,msg:""}:{status:ur.error,msg:"Must be greater than 0"}:{status:ur.error,msg:"Unexpected non-string input."},placeholder:"1"}}]}]);rt(C0,"views",[tN]);rt(C0,"acceptsUserData",!0);rt(C0,"seedData",rN());let Yy=C0;const Wy=new Ns("typing",[Gy,Yy]),iN=Vr({name:"IdentifyVocab",components:{AudioAutoPlayer:zd,UserInputString:s7},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){const n=ri(e,t,"IdentifyVocab"),a=ii(n),o=Lt("");a.question.value=new $y(e.data);const l=Sr(()=>a.question.value);return{...n,...a,answer:o,question:l,submit:()=>{l.value&&a.submitAnswer(o.value)}}}}),nN={"data-viewable":"IdentifyVocab"},sN={key:0,class:"text-h6"};function aN(e,t,n,a,o,l){const h=hr("UserInputString"),f=hr("center"),b=hr("audio-auto-player");return St(),Pt("div",nN,[e.question?(St(),Pt(qr,{key:0},[t[1]||(t[1]=ht("span",{class:"text-h5"}," Spell the word: ",-1)),xr(h,{modelValue:e.answer,"onUpdate:modelValue":t[0]||(t[0]=S=>e.answer=S)},null,8,["modelValue"]),xr(f,null,{default:_n(()=>[e.priorAttempts?(St(),Pt("span",sN,ir(e.question.word),1)):Or("",!0)]),_:1}),xr(f,null,{default:_n(()=>[xr(b,{src:[e.getURL("WordAudio"),e.getURL("SentenceAudio"),e.getURL("WordAudio")]},null,8,["src"])]),_:1})],64)):Or("",!0)])}const oN=Ur(iN,[["render",aN]]),lN=[{name:"Word",type:br.STRING,validator:i3.NonEmptyString},{name:"ExampleSentence",type:br.STRING},{name:"WordAudio",type:br.AUDIO},{name:"SentenceAudio",type:br.AUDIO}],W1=class Fd extends fi{constructor(t){super(t),rt(this,"word"),rt(this,"sentence"),rt(this,"audio_word"),rt(this,"audio_sentence"),this.word=t[0].Word,this.sentence=t[0].Sentence,this.audio_word=t[0].WordAudio,this.audio_sentence=t[0].SentenceAudio}isCorrect(t){return t===this.word}dataShapes(){return Fd.dataShapes}views(){return Fd.views}};rt(W1,"dataShapes",[{fields:lN,name:di.WORDWORK_Spelling}]);rt(W1,"views",[oN]);let $y=W1;const Ky=new Ns("wordWork",[$y]);class jy{constructor(t){rt(this,"courseList"),rt(this,"cachedRawViews",null),this.courseList=t}get courses(){return this.courseList}getCourse(t){return this.courseList.find(n=>n.name===t)}allViewsRaw(){if(!this.cachedRawViews){const t=this.allViews();this.cachedRawViews=Object.fromEntries(Object.entries(t).map(([n,a])=>[n,o7(a)]))}return this.cachedRawViews}allViews(){const t={};return this.courseList.forEach(n=>{Object.assign(t,n.allViewsMap)}),t}getView(t){let n;typeof t=="string"?n=Rg.getViewDescriptor(t):n=t;const a=this.getCourse(n.course);if(a){const o=a.getQuestion(n.questionType);if(o){const l=o.views.find(h=>h.name===n.view);if(l)return l;throw console.error(`QuestionView ${n.view} not found in course ${n.course}
269
+
270
+ descriptor: ${JSON.stringify(n)}
271
+
272
+ course: ${a.name}
273
+ question: ${o.name}
274
+ views: ${o.views.map(h=>h.name).join(", ")}
275
+ `),new Error(`view ${n.view} does not exist.`)}else throw console.error(`Question ${n.questionType} not found in course ${n.course}
276
+
277
+ descriptor: ${JSON.stringify(n)}
278
+
279
+ course: ${a.name}
280
+ questions: ${a.questions.map(l=>l.name).join(", ")}
281
+ `),new Error(`question ${n.questionType} does not exist.`)}else throw console.error(`Course ${n.course} not found.
282
+
283
+ descriptor: ${JSON.stringify(n)}`),new Error(`course ${n.course} does not exist.`)}toString(){let t="";return this.courses.forEach(n=>{t+=`Course: ${n.name}
284
+ `,n.questions.forEach(a=>{t+=` Question: ${a.name}
285
+ `,a.views.forEach(o=>{t+=` View: ${o.name}
286
+ `})})}),t}allDataShapesRaw(){const t=[];return this.courseList.forEach(n=>{n.questions.forEach(a=>{a.dataShapes.forEach(o=>{t.includes(o)||t.push(o)})})}),t}allDataShapes(){const t=[];return this.courseList.forEach(n=>{n.questions.forEach(a=>{a.dataShapes.forEach(o=>{t.findIndex(l=>l.course===n.name&&l.dataShape===o.name)===-1&&t.push({course:n.name,dataShape:o.name,displayable:a})})})}),t}getDataShape(t){let n;if(this.getCourse(t.course).questions.forEach(a=>{a.dataShapes.forEach(o=>{o.name===t.dataShape&&(n=o)})}),n)return n;throw new Error(`DataShape ${Rg.getDataShapeString(t)} not found`)}}const cN=new jy([W3,Ky,H3,E7,ay,cy,Uy,q3,Wy]),fN=Object.freeze(Object.defineProperty({__proto__:null,BlanksCard:go,BlanksCardDataShapes:a3,CourseList:jy,SkMidi:c1,SyllableSeqVis:sy,SyllableSequence:zl,allCourses:cN,chess:q3,eventsToSyllableSequence:on,french:H3,gradeSpellingAttempt:s3,math:W3,piano:ay,pitch:cy,sightSing:Uy,typing:Wy,wordWork:Ky},Symbol.toStringTag,{value:"Module"}));export{i3 as V,cN as a,fN as i};
287
+ //# sourceMappingURL=index-BnAv1C72.js.map