orbitchat 2.2.7 → 2.2.8
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.
- package/bin/orbitchat.js +56 -32
- package/dist/assets/{_basePickBy-1MakYQmz-CFyJwR0u.js → _basePickBy-1MakYQmz-ydNwd1l_.js} +1 -1
- package/dist/assets/{_baseUniq-Cd4llU-Q-D06fzDcA.js → _baseUniq-Cd4llU-Q-Cdw60MU4.js} +1 -1
- package/dist/assets/{api-Ciw0inlZ.js → api-L84wIOvt.js} +1 -1
- package/dist/assets/{arc-b8oyw-lz-BCfULEh7.js → arc-b8oyw-lz-1LLYREoj.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-BuSDV2Do-DuPWl-E8.js → architectureDiagram-VXUJARFQ-BuSDV2Do-_okKpoAJ.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-jQHtez-j-C4kvu0Em.js → blockDiagram-VD42YOAC-jQHtez-j-rtzBv-vF.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-_5giM-EA-CAUaWHfB.js → c4Diagram-YG6GDRKO-_5giM-EA-DjRoFacG.js} +1 -1
- package/dist/assets/channel-BLPbvVT2-CnJJPuZ5.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-BeuiUsbc-SyLBSPGf.js → chunk-4BX2VUAB-BeuiUsbc-DN2rdYji.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-C4OH5_NF-CeUEEy8j.js → chunk-55IACEB6-C4OH5_NF-DrgL4Tv-.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-CnUkcto7-Bw3MBwH8.js → chunk-B4BG7PRW-CnUkcto7-DHe7ngzh.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-CSd59tsh-DMnz_BT4.js → chunk-DI55MBZ5-CSd59tsh-DFg8M9sN.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-C6VImbBX-Ci00_56S.js → chunk-FMBD7UC4-C6VImbBX-ip_5_GPo.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DrWWTLTH-CxKsUSHw.js → chunk-QN33PNHL-DrWWTLTH-tpIkWiz1.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-C6_I39By-wG4V5ipa.js → chunk-QZHKN3VN-C6_I39By-ZQp0I6tE.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-DGddLgNl-oFBh2Kwv.js → chunk-TZMSLE5B-DGddLgNl-CifiGjd6.js} +1 -1
- package/dist/assets/{classDiagram-2ON5EDUG-BngjTxOv-BTvgR8FJ.js → classDiagram-2ON5EDUG-BngjTxOv-2Y-76rXt.js} +1 -1
- package/dist/assets/{classDiagram-v2-WZHVMYZB-BngjTxOv-BTvgR8FJ.js → classDiagram-v2-WZHVMYZB-BngjTxOv-2Y-76rXt.js} +1 -1
- package/dist/assets/clone-DH1Kq5Y6-DxQT_fR1.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-DcyCVH6S-DmuDbM_l.js → cose-bilkent-S5V4N54A-DcyCVH6S-zMMT3oqX.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-B799wmhr-COgMFtha.js → dagre-6UL2VRFP-B799wmhr-DuXOlM7I.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-Dxp2wzKk-BBCx56dy.js → diagram-PSM6KHXK-Dxp2wzKk-CmF_yeQm.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-Km_liL9n-Betp39ze.js → diagram-QEK2KX5R-Km_liL9n-DiDvLC9k.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-tSpHqt0k-44sQtblg.js → diagram-S2PKOQOG-tSpHqt0k-Dhi7ufxY.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-DF6ylQ7o-Dt6nMqG4.js → erDiagram-Q2GNP2WA-DF6ylQ7o-CjIoFnUJ.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-BQUYJeB--BIIW2JbR.js → flowDiagram-NV44I4VS-BQUYJeB--D2fTwlvO.js} +1 -1
- package/dist/assets/{ganttDiagram-LVOFAZNH-BidPm1xz-C_N0fE6y.js → ganttDiagram-LVOFAZNH-BidPm1xz-D_x48jVE.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-zbMOFVrv-C2aviXPE.js → gitGraphDiagram-NY62KEGX-zbMOFVrv-DTVFadEr.js} +1 -1
- package/dist/assets/{graph-aRt77rZZ-BCYSvQYP.js → graph-aRt77rZZ-Dq9dkNsk.js} +1 -1
- package/dist/assets/{index-CyVB0J6E.js → index-p0knuDQ9.js} +6 -6
- package/dist/assets/{index-rW5EEHFR-DdBF6BH7.js → index-rW5EEHFR-Cm6Gxbor.js} +1 -1
- package/dist/assets/{infoDiagram-ER5ION4S-ozjqEnsq-Ba1eAJxv.js → infoDiagram-ER5ION4S-ozjqEnsq-D0PwL9B_.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-C6JuEafR-CDMHuJkC.js → journeyDiagram-XKPGCS4Q-C6JuEafR-BSuib8Wf.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-Ci4U3NR--DxVvWtAD.js → kanban-definition-3W4ZIXB7-Ci4U3NR--Bxb6Yi8G.js} +1 -1
- package/dist/assets/{layout-BKjRgLFe-BqG-N5rr.js → layout-BKjRgLFe-WihuzEZg.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-DveejCtl-DLDRL_jx.js → mindmap-definition-VGOIOE7T-DveejCtl-DXLxEnp4.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-DAbSGtae-DaaJODT6.js → pieDiagram-ADFJNKIX-DAbSGtae-BruonBFZ.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-DnnzUQMW-ByDrDvpT.js → quadrantDiagram-AYHSOK5B-DnnzUQMW-DzWXEz5-.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-BB9jagBx-4ABuhsu-.js → requirementDiagram-UZGBJVZJ-BB9jagBx-q21wBQ9N.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-BttZx2-h-DZFrYF3L.js → sankeyDiagram-TZEHDZUN-BttZx2-h-Cr53tHP7.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-DA6yVs26-Cf4EYRDf.js → sequenceDiagram-WL72ISMW-DA6yVs26-B4W8xwkp.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-BD8xEcbc-DSZVswAk.js → stateDiagram-FKZM4ZOC-BD8xEcbc-BWOiPxZu.js} +1 -1
- package/dist/assets/{stateDiagram-v2-4FDKWEC3-DINzAoyF-Biyi4sW7.js → stateDiagram-v2-4FDKWEC3-DINzAoyF-DshiRv7Q.js} +1 -1
- package/dist/assets/{timeline-definition-IT6M3QCI-XN-D5T3b-CUWPxmpi.js → timeline-definition-IT6M3QCI-XN-D5T3b-l0nKzR1k.js} +1 -1
- package/dist/assets/{treemap-KMMF4GRG-C4GHjB3F-HVe9FL0t.js → treemap-KMMF4GRG-C4GHjB3F-_nPgBK22.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-BL53__6J-Dk9M98Ob.js → xychartDiagram-PRI3JC2R-BL53__6J-XcAq-Lxf.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/channel-BLPbvVT2-BU9ed3z7.js +0 -1
- package/dist/assets/clone-DH1Kq5Y6-CC3PuMQg.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as os}from"./index-CyVB0J6E.js";function cs(T,g){for(var p=0;p<g.length;p++){const o=g[p];if(typeof o!="string"&&!Array.isArray(o)){for(const r in o)if(r!=="default"&&!(r in T)){const n=Object.getOwnPropertyDescriptor(o,r);n&&Object.defineProperty(T,r,n.get?n:{enumerable:!0,get:()=>o[r]})}}}return Object.freeze(Object.defineProperty(T,Symbol.toStringTag,{value:"Module"}))}var Xe,Yr;function ls(){if(Yr)return Xe;Yr=1;var T="6.5.2";return Xe=T,Xe}var Ke,Rr;function Br(){if(Rr)return Ke;Rr=1;var T=function(p,o){var r=this;if(o||(o={}),r.qpm=o.qpm?parseInt(o.qpm,10):null,!r.qpm){var n=p.metaText?p.metaText.tempo:null;r.qpm=p.getBpm(n)}r.extraMeasuresAtBeginning=o.extraMeasuresAtBeginning?parseInt(o.extraMeasuresAtBeginning,10):0,r.beatCallback=o.beatCallback,r.eventCallback=o.eventCallback,r.lineEndCallback=o.lineEndCallback,r.lineEndAnticipation=o.lineEndAnticipation?parseInt(o.lineEndAnticipation,10):0,r.beatSubdivisions=o.beatSubdivisions?parseInt(o.beatSubdivisions,10):1,r.joggerTimer=null,r.replaceTarget=function(s){r.noteTimings=s.setTiming(r.qpm,r.extraMeasuresAtBeginning),s.noteTimings.length===0&&(r.noteTimings=s.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=g(s.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,r.noteTimings.length!==0&&(r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds,r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat))},r.replaceTarget(p),r.doTiming=function(s){if(r.lastTimestamp!==s&&(r.lastTimestamp=s,r.startTime||(r.startTime=s),!r.isPaused&&r.isRunning)){for(r.currentTime=s-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&r.noteTimings[r.currentEvent].type==="event"){var l=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),l!==r.startTime&&(r.currentTime=s-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var d=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],d,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat*r.millisecondsPerBeat<r.currentTime){var f=r.doBeatCallback(s);f!==null&&(r.currentTime=f)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var u=r.doBeatCallback(s);u!==null&&(r.currentTime=u),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var i=r.eventCallback(null);r.shouldStop(i).then(function(t){t&&r.stop()})}else r.stop()}},r.shouldStop=function(s){return new Promise(function(l){if(!s)return l(!0);if(s==="continue")return l(!1);s.then&&s.then(function(d){l(d!=="continue")})})},r.doBeatCallback=function(s){if(r.beatCallback){for(var l=r.currentEvent;l<r.noteTimings.length&&r.noteTimings[l].left===null;)l++;var d,f;if(l<r.noteTimings.length){for(d=r.noteTimings[l].milliseconds,l=Math.max(0,r.currentEvent-1);l>=0&&r.noteTimings[l].left===null;)l--;f=r.noteTimings[l]}var u={},i={};if(f){u.top=f.top,u.height=f.height;var t=Math.max(0,s-r.startTime-f.milliseconds),a=d-f.milliseconds,e=f.endX-f.left,h=a?t*e/a:0;u.left=f.left+h,r.currentEvent===0&&f.milliseconds>s-r.startTime&&(u.left=void 0),i={timestamp:s,startTime:r.startTime,ev:f,endMs:d,offMs:t,offPx:h,gapMs:a,gapPx:e}}else i={timestamp:s,startTime:r.startTime};var v=r.startTime;if(r.beatCallback(r.currentBeat/r.beatSubdivisions,r.totalBeats/r.beatSubdivisions,r.lastMoment,u,i),v!==r.startTime)return s-r.startTime;r.currentBeat++}return null};var c=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,c))},r.start=function(s,l){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,s===void 0&&(r.justUnpaused=!0)),s)r.setProgress(s,l);else if(s===0)r.reset();else if(r.pausedPercent!==null){var d=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=d-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,c)},r.pause=function(){r.isPaused=!0;var s=performance.now();r.pausedPercent=(s-r.startTime)/r.lastMoment,r.isRunning=!1,r.joggerTimer&&(clearTimeout(r.joggerTimer),r.joggerTimer=null)},r.currentMillisecond=function(){return r.currentTime},r.reset=function(){r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.startTime=null,r.pausedPercent=null},r.stop=function(){r.pause(),r.reset()},r.setProgress=function(s,l){var d;switch(l){case"seconds":r.currentTime=s*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),d=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=s*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),d=r.currentTime/r.lastMoment;break;default:d=s,d<0&&(d=0),d>1&&(d=1),r.currentTime=r.lastMoment*d;break}r.isRunning||(r.pausedPercent=d);var f=performance.now();for(r.startTime=f-r.currentTime,r.currentEvent,r.currentEvent=0;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;)r.currentEvent++;if(r.lineEndCallback)for(r.currentLine=0;r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds+r.lineEndAnticipation<r.currentTime;)r.currentLine++;var u=r.currentBeat;r.currentBeat=Math.floor(r.currentTime/r.millisecondsPerBeat),r.beatCallback&&u!==r.currentBeat&&r.doBeatCallback(r.startTime+r.currentTime),r.eventCallback&&r.currentEvent>=0&&r.noteTimings[r.currentEvent].type==="event"&&r.eventCallback(r.noteTimings[r.currentEvent]),r.lineEndCallback&&r.lineEndCallback(r.lineEndTimings[r.currentLine],r.noteTimings[r.currentEvent],{line:r.currentLine,endTimings:r.lineEndTimings}),r.joggerTimer=setTimeout(r.animationJogger,c)}};function g(p,o){for(var r=[],n=null,c=0;c<p.length;c++){var s=p[c];s.type!=="end"&&s.top!==n&&(r.push({measureNumber:s.measureNumber,milliseconds:s.milliseconds-o,top:s.top,bottom:s.top+s.height}),n=s.top)}return r}return Ke=T,Ke}var Ue,Wr;function hs(){if(Wr)return Ue;Wr=1;var T=Br(),g={};return function(){var p,o;g.startAnimation=function(r,n,c){p&&(p.stop(),p=void 0),c.showCursor&&(o=r.querySelector(".abcjs-cursor"),o||(o=document.createElement("DIV"),o.className="abcjs-cursor cursor",o.style.position="absolute",r.appendChild(o),r.style.position="relative"));function s(a){for(var e=0;e<a.length;e++){var h=a[e];h.classList.contains("abcjs-bar")||(h.style.display="none")}}var l;function d(a){if(l){var e=r.querySelectorAll(l);s(e)}l=a}function f(a){var e=r.querySelectorAll(a);s(e)}function u(a){c.hideCurrentMeasure?f(a):c.hideFinishedMeasures&&d(a)}function i(a){return".abcjs-l"+a.line+".abcjs-m"+a.measureNumber}function t(a){if(a){if(a.measureStart){var e=i(a);e&&u(e)}o&&(o.style.left=a.left+"px",o.style.top=a.top+"px",o.style.width=a.width+"px",o.style.height=a.height+"px")}else p.stop(),p=void 0}p=new T(n,{qpm:c.bpm,eventCallback:t}),p.start()},g.pauseAnimation=function(r){p&&(r?p.pause():p.start())},g.stopAnimation=function(){p&&(p.stop(),p=void 0)}}(),Ue=g,Ue}var $e,Gr;function Ne(){if(Gr)return $e;Gr=1;var T={};return T.cloneArray=function(g){for(var p=[],o=0;o<g.length;o++)p.push(Object.assign({},g[o]));return p},T.cloneHashOfHash=function(g){var p={};for(var o in g)g.hasOwnProperty(o)&&(p[o]=Object.assign({},g[o]));return p},T.cloneHashOfArrayOfHash=function(g){var p={};for(var o in g)g.hasOwnProperty(o)&&(p[o]=T.cloneArray(g[o]));return p},T.strip=function(g){return g.replace(/^\s+/,"").replace(/\s+$/,"")},T.startsWith=function(g,p){return g.indexOf(p)===0},T.endsWith=function(g,p){var o=g.length-p.length;return o>=0&&g.lastIndexOf(p)===o},T.last=function(g){return g.length===0?null:g[g.length-1]},$e=T,$e}var Qe,qr;function Pr(){if(qr)return Qe;qr=1;var T=Ne(),g={};return function(){var p,o,r,n,c;g.initialize=function(y,k,w,O,z){p=y,o=k,r=w,n=O,c=z,s()};function s(){r.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},r.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},r.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},r.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},r.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},n.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},n.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},n.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},n.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},n.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},n.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},n.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},n.formatting.annotationfont=r.annotationfont,n.formatting.gchordfont=r.gchordfont,n.formatting.historyfont=r.historyfont,n.formatting.infofont=r.infofont,n.formatting.measurefont=r.measurefont,n.formatting.partsfont=r.partsfont,n.formatting.repeatfont=r.repeatfont,n.formatting.textfont=r.textfont,n.formatting.tripletfont=r.tripletfont,n.formatting.vocalfont=r.vocalfont,n.formatting.wordsfont=r.wordsfont}var l={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},d=function(y){switch(y){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}},f=function(y,k,w,O,z){function V(){var fe=parseInt(y[0].token);return y.shift(),k?y.length===0?{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe}:y.length===1&&y[0].token==="box"&&l[z]?{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe,box:!0}:(o("Extra parameters in font definition.",w,O),{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe}):(o("Can't set just the size of the font since there is no default value.",w,O),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:fe})}if(y[0].token==="*"){if(y.shift(),y[0].type==="number")return V();o("Expected font size number after *.",w,O)}if(y[0].type==="number")return V();for(var I=[],K,Q="normal",G="normal",ee="none",te=!1,ne="face",X=!1;y.length;){var ae=y.shift(),$=ae.token.toLowerCase();switch(ne){case"face":X||$!=="utf"&&ae.type!=="number"&&$!=="bold"&&$!=="italic"&&$!=="underline"&&$!=="box"?I.length>0&&ae.token==="-"?(X=!0,I[I.length-1]=I[I.length-1]+ae.token):X?(X=!1,I[I.length-1]=I[I.length-1]+ae.token):I.push(ae.token):ae.type==="number"?(K?o("Font size specified twice in font definition.",w,O):K=ae.token,ne="modifier"):$==="bold"?Q="bold":$==="italic"?G="italic":$==="underline"?ee="underline":$==="box"?(l[z]?te=!0:o(`This font style doesn't support "box"`,w,O),ne="finished"):$==="utf"?(ae=y.shift(),ne="size"):o("Unknown parameter "+ae.token+" in font definition.",w,O);break;case"size":ae.type==="number"?K?o("Font size specified twice in font definition.",w,O):K=ae.token:o("Expected font size in font definition.",w,O),ne="modifier";break;case"modifier":$==="bold"?Q="bold":$==="italic"?G="italic":$==="underline"?ee="underline":$==="box"?(l[z]?te=!0:o(`This font style doesn't support "box"`,w,O),ne="finished"):o("Unknown parameter "+ae.token+" in font definition.",w,O);break;case"finished":o('Extra characters found after "box" in font definition.',w,O);break}}K===void 0?k?K=k.size:(o("Must specify the size of the font since there is no default value.",w,O),K=12):K=parseFloat(K),I=I.join(" "),I===""&&(k?I=k.face:(o("Must specify the name of the font since there is no default value.",w,O),I="sans-serif"));var se=d(I),ce={};return se?(ce.face=se.face,ce.weight=se.weight,ce.style=se.style,ce.decoration=se.decoration,ce.size=K,te&&(ce.box=!0),ce):(ce.face=I,ce.weight=Q,ce.style=G,ce.decoration=ee,ce.size=K,te&&(ce.box=!0),ce)},u=function(y,k,w){return k.length===0?'Directive "'+y+'" requires a font as a parameter.':(r[y]=f(k,r[y],w,0,y),r.is_in_header&&(n.formatting[y]=r[y]),null)},i=function(y,k,w){return k.length===0?'Directive "'+y+'" requires a font as a parameter.':(n.formatting[y]=f(k,n.formatting[y],w,0,y),null)},t=function(y,k){var w="";k.forEach(function(z){w+=z.token});var O=parseFloat(w);if(isNaN(O)||O===0)return'Directive "'+y+'" requires a number as a parameter.';n.formatting.scale=O},a=["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"],e=function(y){var k=y.split(/\s+/);if(k.length!==2&&k.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var w=k[0],O=parseInt(k[1],10);if((isNaN(O)||O<35||O>81)&&k[1]&&(O=a.indexOf(k[1].toLowerCase())+35),isNaN(O)||O<35||O>81)return{error:'Expected drum name, received "'+k[1]+'"'};var z={sound:O};return k.length===3&&(z.noteHead=k[2]),{key:w,value:z}},h=function(y,k){var w=p.getMeasurement(k);return w.used===0||k.length!==0?{error:'Directive "'+y+'" requires a measurement as a parameter.'}:w.value},v=function(y,k){var w=p.getMeasurement(k);return w.used===0||k.length!==0?'Directive "'+y+'" requires a measurement as a parameter.':(n.formatting[y]=w.value,null)},m=function(y,k,w,O,z){if(w.length!==1||w[0].type!=="number")return'Directive "'+k+'" requires a number as a parameter.';var V=w[0].intt;return O!==void 0&&V<O?'Directive "'+k+'" requires a number greater than or equal to '+O+" as a parameter.":z!==void 0&&V>z?'Directive "'+k+'" requires a number less than or equal to '+z+" as a parameter.":(r[y]=V,null)},x=function(y,k,w){if(w.length===1&&(w[0].token==="true"||w[0].token==="false"))return r[y]=w[0].token==="true",null;var O=m(y,k,w,0,1);return O!==null?O:(r[y]=r[y]===1,null)},C=function(y,k,w,O){if(w.length!==1)return'Directive "'+k+'" requires one of [ '+O.join(", ")+" ] as a parameter.";for(var z=w[0].token,V=!1,I=0;!V&&I<O.length;I++)O[I]===z&&(V=!0);return V?(r[y]=z,null):'Directive "'+k+'" requires one of [ '+O.join(", ")+" ] as a parameter."},S=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],j=["gchord","ptstress","beatstring"],F=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],b=["program"],M=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],B=["beat"],A=["drone"],P=["portamento"],N=["expand","grace","trim"],E=["drum","chordname"],_=["bassprog","chordprog"],L=function(y,k,w){var O=y.shift().token,z=[];if(S.indexOf(O)>=0)y.length!==0&&o("Unexpected parameter in MIDI "+O,w,0);else if(j.indexOf(O)>=0)y.length!==1?o("Expected one parameter in MIDI "+O,w,0):z.push(y[0].token);else if(F.indexOf(O)>=0)y.length!==1?o("Expected one parameter in MIDI "+O,w,0):y[0].type!=="number"?o("Expected one integer parameter in MIDI "+O,w,0):z.push(y[0].intt);else if(b.indexOf(O)>=0)y.length!==1&&y.length!==2?o("Expected one or two parameters in MIDI "+O,w,0):y[0].type!=="number"||y.length===2&&y[1].type!=="number"?o("Expected integer parameter in MIDI "+O,w,0):(z.push(y[0].intt),y.length===2&&z.push(y[1].intt));else if(M.indexOf(O)>=0)y.length!==2?o("Expected two parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"?o("Expected two integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt));else if(P.indexOf(O)>=0)y.length!==2?o("Expected two parameters in MIDI "+O,w,0):y[0].type!=="alpha"||y[1].type!=="number"?o("Expected one string and one integer parameters in MIDI "+O,w,0):(z.push(y[0].token),z.push(y[1].intt));else if(O==="drummap")y.length===2&&y[0].type==="alpha"&&y[1].type==="number"?(k.formatting||(k.formatting={}),k.formatting.midi||(k.formatting.midi={}),k.formatting.midi.drummap||(k.formatting.midi.drummap={}),k.formatting.midi.drummap[y[0].token]=y[1].intt,z=k.formatting.midi.drummap):y.length===3&&y[0].type==="punct"&&y[1].type==="alpha"&&y[2].type==="number"?(k.formatting||(k.formatting={}),k.formatting.midi||(k.formatting.midi={}),k.formatting.midi.drummap||(k.formatting.midi.drummap={}),k.formatting.midi.drummap[y[0].token+y[1].token]=y[2].intt,z=k.formatting.midi.drummap):o("Expected one note name and one integer parameter in MIDI "+O,w,0);else if(N.indexOf(O)>=0)y.length!==3||y[0].type!=="number"||y[1].token!=="/"||y[2].type!=="number"?o("Expected fraction parameter in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[2].intt));else if(B.indexOf(O)>=0)y.length!==4?o("Expected four parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"?o("Expected four integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt),z.push(y[2].intt),z.push(y[3].intt));else if(A.indexOf(O)>=0)y.length!==5?o("Expected five parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"||y[4].type!=="number"?o("Expected five integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt),z.push(y[2].intt),z.push(y[3].intt),z.push(y[4].intt));else if(b.indexOf(O)>=0)y.length!==1||y.length!==4?o("Expected one or two parameters in MIDI "+O,w,0):y[0].type!=="number"?o("Expected integer parameter in MIDI "+O,w,0):y.length===4?(y[1].token!=="octave"&&o("Expected octave parameter in MIDI "+O,w,0),y[2].token!=="="&&o("Expected octave parameter in MIDI "+O,w,0),y[3].type!=="number"&&o("Expected integer parameter for octave in MIDI "+O,w,0)):(z.push(y[0].intt),y.length===4&&z.push(y[3].intt));else if(E.indexOf(O)>=0)if(y.length<2)o("Expected string parameter and at least one integer parameter in MIDI "+O,w,0);else if(y[0].type!=="alpha")o("Expected string parameter and at least one integer parameter in MIDI "+O,w,0);else{var V=y.shift();for(z.push(V.token);y.length>0;)V=y.shift(),V.type!=="number"&&o("Expected integer parameter in MIDI "+O,w,0),z.push(V.intt)}else if(_.indexOf(O)>=0){if(y.length!==1&&y.length!==2)o("Expected one or two parameters in MIDI "+O,w,0);else if(y[0].type!=="number")o("Expected integer parameter in MIDI "+O,w,0);else if(y.length===2&&y[1].type!=="alpha")o("Expected alpha parameter in MIDI "+O,w,0);else if(z.push(y[0].intt),y.length===2){var I=y[1].token;I.indexOf("octave=")!=-1?(I=I.replace("octave=",""),I=parseInt(I),isNaN(I)?o("Expected octave value in MIDI"+O):(I<-1&&(o("Expected octave= in MIDI "+O+" to be >= -1 (recv:"+I+")"),I=-1),I>3&&(o("Expected octave= in MIDI "+O+" to be <= 3 (recv:"+I+")"),I=3),z.push(I))):o("Expected octave= in MIDI"+O)}}c.hasBeginMusic()?c.appendElement("midi",-1,-1,{cmd:O,params:z}):(k.formatting.midi===void 0&&(k.formatting.midi={}),k.formatting.midi[O]=z)};g.parseFontChangeLine=function(y){y=y.replace(/\$\$/g,"");var k=y.split("$");if(k.length>1&&r.setfont){var w=[];k[0]!==""&&w.push({text:k[0]});for(var O=1;O<k.length;O++)if(k[O][0]==="0")w.push({text:k[O].substring(1).replace(/\x03/g,"$$")});else{var z=parseInt(k[O][0],10);r.setfont[z]?w.push({font:r.setfont[z],text:k[O].substring(1).replace(/\x03/g,"$$")}):w[w.length-1].text+="$"+k[O].replace(/\x03/g,"$$")}return w}return y.replace(/\x03/g,"$$")};var D=["auto","above","below","hidden"];g.addDirective=function(y){var k=p.tokenize(y,0,y.length);if(k.length===0||k[0].type!=="alpha")return null;var w=y.substring(y.indexOf(k[0].token)+k[0].token.length);w=p.stripComment(w);var O=k.shift().token.toLowerCase(),z="",V;switch(O){case"bagpipes":n.formatting.bagpipes=!0;break;case"flatbeams":n.formatting.flatbeams=!0;break;case"jazzchords":n.formatting.jazzchords=!0;break;case"accentAbove":n.formatting.accentAbove=!0;break;case"germanAlphabet":n.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=w;break;case"graceslurs":if(k.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(k[0].token==="0"||k[0].token==="false")n.formatting.graceSlurs=!1;else if(k[0].token==="1"||k[0].token==="true")n.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+k[0].token+")";break;case"lineThickness":var I=H(k);if(I.value!==void 0&&(n.formatting.lineThickness=I.value),I.error)return I.error;break;case"stretchlast":var K=H(k);if(K.value!==void 0&&(n.formatting.stretchlast=K.value),K.error)return K.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":n.formatting.titleleft=!0;break;case"measurebox":n.formatting.measurebox=!0;break;case"vocal":return C("vocalPosition",O,k,D);case"dynamic":return C("dynamicPosition",O,k,D);case"gchord":return C("chordPosition",O,k,D);case"ornament":return C("ornamentPosition",O,k,D);case"volume":return C("volumePosition",O,k,D);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 v(O,k);case"voicescale":if(k.length!==1||k[0].type!=="number")return"voicescale requires one float as a parameter";var Q=k.shift();return r.currentVoice&&(r.currentVoice.scale=Q.floatt,c.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(k.length!==1)return"voicecolor requires one string as a parameter";var G=k.shift();return r.currentVoice&&(r.currentVoice.color=G.token,c.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var ee=Math.round(h(O,k));return ee.error?ee.error:(c.addSpacing(ee),null);case"scale":t(O,k);break;case"sep":if(k.length===0)c.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var te=p.getMeasurement(k);if(te.used===0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var ne=te.value;if(te=p.getMeasurement(k),te.used===0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var X=te.value;if(te=p.getMeasurement(k),te.used===0||k.length!==0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var ae=te.value;c.addSeparator(ne,X,ae,{startChar:r.iChar,endChar:r.iChar+w.length})}break;case"barsperstaff":if(z=m("barsperstaff",O,k),z!==null)return z;break;case"staffnonote":if(k.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(k[0].token==="0")r.staffnonote=!0;else if(k[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+k[0].token+")";break;case"printtempo":if(z=x("printTempo",O,k),z!==null)return z;break;case"partsbox":if(z=x("partsBox",O,k),z!==null)return z;r.partsfont.box=r.partsBox;break;case"freegchord":if(z=x("freegchord",O,k),z!==null)return z;break;case"measurenb":case"barnumbers":if(z=m("barNumbers",O,k),z!==null)return z;break;case"setbarnb":if(k.length!==1||k[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=c.setBarNumberImmediate(k[0].intt);break;case"keywarn":if(k.length!==1||k[0].type!=="number"||k[0].intt!==1&&k[0].intt!==0)return"Directive "+O+" requires 0 or 1 as a parameter.";r[O]=k[0].intt===1;break;case"begintext":var $="";for(V=p.nextLine();V&&V.indexOf("%%endtext")!==0;){if(T.startsWith(V,"%%")){var se=V.substring(2);se=se.trim()+`
|
|
1
|
+
import{D as os}from"./index-p0knuDQ9.js";function cs(T,g){for(var p=0;p<g.length;p++){const o=g[p];if(typeof o!="string"&&!Array.isArray(o)){for(const r in o)if(r!=="default"&&!(r in T)){const n=Object.getOwnPropertyDescriptor(o,r);n&&Object.defineProperty(T,r,n.get?n:{enumerable:!0,get:()=>o[r]})}}}return Object.freeze(Object.defineProperty(T,Symbol.toStringTag,{value:"Module"}))}var Xe,Yr;function ls(){if(Yr)return Xe;Yr=1;var T="6.5.2";return Xe=T,Xe}var Ke,Rr;function Br(){if(Rr)return Ke;Rr=1;var T=function(p,o){var r=this;if(o||(o={}),r.qpm=o.qpm?parseInt(o.qpm,10):null,!r.qpm){var n=p.metaText?p.metaText.tempo:null;r.qpm=p.getBpm(n)}r.extraMeasuresAtBeginning=o.extraMeasuresAtBeginning?parseInt(o.extraMeasuresAtBeginning,10):0,r.beatCallback=o.beatCallback,r.eventCallback=o.eventCallback,r.lineEndCallback=o.lineEndCallback,r.lineEndAnticipation=o.lineEndAnticipation?parseInt(o.lineEndAnticipation,10):0,r.beatSubdivisions=o.beatSubdivisions?parseInt(o.beatSubdivisions,10):1,r.joggerTimer=null,r.replaceTarget=function(s){r.noteTimings=s.setTiming(r.qpm,r.extraMeasuresAtBeginning),s.noteTimings.length===0&&(r.noteTimings=s.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=g(s.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,r.noteTimings.length!==0&&(r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds,r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat))},r.replaceTarget(p),r.doTiming=function(s){if(r.lastTimestamp!==s&&(r.lastTimestamp=s,r.startTime||(r.startTime=s),!r.isPaused&&r.isRunning)){for(r.currentTime=s-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&r.noteTimings[r.currentEvent].type==="event"){var l=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),l!==r.startTime&&(r.currentTime=s-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var d=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],d,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat*r.millisecondsPerBeat<r.currentTime){var f=r.doBeatCallback(s);f!==null&&(r.currentTime=f)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var u=r.doBeatCallback(s);u!==null&&(r.currentTime=u),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var i=r.eventCallback(null);r.shouldStop(i).then(function(t){t&&r.stop()})}else r.stop()}},r.shouldStop=function(s){return new Promise(function(l){if(!s)return l(!0);if(s==="continue")return l(!1);s.then&&s.then(function(d){l(d!=="continue")})})},r.doBeatCallback=function(s){if(r.beatCallback){for(var l=r.currentEvent;l<r.noteTimings.length&&r.noteTimings[l].left===null;)l++;var d,f;if(l<r.noteTimings.length){for(d=r.noteTimings[l].milliseconds,l=Math.max(0,r.currentEvent-1);l>=0&&r.noteTimings[l].left===null;)l--;f=r.noteTimings[l]}var u={},i={};if(f){u.top=f.top,u.height=f.height;var t=Math.max(0,s-r.startTime-f.milliseconds),a=d-f.milliseconds,e=f.endX-f.left,h=a?t*e/a:0;u.left=f.left+h,r.currentEvent===0&&f.milliseconds>s-r.startTime&&(u.left=void 0),i={timestamp:s,startTime:r.startTime,ev:f,endMs:d,offMs:t,offPx:h,gapMs:a,gapPx:e}}else i={timestamp:s,startTime:r.startTime};var v=r.startTime;if(r.beatCallback(r.currentBeat/r.beatSubdivisions,r.totalBeats/r.beatSubdivisions,r.lastMoment,u,i),v!==r.startTime)return s-r.startTime;r.currentBeat++}return null};var c=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,c))},r.start=function(s,l){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,s===void 0&&(r.justUnpaused=!0)),s)r.setProgress(s,l);else if(s===0)r.reset();else if(r.pausedPercent!==null){var d=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=d-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,c)},r.pause=function(){r.isPaused=!0;var s=performance.now();r.pausedPercent=(s-r.startTime)/r.lastMoment,r.isRunning=!1,r.joggerTimer&&(clearTimeout(r.joggerTimer),r.joggerTimer=null)},r.currentMillisecond=function(){return r.currentTime},r.reset=function(){r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.startTime=null,r.pausedPercent=null},r.stop=function(){r.pause(),r.reset()},r.setProgress=function(s,l){var d;switch(l){case"seconds":r.currentTime=s*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),d=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=s*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),d=r.currentTime/r.lastMoment;break;default:d=s,d<0&&(d=0),d>1&&(d=1),r.currentTime=r.lastMoment*d;break}r.isRunning||(r.pausedPercent=d);var f=performance.now();for(r.startTime=f-r.currentTime,r.currentEvent,r.currentEvent=0;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;)r.currentEvent++;if(r.lineEndCallback)for(r.currentLine=0;r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds+r.lineEndAnticipation<r.currentTime;)r.currentLine++;var u=r.currentBeat;r.currentBeat=Math.floor(r.currentTime/r.millisecondsPerBeat),r.beatCallback&&u!==r.currentBeat&&r.doBeatCallback(r.startTime+r.currentTime),r.eventCallback&&r.currentEvent>=0&&r.noteTimings[r.currentEvent].type==="event"&&r.eventCallback(r.noteTimings[r.currentEvent]),r.lineEndCallback&&r.lineEndCallback(r.lineEndTimings[r.currentLine],r.noteTimings[r.currentEvent],{line:r.currentLine,endTimings:r.lineEndTimings}),r.joggerTimer=setTimeout(r.animationJogger,c)}};function g(p,o){for(var r=[],n=null,c=0;c<p.length;c++){var s=p[c];s.type!=="end"&&s.top!==n&&(r.push({measureNumber:s.measureNumber,milliseconds:s.milliseconds-o,top:s.top,bottom:s.top+s.height}),n=s.top)}return r}return Ke=T,Ke}var Ue,Wr;function hs(){if(Wr)return Ue;Wr=1;var T=Br(),g={};return function(){var p,o;g.startAnimation=function(r,n,c){p&&(p.stop(),p=void 0),c.showCursor&&(o=r.querySelector(".abcjs-cursor"),o||(o=document.createElement("DIV"),o.className="abcjs-cursor cursor",o.style.position="absolute",r.appendChild(o),r.style.position="relative"));function s(a){for(var e=0;e<a.length;e++){var h=a[e];h.classList.contains("abcjs-bar")||(h.style.display="none")}}var l;function d(a){if(l){var e=r.querySelectorAll(l);s(e)}l=a}function f(a){var e=r.querySelectorAll(a);s(e)}function u(a){c.hideCurrentMeasure?f(a):c.hideFinishedMeasures&&d(a)}function i(a){return".abcjs-l"+a.line+".abcjs-m"+a.measureNumber}function t(a){if(a){if(a.measureStart){var e=i(a);e&&u(e)}o&&(o.style.left=a.left+"px",o.style.top=a.top+"px",o.style.width=a.width+"px",o.style.height=a.height+"px")}else p.stop(),p=void 0}p=new T(n,{qpm:c.bpm,eventCallback:t}),p.start()},g.pauseAnimation=function(r){p&&(r?p.pause():p.start())},g.stopAnimation=function(){p&&(p.stop(),p=void 0)}}(),Ue=g,Ue}var $e,Gr;function Ne(){if(Gr)return $e;Gr=1;var T={};return T.cloneArray=function(g){for(var p=[],o=0;o<g.length;o++)p.push(Object.assign({},g[o]));return p},T.cloneHashOfHash=function(g){var p={};for(var o in g)g.hasOwnProperty(o)&&(p[o]=Object.assign({},g[o]));return p},T.cloneHashOfArrayOfHash=function(g){var p={};for(var o in g)g.hasOwnProperty(o)&&(p[o]=T.cloneArray(g[o]));return p},T.strip=function(g){return g.replace(/^\s+/,"").replace(/\s+$/,"")},T.startsWith=function(g,p){return g.indexOf(p)===0},T.endsWith=function(g,p){var o=g.length-p.length;return o>=0&&g.lastIndexOf(p)===o},T.last=function(g){return g.length===0?null:g[g.length-1]},$e=T,$e}var Qe,qr;function Pr(){if(qr)return Qe;qr=1;var T=Ne(),g={};return function(){var p,o,r,n,c;g.initialize=function(y,k,w,O,z){p=y,o=k,r=w,n=O,c=z,s()};function s(){r.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},r.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},r.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},r.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},r.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},n.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},n.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},n.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},n.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},n.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},n.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},n.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},n.formatting.annotationfont=r.annotationfont,n.formatting.gchordfont=r.gchordfont,n.formatting.historyfont=r.historyfont,n.formatting.infofont=r.infofont,n.formatting.measurefont=r.measurefont,n.formatting.partsfont=r.partsfont,n.formatting.repeatfont=r.repeatfont,n.formatting.textfont=r.textfont,n.formatting.tripletfont=r.tripletfont,n.formatting.vocalfont=r.vocalfont,n.formatting.wordsfont=r.wordsfont}var l={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},d=function(y){switch(y){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}},f=function(y,k,w,O,z){function V(){var fe=parseInt(y[0].token);return y.shift(),k?y.length===0?{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe}:y.length===1&&y[0].token==="box"&&l[z]?{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe,box:!0}:(o("Extra parameters in font definition.",w,O),{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe}):(o("Can't set just the size of the font since there is no default value.",w,O),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:fe})}if(y[0].token==="*"){if(y.shift(),y[0].type==="number")return V();o("Expected font size number after *.",w,O)}if(y[0].type==="number")return V();for(var I=[],K,Q="normal",G="normal",ee="none",te=!1,ne="face",X=!1;y.length;){var ae=y.shift(),$=ae.token.toLowerCase();switch(ne){case"face":X||$!=="utf"&&ae.type!=="number"&&$!=="bold"&&$!=="italic"&&$!=="underline"&&$!=="box"?I.length>0&&ae.token==="-"?(X=!0,I[I.length-1]=I[I.length-1]+ae.token):X?(X=!1,I[I.length-1]=I[I.length-1]+ae.token):I.push(ae.token):ae.type==="number"?(K?o("Font size specified twice in font definition.",w,O):K=ae.token,ne="modifier"):$==="bold"?Q="bold":$==="italic"?G="italic":$==="underline"?ee="underline":$==="box"?(l[z]?te=!0:o(`This font style doesn't support "box"`,w,O),ne="finished"):$==="utf"?(ae=y.shift(),ne="size"):o("Unknown parameter "+ae.token+" in font definition.",w,O);break;case"size":ae.type==="number"?K?o("Font size specified twice in font definition.",w,O):K=ae.token:o("Expected font size in font definition.",w,O),ne="modifier";break;case"modifier":$==="bold"?Q="bold":$==="italic"?G="italic":$==="underline"?ee="underline":$==="box"?(l[z]?te=!0:o(`This font style doesn't support "box"`,w,O),ne="finished"):o("Unknown parameter "+ae.token+" in font definition.",w,O);break;case"finished":o('Extra characters found after "box" in font definition.',w,O);break}}K===void 0?k?K=k.size:(o("Must specify the size of the font since there is no default value.",w,O),K=12):K=parseFloat(K),I=I.join(" "),I===""&&(k?I=k.face:(o("Must specify the name of the font since there is no default value.",w,O),I="sans-serif"));var se=d(I),ce={};return se?(ce.face=se.face,ce.weight=se.weight,ce.style=se.style,ce.decoration=se.decoration,ce.size=K,te&&(ce.box=!0),ce):(ce.face=I,ce.weight=Q,ce.style=G,ce.decoration=ee,ce.size=K,te&&(ce.box=!0),ce)},u=function(y,k,w){return k.length===0?'Directive "'+y+'" requires a font as a parameter.':(r[y]=f(k,r[y],w,0,y),r.is_in_header&&(n.formatting[y]=r[y]),null)},i=function(y,k,w){return k.length===0?'Directive "'+y+'" requires a font as a parameter.':(n.formatting[y]=f(k,n.formatting[y],w,0,y),null)},t=function(y,k){var w="";k.forEach(function(z){w+=z.token});var O=parseFloat(w);if(isNaN(O)||O===0)return'Directive "'+y+'" requires a number as a parameter.';n.formatting.scale=O},a=["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"],e=function(y){var k=y.split(/\s+/);if(k.length!==2&&k.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var w=k[0],O=parseInt(k[1],10);if((isNaN(O)||O<35||O>81)&&k[1]&&(O=a.indexOf(k[1].toLowerCase())+35),isNaN(O)||O<35||O>81)return{error:'Expected drum name, received "'+k[1]+'"'};var z={sound:O};return k.length===3&&(z.noteHead=k[2]),{key:w,value:z}},h=function(y,k){var w=p.getMeasurement(k);return w.used===0||k.length!==0?{error:'Directive "'+y+'" requires a measurement as a parameter.'}:w.value},v=function(y,k){var w=p.getMeasurement(k);return w.used===0||k.length!==0?'Directive "'+y+'" requires a measurement as a parameter.':(n.formatting[y]=w.value,null)},m=function(y,k,w,O,z){if(w.length!==1||w[0].type!=="number")return'Directive "'+k+'" requires a number as a parameter.';var V=w[0].intt;return O!==void 0&&V<O?'Directive "'+k+'" requires a number greater than or equal to '+O+" as a parameter.":z!==void 0&&V>z?'Directive "'+k+'" requires a number less than or equal to '+z+" as a parameter.":(r[y]=V,null)},x=function(y,k,w){if(w.length===1&&(w[0].token==="true"||w[0].token==="false"))return r[y]=w[0].token==="true",null;var O=m(y,k,w,0,1);return O!==null?O:(r[y]=r[y]===1,null)},C=function(y,k,w,O){if(w.length!==1)return'Directive "'+k+'" requires one of [ '+O.join(", ")+" ] as a parameter.";for(var z=w[0].token,V=!1,I=0;!V&&I<O.length;I++)O[I]===z&&(V=!0);return V?(r[y]=z,null):'Directive "'+k+'" requires one of [ '+O.join(", ")+" ] as a parameter."},S=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],j=["gchord","ptstress","beatstring"],F=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],b=["program"],M=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],B=["beat"],A=["drone"],P=["portamento"],N=["expand","grace","trim"],E=["drum","chordname"],_=["bassprog","chordprog"],L=function(y,k,w){var O=y.shift().token,z=[];if(S.indexOf(O)>=0)y.length!==0&&o("Unexpected parameter in MIDI "+O,w,0);else if(j.indexOf(O)>=0)y.length!==1?o("Expected one parameter in MIDI "+O,w,0):z.push(y[0].token);else if(F.indexOf(O)>=0)y.length!==1?o("Expected one parameter in MIDI "+O,w,0):y[0].type!=="number"?o("Expected one integer parameter in MIDI "+O,w,0):z.push(y[0].intt);else if(b.indexOf(O)>=0)y.length!==1&&y.length!==2?o("Expected one or two parameters in MIDI "+O,w,0):y[0].type!=="number"||y.length===2&&y[1].type!=="number"?o("Expected integer parameter in MIDI "+O,w,0):(z.push(y[0].intt),y.length===2&&z.push(y[1].intt));else if(M.indexOf(O)>=0)y.length!==2?o("Expected two parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"?o("Expected two integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt));else if(P.indexOf(O)>=0)y.length!==2?o("Expected two parameters in MIDI "+O,w,0):y[0].type!=="alpha"||y[1].type!=="number"?o("Expected one string and one integer parameters in MIDI "+O,w,0):(z.push(y[0].token),z.push(y[1].intt));else if(O==="drummap")y.length===2&&y[0].type==="alpha"&&y[1].type==="number"?(k.formatting||(k.formatting={}),k.formatting.midi||(k.formatting.midi={}),k.formatting.midi.drummap||(k.formatting.midi.drummap={}),k.formatting.midi.drummap[y[0].token]=y[1].intt,z=k.formatting.midi.drummap):y.length===3&&y[0].type==="punct"&&y[1].type==="alpha"&&y[2].type==="number"?(k.formatting||(k.formatting={}),k.formatting.midi||(k.formatting.midi={}),k.formatting.midi.drummap||(k.formatting.midi.drummap={}),k.formatting.midi.drummap[y[0].token+y[1].token]=y[2].intt,z=k.formatting.midi.drummap):o("Expected one note name and one integer parameter in MIDI "+O,w,0);else if(N.indexOf(O)>=0)y.length!==3||y[0].type!=="number"||y[1].token!=="/"||y[2].type!=="number"?o("Expected fraction parameter in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[2].intt));else if(B.indexOf(O)>=0)y.length!==4?o("Expected four parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"?o("Expected four integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt),z.push(y[2].intt),z.push(y[3].intt));else if(A.indexOf(O)>=0)y.length!==5?o("Expected five parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"||y[4].type!=="number"?o("Expected five integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt),z.push(y[2].intt),z.push(y[3].intt),z.push(y[4].intt));else if(b.indexOf(O)>=0)y.length!==1||y.length!==4?o("Expected one or two parameters in MIDI "+O,w,0):y[0].type!=="number"?o("Expected integer parameter in MIDI "+O,w,0):y.length===4?(y[1].token!=="octave"&&o("Expected octave parameter in MIDI "+O,w,0),y[2].token!=="="&&o("Expected octave parameter in MIDI "+O,w,0),y[3].type!=="number"&&o("Expected integer parameter for octave in MIDI "+O,w,0)):(z.push(y[0].intt),y.length===4&&z.push(y[3].intt));else if(E.indexOf(O)>=0)if(y.length<2)o("Expected string parameter and at least one integer parameter in MIDI "+O,w,0);else if(y[0].type!=="alpha")o("Expected string parameter and at least one integer parameter in MIDI "+O,w,0);else{var V=y.shift();for(z.push(V.token);y.length>0;)V=y.shift(),V.type!=="number"&&o("Expected integer parameter in MIDI "+O,w,0),z.push(V.intt)}else if(_.indexOf(O)>=0){if(y.length!==1&&y.length!==2)o("Expected one or two parameters in MIDI "+O,w,0);else if(y[0].type!=="number")o("Expected integer parameter in MIDI "+O,w,0);else if(y.length===2&&y[1].type!=="alpha")o("Expected alpha parameter in MIDI "+O,w,0);else if(z.push(y[0].intt),y.length===2){var I=y[1].token;I.indexOf("octave=")!=-1?(I=I.replace("octave=",""),I=parseInt(I),isNaN(I)?o("Expected octave value in MIDI"+O):(I<-1&&(o("Expected octave= in MIDI "+O+" to be >= -1 (recv:"+I+")"),I=-1),I>3&&(o("Expected octave= in MIDI "+O+" to be <= 3 (recv:"+I+")"),I=3),z.push(I))):o("Expected octave= in MIDI"+O)}}c.hasBeginMusic()?c.appendElement("midi",-1,-1,{cmd:O,params:z}):(k.formatting.midi===void 0&&(k.formatting.midi={}),k.formatting.midi[O]=z)};g.parseFontChangeLine=function(y){y=y.replace(/\$\$/g,"");var k=y.split("$");if(k.length>1&&r.setfont){var w=[];k[0]!==""&&w.push({text:k[0]});for(var O=1;O<k.length;O++)if(k[O][0]==="0")w.push({text:k[O].substring(1).replace(/\x03/g,"$$")});else{var z=parseInt(k[O][0],10);r.setfont[z]?w.push({font:r.setfont[z],text:k[O].substring(1).replace(/\x03/g,"$$")}):w[w.length-1].text+="$"+k[O].replace(/\x03/g,"$$")}return w}return y.replace(/\x03/g,"$$")};var D=["auto","above","below","hidden"];g.addDirective=function(y){var k=p.tokenize(y,0,y.length);if(k.length===0||k[0].type!=="alpha")return null;var w=y.substring(y.indexOf(k[0].token)+k[0].token.length);w=p.stripComment(w);var O=k.shift().token.toLowerCase(),z="",V;switch(O){case"bagpipes":n.formatting.bagpipes=!0;break;case"flatbeams":n.formatting.flatbeams=!0;break;case"jazzchords":n.formatting.jazzchords=!0;break;case"accentAbove":n.formatting.accentAbove=!0;break;case"germanAlphabet":n.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=w;break;case"graceslurs":if(k.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(k[0].token==="0"||k[0].token==="false")n.formatting.graceSlurs=!1;else if(k[0].token==="1"||k[0].token==="true")n.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+k[0].token+")";break;case"lineThickness":var I=H(k);if(I.value!==void 0&&(n.formatting.lineThickness=I.value),I.error)return I.error;break;case"stretchlast":var K=H(k);if(K.value!==void 0&&(n.formatting.stretchlast=K.value),K.error)return K.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":n.formatting.titleleft=!0;break;case"measurebox":n.formatting.measurebox=!0;break;case"vocal":return C("vocalPosition",O,k,D);case"dynamic":return C("dynamicPosition",O,k,D);case"gchord":return C("chordPosition",O,k,D);case"ornament":return C("ornamentPosition",O,k,D);case"volume":return C("volumePosition",O,k,D);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 v(O,k);case"voicescale":if(k.length!==1||k[0].type!=="number")return"voicescale requires one float as a parameter";var Q=k.shift();return r.currentVoice&&(r.currentVoice.scale=Q.floatt,c.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(k.length!==1)return"voicecolor requires one string as a parameter";var G=k.shift();return r.currentVoice&&(r.currentVoice.color=G.token,c.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var ee=Math.round(h(O,k));return ee.error?ee.error:(c.addSpacing(ee),null);case"scale":t(O,k);break;case"sep":if(k.length===0)c.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var te=p.getMeasurement(k);if(te.used===0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var ne=te.value;if(te=p.getMeasurement(k),te.used===0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var X=te.value;if(te=p.getMeasurement(k),te.used===0||k.length!==0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var ae=te.value;c.addSeparator(ne,X,ae,{startChar:r.iChar,endChar:r.iChar+w.length})}break;case"barsperstaff":if(z=m("barsperstaff",O,k),z!==null)return z;break;case"staffnonote":if(k.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(k[0].token==="0")r.staffnonote=!0;else if(k[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+k[0].token+")";break;case"printtempo":if(z=x("printTempo",O,k),z!==null)return z;break;case"partsbox":if(z=x("partsBox",O,k),z!==null)return z;r.partsfont.box=r.partsBox;break;case"freegchord":if(z=x("freegchord",O,k),z!==null)return z;break;case"measurenb":case"barnumbers":if(z=m("barNumbers",O,k),z!==null)return z;break;case"setbarnb":if(k.length!==1||k[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=c.setBarNumberImmediate(k[0].intt);break;case"keywarn":if(k.length!==1||k[0].type!=="number"||k[0].intt!==1&&k[0].intt!==0)return"Directive "+O+" requires 0 or 1 as a parameter.";r[O]=k[0].intt===1;break;case"begintext":var $="";for(V=p.nextLine();V&&V.indexOf("%%endtext")!==0;){if(T.startsWith(V,"%%")){var se=V.substring(2);se=se.trim()+`
|
|
2
2
|
`,$+=se}else $+=V.trim()+`
|
|
3
3
|
`;V=p.nextLine()}c.addText($,{startChar:r.iChar,endChar:r.iChar+$.length+7});break;case"continueall":r.continueall=!0;break;case"beginps":for(V=p.nextLine();V&&V.indexOf("%%endps")!==0;)p.nextLine();o("Postscript ignored",y,0);break;case"deco":w.length>0&&r.ignoredDecorations.push(w.substring(0,w.indexOf(" "))),o("Decoration redefinition ignored",y,0);break;case"text":var ce=p.translateString(w);c.addText(g.parseFontChangeLine(ce),{startChar:r.iChar,endChar:r.iChar+w.length+7});break;case"center":var fe=p.translateString(w);c.addCentered(g.parseFontChangeLine(fe));break;case"font":break;case"setfont":var le=p.tokenize(w,0,w.length);if(le.length>=4&&le[0].token==="-"&&le[1].type==="number"){var ve=parseInt(le[1].token);ve>=1&&ve<=9&&(r.setfont||(r.setfont=[]),le.shift(),le.shift(),r.setfont[ve]=f(le,r.setfont[ve],y,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 u(O,k,y);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return i(O,k,y);case"barlabelfont":case"barnumberfont":case"barnumfont":return u("measurefont",k,y);case"staves":case"score":r.score_is_present=!0;for(var ge=function(Pe,ze,Ie,Ve,Ye){(ze||r.staves.length===0)&&r.staves.push({index:r.staves.length,numVoices:0});var Se=T.last(r.staves);Ie!==void 0&&Se.bracket===void 0&&(Se.bracket=Ie),Ve!==void 0&&Se.brace===void 0&&(Se.brace=Ve),Ye&&(Se.connectBarLines="end"),r.voices[Pe]===void 0&&(r.voices[Pe]={staffNum:Se.index,index:Se.numVoices},Se.numVoices++)},ye=!1,R=!1,q=!1,Y=!1,W=!1,U=!1,J=!1,re,he=function(){if(J=!0,re){var Pe="start";re.staffNum>0&&(r.staves[re.staffNum-1].connectBarLines==="start"||r.staves[re.staffNum-1].connectBarLines==="continue")&&(Pe="continue"),r.staves[re.staffNum].connectBarLines=Pe}};k.length;){var Z=k.shift();switch(Z.token){case"(":ye?o("Can't nest parenthesis in %%score",y,Z.start):(ye=!0,Y=!0);break;case")":!ye||Y?o("Unexpected close parenthesis in %%score",y,Z.start):ye=!1;break;case"[":R?o("Can't nest brackets in %%score",y,Z.start):(R=!0,W=!0);break;case"]":!R||W?o("Unexpected close bracket in %%score",y,Z.start):(R=!1,r.staves[re.staffNum].bracket="end");break;case"{":q?o("Can't nest braces in %%score",y,Z.start):(q=!0,U=!0);break;case"}":!q||U?o("Unexpected close brace in %%score",y,Z.start):(q=!1,r.staves[re.staffNum].brace="end");break;case"|":he();break;default:for(var ie="";(Z.type==="alpha"||Z.type==="number")&&(ie+=Z.token,Z.continueId);)Z=k.shift();var be=!ye||Y,pe=W?"start":R?"continue":void 0,oe=U?"start":q?"continue":void 0;ge(ie,be,pe,oe,J),Y=!1,W=!1,U=!1,J=!1,re=r.voices[ie],O==="staves"&&he();break}}break;case"maxstaves":var me=p.getInt(w);me.digits===0?o("Expected number of staves in maxstaves"):me.value>0&&(n.formatting.maxStaves=me.value);break;case"newpage":var Ee=p.getInt(w);c.addNewPage(Ee.digits===0?-1:Ee.value);break;case"abc":var ue=w.split(" ");switch(ue[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var xe=ue.shift();c.addMetaText(O+xe,ue.join(" "),{startChar:r.iChar,endChar:r.iChar+w.length+5});break;default:return"Unknown directive: "+O+ue[0]}break;case"header":case"footer":var we=p.getMeat(w,0,w.length);we=w.substring(we.start,we.end),we[0]==='"'&&we[we.length-1]==='"'&&(we=we.substring(1,we.length-1));var de=we.split(" "),Te={};de.length===1?Te={left:"",center:de[0],right:""}:de.length===2?Te={left:de[0],center:de[1],right:""}:Te={left:de[0],center:de[1],right:de[2]},de.length>3&&o("Too many tabs in "+O+": "+de.length+" found.",w,0),c.addMetaTextObj(O,Te,{startChar:r.iChar,endChar:r.iChar+y.length});break;case"midi":var ke=p.tokenize(w,0,w.length,!0);ke.length>0&&ke[0].token==="="&&ke.shift(),ke.length===0?o("Expected midi command",w,0):L(ke,n,w);break;case"percmap":var Be=e(w);Be.error?o(Be.error,y,8):(n.formatting.percmap||(n.formatting.percmap={}),n.formatting.percmap[Be.key]=Be.value);break;case"visualtranspose":var De=p.getInt(w);De.digits===0?o("Expected number of half steps in visualTranspose"):r.globalTranspose=De.value;break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":n.formatting[O]=w;break;default:return"Unknown directive: "+O}return null},g.globalFormatting=function(y){for(var k in y)if(y.hasOwnProperty(k)){var w=""+y[k],O=p.tokenize(w,0,w.length),z;switch(k){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":u(k,O,w);break;case"scale":t(k,O);break;case"partsbox":z=x("partsBox",k,O),z!==null&&o(z),r.partsfont.box=r.partsBox;break;case"freegchord":z=x("freegchord",k,O),z!==null&&o(z);break;case"fontboxpadding":(O.length!==1||O[0].type!=="number")&&o('Directive "'+k+'" requires a number as a parameter.'),n.formatting.fontboxpadding=O[0].floatt;break;case"stafftopmargin":(O.length!==1||O[0].type!=="number")&&o('Directive "'+k+'" requires a number as a parameter.'),n.formatting.stafftopmargin=O[0].floatt;break;case"stretchlast":var V=H(O);if(V.value!==void 0&&(n.formatting.stretchlast=V.value),V.error)return V.error;break;default:o("Formatting directive unrecognized: ",k,0)}}};function H(y){if(y.length===0)return{value:1};if(y.length===1)if(y[0].type==="number"){if(y[0].floatt>=0||y[0].floatt<=1)return{value:y[0].floatt}}else{if(y[0].token==="false")return{value:0};if(y[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+y[0].token+")"}}}(),Qe=g,Qe}var Je,Xr;function us(){if(Xr)return Je;Xr=1;var T={};const g=["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 T.pitchIndex=function(p){return g.indexOf(p)},T.noteName=function(p){return g[p]},Je=T,Je}var Ze,Kr;function Mi(){if(Kr)return Ze;Kr=1;var T=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],g=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],p=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],o=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function r(n,c,s,l){if(!c||c%12===0)return n;for(;c<0;)c+=12;c>11&&(c=c%12);var d=n.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!d)return n;var f=d[1],u=d[2],i=d[3],t=d[4],a=T.indexOf(f);if(a<0&&(a=g.indexOf(f)),a<0&&(a=p.indexOf(f)),a<0&&(a=o.indexOf(f)),a<0)return n;a+=c,a=a%12,s?l?n=o[a]:n=g[a]:l?n=p[a]:n=T[a];var e=u&&(u.indexOf("dim")>=0||u.indexOf("°")>=0);if(e&&n==="A#"&&(n="Bb"),e&&n==="D#"&&(n="Eb"),e&&n==="A♯"&&(n="B♭"),e&&n==="D♯"&&(n="E♭"),u&&(n+=u),i){var a=T.indexOf(i);a<0&&(a=g.indexOf(i)),a<0&&(a=p.indexOf(i)),a<0&&(a=o.indexOf(i)),n+="/",a>=0?(a+=c,a=a%12,s?l?n+=o[a]:n+=g[a]:l?n+=p[a]:n+=T[a]):n+=i}return t&&(n+=t),n}return Ze=r,Ze}var et,Ur;function Ai(){if(Ur)return et;Ur=1;var T={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}},g=null;function p(){g={};for(var c=Object.keys(T),s=0;s<c.length;s++){var l=T[c[s]];g[c[s].toLowerCase()]=c[s];for(var d=0;d<l.modes.length;d++){var f=l.modes[d].toLowerCase();g[f]=c[s]}}}function o(c){g||p();var s=c.toLowerCase().match(/([a-g][b#]?)(maj|min|mix|dor|phr|lyd|loc|m)?/);if(!s||!s[2])return c;s=s[1]+s[2];var l=g[s];return l||c}function r(c,s){var l=T[c];if(!l||s==="")return c;var d=s.toLowerCase().match(/^(maj|min|mix|dor|phr|lyd|loc|m)/);if(!d)return c;for(var f=d[1],u=0;u<l.modes.length;u++){var i=l.modes[u],t=i.toLowerCase().indexOf(f);if(t!==-1&&t===i.length-f.length)return i.substring(0,i.length-f.length)}return c}function n(c,s){var l=T[c];if(!l)return c;for(;s<0;)s+=12;for(var d=(l.stepsFromC+s)%12,f=0;f<Object.keys(T).length;f++){var u=Object.keys(T)[f];if(T[u].stepsFromC===d)return u}return c}return et={relativeMajor:o,relativeMode:r,transposeKey:n},et}var tt,$r;function Ni(){if($r)return tt;$r=1;var{relativeMajor:T}=Ai(),g={acc:"sharp",note:"f"},p={acc:"sharp",note:"c"},o={acc:"sharp",note:"g"},r={acc:"sharp",note:"d"},n={acc:"sharp",note:"A"},c={acc:"sharp",note:"e"},s={acc:"sharp",note:"B"},l={acc:"flat",note:"B"},d={acc:"flat",note:"e"},f={acc:"flat",note:"A"},u={acc:"flat",note:"d"},i={acc:"flat",note:"G"},t={acc:"flat",note:"c"},a={acc:"flat",note:"F"},e={"C#":[g,p,o,r,n,c,s],"F#":[g,p,o,r,n,c],B:[g,p,o,r,n],E:[g,p,o,r],A:[g,p,o],D:[g,p],G:[g],C:[],F:[l],Bb:[l,d],Eb:[l,d,f],Cm:[l,d,f],Ab:[l,d,f,u],Db:[l,d,f,u,i],Gb:[l,d,f,u,i,t],Cb:[l,d,f,u,i,t,a],"A#":[l,d],"B#":[],"D#":[l,d,f],"E#":[l],"G#":[l,d,f,u],none:[]};function h(v){var m=e[T(v)];return m?JSON.parse(JSON.stringify(m)):null}return tt=h,tt}var rt,Qr;function Bi(){if(Qr)return rt;Qr=1;var T=us(),g=Mi(),p=Ni(),o={},r={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},n=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],c=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];o.keySignature=function(i,t,a,e,h){if(i.clef.type==="perc"||i.clef.type==="none")return{accidentals:p(t),root:a,acc:e};h||(h=0),i.localTransposeVerticalMovement=0,i.localTransposePreferFlats=!1;var v=p(t);if(!v)return i.key;if(i.localTranspose=(i.globalTranspose?i.globalTranspose:0)+h,!i.localTranspose)return{accidentals:v,root:a,acc:e};if(i.globalTransposeOrigKeySig=v,i.localTranspose%12===0)return i.localTransposeVerticalMovement=i.localTranspose/12*7,{accidentals:v,root:a,acc:e};var m=t[0];t[1]==="b"||t[1]==="#"?(m+=t[1],t=t.substr(2)):t=t.substr(1);var x=r[m],C=x!==void 0;C||(x=0,m="C",t="");for(var S=x+i.localTranspose;S<0;)S+=12;S>11&&(S=S%12);var j=t[0]==="m"?c[S]:n[S],F=j+t,b=p(F);(b.length===0||b[0].acc==="flat")&&(i.localTransposePreferFlats=!0);var M=F.charCodeAt(0)-m.charCodeAt(0);return i.localTranspose>0?(M<0||M===0&&(m[1]==="#"||F[1]==="b"))&&(M+=7):i.localTranspose<0&&(M>0||M===0&&(m[1]==="b"||F[1]==="#"))&&(M-=7),i.localTranspose>0?i.localTransposeVerticalMovement=M+Math.floor(i.localTranspose/12)*7:i.localTransposeVerticalMovement=M+Math.ceil(i.localTranspose/12)*7,C?{accidentals:b,root:j[0],acc:j.length>1?j[1]:""}:{accidentals:[],root:a,acc:e}},o.chordName=function(i,t){return g(t,i.localTranspose,i.localTransposePreferFlats,i.freegchord)};var s=["c","d","e","f","g","a","b"];function l(i,t,a,e,h){for(var v=s[(i+49)%7],m=0,x=0;x<e.length;x++)e[x].note.toLowerCase()===v&&(m=d[e[x].acc]);for(var C=d[a],S=C-m,j=s[(t+49)%7],F=0,b=0;b<h.accidentals.length;b++)h.accidentals[b].note.toLowerCase()===j&&(F=d[h.accidentals[b].acc]);var M=S+F;return M<-2&&(t--,M+=j==="c"||j==="f"?1:2),M>2&&(t++,M-=j==="b"||j==="e"?1:2),[t,M]}var d={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},f={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},u={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};return o.note=function(i,t){if(!(!i.localTranspose||i.clef.type==="perc")){var a=t.pitch;if(i.localTransposeVerticalMovement&&(t.pitch=t.pitch+i.localTransposeVerticalMovement,t.name)){var e=t.accidental?t.name.substring(1):t.name,h=t.accidental?t.name[0]:"",v=T.pitchIndex(e);t.name=h+T.noteName(v+i.localTransposeVerticalMovement)}if(t.accidental){var m=l(a,t.pitch,t.accidental,i.globalTransposeOrigKeySig,i.targetKey);t.pitch=m[0],t.accidental=f[m[1]],t.name&&(t.name=u[m[1]]+t.name.replace(/[_^=]/g,""))}}},rt=o,rt}var at,Jr;function Lr(){if(Jr)return at;Jr=1;var T=Pr(),g=Bi(),p={};return function(){var o,r,n,c;p.initialize=function(t,a,e,h,v){o=t,r=a,n=e,c=v},p.standardKey=function(t,a,e,h){return g.keySignature(n,t,a,e,h)};var s={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}},l=function(t,a){var e=s[t],h=e?e.mid:0;return h+a};p.fixClef=function(t){var a=s[t.type];a&&(t.clefPos=a.pitch,t.type=a.clef)},p.deepCopyKey=function(t){var a={accidentals:[],root:t.root,acc:t.acc,mode:t.mode};return t.accidentals.forEach(function(e){a.accidentals.push(Object.assign({},e))}),a};var d={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};p.addPosToKey=function(t,a){var e=t.verticalPos;a.accidentals.forEach(function(h){var v=d[h.note];v=v-e,h.verticalPos=v}),a.impliedNaturals&&a.impliedNaturals.forEach(function(h){var v=d[h.note];v=v-e,h.verticalPos=v}),e<-10?(a.accidentals.forEach(function(h){h.verticalPos-=7,(h.verticalPos>=11||h.verticalPos===10&&h.acc==="flat")&&(h.verticalPos-=7),h.note==="A"&&h.acc==="sharp"&&(h.verticalPos-=7),(h.note==="G"||h.note==="F")&&h.acc==="flat"&&(h.verticalPos-=7)}),a.impliedNaturals&&a.impliedNaturals.forEach(function(h){h.verticalPos-=7,(h.verticalPos>=11||h.verticalPos===10&&h.acc==="flat")&&(h.verticalPos-=7),h.note==="A"&&h.acc==="sharp"&&(h.verticalPos-=7),(h.note==="G"||h.note==="F")&&h.acc==="flat"&&(h.verticalPos-=7)})):e<-4?(a.accidentals.forEach(function(h){h.verticalPos-=7,e===-8&&(h.note==="f"||h.note==="g")&&h.acc==="sharp"&&(h.verticalPos-=7)}),a.impliedNaturals&&a.impliedNaturals.forEach(function(h){h.verticalPos-=7,e===-8&&(h.note==="f"||h.note==="g")&&h.acc==="sharp"&&(h.verticalPos-=7)})):e>=7&&(a.accidentals.forEach(function(h){h.verticalPos+=7}),a.impliedNaturals&&a.impliedNaturals.forEach(function(h){h.verticalPos+=7}))},p.fixKey=function(t,a){var e=Object.assign({},a);return p.addPosToKey(t,e),e};var f=function(t){var a=0,e=t[a++];(e==="^"||e==="_")&&(e=t[a++]);var h=d[e];for(h===void 0&&(h=6);a<t.length;a++)if(t[a]===",")h-=7;else if(t[a]==="'")h+=7;else break;return{mid:h-6,str:t.substring(a)}},u=function(t){for(var a=0;a<t.length;a++)t[a].note==="b"?t[a].note="B":t[a].note==="a"?t[a].note="A":t[a].note==="F"?t[a].note="f":t[a].note==="E"?t[a].note="e":t[a].note==="D"?t[a].note="d":t[a].note==="C"?t[a].note="c":t[a].note==="G"&&t[a].acc==="sharp"?t[a].note="g":t[a].note==="g"&&t[a].acc==="flat"&&(t[a].note="G")};p.parseKey=function(t,a){t.length===0&&(t="none");var e=o.tokenize(t,0,t.length),h={};if(e.length===0)return r("Must pass in key signature.",t,0),h;switch(e[0].token){case"HP":T.addDirective("bagpipes"),n.key={root:"HP",accidentals:[],acc:"",mode:""},h.foundKey=!0,e.shift();break;case"Hp":T.addDirective("bagpipes"),n.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},h.foundKey=!0,e.shift();break;case"none":n.key={root:"none",accidentals:[],acc:"",mode:""},h.foundKey=!0,e.shift();break;default:var v=o.getKeyPitch(e[0].token);if(v.len>0){h.foundKey=!0;var m="",x="";e[0].token.length>1?e[0].token=e[0].token.substring(1):e.shift();var C=v.token;if(e.length>0){var S=o.getSharpFlat(e[0].token);if(S.len>0&&(e[0].token.length>1?e[0].token=e[0].token.substring(1):e.shift(),C+=S.token,m=S.token),e.length>0){var j=o.getMode(e[0].token);j.len>0&&(e.shift(),C+=j.token,x=j.token)}if(p.standardKey(C,v.token,m,0)===void 0)return r("Unsupported key signature: "+C,t,0),h}var F=p.deepCopyKey(n.key),b=!a&&n.globalTranspose?-n.globalTranspose:0,M;if(a&&(M=n.globalTransposeOrigKeySig),n.key=p.deepCopyKey(p.standardKey(C,v.token,m,b)),a&&(n.globalTransposeOrigKeySig=M),n.key.mode=x,F&&n.keywarn!==!1){for(var B,A=0;A<n.key.accidentals.length;A++)for(B=0;B<F.accidentals.length;B++)F.accidentals[B].note&&n.key.accidentals[A].note.toLowerCase()===F.accidentals[B].note.toLowerCase()&&(F.accidentals[B].note=null);for(B=0;B<F.accidentals.length;B++)F.accidentals[B].note&&(n.key.impliedNaturals||(n.key.impliedNaturals=[]),n.key.impliedNaturals.push({acc:"natural",note:F.accidentals[B].note}))}}break}if(e.length===0||(e[0].token==="exp"&&e.shift(),e.length===0)||(e[0].token==="oct"&&e.shift(),e.length===0))return h;var P=o.getKeyAccidentals2(e);if(P.warn&&r(P.warn,t,0),P.accs){h.foundKey||(h.foundKey=!0,n.key={root:"none",acc:"",mode:"",accidentals:[]}),u(P.accs);for(var N=0;N<P.accs.length;N++){for(var E=!1,_=0;_<n.key.accidentals.length&&!E;_++)n.key.accidentals[_].note===P.accs[N].note&&(E=!0,n.key.accidentals[_].acc!==P.accs[N].acc&&(n.key.accidentals[_].acc=P.accs[N].acc,n.key.explicitAccidentals||(n.key.explicitAccidentals=[]),n.key.explicitAccidentals.push(P.accs[N])));if(!E&&(n.key.explicitAccidentals||(n.key.explicitAccidentals=[]),n.key.explicitAccidentals.push(P.accs[N]),n.key.accidentals.push(P.accs[N]),n.key.impliedNaturals))for(var L=0;L<n.key.impliedNaturals.length;L++)n.key.impliedNaturals[L].note===P.accs[N].note&&n.key.impliedNaturals.splice(L,1)}}for(var D;e.length>0;)switch(e[0].token){case"m":case"middle":if(e.shift(),e.length===0)return r("Expected = after middle",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after middle",t,D.start);break}if(e.length===0)return r("Expected parameter after middle=",t,0),h;var H=o.getPitchFromTokens(e);H.warn&&r(H.warn,t,0),H.position&&(n.clef.verticalPos=H.position-6);break;case"transpose":if(e.shift(),e.length===0)return r("Expected = after transpose",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after transpose",t,D.start);break}if(e.length===0)return r("Expected parameter after transpose=",t,0),h;if(e[0].type!=="number"){r("Expected number after transpose",t,e[0].start);break}n.clef.transpose=e[0].intt,e.shift();break;case"stafflines":if(e.shift(),e.length===0)return r("Expected = after stafflines",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after stafflines",t,D.start);break}if(e.length===0)return r("Expected parameter after stafflines=",t,0),h;if(e[0].type!=="number"){r("Expected number after stafflines",t,e[0].start);break}n.clef.stafflines=e[0].intt,e.shift();break;case"staffscale":if(e.shift(),e.length===0)return r("Expected = after staffscale",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after staffscale",t,D.start);break}if(e.length===0)return r("Expected parameter after staffscale=",t,0),h;if(e[0].type!=="number"){r("Expected number after staffscale",t,e[0].start);break}n.clef.staffscale=e[0].floatt,e.shift();break;case"octave":if(e.shift(),e.length===0)return r("Expected = after octave",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after octave",t,D.start);break}if(e.length===0)return r("Expected parameter after octave=",t,0),h;if(e[0].type!=="number"){r("Expected number after octave",t,e[0].start);break}n.octave=e[0].intt,e.shift();break;case"style":if(e.shift(),e.length===0)return r("Expected = after style",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after style",t,D.start);break}if(e.length===0)return r("Expected parameter after style=",t,0),h;switch(e[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":n.style=e[0].token,e.shift();break;default:r("error parsing style element: "+e[0].token,t,e[0].start);break}break;case"clef":if(e.shift(),e.length===0)return r("Expected = after clef",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after clef",t,D.start);break}if(e.length===0)return r("Expected parameter after clef=",t,0),h;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var y=e.shift();switch(y.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":y.token="alto";break;case"F":y.token="bass";break;case"G":y.token="treble";break;case"c":y.token="alto";break;case"f":y.token="bass";break;case"g":y.token="treble";break;default:r("Expected clef name. Found "+y.token,t,y.start);break}e.length>0&&e[0].type==="number"&&(y.token+=e[0].token,e.shift()),e.length>1&&(e[0].token==="-"||e[0].token==="+"||e[0].token==="^"||e[0].token==="_")&&e[1].token==="8"&&(y.token+=e[0].token+e[1].token,e.shift(),e.shift()),n.clef={type:y.token,verticalPos:l(y.token,0)},n.currentVoice&&n.currentVoice.transpose!==void 0&&(n.clef.transpose=n.currentVoice.transpose),h.foundClef=!0;break;default:r("Unknown parameter: "+e[0].token,t,e[0].start),e.shift()}return h};var i=function(t){var a=n.voices[t];if(!(n.currentVoice&&n.currentVoice.index===a.index&&n.currentVoice.staffNum===a.staffNum))return n.currentVoice=a,c.setCurrentVoice(a.staffNum,a.index,t)};p.parseVoice=function(t,a,e){var h=o.getMeat(t,a,e),v=h.start,m=h.end,x=o.getToken(t,v,m);if(x.length===0){r("Expected a voice id",t,v);return}var C=!1;n.voices[x]===void 0&&(n.voices[x]={},C=!0,n.score_is_present&&r("Can't have an unknown V: id when the %score directive is present",t,v)),v+=x.length,v+=o.eatWhiteSpace(t,v);for(var S={startStaff:C},j=function(H){var y=o.getVoiceToken(t,v,m);y.warn!==void 0?r("Expected value for "+H+" in voice: "+y.warn,t,v):y.err!==void 0?r("Expected value for "+H+" in voice: "+y.err,t,v):y.token.length===0&&t[v]!=='"'?r("Expected value for "+H+" in voice",t,v):S[H]=y.token,v+=y.len},F=function(H,y,k){var w=o.getVoiceToken(t,v,m);w.warn!==void 0?r("Expected value for "+y+" in voice: "+w.warn,t,v):w.err!==void 0?r("Expected value for "+y+" in voice: "+w.err,t,v):w.token.length===0&&t[v]!=='"'?r("Expected value for "+y+" in voice",t,v):(w.token=parseFloat(w.token),n.voices[H][y]=w.token),v+=w.len},b=function(H,y){var k=o.getVoiceToken(t,v,m);if(k.warn!==void 0)r("Expected value for "+H+" in voice: "+k.warn,t,v);else if(k.err!==void 0)r("Expected value for "+H+" in voice: "+k.err,t,v);else if(k.token.length===0&&t[v]!=='"')r("Expected value for "+H+" in voice",t,v);else return k.token;v+=k.len},M=function(H,y){var k={_B:2,_E:9,_b:-10,_e:-3},w=o.getVoiceToken(t,v,m);if(w.warn!==void 0)r("Expected one of (_B, _E, _b, _e) for "+y+" in voice: "+w.warn,t,v);else if(w.token.length===0&&t[v]!=='"')r("Expected one of (_B, _E, _b, _e) for "+y+" in voice",t,v);else{var O=k[w.token];O?n.voices[H][y]=O:r("Expected one of (_B, _E, _b, _e) for "+y+" in voice",t,v)}v+=w.len};v<m;){var B=o.getVoiceToken(t,v,m);if(v+=B.len,B.warn)r("Error parsing voice: "+B.warn,t,v);else{var A=null;switch(B.token){case"clef":case"cl":j("clef");var P=0;S.clef!==void 0&&(S.clef=S.clef.replace(/[',]/g,""),S.clef.indexOf("+16")!==-1&&(P+=14,S.clef=S.clef.replace("+16","")),S.verticalPos=l(S.clef,P));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,,":case"treble+8":case"treble-8":case"treble^8":case"treble_8":case"treble1":case"treble2":case"treble3":case"treble4":case"treble5":case"bass+8":case"bass-8":case"bass^8":case"bass_8":case"bass+16":case"bass-16":case"bass^16":case"bass_16":case"bass1":case"bass2":case"bass3":case"bass4":case"bass5":case"tenor1":case"tenor2":case"tenor3":case"tenor4":case"tenor5":case"alto1":case"alto2":case"alto3":case"alto4":case"alto5":case"alto+8":case"alto-8":case"alto^8":case"alto_8":var N=0;S.clef=B.token.replace(/[',]/g,""),S.verticalPos=l(S.clef,N),n.voices[x].clef=B.token;break;case"staves":case"stave":case"stv":j("staves");break;case"brace":case"brc":j("brace");break;case"bracket":case"brk":j("bracket");break;case"name":case"nm":j("name");break;case"subname":case"sname":case"snm":j("subname");break;case"merge":S.startStaff=!1;break;case"stem":case"stems":A=o.getVoiceToken(t,v,m),A.warn!==void 0?r("Expected value for stems in voice: "+A.warn,t,v):A.err!==void 0?r("Expected value for stems in voice: "+A.err,t,v):A.token==="up"||A.token==="down"?n.voices[x].stem=A.token:r("Expected up or down for voice stem",t,v),v+=A.len;break;case"up":case"down":n.voices[x].stem=B.token;break;case"middle":case"m":j("verticalPos"),S.verticalPos=f(S.verticalPos).mid;break;case"gchords":case"gch":n.voices[x].suppressChords=!0,A=o.getVoiceToken(t,v,m),A.token==="0"&&(v=v+A.len);break;case"space":case"spc":j("spacing");break;case"scale":F(x,"scale");break;case"score":M(x,"scoreTranspose");break;case"transpose":F(x,"transpose");break;case"stafflines":F(x,"stafflines");break;case"staffscale":F(x,"staffscale");break;case"octave":F(x,"octave");break;case"volume":F(x,"volume");break;case"cue":var E=b("cue");E==="on"?n.voices[x].scale=.6:n.voices[x].scale=1;break;case"style":A=o.getVoiceToken(t,v,m),A.warn!==void 0?r("Expected value for style in voice: "+A.warn,t,v):A.err!==void 0?r("Expected value for style in voice: "+A.err,t,v):A.token==="normal"||A.token==="harmonic"||A.token==="rhythm"||A.token==="x"||A.token==="triangle"?n.voices[x].style=A.token:r("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",t,v),v+=A.len;break}}v+=o.eatWhiteSpace(t,v)}if((S.startStaff||n.staves.length===0)&&(n.staves.push({index:n.staves.length,meter:n.origMeter}),n.score_is_present||(n.staves[n.staves.length-1].numVoices=0)),n.voices[x].staffNum===void 0){n.voices[x].staffNum=n.staves.length-1;var _=0;for(var L in n.voices)n.voices.hasOwnProperty(L)&&n.voices[L].staffNum===n.voices[x].staffNum&&_++;n.voices[x].index=_-1}var D=n.staves[n.voices[x].staffNum];return n.score_is_present||D.numVoices++,S.clef&&(D.clef={type:S.clef,verticalPos:S.verticalPos}),S.spacing&&(D.spacing_below_offset=S.spacing),S.verticalPos&&(D.verticalPos=S.verticalPos),S.name&&(D.name?D.name.push(S.name):D.name=[S.name]),S.subname&&(D.subname?D.subname.push(S.subname):D.subname=[S.subname]),i(x)}}(),at=p,at}var nt,Zr;function ds(){if(Zr)return nt;Zr=1;var T=Ne(),g=Pr(),p=Lr(),o=function(r,n,c,s,l){this.reset=function(u,i,t,a){p.initialize(u,i,t,a,l),g.initialize(u,i,t,a,l)},this.reset(r,n,c,s),this.setTitle=function(u,i){c.hasMainTitle?l.addSubtitle(u,{startChar:c.iChar,endChar:c.iChar+i+2}):(l.addMetaText("title",u,{startChar:c.iChar,endChar:c.iChar+i+2}),c.hasMainTitle=!0)},this.setMeter=function(u){if(u=r.stripComment(u),u==="C")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"common_time"};if(u==="C|")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"cut_time"};if(u==="o")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_perfectum"};if(u==="c")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_imperfectum"};if(u==="o.")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(u==="c.")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(u.length===0||u.toLowerCase()==="none")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),null;var i=r.tokenize(u,0,u.length);try{var t=function(){var x={value:0,num:""},C=i.shift();for(C.token==="("&&(C=i.shift());;){if(C.type!=="number")throw"Expected top number of meter";if(x.value+=parseInt(C.token),x.num+=C.token,i.length===0||i[0].token==="/")return x;if(C=i.shift(),C.token===")"){if(i.length===0||i[0].token==="/")return x;throw"Unexpected paren in meter"}if(C.token!=="."&&C.token!=="+"||(x.num+=C.token,i.length===0))throw"Expected top number of meter";C=i.shift()}return x},a=function(){var x=t();if(i.length===0)return x;var C=i.shift();if(C.token!=="/")throw"Expected slash in meter";if(C=i.shift(),C.type!=="number")throw"Expected bottom number of meter";return x.den=C.token,x.value=x.value/parseInt(x.den),x};if(i.length===0)throw"Expected meter definition in M: line";for(var e={type:"specified",value:[]},h=0;;){var v=a();h+=v.value;var m={num:v.num};if(v.den!==void 0&&(m.den=v.den),e.value.push(m),i.length===0)break}return c.havent_set_length===!0&&(c.default_length=h<.75?.0625:.125,c.havent_set_length=!1),e}catch(x){n(x,u,0)}return null},this.calcTempo=function(u){var i=.25;c.meter&&c.meter.type==="specified"?i=1/parseInt(c.meter.value[0].den):c.origMeter&&c.origMeter.type==="specified"&&(i=1/parseInt(c.origMeter.value[0].den));for(var t=0;t<u.duration;t++)u.duration[t]=i*u.duration[t];return u},this.resolveTempo=function(){c.tempo&&(this.calcTempo(c.tempo),s.metaText.tempo=c.tempo,delete c.tempo)},this.addUserDefinition=function(u,i,t){var a=u.indexOf("=",i);if(a===-1){n("Need an = in a macro definition",u,i);return}var e=T.strip(u.substring(i,a)),h=T.strip(u.substring(a+1));if(e.length!==1){n("Macro definitions can only be one character",u,i);return}var v="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(v.indexOf(e)===-1){n("Macro definitions must be H-Y, h-w, or tilde",u,i);return}if(h.length===0){n("Missing macro definition",u,i);return}c.macros===void 0&&(c.macros={}),c.macros[e]=h},this.setDefaultLength=function(u,i,t){var a=u.substring(i,t).replace(/ /g,""),e=a.split("/");if(e.length===2){var h=parseInt(e[0]),v=parseInt(e[1]);v>0&&(c.default_length=h/v,c.havent_set_length=!1)}else e.length===1&&e[0]==="1"&&(c.default_length=1,c.havent_set_length=!1)};var d={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(u,i,t,a){try{var e=r.tokenize(u,i,t);if(e.length===0)throw"Missing parameter in Q: field";var h={startChar:a+i-2,endChar:a+t},v=!0,m=e.shift();if(m.type==="quote"&&(h.preString=m.token,m=e.shift(),e.length===0))return d[h.preString.toLowerCase()]&&(h.bpm=d[h.preString.toLowerCase()],h.suppressBpm=!0),{type:"immediate",tempo:h};if(m.type==="alpha"&&m.token==="C"){if(e.length===0)throw"Missing tempo after C in Q: field";if(m=e.shift(),m.type==="punct"&&m.token==="="){if(e.length===0)throw"Missing tempo after = in Q: field";if(m=e.shift(),m.type!=="number")throw"Expected number after = in Q: field";h.duration=[1],h.bpm=parseInt(m.token)}else if(m.type==="number"){if(h.duration=[parseInt(m.token)],e.length===0)throw"Missing = after duration in Q: field";if(m=e.shift(),m.type!=="punct"||m.token!=="=")throw"Expected = after duration in Q: field";if(e.length===0)throw"Missing tempo after = in Q: field";if(m=e.shift(),m.type!=="number")throw"Expected number after = in Q: field";h.bpm=parseInt(m.token)}else throw"Expected number or equal after C in Q: field"}else if(m.type==="number"){var x=parseInt(m.token);if(e.length===0||e[0].type==="quote")h.duration=[1],h.bpm=x;else{if(v=!1,m=e.shift(),m.type!=="punct"&&m.token!=="/"||(m=e.shift(),m.type!=="number"))throw"Expected fraction in Q: field";var C=parseInt(m.token);for(h.duration=[x/C];e.length>0&&e[0].token!=="="&&e[0].type!=="quote";){if(m=e.shift(),m.type!=="number"||(x=parseInt(m.token),m=e.shift(),m.type!=="punct"&&m.token!=="/")||(m=e.shift(),m.type!=="number"))throw"Expected fraction in Q: field";C=parseInt(m.token),h.duration.push(x/C)}if(m=e.shift(),m.type!=="punct"&&m.token!=="=")throw"Expected = in Q: field";if(m=e.shift(),m.type!=="number")throw"Expected tempo in Q: field";h.bpm=parseInt(m.token)}}else throw"Unknown value in Q: field";if(e.length!==0&&(m=e.shift(),m.type==="quote"&&(h.postString=m.token,m=e.shift()),e.length!==0))throw"Unexpected string at end of Q: field";return c.printTempo===!1&&(h.suppress=!0),{type:v?"delaySet":"immediate",tempo:h}}catch(S){return n(S,u,i),{type:"none"}}},this.letter_to_inline_header=function(u,i,t){var a=!1,e=r.eatWhiteSpace(u,i);if(i+=e,u.length>=i+5&&u[i]==="["&&u[i+2]===":"){var h=u.indexOf("]",i),v=c.iChar+i,m=c.iChar+h+1;switch(u.substring(i,i+3)){case"[I:":var x=g.addDirective(u.substring(i+3,h));return x&&n(x,u,i),[h-i+1+e];case"[M:":var C=this.setMeter(u.substring(i+3,h));return l.hasBeginMusic()&&C?l.appendStartingElement("meter",v,m,C):c.meter=C,[h-i+1+e];case"[K:":var S=p.parseKey(u.substring(i+3,h),!0);return S.foundClef&&l.hasBeginMusic()&&l.appendStartingElement("clef",v,m,c.clef),S.foundKey&&l.hasBeginMusic()&&l.appendStartingElement("key",v,m,p.fixKey(c.clef,c.key)),[h-i+1+e];case"[P:":var j=g.parseFontChangeLine(u.substring(i+3,h));return t||s.lines.length<=s.lineNum?c.partForNextLine={title:j,startChar:v,endChar:m}:l.appendElement("part",v,m,{title:j}),[h-i+1+e];case"[L:":return this.setDefaultLength(u,i+3,h),[h-i+1+e];case"[Q:":if(h>0){var F=this.setTempo(u,i+3,h,c.iChar);return F.type==="delaySet"?l.hasBeginMusic()?l.appendElement("tempo",v,m,this.calcTempo(F.tempo)):c.tempoForNextLine=["tempo",v,m,this.calcTempo(F.tempo)]:F.type==="immediate"&&(!t&&l.hasBeginMusic()?l.appendElement("tempo",v,m,F.tempo):c.tempoForNextLine=["tempo",v,m,F.tempo]),[h-i+1+e,u[i+1],u.substring(i+3,h)]}break;case"[V:":if(h>0)return a=p.parseVoice(u,i+3,h),[h-i+1+e,u[i+1],u.substring(i+3,h),a];break;case"[r:":return[h-i+1+e]}}return[0]},this.letter_to_body_header=function(u,i){var t=!1;if(u.length>=i+3)switch(u.substring(i,i+2)){case"I:":var a=g.addDirective(u.substring(i+2));return a&&n(a,u,i),[u.length];case"M:":var e=this.setMeter(u.substring(i+2));return l.hasBeginMusic()&&e&&l.appendStartingElement("meter",c.iChar+i,c.iChar+u.length,e),[u.length];case"K:":var h=p.parseKey(u.substring(i+2),l.hasBeginMusic());return h.foundClef&&l.hasBeginMusic()&&c.keywarn!==!1&&l.appendStartingElement("clef",c.iChar+i,c.iChar+u.length,c.clef),h.foundKey&&l.hasBeginMusic()&&c.keywarn!==!1&&l.appendStartingElement("key",c.iChar+i,c.iChar+u.length,p.fixKey(c.clef,c.key)),[u.length];case"P:":return l.hasBeginMusic()&&l.appendElement("part",c.iChar+i,c.iChar+u.length,{title:u.substring(i+2)}),[u.length];case"L:":return this.setDefaultLength(u,i+2,u.length),[u.length];case"Q:":var v=u.indexOf("",i+2);v===-1&&(v=u.length);var m=this.setTempo(u,i+2,v,c.iChar);return m.type==="delaySet"?l.appendElement("tempo",c.iChar+i,c.iChar+u.length,this.calcTempo(m.tempo)):m.type==="immediate"&&l.appendElement("tempo",c.iChar+i,c.iChar+u.length,m.tempo),[v,u[i],T.strip(u.substring(i+2))];case"V:":return t=p.parseVoice(u,i+2,u.length),[u.length,u[i],T.strip(u.substring(i+2)),t]}return[0]};var f={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(u){var i=f[u[0]],t=u.length-2,a=r.translateString(r.stripComment(u.substring(2)));if(i==="unalignedWords"||i==="notes")l.addMetaTextArray(i,g.parseFontChangeLine(a),{startChar:c.iChar,endChar:c.iChar+u.length});else if(i!==void 0)l.addMetaText(i,g.parseFontChangeLine(a),{startChar:c.iChar,endChar:c.iChar+u.length});else{var e=c.iChar,h=e+u.length;switch(u[0]){case"H":for(l.addMetaTextArray("history",g.parseFontChangeLine(a),{startChar:c.iChar,endChar:c.iChar+u.length}),u=r.peekLine();u&&u[1]!==":";)r.nextLine(),l.addMetaTextArray("history",g.parseFontChangeLine(r.translateString(r.stripComment(u))),{startChar:c.iChar,endChar:c.iChar+u.length}),u=r.peekLine();break;case"K":this.resolveTempo();var v=p.parseKey(u.substring(2),!1);!c.is_in_header&&l.hasBeginMusic()&&c.keywarn!==!1&&(v.foundClef&&l.appendStartingElement("clef",e,h,c.clef),v.foundKey&&l.appendStartingElement("key",e,h,p.fixKey(c.clef,c.key))),c.is_in_header=!1;break;case"L":this.setDefaultLength(u,2,u.length);break;case"M":c.origMeter=c.meter=this.setMeter(u.substring(2));break;case"P":c.is_in_header?l.addMetaText("partOrder",g.parseFontChangeLine(a),{startChar:c.iChar,endChar:c.iChar+u.length}):c.partForNextLine={title:a,startChar:e,endChar:h};break;case"Q":var m=this.setTempo(u,2,u.length,c.iChar);m.type==="delaySet"?c.tempo=m.tempo:m.type==="immediate"&&(s.metaText.tempo?c.tempoForNextLine=["tempo",e,h,m.tempo]:s.metaText.tempo=m.tempo);break;case"T":c.titlecaps&&(a=a.toUpperCase()),this.setTitle(g.parseFontChangeLine(r.theReverser(a)),t);break;case"U":this.addUserDefinition(u,2,u.length);break;case"V":if(p.parseVoice(u,2,u.length),!c.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":n("Ignored header",u,0);break;default:return{regular:!0}}}return{}}};return nt=o,nt}var Ce={},ea;function fs(){return ea||(ea=1,Ce.legalAccents=["trill","trillh","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"],Ce.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"],Ce.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"],Ce.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],Ce.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],Ce.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{",Ce.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],Ce.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},Ce.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"},Ce.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"},Ce.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2}),Ce}var it,ta;function ps(){if(ta)return it;ta=1;var T=Lr(),g=Bi(),p,o,r,n,c,s,{legalAccents:l,volumeDecorations:d,dynamicDecorations:f,accentPseudonyms:u,accentDynamicPseudonyms:i,nonDecorations:t,durations:a,pitches:e,rests:h,accMap:v,tripletQ:m}=fs(),x=function(y,k,w,O,z,V){p=y,o=k,r=w,n=O,c=z,s=V,this.lineContinuation=!1},C=function(y,k,w){if(y.inTie[k]===void 0)return!1;var O=y.currentVoice?y.currentVoice.staffNum*100+y.currentVoice.index:0;return!!(y.inTie[k][O]&&(w.pitches!==void 0||w.rest.type!=="spacer"))},S={};x.prototype.parseMusic=function(y){s.resolveTempo(),r.is_in_header=!1;for(var k=0,w=r.iChar;p.isWhiteSpace(y[k])&&k<y.length;)k++;if(!(k===y.length||y[k]==="%")){var O=r.start_new_line;r.continueall===void 0?r.start_new_line=!0:r.start_new_line=!1;var z=0,V=s.letter_to_body_header(y,k);V[0]>0&&(k+=V[0],V[1]==="V"&&this.startNewLine());for(var I=0;k<y.length;){var K=k;if(y[k]==="%")break;var Q=s.letter_to_inline_header(y,k,O);if(Q[0]>0)k+=Q[0],Q[1]==="V"&&(O=!0);else{(!c.hasBeginMusic()||O&&!this.lineContinuation)&&(this.startNewLine(),O=!1);for(var G;;)if(G=p.eatWhiteSpace(y,k),G>0&&(k+=G),k>0&&y[k-1]===""&&(G=s.letter_to_body_header(y,k),G[0]>0&&(G[1]==="V"&&this.startNewLine(),k=G[0],r.start_new_line=!1)),G=P(y,k),G[0]>0&&(k+=G[0]),G=F(y,k),G[0]>0){S.chord||(S.chord=[]);var ee=p.translateString(G[1]);ee=ee.replace(/;/g,`
|
|
4
4
|
`);for(var te=!1,ne=0;ne<S.chord.length;ne++)S.chord[ne].position===G[2]&&(te=!0,S.chord[ne].name+=`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{R as e,O as s,am as i,B as n,an as d}from"./index-
|
|
1
|
+
import{R as e,O as s,am as i,B as n,an as d}from"./index-p0knuDQ9.js";import{N as p}from"./treemap-KMMF4GRG-C4GHjB3F-_nPgBK22.js";import"./_baseUniq-Cd4llU-Q-Cdw60MU4.js";import"./_basePickBy-1MakYQmz-ydNwd1l_.js";import"./clone-DH1Kq5Y6-DxQT_fR1.js";var m={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},g={version:d.version+""},v=e(()=>g.version,"getVersion"),c={getVersion:v},f=e((r,a,o)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=i(a);n(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),x={draw:f},N={parser:m,db:c,renderer:x};export{N as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as ft,y as rt,g as gt,x as mt}from"./chunk-TZMSLE5B-DGddLgNl-
|
|
1
|
+
import{d as ft,y as rt,g as gt,x as mt}from"./chunk-TZMSLE5B-DGddLgNl-CifiGjd6.js";import{l as xt}from"./chunk-FMBD7UC4-C6VImbBX-ip_5_GPo.js";import{R as s,u as kt,f as _t,l as bt,s as wt,r as $t,o as vt,g as V,e as X,B as St,w as Mt}from"./index-p0knuDQ9.js";import{h as tt}from"./arc-b8oyw-lz-1LLYREoj.js";var U=function(){var t=s(function(y,i,a,u){for(a=a||{},u=y.length;u--;a[y[u]]=i);return a},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],l=[1,10],n=[1,11],c=[1,12],d=[1,13],h=[1,14],f={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(y,i,a,u,p,o,x){var k=o.length-1;switch(p){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:u.setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),u.setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),u.setAccDescription(this.$);break;case 12:u.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 13:u.addTask(o[k-1],o[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:l,14:n,16:c,17:d,18:h},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:l,14:n,16:c,17:d,18:h},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(y,i){if(i.recoverable)this.trace(y);else{var a=new Error(y);throw a.hash=i,a}},"parseError"),parse:s(function(y){var i=this,a=[0],u=[],p=[null],o=[],x=this.table,k="",T=0,A=0,ut=2,J=1,pt=o.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var Y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Y)&&(I.yy[Y]=this.yy[Y]);_.setInput(y,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;o.push(z);var yt=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function dt(w){a.length=a.length-2*w,p.length=p.length-w,o.length=o.length-w}s(dt,"popStack");function K(){var w;return w=u.pop()||_.lex()||J,typeof w!="number"&&(w instanceof Array&&(u=w,w=u.pop()),w=i.symbols_[w]||w),w}s(K,"lex");for(var b,P,$,W,j={},D,M,H,O;;){if(P=a[a.length-1],this.defaultActions[P]?$=this.defaultActions[P]:((b===null||typeof b>"u")&&(b=K()),$=x[P]&&x[P][b]),typeof $>"u"||!$.length||!$[0]){var G="";O=[];for(D in x[P])this.terminals_[D]&&D>ut&&O.push("'"+this.terminals_[D]+"'");_.showPosition?G="Parse error on line "+(T+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+O.join(", ")+", got '"+(this.terminals_[b]||b)+"'":G="Parse error on line "+(T+1)+": Unexpected "+(b==J?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(G,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:z,expected:O})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+b);switch($[0]){case 1:a.push(b),p.push(_.yytext),o.push(_.yylloc),a.push($[1]),b=null,A=_.yyleng,k=_.yytext,T=_.yylineno,z=_.yylloc;break;case 2:if(M=this.productions_[$[1]][1],j.$=p[p.length-M],j._$={first_line:o[o.length-(M||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(M||1)].first_column,last_column:o[o.length-1].last_column},yt&&(j._$.range=[o[o.length-(M||1)].range[0],o[o.length-1].range[1]]),W=this.performAction.apply(j,[k,A,T,I.yy,$[1],p,o].concat(pt)),typeof W<"u")return W;M&&(a=a.slice(0,-1*M*2),p=p.slice(0,-1*M),o=o.slice(0,-1*M)),a.push(this.productions_[$[1]][0]),p.push(j.$),o.push(j._$),H=x[a[a.length-2]][a[a.length-1]],a.push(H);break;case 3:return!0}}return!0},"parse")},m=function(){var y={EOF:1,parseError:s(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:s(function(i,a){return this.yy=a||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:s(function(i){var a=i.length,u=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var o=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===p.length?this.yylloc.first_column:0)+p[p.length-u.length].length-u[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(i){this.unput(this.match.slice(i))},"less"),pastInput:s(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as a,O as ee,g as W,am as pe,b as ye,m as fe,Y as me,aT as be,L as K,A as G,v as _e,y as Ee,aU as Se,aV as ae,aW as le}from"./index-
|
|
1
|
+
import{R as a,O as ee,g as W,am as pe,b as ye,m as fe,Y as me,aT as be,L as K,A as G,v as _e,y as Ee,aU as Se,aV as ae,aW as le}from"./index-p0knuDQ9.js";import{l as ke}from"./chunk-FMBD7UC4-C6VImbBX-ip_5_GPo.js";var Q=function(){var i=a(function(k,e,n,r){for(n=n||{},r=k.length;r--;n[k[r]]=e);return n},"o"),u=[1,4],d=[1,13],s=[1,12],g=[1,15],D=[1,16],S=[1,20],h=[1,19],O=[6,7,8],b=[1,26],_=[1,24],C=[1,25],o=[6,7,11],M=[1,31],w=[6,7,11,24],T=[1,6,13,16,17,20,23],$=[1,35],H=[1,36],A=[1,6,7,11,13,16,17,20,23],U=[1,38],y={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:a(function(k,e,n,r,c,t,m){var l=t.length-1;switch(c){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",t[l-1].id),r.addNode(t[l-2].length,t[l-1].id,t[l-1].descr,t[l-1].type,t[l]);break;case 16:r.getLogger().info("Node: ",t[l].id),r.addNode(t[l-1].length,t[l].id,t[l].descr,t[l].type);break;case 17:r.getLogger().trace("Icon: ",t[l]),r.decorateNode({icon:t[l]});break;case 18:case 23:r.decorateNode({class:t[l]});break;case 19:r.getLogger().trace("SPACELIST");break;case 20:r.getLogger().trace("Node: ",t[l-1].id),r.addNode(0,t[l-1].id,t[l-1].descr,t[l-1].type,t[l]);break;case 21:r.getLogger().trace("Node: ",t[l].id),r.addNode(0,t[l].id,t[l].descr,t[l].type);break;case 22:r.decorateNode({icon:t[l]});break;case 27:r.getLogger().trace("node found ..",t[l-2]),this.$={id:t[l-1],descr:t[l-1],type:r.getType(t[l-2],t[l])};break;case 28:this.$={id:t[l],descr:t[l],type:0};break;case 29:r.getLogger().trace("node found ..",t[l-3]),this.$={id:t[l-3],descr:t[l-1],type:r.getType(t[l-2],t[l])};break;case 30:this.$=t[l-1]+t[l];break;case 31:this.$=t[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:u},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:u},{6:d,7:[1,10],9:9,12:11,13:s,14:14,16:g,17:D,18:17,19:18,20:S,23:h},i(O,[2,3]),{1:[2,2]},i(O,[2,4]),i(O,[2,5]),{1:[2,6],6:d,12:21,13:s,14:14,16:g,17:D,18:17,19:18,20:S,23:h},{6:d,9:22,12:11,13:s,14:14,16:g,17:D,18:17,19:18,20:S,23:h},{6:b,7:_,10:23,11:C},i(o,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:h}),i(o,[2,19]),i(o,[2,21],{15:30,24:M}),i(o,[2,22]),i(o,[2,23]),i(w,[2,25]),i(w,[2,26]),i(w,[2,28],{20:[1,32]}),{21:[1,33]},{6:b,7:_,10:34,11:C},{1:[2,7],6:d,12:21,13:s,14:14,16:g,17:D,18:17,19:18,20:S,23:h},i(T,[2,14],{7:$,11:H}),i(A,[2,8]),i(A,[2,9]),i(A,[2,10]),i(o,[2,16],{15:37,24:M}),i(o,[2,17]),i(o,[2,18]),i(o,[2,20],{24:U}),i(w,[2,31]),{21:[1,39]},{22:[1,40]},i(T,[2,13],{7:$,11:H}),i(A,[2,11]),i(A,[2,12]),i(o,[2,15],{24:U}),i(w,[2,30]),{22:[1,41]},i(w,[2,27]),i(w,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:a(function(k,e){if(e.recoverable)this.trace(k);else{var n=new Error(k);throw n.hash=e,n}},"parseError"),parse:a(function(k){var e=this,n=[0],r=[],c=[null],t=[],m=this.table,l="",F=0,ne=0,he=2,se=1,ue=t.slice.call(arguments,1),f=Object.create(this.lexer),P={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(P.yy[q]=this.yy[q]);f.setInput(k,P.yy),P.yy.lexer=f,P.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var X=f.yylloc;t.push(X);var ge=f.options&&f.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(N){n.length=n.length-2*N,c.length=c.length-N,t.length=t.length-N}a(de,"popStack");function re(){var N;return N=r.pop()||f.lex()||se,typeof N!="number"&&(N instanceof Array&&(r=N,N=r.pop()),N=e.symbols_[N]||N),N}a(re,"lex");for(var E,B,x,Y,j={},z,I,oe,V;;){if(B=n[n.length-1],this.defaultActions[B]?x=this.defaultActions[B]:((E===null||typeof E>"u")&&(E=re()),x=m[B]&&m[B][E]),typeof x>"u"||!x.length||!x[0]){var J="";V=[];for(z in m[B])this.terminals_[z]&&z>he&&V.push("'"+this.terminals_[z]+"'");f.showPosition?J="Parse error on line "+(F+1)+`:
|
|
2
2
|
`+f.showPosition()+`
|
|
3
3
|
Expecting `+V.join(", ")+", got '"+(this.terminals_[E]||E)+"'":J="Parse error on line "+(F+1)+": Unexpected "+(E==se?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(J,{text:f.match,token:this.terminals_[E]||E,line:f.yylineno,loc:X,expected:V})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+E);switch(x[0]){case 1:n.push(E),c.push(f.yytext),t.push(f.yylloc),n.push(x[1]),E=null,ne=f.yyleng,l=f.yytext,F=f.yylineno,X=f.yylloc;break;case 2:if(I=this.productions_[x[1]][1],j.$=c[c.length-I],j._$={first_line:t[t.length-(I||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(I||1)].first_column,last_column:t[t.length-1].last_column},ge&&(j._$.range=[t[t.length-(I||1)].range[0],t[t.length-1].range[1]]),Y=this.performAction.apply(j,[l,ne,F,P.yy,x[1],c,t].concat(ue)),typeof Y<"u")return Y;I&&(n=n.slice(0,-1*I*2),c=c.slice(0,-1*I),t=t.slice(0,-1*I)),n.push(this.productions_[x[1]][0]),c.push(j.$),t.push(j._$),oe=m[n[n.length-2]][n[n.length-1]],n.push(oe);break;case 3:return!0}}return!0},"parse")},R=function(){var k={EOF:1,parseError:a(function(e,n){if(this.yy.parser)this.yy.parser.parseError(e,n);else throw new Error(e)},"parseError"),setInput:a(function(e,n){return this.yy=n||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var n=e.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:a(function(e){var n=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var t=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===c.length?this.yylloc.first_column:0)+c[c.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[t[0],t[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(e){this.unput(this.match.slice(e))},"less"),pastInput:a(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var e=this.pastInput(),n=new Array(e.length+1).join("-");return e+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as m}from"./graph-aRt77rZZ-BCYSvQYP.js";import{O as Mn,$ as s,b as $,y as Tn,L as H,E as x,S as b,l as hn,a as Sn,I as T,_ as L,m as Cn,c as gn,i as $n,N as nn}from"./_baseUniq-Cd4llU-Q-D06fzDcA.js";import{d as Gn,u as j,f as N,V as Fn,m as _,b as p,g as vn,t as ln,X as G,o as Vn,h as J,r as Bn}from"./_basePickBy-1MakYQmz-CFyJwR0u.js";import{aE as Yn,aF as z,aG as A,aH as qn,aI as zn,aJ as pn,aK as wn,aL as An,aM as Dn,aN as Hn,aO as Jn,aP as Qn,aQ as Kn}from"./index-CyVB0J6E.js";function Un(n){return qn(zn(n,void 0,N),n+"")}var Zn=1,Xn=4;function Wn(n){return Cn(n,Zn|Xn)}function nr(n,r){return n==null?n:Qn(n,gn(r),Kn)}function rr(n,r){return n&&hn(n,gn(r))}function er(n,r){return n>r}function S(n,r){var e={};return r=H(r),hn(n,function(t,o,i){Dn(e,o,r(t,o,i))}),e}function y(n){return n&&n.length?ln(n,wn,er):void 0}function Q(n,r){return n&&n.length?ln(n,H(r),Bn):void 0}function tr(n,r){var e=n.length;for(n.sort(r);e--;)n[e]=n[e].value;return n}function or(n,r){if(n!==r){var e=n!==void 0,t=n===null,o=n===n,i=nn(n),a=r!==void 0,u=r===null,d=r===r,c=nn(r);if(!u&&!c&&!i&&n>r||i&&a&&d&&!u&&!c||t&&a&&d||!e&&d||!o)return 1;if(!t&&!i&&!c&&n<r||c&&e&&o&&!t&&!i||u&&e&&o||!a&&o||!d)return-1}return 0}function ir(n,r,e){for(var t=-1,o=n.criteria,i=r.criteria,a=o.length,u=e.length;++t<a;){var d=or(o[t],i[t]);if(d){if(t>=u)return d;var c=e[t];return d*(c=="desc"?-1:1)}}return n.index-r.index}function ar(n,r,e){r.length?r=$(r,function(i){return pn(i)?function(a){return Tn(a,i.length===1?i[0]:i)}:i}):r=[wn];var t=-1;r=$(r,An(H));var o=Fn(n,function(i,a,u){var d=$(r,function(c){return c(i)});return{criteria:d,index:++t,value:i}});return tr(o,function(i,a){return ir(i,a,e)})}function ur(n,r){return Vn(n,r,function(e,t){return $n(n,t)})}var M=Un(function(n,r){return n==null?{}:ur(n,r)}),dr=Math.ceil,cr=Math.max;function sr(n,r,e,t){for(var o=-1,i=cr(dr((r-n)/(e||1)),0),a=Array(i);i--;)a[++o]=n,n+=e;return a}function fr(n){return function(r,e,t){return t&&typeof t!="number"&&z(r,e,t)&&(e=t=void 0),r=G(r),e===void 0?(e=r,r=0):e=G(e),t=t===void 0?r<e?1:-1:G(t),sr(r,e,t)}}var E=fr(),R=Yn(function(n,r){if(n==null)return[];var e=r.length;return e>1&&z(n,r[0],r[1])?r=[]:e>2&&z(r[0],r[1],r[2])&&(r=[r[0]]),ar(n,Mn(r),[])}),hr=0;function K(n){var r=++hr;return Sn(n)+r}function gr(n,r,e){for(var t=-1,o=n.length,i=r.length,a={};++t<o;){var u=t<i?r[t]:void 0;e(a,n[t],u)}return a}function vr(n,r){return gr(n||[],r||[],Jn)}class lr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return rn(e),e}enqueue(r){var e=this._sentinel;r._prev&&r._next&&rn(r),r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){for(var r=[],e=this._sentinel,t=e._prev;t!==e;)r.push(JSON.stringify(t,pr)),t=t._prev;return"["+r.join(", ")+"]"}}function rn(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function pr(n,r){if(n!=="_next"&&n!=="_prev")return r}var wr=Hn(1);function br(n,r){if(n.nodeCount()<=1)return[];var e=yr(n,r||wr),t=mr(e.graph,e.buckets,e.zeroIdx);return N(p(t,function(o){return n.outEdges(o.v,o.w)}))}function mr(n,r,e){for(var t=[],o=r[r.length-1],i=r[0],a;n.nodeCount();){for(;a=i.dequeue();)F(n,r,e,a);for(;a=o.dequeue();)F(n,r,e,a);if(n.nodeCount()){for(var u=r.length-2;u>0;--u)if(a=r[u].dequeue(),a){t=t.concat(F(n,r,e,a,!0));break}}}return t}function F(n,r,e,t,o){var i=o?[]:void 0;return s(n.inEdges(t.v),function(a){var u=n.edge(a),d=n.node(a.v);o&&i.push({v:a.v,w:a.w}),d.out-=u,D(r,e,d)}),s(n.outEdges(t.v),function(a){var u=n.edge(a),d=a.w,c=n.node(d);c.in-=u,D(r,e,c)}),n.removeNode(t.v),i}function yr(n,r){var e=new m,t=0,o=0;s(n.nodes(),function(u){e.setNode(u,{v:u,in:0,out:0})}),s(n.edges(),function(u){var d=e.edge(u.v,u.w)||0,c=r(u),f=d+c;e.setEdge(u.v,u.w,f),o=Math.max(o,e.node(u.v).out+=c),t=Math.max(t,e.node(u.w).in+=c)});var i=E(o+t+3).map(function(){return new lr}),a=t+1;return s(e.nodes(),function(u){D(i,a,e.node(u))}),{graph:e,buckets:i,zeroIdx:a}}function D(n,r,e){e.out?e.in?n[e.out-e.in+r].enqueue(e):n[n.length-1].enqueue(e):n[0].enqueue(e)}function kr(n){var r=n.graph().acyclicer==="greedy"?br(n,e(n)):xr(n);s(r,function(t){var o=n.edge(t);n.removeEdge(t),o.forwardName=t.name,o.reversed=!0,n.setEdge(t.w,t.v,o,K("rev"))});function e(t){return function(o){return t.edge(o).weight}}}function xr(n){var r=[],e={},t={};function o(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,e[i]=!0,s(n.outEdges(i),function(a){Object.prototype.hasOwnProperty.call(e,a.w)?r.push(a):o(a.w)}),delete e[i])}return s(n.nodes(),o),r}function Er(n){s(n.edges(),function(r){var e=n.edge(r);if(e.reversed){n.removeEdge(r);var t=e.forwardName;delete e.reversed,delete e.forwardName,n.setEdge(r.w,r.v,e,t)}})}function O(n,r,e,t){var o;do o=K(t);while(n.hasNode(o));return e.dummy=r,n.setNode(o,e),o}function Nr(n){var r=new m().setGraph(n.graph());return s(n.nodes(),function(e){r.setNode(e,n.node(e))}),s(n.edges(),function(e){var t=r.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);r.setEdge(e.v,e.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),r}function bn(n){var r=new m({multigraph:n.isMultigraph()}).setGraph(n.graph());return s(n.nodes(),function(e){n.children(e).length||r.setNode(e,n.node(e))}),s(n.edges(),function(e){r.setEdge(e,n.edge(e))}),r}function en(n,r){var e=n.x,t=n.y,o=r.x-e,i=r.y-t,a=n.width/2,u=n.height/2;if(!o&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var d,c;return Math.abs(i)*a>Math.abs(o)*u?(i<0&&(u=-u),d=u*o/i,c=u):(o<0&&(a=-a),d=a,c=a*i/o),{x:e+d,y:t+c}}function C(n){var r=p(E(mn(n)+1),function(){return[]});return s(n.nodes(),function(e){var t=n.node(e),o=t.rank;b(o)||(r[o][t.order]=e)}),r}function Or(n){var r=_(p(n.nodes(),function(e){return n.node(e).rank}));s(n.nodes(),function(e){var t=n.node(e);vn(t,"rank")&&(t.rank-=r)})}function Ir(n){var r=_(p(n.nodes(),function(i){return n.node(i).rank})),e=[];s(n.nodes(),function(i){var a=n.node(i).rank-r;e[a]||(e[a]=[]),e[a].push(i)});var t=0,o=n.graph().nodeRankFactor;s(e,function(i,a){b(i)&&a%o!==0?--t:t&&s(i,function(u){n.node(u).rank+=t})})}function tn(n,r,e,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=e,o.order=t),O(n,"border",o,r)}function mn(n){return y(p(n.nodes(),function(r){var e=n.node(r).rank;if(!b(e))return e}))}function _r(n,r){var e={lhs:[],rhs:[]};return s(n,function(t){r(t)?e.lhs.push(t):e.rhs.push(t)}),e}function Pr(n,r){return r()}function Lr(n){function r(e){var t=n.children(e),o=n.node(e);if(t.length&&s(t,r),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)on(n,"borderLeft","_bl",e,o,i),on(n,"borderRight","_br",e,o,i)}}s(n.children(),r)}function on(n,r,e,t,o,i){var a={width:0,height:0,rank:i,borderType:r},u=o[r][i-1],d=O(n,"border",a,e);o[r][i]=d,n.setParent(d,t),u&&n.setEdge(u,d,{weight:1})}function Rr(n){var r=n.graph().rankdir.toLowerCase();(r==="lr"||r==="rl")&&yn(n)}function jr(n){var r=n.graph().rankdir.toLowerCase();(r==="bt"||r==="rl")&&Mr(n),(r==="lr"||r==="rl")&&(Tr(n),yn(n))}function yn(n){s(n.nodes(),function(r){an(n.node(r))}),s(n.edges(),function(r){an(n.edge(r))})}function an(n){var r=n.width;n.width=n.height,n.height=r}function Mr(n){s(n.nodes(),function(r){V(n.node(r))}),s(n.edges(),function(r){var e=n.edge(r);s(e.points,V),Object.prototype.hasOwnProperty.call(e,"y")&&V(e)})}function V(n){n.y=-n.y}function Tr(n){s(n.nodes(),function(r){B(n.node(r))}),s(n.edges(),function(r){var e=n.edge(r);s(e.points,B),Object.prototype.hasOwnProperty.call(e,"x")&&B(e)})}function B(n){var r=n.x;n.x=n.y,n.y=r}function Sr(n){n.graph().dummyChains=[],s(n.edges(),function(r){Cr(n,r)})}function Cr(n,r){var e=r.v,t=n.node(e).rank,o=r.w,i=n.node(o).rank,a=r.name,u=n.edge(r),d=u.labelRank;if(i!==t+1){n.removeEdge(r);var c=void 0,f,h;for(h=0,++t;t<i;++h,++t)u.points=[],c={width:0,height:0,edgeLabel:u,edgeObj:r,rank:t},f=O(n,"edge",c,"_d"),t===d&&(c.width=u.width,c.height=u.height,c.dummy="edge-label",c.labelpos=u.labelpos),n.setEdge(e,f,{weight:u.weight},a),h===0&&n.graph().dummyChains.push(f),e=f;n.setEdge(e,o,{weight:u.weight},a)}}function $r(n){s(n.graph().dummyChains,function(r){var e=n.node(r),t=e.edgeLabel,o;for(n.setEdge(e.edgeObj,t);e.dummy;)o=n.successors(r)[0],n.removeNode(r),t.points.push({x:e.x,y:e.y}),e.dummy==="edge-label"&&(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height),r=o,e=n.node(r)})}function U(n){var r={};function e(t){var o=n.node(t);if(Object.prototype.hasOwnProperty.call(r,t))return o.rank;r[t]=!0;var i=_(p(n.outEdges(t),function(a){return e(a.w)-n.edge(a).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),o.rank=i}s(n.sources(),e)}function P(n,r){return n.node(r.w).rank-n.node(r.v).rank-n.edge(r).minlen}function kn(n){var r=new m({directed:!1}),e=n.nodes()[0],t=n.nodeCount();r.setNode(e,{});for(var o,i;Gr(r,n)<t;)o=Fr(r,n),i=r.hasNode(o.v)?P(n,o):-P(n,o),Vr(r,n,i);return r}function Gr(n,r){function e(t){s(r.nodeEdges(t),function(o){var i=o.v,a=t===i?o.w:i;!n.hasNode(a)&&!P(r,o)&&(n.setNode(a,{}),n.setEdge(t,a,{}),e(a))})}return s(n.nodes(),e),n.nodeCount()}function Fr(n,r){return Q(r.edges(),function(e){if(n.hasNode(e.v)!==n.hasNode(e.w))return P(r,e)})}function Vr(n,r,e){s(n.nodes(),function(t){r.node(t).rank+=e})}function xn(n,r,e){pn(r)||(r=[r]);var t=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],i={};return s(r,function(a){if(!n.hasNode(a))throw new Error("Graph does not have node: "+a);En(n,a,e==="post",i,t,o)}),o}function En(n,r,e,t,o,i){Object.prototype.hasOwnProperty.call(t,r)||(t[r]=!0,e||i.push(r),s(o(r),function(a){En(n,a,e,t,o,i)}),e&&i.push(r))}function Br(n,r){return xn(n,r,"post")}function Yr(n,r){return xn(n,r,"pre")}k.initLowLimValues=X;k.initCutValues=Z;k.calcCutValue=Nn;k.leaveEdge=In;k.enterEdge=_n;k.exchangeEdges=Pn;function k(n){n=Nr(n),U(n);var r=kn(n);X(r),Z(r,n);for(var e,t;e=In(r);)t=_n(r,n,e),Pn(r,n,e,t)}function Z(n,r){var e=Br(n,n.nodes());e=e.slice(0,e.length-1),s(e,function(t){qr(n,r,t)})}function qr(n,r,e){var t=n.node(e),o=t.parent;n.edge(e,o).cutvalue=Nn(n,r,e)}function Nn(n,r,e){var t=n.node(e),o=t.parent,i=!0,a=r.edge(e,o),u=0;return a||(i=!1,a=r.edge(o,e)),u=a.weight,s(r.nodeEdges(e),function(d){var c=d.v===e,f=c?d.w:d.v;if(f!==o){var h=c===i,g=r.edge(d).weight;if(u+=h?g:-g,Ar(n,e,f)){var v=n.edge(e,f).cutvalue;u+=h?-v:v}}}),u}function X(n,r){arguments.length<2&&(r=n.nodes()[0]),On(n,{},1,r)}function On(n,r,e,t,o){var i=e,a=n.node(t);return r[t]=!0,s(n.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(r,u)||(e=On(n,r,e,u,t))}),a.low=i,a.lim=e++,o?a.parent=o:delete a.parent,e}function In(n){return J(n.edges(),function(r){return n.edge(r).cutvalue<0})}function _n(n,r,e){var t=e.v,o=e.w;r.hasEdge(t,o)||(t=e.w,o=e.v);var i=n.node(t),a=n.node(o),u=i,d=!1;i.lim>a.lim&&(u=a,d=!0);var c=L(r.edges(),function(f){return d===un(n,n.node(f.v),u)&&d!==un(n,n.node(f.w),u)});return Q(c,function(f){return P(r,f)})}function Pn(n,r,e,t){var o=e.v,i=e.w;n.removeEdge(o,i),n.setEdge(t.v,t.w,{}),X(n),Z(n,r),zr(n,r)}function zr(n,r){var e=J(n.nodes(),function(o){return!r.node(o).parent}),t=Yr(n,e);t=t.slice(1),s(t,function(o){var i=n.node(o).parent,a=r.edge(o,i),u=!1;a||(a=r.edge(i,o),u=!0),r.node(o).rank=r.node(i).rank+(u?a.minlen:-a.minlen)})}function Ar(n,r,e){return n.hasEdge(r,e)}function un(n,r,e){return e.low<=r.lim&&r.lim<=e.lim}function Dr(n){switch(n.graph().ranker){case"network-simplex":dn(n);break;case"tight-tree":Jr(n);break;case"longest-path":Hr(n);break;default:dn(n)}}var Hr=U;function Jr(n){U(n),kn(n)}function dn(n){k(n)}function Qr(n){var r=O(n,"root",{},"_root"),e=Kr(n),t=y(x(e))-1,o=2*t+1;n.graph().nestingRoot=r,s(n.edges(),function(a){n.edge(a).minlen*=o});var i=Ur(n)+1;s(n.children(),function(a){Ln(n,r,o,i,t,e,a)}),n.graph().nodeRankFactor=o}function Ln(n,r,e,t,o,i,a){var u=n.children(a);if(!u.length){a!==r&&n.setEdge(r,a,{weight:0,minlen:e});return}var d=tn(n,"_bt"),c=tn(n,"_bb"),f=n.node(a);n.setParent(d,a),f.borderTop=d,n.setParent(c,a),f.borderBottom=c,s(u,function(h){Ln(n,r,e,t,o,i,h);var g=n.node(h),v=g.borderTop?g.borderTop:h,l=g.borderBottom?g.borderBottom:h,w=g.borderTop?t:2*t,I=v!==l?1:o-i[a]+1;n.setEdge(d,v,{weight:w,minlen:I,nestingEdge:!0}),n.setEdge(l,c,{weight:w,minlen:I,nestingEdge:!0})}),n.parent(a)||n.setEdge(r,d,{weight:0,minlen:o+i[a]})}function Kr(n){var r={};function e(t,o){var i=n.children(t);i&&i.length&&s(i,function(a){e(a,o+1)}),r[t]=o}return s(n.children(),function(t){e(t,1)}),r}function Ur(n){return T(n.edges(),function(r,e){return r+n.edge(e).weight},0)}function Zr(n){var r=n.graph();n.removeNode(r.nestingRoot),delete r.nestingRoot,s(n.edges(),function(e){var t=n.edge(e);t.nestingEdge&&n.removeEdge(e)})}function Xr(n,r,e){var t={},o;s(e,function(i){for(var a=n.parent(i),u,d;a;){if(u=n.parent(a),u?(d=t[u],t[u]=a):(d=o,o=a),d&&d!==a){r.setEdge(d,a);return}a=u}})}function Wr(n,r,e){var t=ne(n),o=new m({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return n.node(i)});return s(n.nodes(),function(i){var a=n.node(i),u=n.parent(i);(a.rank===r||a.minRank<=r&&r<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||t),s(n[e](i),function(d){var c=d.v===i?d.w:d.v,f=o.edge(c,i),h=b(f)?0:f.weight;o.setEdge(c,i,{weight:n.edge(d).weight+h})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[r],borderRight:a.borderRight[r]}))}),o}function ne(n){for(var r;n.hasNode(r=K("_root")););return r}function re(n,r){for(var e=0,t=1;t<r.length;++t)e+=ee(n,r[t-1],r[t]);return e}function ee(n,r,e){for(var t=vr(e,p(e,function(c,f){return f})),o=N(p(r,function(c){return R(p(n.outEdges(c),function(f){return{pos:t[f.w],weight:n.edge(f).weight}}),"pos")})),i=1;i<e.length;)i<<=1;var a=2*i-1;i-=1;var u=p(new Array(a),function(){return 0}),d=0;return s(o.forEach(function(c){var f=c.pos+i;u[f]+=c.weight;for(var h=0;f>0;)f%2&&(h+=u[f+1]),f=f-1>>1,u[f]+=c.weight;d+=c.weight*h})),d}function te(n){var r={},e=L(n.nodes(),function(u){return!n.children(u).length}),t=y(p(e,function(u){return n.node(u).rank})),o=p(E(t+1),function(){return[]});function i(u){if(!vn(r,u)){r[u]=!0;var d=n.node(u);o[d.rank].push(u),s(n.successors(u),i)}}var a=R(e,function(u){return n.node(u).rank});return s(a,i),o}function oe(n,r){return p(r,function(e){var t=n.inEdges(e);if(t.length){var o=T(t,function(i,a){var u=n.edge(a),d=n.node(a.v);return{sum:i.sum+u.weight*d.order,weight:i.weight+u.weight}},{sum:0,weight:0});return{v:e,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:e}})}function ie(n,r){var e={};s(n,function(o,i){var a=e[o.v]={indegree:0,in:[],out:[],vs:[o.v],i};b(o.barycenter)||(a.barycenter=o.barycenter,a.weight=o.weight)}),s(r.edges(),function(o){var i=e[o.v],a=e[o.w];!b(i)&&!b(a)&&(a.indegree++,i.out.push(e[o.w]))});var t=L(e,function(o){return!o.indegree});return ae(t)}function ae(n){var r=[];function e(i){return function(a){a.merged||(b(a.barycenter)||b(i.barycenter)||a.barycenter>=i.barycenter)&&ue(i,a)}}function t(i){return function(a){a.in.push(i),--a.indegree===0&&n.push(a)}}for(;n.length;){var o=n.pop();r.push(o),s(o.in.reverse(),e(o)),s(o.out,t(o))}return p(L(r,function(i){return!i.merged}),function(i){return M(i,["vs","i","barycenter","weight"])})}function ue(n,r){var e=0,t=0;n.weight&&(e+=n.barycenter*n.weight,t+=n.weight),r.weight&&(e+=r.barycenter*r.weight,t+=r.weight),n.vs=r.vs.concat(n.vs),n.barycenter=e/t,n.weight=t,n.i=Math.min(r.i,n.i),r.merged=!0}function de(n,r){var e=_r(n,function(f){return Object.prototype.hasOwnProperty.call(f,"barycenter")}),t=e.lhs,o=R(e.rhs,function(f){return-f.i}),i=[],a=0,u=0,d=0;t.sort(ce(!!r)),d=cn(i,o,d),s(t,function(f){d+=f.vs.length,i.push(f.vs),a+=f.barycenter*f.weight,u+=f.weight,d=cn(i,o,d)});var c={vs:N(i)};return u&&(c.barycenter=a/u,c.weight=u),c}function cn(n,r,e){for(var t;r.length&&(t=j(r)).i<=e;)r.pop(),n.push(t.vs),e++;return e}function ce(n){return function(r,e){return r.barycenter<e.barycenter?-1:r.barycenter>e.barycenter?1:n?e.i-r.i:r.i-e.i}}function Rn(n,r,e,t){var o=n.children(r),i=n.node(r),a=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,d={};a&&(o=L(o,function(l){return l!==a&&l!==u}));var c=oe(n,o);s(c,function(l){if(n.children(l.v).length){var w=Rn(n,l.v,e,t);d[l.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&fe(l,w)}});var f=ie(c,e);se(f,d);var h=de(f,t);if(a&&(h.vs=N([a,h.vs,u]),n.predecessors(a).length)){var g=n.node(n.predecessors(a)[0]),v=n.node(n.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+g.order+v.order)/(h.weight+2),h.weight+=2}return h}function se(n,r){s(n,function(e){e.vs=N(e.vs.map(function(t){return r[t]?r[t].vs:t}))})}function fe(n,r){b(n.barycenter)?(n.barycenter=r.barycenter,n.weight=r.weight):(n.barycenter=(n.barycenter*n.weight+r.barycenter*r.weight)/(n.weight+r.weight),n.weight+=r.weight)}function he(n){var r=mn(n),e=sn(n,E(1,r+1),"inEdges"),t=sn(n,E(r-1,-1,-1),"outEdges"),o=te(n);fn(n,o);for(var i=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){ge(u%2?e:t,u%4>=2),o=C(n);var c=re(n,o);c<i&&(d=0,a=Wn(o),i=c)}fn(n,a)}function sn(n,r,e){return p(r,function(t){return Wr(n,t,e)})}function ge(n,r){var e=new m;s(n,function(t){var o=t.graph().root,i=Rn(t,o,e,r);s(i.vs,function(a,u){t.node(a).order=u}),Xr(t,e,i.vs)})}function fn(n,r){s(r,function(e){s(e,function(t,o){n.node(t).order=o})})}function ve(n){var r=pe(n);s(n.graph().dummyChains,function(e){for(var t=n.node(e),o=t.edgeObj,i=le(n,r,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],f=!0;e!==o.w;){if(t=n.node(e),f){for(;(c=a[d])!==u&&n.node(c).maxRank<t.rank;)d++;c===u&&(f=!1)}if(!f){for(;d<a.length-1&&n.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}n.setParent(e,c),e=n.successors(e)[0]}})}function le(n,r,e,t){var o=[],i=[],a=Math.min(r[e].low,r[t].low),u=Math.max(r[e].lim,r[t].lim),d,c;d=e;do d=n.parent(d),o.push(d);while(d&&(r[d].low>a||u>r[d].lim));for(c=d,d=t;(d=n.parent(d))!==c;)i.push(d);return{path:o.concat(i.reverse()),lca:c}}function pe(n){var r={},e=0;function t(o){var i=e;s(n.children(o),t),r[o]={low:i,lim:e++}}return s(n.children(),t),r}function we(n,r){var e={};function t(o,i){var a=0,u=0,d=o.length,c=j(i);return s(i,function(f,h){var g=me(n,f),v=g?n.node(g).order:d;(g||f===c)&&(s(i.slice(u,h+1),function(l){s(n.predecessors(l),function(w){var I=n.node(w),W=I.order;(W<a||v<W)&&!(I.dummy&&n.node(l).dummy)&&jn(e,w,l)})}),u=h+1,a=v)}),i}return T(r,t),e}function be(n,r){var e={};function t(i,a,u,d,c){var f;s(E(a,u),function(h){f=i[h],n.node(f).dummy&&s(n.predecessors(f),function(g){var v=n.node(g);v.dummy&&(v.order<d||v.order>c)&&jn(e,g,f)})})}function o(i,a){var u=-1,d,c=0;return s(a,function(f,h){if(n.node(f).dummy==="border"){var g=n.predecessors(f);g.length&&(d=n.node(g[0]).order,t(a,c,h,u,d),c=h,u=d)}t(a,c,a.length,d,i.length)}),a}return T(r,o),e}function me(n,r){if(n.node(r).dummy)return J(n.predecessors(r),function(e){return n.node(e).dummy})}function jn(n,r,e){if(r>e){var t=r;r=e,e=t}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=n[r];Object.defineProperty(o,e,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function ye(n,r,e){if(r>e){var t=r;r=e,e=t}return!!n[r]&&Object.prototype.hasOwnProperty.call(n[r],e)}function ke(n,r,e,t){var o={},i={},a={};return s(r,function(u){s(u,function(d,c){o[d]=d,i[d]=d,a[d]=c})}),s(r,function(u){var d=-1;s(u,function(c){var f=t(c);if(f.length){f=R(f,function(w){return a[w]});for(var h=(f.length-1)/2,g=Math.floor(h),v=Math.ceil(h);g<=v;++g){var l=f[g];i[c]===c&&d<a[l]&&!ye(e,c,l)&&(i[l]=c,i[c]=o[c]=o[l],d=a[l])}}})}),{root:o,align:i}}function xe(n,r,e,t,o){var i={},a=Ee(n,r,e,o),u=o?"borderLeft":"borderRight";function d(h,g){for(var v=a.nodes(),l=v.pop(),w={};l;)w[l]?h(l):(w[l]=!0,v.push(l),v=v.concat(g(l))),l=v.pop()}function c(h){i[h]=a.inEdges(h).reduce(function(g,v){return Math.max(g,i[v.v]+a.edge(v))},0)}function f(h){var g=a.outEdges(h).reduce(function(l,w){return Math.min(l,i[w.w]-a.edge(w))},Number.POSITIVE_INFINITY),v=n.node(h);g!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(i[h]=Math.max(i[h],g))}return d(c,a.predecessors.bind(a)),d(f,a.successors.bind(a)),s(t,function(h){i[h]=i[e[h]]}),i}function Ee(n,r,e,t){var o=new m,i=n.graph(),a=Pe(i.nodesep,i.edgesep,t);return s(r,function(u){var d;s(u,function(c){var f=e[c];if(o.setNode(f),d){var h=e[d],g=o.edge(h,f);o.setEdge(h,f,Math.max(a(n,c,d),g||0))}d=c})}),o}function Ne(n,r){return Q(x(r),function(e){var t=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return nr(e,function(i,a){var u=Le(n,a)/2;t=Math.max(i+u,t),o=Math.min(i-u,o)}),t-o})}function Oe(n,r){var e=x(r),t=_(e),o=y(e);s(["u","d"],function(i){s(["l","r"],function(a){var u=i+a,d=n[u],c;if(d!==r){var f=x(d);c=a==="l"?t-_(f):o-y(f),c&&(n[u]=S(d,function(h){return h+c}))}})})}function Ie(n,r){return S(n.ul,function(e,t){if(r)return n[r.toLowerCase()][t];var o=R(p(n,t));return(o[1]+o[2])/2})}function _e(n){var r=C(n),e=A(we(n,r),be(n,r)),t={},o;s(["u","d"],function(a){o=a==="u"?r:x(r).reverse(),s(["l","r"],function(u){u==="r"&&(o=p(o,function(h){return x(h).reverse()}));var d=(a==="u"?n.predecessors:n.successors).bind(n),c=ke(n,o,e,d),f=xe(n,o,c.root,c.align,u==="r");u==="r"&&(f=S(f,function(h){return-h})),t[a+u]=f})});var i=Ne(n,t);return Oe(t,i),Ie(t,n.graph().align)}function Pe(n,r,e){return function(t,o,i){var a=t.node(o),u=t.node(i),d=0,c;if(d+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=-a.width/2;break;case"r":c=a.width/2;break}if(c&&(d+=e?c:-c),c=0,d+=(a.dummy?r:n)/2,d+=(u.dummy?r:n)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":c=u.width/2;break;case"r":c=-u.width/2;break}return c&&(d+=e?c:-c),c=0,d}}function Le(n,r){return n.node(r).width}function Re(n){n=bn(n),je(n),rr(_e(n),function(r,e){n.node(e).x=r})}function je(n){var r=C(n),e=n.graph().ranksep,t=0;s(r,function(o){var i=y(p(o,function(a){return n.node(a).height}));s(o,function(a){n.node(a).y=t+i/2}),t+=i+e})}function it(n,r){var e=Pr;e("layout",()=>{var t=e(" buildLayoutGraph",()=>qe(n));e(" runLayout",()=>Me(t,e)),e(" updateInputGraph",()=>Te(n,t))})}function Me(n,r){r(" makeSpaceForEdgeLabels",()=>ze(n)),r(" removeSelfEdges",()=>Xe(n)),r(" acyclic",()=>kr(n)),r(" nestingGraph.run",()=>Qr(n)),r(" rank",()=>Dr(bn(n))),r(" injectEdgeLabelProxies",()=>Ae(n)),r(" removeEmptyRanks",()=>Ir(n)),r(" nestingGraph.cleanup",()=>Zr(n)),r(" normalizeRanks",()=>Or(n)),r(" assignRankMinMax",()=>De(n)),r(" removeEdgeLabelProxies",()=>He(n)),r(" normalize.run",()=>Sr(n)),r(" parentDummyChains",()=>ve(n)),r(" addBorderSegments",()=>Lr(n)),r(" order",()=>he(n)),r(" insertSelfEdges",()=>We(n)),r(" adjustCoordinateSystem",()=>Rr(n)),r(" position",()=>Re(n)),r(" positionSelfEdges",()=>nt(n)),r(" removeBorderNodes",()=>Ze(n)),r(" normalize.undo",()=>$r(n)),r(" fixupEdgeLabelCoords",()=>Ke(n)),r(" undoCoordinateSystem",()=>jr(n)),r(" translateGraph",()=>Je(n)),r(" assignNodeIntersects",()=>Qe(n)),r(" reversePoints",()=>Ue(n)),r(" acyclic.undo",()=>Er(n))}function Te(n,r){s(n.nodes(),function(e){var t=n.node(e),o=r.node(e);t&&(t.x=o.x,t.y=o.y,r.children(e).length&&(t.width=o.width,t.height=o.height))}),s(n.edges(),function(e){var t=n.edge(e),o=r.edge(e);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)}),n.graph().width=r.graph().width,n.graph().height=r.graph().height}var Se=["nodesep","edgesep","ranksep","marginx","marginy"],Ce={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$e=["acyclicer","ranker","rankdir","align"],Ge=["width","height"],Fe={width:0,height:0},Ve=["minlen","weight","width","height","labeloffset"],Be={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ye=["labelpos"];function qe(n){var r=new m({multigraph:!0,compound:!0}),e=q(n.graph());return r.setGraph(A({},Ce,Y(e,Se),M(e,$e))),s(n.nodes(),function(t){var o=q(n.node(t));r.setNode(t,Gn(Y(o,Ge),Fe)),r.setParent(t,n.parent(t))}),s(n.edges(),function(t){var o=q(n.edge(t));r.setEdge(t,A({},Be,Y(o,Ve),M(o,Ye)))}),r}function ze(n){var r=n.graph();r.ranksep/=2,s(n.edges(),function(e){var t=n.edge(e);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(r.rankdir==="TB"||r.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Ae(n){s(n.edges(),function(r){var e=n.edge(r);if(e.width&&e.height){var t=n.node(r.v),o=n.node(r.w),i={rank:(o.rank-t.rank)/2+t.rank,e:r};O(n,"edge-proxy",i,"_ep")}})}function De(n){var r=0;s(n.nodes(),function(e){var t=n.node(e);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,r=y(r,t.maxRank))}),n.graph().maxRank=r}function He(n){s(n.nodes(),function(r){var e=n.node(r);e.dummy==="edge-proxy"&&(n.edge(e.e).labelRank=e.rank,n.removeNode(r))})}function Je(n){var r=Number.POSITIVE_INFINITY,e=0,t=Number.POSITIVE_INFINITY,o=0,i=n.graph(),a=i.marginx||0,u=i.marginy||0;function d(c){var f=c.x,h=c.y,g=c.width,v=c.height;r=Math.min(r,f-g/2),e=Math.max(e,f+g/2),t=Math.min(t,h-v/2),o=Math.max(o,h+v/2)}s(n.nodes(),function(c){d(n.node(c))}),s(n.edges(),function(c){var f=n.edge(c);Object.prototype.hasOwnProperty.call(f,"x")&&d(f)}),r-=a,t-=u,s(n.nodes(),function(c){var f=n.node(c);f.x-=r,f.y-=t}),s(n.edges(),function(c){var f=n.edge(c);s(f.points,function(h){h.x-=r,h.y-=t}),Object.prototype.hasOwnProperty.call(f,"x")&&(f.x-=r),Object.prototype.hasOwnProperty.call(f,"y")&&(f.y-=t)}),i.width=e-r+a,i.height=o-t+u}function Qe(n){s(n.edges(),function(r){var e=n.edge(r),t=n.node(r.v),o=n.node(r.w),i,a;e.points?(i=e.points[0],a=e.points[e.points.length-1]):(e.points=[],i=o,a=t),e.points.unshift(en(t,i)),e.points.push(en(o,a))})}function Ke(n){s(n.edges(),function(r){var e=n.edge(r);if(Object.prototype.hasOwnProperty.call(e,"x"))switch((e.labelpos==="l"||e.labelpos==="r")&&(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset;break}})}function Ue(n){s(n.edges(),function(r){var e=n.edge(r);e.reversed&&e.points.reverse()})}function Ze(n){s(n.nodes(),function(r){if(n.children(r).length){var e=n.node(r),t=n.node(e.borderTop),o=n.node(e.borderBottom),i=n.node(j(e.borderLeft)),a=n.node(j(e.borderRight));e.width=Math.abs(a.x-i.x),e.height=Math.abs(o.y-t.y),e.x=i.x+e.width/2,e.y=t.y+e.height/2}}),s(n.nodes(),function(r){n.node(r).dummy==="border"&&n.removeNode(r)})}function Xe(n){s(n.edges(),function(r){if(r.v===r.w){var e=n.node(r.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:r,label:n.edge(r)}),n.removeEdge(r)}})}function We(n){var r=C(n);s(r,function(e){var t=0;s(e,function(o,i){var a=n.node(o);a.order=i+t,s(a.selfEdges,function(u){O(n,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:i+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function nt(n){s(n.nodes(),function(r){var e=n.node(r);if(e.dummy==="selfedge"){var t=n.node(e.e.v),o=t.x+t.width/2,i=t.y,a=e.x-o,u=t.height/2;n.setEdge(e.e,e.label),n.removeNode(r),e.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],e.label.x=e.x,e.label.y=e.y}})}function Y(n,r){return S(M(n,r),Number)}function q(n){var r={};return s(n,function(e,t){r[t.toLowerCase()]=e}),r}export{it as o};
|
|
1
|
+
import{L as m}from"./graph-aRt77rZZ-Dq9dkNsk.js";import{O as Mn,$ as s,b as $,y as Tn,L as H,E as x,S as b,l as hn,a as Sn,I as T,_ as L,m as Cn,c as gn,i as $n,N as nn}from"./_baseUniq-Cd4llU-Q-Cdw60MU4.js";import{d as Gn,u as j,f as N,V as Fn,m as _,b as p,g as vn,t as ln,X as G,o as Vn,h as J,r as Bn}from"./_basePickBy-1MakYQmz-ydNwd1l_.js";import{aE as Yn,aF as z,aG as A,aH as qn,aI as zn,aJ as pn,aK as wn,aL as An,aM as Dn,aN as Hn,aO as Jn,aP as Qn,aQ as Kn}from"./index-p0knuDQ9.js";function Un(n){return qn(zn(n,void 0,N),n+"")}var Zn=1,Xn=4;function Wn(n){return Cn(n,Zn|Xn)}function nr(n,r){return n==null?n:Qn(n,gn(r),Kn)}function rr(n,r){return n&&hn(n,gn(r))}function er(n,r){return n>r}function S(n,r){var e={};return r=H(r),hn(n,function(t,o,i){Dn(e,o,r(t,o,i))}),e}function y(n){return n&&n.length?ln(n,wn,er):void 0}function Q(n,r){return n&&n.length?ln(n,H(r),Bn):void 0}function tr(n,r){var e=n.length;for(n.sort(r);e--;)n[e]=n[e].value;return n}function or(n,r){if(n!==r){var e=n!==void 0,t=n===null,o=n===n,i=nn(n),a=r!==void 0,u=r===null,d=r===r,c=nn(r);if(!u&&!c&&!i&&n>r||i&&a&&d&&!u&&!c||t&&a&&d||!e&&d||!o)return 1;if(!t&&!i&&!c&&n<r||c&&e&&o&&!t&&!i||u&&e&&o||!a&&o||!d)return-1}return 0}function ir(n,r,e){for(var t=-1,o=n.criteria,i=r.criteria,a=o.length,u=e.length;++t<a;){var d=or(o[t],i[t]);if(d){if(t>=u)return d;var c=e[t];return d*(c=="desc"?-1:1)}}return n.index-r.index}function ar(n,r,e){r.length?r=$(r,function(i){return pn(i)?function(a){return Tn(a,i.length===1?i[0]:i)}:i}):r=[wn];var t=-1;r=$(r,An(H));var o=Fn(n,function(i,a,u){var d=$(r,function(c){return c(i)});return{criteria:d,index:++t,value:i}});return tr(o,function(i,a){return ir(i,a,e)})}function ur(n,r){return Vn(n,r,function(e,t){return $n(n,t)})}var M=Un(function(n,r){return n==null?{}:ur(n,r)}),dr=Math.ceil,cr=Math.max;function sr(n,r,e,t){for(var o=-1,i=cr(dr((r-n)/(e||1)),0),a=Array(i);i--;)a[++o]=n,n+=e;return a}function fr(n){return function(r,e,t){return t&&typeof t!="number"&&z(r,e,t)&&(e=t=void 0),r=G(r),e===void 0?(e=r,r=0):e=G(e),t=t===void 0?r<e?1:-1:G(t),sr(r,e,t)}}var E=fr(),R=Yn(function(n,r){if(n==null)return[];var e=r.length;return e>1&&z(n,r[0],r[1])?r=[]:e>2&&z(r[0],r[1],r[2])&&(r=[r[0]]),ar(n,Mn(r),[])}),hr=0;function K(n){var r=++hr;return Sn(n)+r}function gr(n,r,e){for(var t=-1,o=n.length,i=r.length,a={};++t<o;){var u=t<i?r[t]:void 0;e(a,n[t],u)}return a}function vr(n,r){return gr(n||[],r||[],Jn)}class lr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return rn(e),e}enqueue(r){var e=this._sentinel;r._prev&&r._next&&rn(r),r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){for(var r=[],e=this._sentinel,t=e._prev;t!==e;)r.push(JSON.stringify(t,pr)),t=t._prev;return"["+r.join(", ")+"]"}}function rn(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function pr(n,r){if(n!=="_next"&&n!=="_prev")return r}var wr=Hn(1);function br(n,r){if(n.nodeCount()<=1)return[];var e=yr(n,r||wr),t=mr(e.graph,e.buckets,e.zeroIdx);return N(p(t,function(o){return n.outEdges(o.v,o.w)}))}function mr(n,r,e){for(var t=[],o=r[r.length-1],i=r[0],a;n.nodeCount();){for(;a=i.dequeue();)F(n,r,e,a);for(;a=o.dequeue();)F(n,r,e,a);if(n.nodeCount()){for(var u=r.length-2;u>0;--u)if(a=r[u].dequeue(),a){t=t.concat(F(n,r,e,a,!0));break}}}return t}function F(n,r,e,t,o){var i=o?[]:void 0;return s(n.inEdges(t.v),function(a){var u=n.edge(a),d=n.node(a.v);o&&i.push({v:a.v,w:a.w}),d.out-=u,D(r,e,d)}),s(n.outEdges(t.v),function(a){var u=n.edge(a),d=a.w,c=n.node(d);c.in-=u,D(r,e,c)}),n.removeNode(t.v),i}function yr(n,r){var e=new m,t=0,o=0;s(n.nodes(),function(u){e.setNode(u,{v:u,in:0,out:0})}),s(n.edges(),function(u){var d=e.edge(u.v,u.w)||0,c=r(u),f=d+c;e.setEdge(u.v,u.w,f),o=Math.max(o,e.node(u.v).out+=c),t=Math.max(t,e.node(u.w).in+=c)});var i=E(o+t+3).map(function(){return new lr}),a=t+1;return s(e.nodes(),function(u){D(i,a,e.node(u))}),{graph:e,buckets:i,zeroIdx:a}}function D(n,r,e){e.out?e.in?n[e.out-e.in+r].enqueue(e):n[n.length-1].enqueue(e):n[0].enqueue(e)}function kr(n){var r=n.graph().acyclicer==="greedy"?br(n,e(n)):xr(n);s(r,function(t){var o=n.edge(t);n.removeEdge(t),o.forwardName=t.name,o.reversed=!0,n.setEdge(t.w,t.v,o,K("rev"))});function e(t){return function(o){return t.edge(o).weight}}}function xr(n){var r=[],e={},t={};function o(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,e[i]=!0,s(n.outEdges(i),function(a){Object.prototype.hasOwnProperty.call(e,a.w)?r.push(a):o(a.w)}),delete e[i])}return s(n.nodes(),o),r}function Er(n){s(n.edges(),function(r){var e=n.edge(r);if(e.reversed){n.removeEdge(r);var t=e.forwardName;delete e.reversed,delete e.forwardName,n.setEdge(r.w,r.v,e,t)}})}function O(n,r,e,t){var o;do o=K(t);while(n.hasNode(o));return e.dummy=r,n.setNode(o,e),o}function Nr(n){var r=new m().setGraph(n.graph());return s(n.nodes(),function(e){r.setNode(e,n.node(e))}),s(n.edges(),function(e){var t=r.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);r.setEdge(e.v,e.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),r}function bn(n){var r=new m({multigraph:n.isMultigraph()}).setGraph(n.graph());return s(n.nodes(),function(e){n.children(e).length||r.setNode(e,n.node(e))}),s(n.edges(),function(e){r.setEdge(e,n.edge(e))}),r}function en(n,r){var e=n.x,t=n.y,o=r.x-e,i=r.y-t,a=n.width/2,u=n.height/2;if(!o&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var d,c;return Math.abs(i)*a>Math.abs(o)*u?(i<0&&(u=-u),d=u*o/i,c=u):(o<0&&(a=-a),d=a,c=a*i/o),{x:e+d,y:t+c}}function C(n){var r=p(E(mn(n)+1),function(){return[]});return s(n.nodes(),function(e){var t=n.node(e),o=t.rank;b(o)||(r[o][t.order]=e)}),r}function Or(n){var r=_(p(n.nodes(),function(e){return n.node(e).rank}));s(n.nodes(),function(e){var t=n.node(e);vn(t,"rank")&&(t.rank-=r)})}function Ir(n){var r=_(p(n.nodes(),function(i){return n.node(i).rank})),e=[];s(n.nodes(),function(i){var a=n.node(i).rank-r;e[a]||(e[a]=[]),e[a].push(i)});var t=0,o=n.graph().nodeRankFactor;s(e,function(i,a){b(i)&&a%o!==0?--t:t&&s(i,function(u){n.node(u).rank+=t})})}function tn(n,r,e,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=e,o.order=t),O(n,"border",o,r)}function mn(n){return y(p(n.nodes(),function(r){var e=n.node(r).rank;if(!b(e))return e}))}function _r(n,r){var e={lhs:[],rhs:[]};return s(n,function(t){r(t)?e.lhs.push(t):e.rhs.push(t)}),e}function Pr(n,r){return r()}function Lr(n){function r(e){var t=n.children(e),o=n.node(e);if(t.length&&s(t,r),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)on(n,"borderLeft","_bl",e,o,i),on(n,"borderRight","_br",e,o,i)}}s(n.children(),r)}function on(n,r,e,t,o,i){var a={width:0,height:0,rank:i,borderType:r},u=o[r][i-1],d=O(n,"border",a,e);o[r][i]=d,n.setParent(d,t),u&&n.setEdge(u,d,{weight:1})}function Rr(n){var r=n.graph().rankdir.toLowerCase();(r==="lr"||r==="rl")&&yn(n)}function jr(n){var r=n.graph().rankdir.toLowerCase();(r==="bt"||r==="rl")&&Mr(n),(r==="lr"||r==="rl")&&(Tr(n),yn(n))}function yn(n){s(n.nodes(),function(r){an(n.node(r))}),s(n.edges(),function(r){an(n.edge(r))})}function an(n){var r=n.width;n.width=n.height,n.height=r}function Mr(n){s(n.nodes(),function(r){V(n.node(r))}),s(n.edges(),function(r){var e=n.edge(r);s(e.points,V),Object.prototype.hasOwnProperty.call(e,"y")&&V(e)})}function V(n){n.y=-n.y}function Tr(n){s(n.nodes(),function(r){B(n.node(r))}),s(n.edges(),function(r){var e=n.edge(r);s(e.points,B),Object.prototype.hasOwnProperty.call(e,"x")&&B(e)})}function B(n){var r=n.x;n.x=n.y,n.y=r}function Sr(n){n.graph().dummyChains=[],s(n.edges(),function(r){Cr(n,r)})}function Cr(n,r){var e=r.v,t=n.node(e).rank,o=r.w,i=n.node(o).rank,a=r.name,u=n.edge(r),d=u.labelRank;if(i!==t+1){n.removeEdge(r);var c=void 0,f,h;for(h=0,++t;t<i;++h,++t)u.points=[],c={width:0,height:0,edgeLabel:u,edgeObj:r,rank:t},f=O(n,"edge",c,"_d"),t===d&&(c.width=u.width,c.height=u.height,c.dummy="edge-label",c.labelpos=u.labelpos),n.setEdge(e,f,{weight:u.weight},a),h===0&&n.graph().dummyChains.push(f),e=f;n.setEdge(e,o,{weight:u.weight},a)}}function $r(n){s(n.graph().dummyChains,function(r){var e=n.node(r),t=e.edgeLabel,o;for(n.setEdge(e.edgeObj,t);e.dummy;)o=n.successors(r)[0],n.removeNode(r),t.points.push({x:e.x,y:e.y}),e.dummy==="edge-label"&&(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height),r=o,e=n.node(r)})}function U(n){var r={};function e(t){var o=n.node(t);if(Object.prototype.hasOwnProperty.call(r,t))return o.rank;r[t]=!0;var i=_(p(n.outEdges(t),function(a){return e(a.w)-n.edge(a).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),o.rank=i}s(n.sources(),e)}function P(n,r){return n.node(r.w).rank-n.node(r.v).rank-n.edge(r).minlen}function kn(n){var r=new m({directed:!1}),e=n.nodes()[0],t=n.nodeCount();r.setNode(e,{});for(var o,i;Gr(r,n)<t;)o=Fr(r,n),i=r.hasNode(o.v)?P(n,o):-P(n,o),Vr(r,n,i);return r}function Gr(n,r){function e(t){s(r.nodeEdges(t),function(o){var i=o.v,a=t===i?o.w:i;!n.hasNode(a)&&!P(r,o)&&(n.setNode(a,{}),n.setEdge(t,a,{}),e(a))})}return s(n.nodes(),e),n.nodeCount()}function Fr(n,r){return Q(r.edges(),function(e){if(n.hasNode(e.v)!==n.hasNode(e.w))return P(r,e)})}function Vr(n,r,e){s(n.nodes(),function(t){r.node(t).rank+=e})}function xn(n,r,e){pn(r)||(r=[r]);var t=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],i={};return s(r,function(a){if(!n.hasNode(a))throw new Error("Graph does not have node: "+a);En(n,a,e==="post",i,t,o)}),o}function En(n,r,e,t,o,i){Object.prototype.hasOwnProperty.call(t,r)||(t[r]=!0,e||i.push(r),s(o(r),function(a){En(n,a,e,t,o,i)}),e&&i.push(r))}function Br(n,r){return xn(n,r,"post")}function Yr(n,r){return xn(n,r,"pre")}k.initLowLimValues=X;k.initCutValues=Z;k.calcCutValue=Nn;k.leaveEdge=In;k.enterEdge=_n;k.exchangeEdges=Pn;function k(n){n=Nr(n),U(n);var r=kn(n);X(r),Z(r,n);for(var e,t;e=In(r);)t=_n(r,n,e),Pn(r,n,e,t)}function Z(n,r){var e=Br(n,n.nodes());e=e.slice(0,e.length-1),s(e,function(t){qr(n,r,t)})}function qr(n,r,e){var t=n.node(e),o=t.parent;n.edge(e,o).cutvalue=Nn(n,r,e)}function Nn(n,r,e){var t=n.node(e),o=t.parent,i=!0,a=r.edge(e,o),u=0;return a||(i=!1,a=r.edge(o,e)),u=a.weight,s(r.nodeEdges(e),function(d){var c=d.v===e,f=c?d.w:d.v;if(f!==o){var h=c===i,g=r.edge(d).weight;if(u+=h?g:-g,Ar(n,e,f)){var v=n.edge(e,f).cutvalue;u+=h?-v:v}}}),u}function X(n,r){arguments.length<2&&(r=n.nodes()[0]),On(n,{},1,r)}function On(n,r,e,t,o){var i=e,a=n.node(t);return r[t]=!0,s(n.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(r,u)||(e=On(n,r,e,u,t))}),a.low=i,a.lim=e++,o?a.parent=o:delete a.parent,e}function In(n){return J(n.edges(),function(r){return n.edge(r).cutvalue<0})}function _n(n,r,e){var t=e.v,o=e.w;r.hasEdge(t,o)||(t=e.w,o=e.v);var i=n.node(t),a=n.node(o),u=i,d=!1;i.lim>a.lim&&(u=a,d=!0);var c=L(r.edges(),function(f){return d===un(n,n.node(f.v),u)&&d!==un(n,n.node(f.w),u)});return Q(c,function(f){return P(r,f)})}function Pn(n,r,e,t){var o=e.v,i=e.w;n.removeEdge(o,i),n.setEdge(t.v,t.w,{}),X(n),Z(n,r),zr(n,r)}function zr(n,r){var e=J(n.nodes(),function(o){return!r.node(o).parent}),t=Yr(n,e);t=t.slice(1),s(t,function(o){var i=n.node(o).parent,a=r.edge(o,i),u=!1;a||(a=r.edge(i,o),u=!0),r.node(o).rank=r.node(i).rank+(u?a.minlen:-a.minlen)})}function Ar(n,r,e){return n.hasEdge(r,e)}function un(n,r,e){return e.low<=r.lim&&r.lim<=e.lim}function Dr(n){switch(n.graph().ranker){case"network-simplex":dn(n);break;case"tight-tree":Jr(n);break;case"longest-path":Hr(n);break;default:dn(n)}}var Hr=U;function Jr(n){U(n),kn(n)}function dn(n){k(n)}function Qr(n){var r=O(n,"root",{},"_root"),e=Kr(n),t=y(x(e))-1,o=2*t+1;n.graph().nestingRoot=r,s(n.edges(),function(a){n.edge(a).minlen*=o});var i=Ur(n)+1;s(n.children(),function(a){Ln(n,r,o,i,t,e,a)}),n.graph().nodeRankFactor=o}function Ln(n,r,e,t,o,i,a){var u=n.children(a);if(!u.length){a!==r&&n.setEdge(r,a,{weight:0,minlen:e});return}var d=tn(n,"_bt"),c=tn(n,"_bb"),f=n.node(a);n.setParent(d,a),f.borderTop=d,n.setParent(c,a),f.borderBottom=c,s(u,function(h){Ln(n,r,e,t,o,i,h);var g=n.node(h),v=g.borderTop?g.borderTop:h,l=g.borderBottom?g.borderBottom:h,w=g.borderTop?t:2*t,I=v!==l?1:o-i[a]+1;n.setEdge(d,v,{weight:w,minlen:I,nestingEdge:!0}),n.setEdge(l,c,{weight:w,minlen:I,nestingEdge:!0})}),n.parent(a)||n.setEdge(r,d,{weight:0,minlen:o+i[a]})}function Kr(n){var r={};function e(t,o){var i=n.children(t);i&&i.length&&s(i,function(a){e(a,o+1)}),r[t]=o}return s(n.children(),function(t){e(t,1)}),r}function Ur(n){return T(n.edges(),function(r,e){return r+n.edge(e).weight},0)}function Zr(n){var r=n.graph();n.removeNode(r.nestingRoot),delete r.nestingRoot,s(n.edges(),function(e){var t=n.edge(e);t.nestingEdge&&n.removeEdge(e)})}function Xr(n,r,e){var t={},o;s(e,function(i){for(var a=n.parent(i),u,d;a;){if(u=n.parent(a),u?(d=t[u],t[u]=a):(d=o,o=a),d&&d!==a){r.setEdge(d,a);return}a=u}})}function Wr(n,r,e){var t=ne(n),o=new m({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return n.node(i)});return s(n.nodes(),function(i){var a=n.node(i),u=n.parent(i);(a.rank===r||a.minRank<=r&&r<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||t),s(n[e](i),function(d){var c=d.v===i?d.w:d.v,f=o.edge(c,i),h=b(f)?0:f.weight;o.setEdge(c,i,{weight:n.edge(d).weight+h})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[r],borderRight:a.borderRight[r]}))}),o}function ne(n){for(var r;n.hasNode(r=K("_root")););return r}function re(n,r){for(var e=0,t=1;t<r.length;++t)e+=ee(n,r[t-1],r[t]);return e}function ee(n,r,e){for(var t=vr(e,p(e,function(c,f){return f})),o=N(p(r,function(c){return R(p(n.outEdges(c),function(f){return{pos:t[f.w],weight:n.edge(f).weight}}),"pos")})),i=1;i<e.length;)i<<=1;var a=2*i-1;i-=1;var u=p(new Array(a),function(){return 0}),d=0;return s(o.forEach(function(c){var f=c.pos+i;u[f]+=c.weight;for(var h=0;f>0;)f%2&&(h+=u[f+1]),f=f-1>>1,u[f]+=c.weight;d+=c.weight*h})),d}function te(n){var r={},e=L(n.nodes(),function(u){return!n.children(u).length}),t=y(p(e,function(u){return n.node(u).rank})),o=p(E(t+1),function(){return[]});function i(u){if(!vn(r,u)){r[u]=!0;var d=n.node(u);o[d.rank].push(u),s(n.successors(u),i)}}var a=R(e,function(u){return n.node(u).rank});return s(a,i),o}function oe(n,r){return p(r,function(e){var t=n.inEdges(e);if(t.length){var o=T(t,function(i,a){var u=n.edge(a),d=n.node(a.v);return{sum:i.sum+u.weight*d.order,weight:i.weight+u.weight}},{sum:0,weight:0});return{v:e,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:e}})}function ie(n,r){var e={};s(n,function(o,i){var a=e[o.v]={indegree:0,in:[],out:[],vs:[o.v],i};b(o.barycenter)||(a.barycenter=o.barycenter,a.weight=o.weight)}),s(r.edges(),function(o){var i=e[o.v],a=e[o.w];!b(i)&&!b(a)&&(a.indegree++,i.out.push(e[o.w]))});var t=L(e,function(o){return!o.indegree});return ae(t)}function ae(n){var r=[];function e(i){return function(a){a.merged||(b(a.barycenter)||b(i.barycenter)||a.barycenter>=i.barycenter)&&ue(i,a)}}function t(i){return function(a){a.in.push(i),--a.indegree===0&&n.push(a)}}for(;n.length;){var o=n.pop();r.push(o),s(o.in.reverse(),e(o)),s(o.out,t(o))}return p(L(r,function(i){return!i.merged}),function(i){return M(i,["vs","i","barycenter","weight"])})}function ue(n,r){var e=0,t=0;n.weight&&(e+=n.barycenter*n.weight,t+=n.weight),r.weight&&(e+=r.barycenter*r.weight,t+=r.weight),n.vs=r.vs.concat(n.vs),n.barycenter=e/t,n.weight=t,n.i=Math.min(r.i,n.i),r.merged=!0}function de(n,r){var e=_r(n,function(f){return Object.prototype.hasOwnProperty.call(f,"barycenter")}),t=e.lhs,o=R(e.rhs,function(f){return-f.i}),i=[],a=0,u=0,d=0;t.sort(ce(!!r)),d=cn(i,o,d),s(t,function(f){d+=f.vs.length,i.push(f.vs),a+=f.barycenter*f.weight,u+=f.weight,d=cn(i,o,d)});var c={vs:N(i)};return u&&(c.barycenter=a/u,c.weight=u),c}function cn(n,r,e){for(var t;r.length&&(t=j(r)).i<=e;)r.pop(),n.push(t.vs),e++;return e}function ce(n){return function(r,e){return r.barycenter<e.barycenter?-1:r.barycenter>e.barycenter?1:n?e.i-r.i:r.i-e.i}}function Rn(n,r,e,t){var o=n.children(r),i=n.node(r),a=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,d={};a&&(o=L(o,function(l){return l!==a&&l!==u}));var c=oe(n,o);s(c,function(l){if(n.children(l.v).length){var w=Rn(n,l.v,e,t);d[l.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&fe(l,w)}});var f=ie(c,e);se(f,d);var h=de(f,t);if(a&&(h.vs=N([a,h.vs,u]),n.predecessors(a).length)){var g=n.node(n.predecessors(a)[0]),v=n.node(n.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+g.order+v.order)/(h.weight+2),h.weight+=2}return h}function se(n,r){s(n,function(e){e.vs=N(e.vs.map(function(t){return r[t]?r[t].vs:t}))})}function fe(n,r){b(n.barycenter)?(n.barycenter=r.barycenter,n.weight=r.weight):(n.barycenter=(n.barycenter*n.weight+r.barycenter*r.weight)/(n.weight+r.weight),n.weight+=r.weight)}function he(n){var r=mn(n),e=sn(n,E(1,r+1),"inEdges"),t=sn(n,E(r-1,-1,-1),"outEdges"),o=te(n);fn(n,o);for(var i=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){ge(u%2?e:t,u%4>=2),o=C(n);var c=re(n,o);c<i&&(d=0,a=Wn(o),i=c)}fn(n,a)}function sn(n,r,e){return p(r,function(t){return Wr(n,t,e)})}function ge(n,r){var e=new m;s(n,function(t){var o=t.graph().root,i=Rn(t,o,e,r);s(i.vs,function(a,u){t.node(a).order=u}),Xr(t,e,i.vs)})}function fn(n,r){s(r,function(e){s(e,function(t,o){n.node(t).order=o})})}function ve(n){var r=pe(n);s(n.graph().dummyChains,function(e){for(var t=n.node(e),o=t.edgeObj,i=le(n,r,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],f=!0;e!==o.w;){if(t=n.node(e),f){for(;(c=a[d])!==u&&n.node(c).maxRank<t.rank;)d++;c===u&&(f=!1)}if(!f){for(;d<a.length-1&&n.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}n.setParent(e,c),e=n.successors(e)[0]}})}function le(n,r,e,t){var o=[],i=[],a=Math.min(r[e].low,r[t].low),u=Math.max(r[e].lim,r[t].lim),d,c;d=e;do d=n.parent(d),o.push(d);while(d&&(r[d].low>a||u>r[d].lim));for(c=d,d=t;(d=n.parent(d))!==c;)i.push(d);return{path:o.concat(i.reverse()),lca:c}}function pe(n){var r={},e=0;function t(o){var i=e;s(n.children(o),t),r[o]={low:i,lim:e++}}return s(n.children(),t),r}function we(n,r){var e={};function t(o,i){var a=0,u=0,d=o.length,c=j(i);return s(i,function(f,h){var g=me(n,f),v=g?n.node(g).order:d;(g||f===c)&&(s(i.slice(u,h+1),function(l){s(n.predecessors(l),function(w){var I=n.node(w),W=I.order;(W<a||v<W)&&!(I.dummy&&n.node(l).dummy)&&jn(e,w,l)})}),u=h+1,a=v)}),i}return T(r,t),e}function be(n,r){var e={};function t(i,a,u,d,c){var f;s(E(a,u),function(h){f=i[h],n.node(f).dummy&&s(n.predecessors(f),function(g){var v=n.node(g);v.dummy&&(v.order<d||v.order>c)&&jn(e,g,f)})})}function o(i,a){var u=-1,d,c=0;return s(a,function(f,h){if(n.node(f).dummy==="border"){var g=n.predecessors(f);g.length&&(d=n.node(g[0]).order,t(a,c,h,u,d),c=h,u=d)}t(a,c,a.length,d,i.length)}),a}return T(r,o),e}function me(n,r){if(n.node(r).dummy)return J(n.predecessors(r),function(e){return n.node(e).dummy})}function jn(n,r,e){if(r>e){var t=r;r=e,e=t}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=n[r];Object.defineProperty(o,e,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function ye(n,r,e){if(r>e){var t=r;r=e,e=t}return!!n[r]&&Object.prototype.hasOwnProperty.call(n[r],e)}function ke(n,r,e,t){var o={},i={},a={};return s(r,function(u){s(u,function(d,c){o[d]=d,i[d]=d,a[d]=c})}),s(r,function(u){var d=-1;s(u,function(c){var f=t(c);if(f.length){f=R(f,function(w){return a[w]});for(var h=(f.length-1)/2,g=Math.floor(h),v=Math.ceil(h);g<=v;++g){var l=f[g];i[c]===c&&d<a[l]&&!ye(e,c,l)&&(i[l]=c,i[c]=o[c]=o[l],d=a[l])}}})}),{root:o,align:i}}function xe(n,r,e,t,o){var i={},a=Ee(n,r,e,o),u=o?"borderLeft":"borderRight";function d(h,g){for(var v=a.nodes(),l=v.pop(),w={};l;)w[l]?h(l):(w[l]=!0,v.push(l),v=v.concat(g(l))),l=v.pop()}function c(h){i[h]=a.inEdges(h).reduce(function(g,v){return Math.max(g,i[v.v]+a.edge(v))},0)}function f(h){var g=a.outEdges(h).reduce(function(l,w){return Math.min(l,i[w.w]-a.edge(w))},Number.POSITIVE_INFINITY),v=n.node(h);g!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(i[h]=Math.max(i[h],g))}return d(c,a.predecessors.bind(a)),d(f,a.successors.bind(a)),s(t,function(h){i[h]=i[e[h]]}),i}function Ee(n,r,e,t){var o=new m,i=n.graph(),a=Pe(i.nodesep,i.edgesep,t);return s(r,function(u){var d;s(u,function(c){var f=e[c];if(o.setNode(f),d){var h=e[d],g=o.edge(h,f);o.setEdge(h,f,Math.max(a(n,c,d),g||0))}d=c})}),o}function Ne(n,r){return Q(x(r),function(e){var t=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return nr(e,function(i,a){var u=Le(n,a)/2;t=Math.max(i+u,t),o=Math.min(i-u,o)}),t-o})}function Oe(n,r){var e=x(r),t=_(e),o=y(e);s(["u","d"],function(i){s(["l","r"],function(a){var u=i+a,d=n[u],c;if(d!==r){var f=x(d);c=a==="l"?t-_(f):o-y(f),c&&(n[u]=S(d,function(h){return h+c}))}})})}function Ie(n,r){return S(n.ul,function(e,t){if(r)return n[r.toLowerCase()][t];var o=R(p(n,t));return(o[1]+o[2])/2})}function _e(n){var r=C(n),e=A(we(n,r),be(n,r)),t={},o;s(["u","d"],function(a){o=a==="u"?r:x(r).reverse(),s(["l","r"],function(u){u==="r"&&(o=p(o,function(h){return x(h).reverse()}));var d=(a==="u"?n.predecessors:n.successors).bind(n),c=ke(n,o,e,d),f=xe(n,o,c.root,c.align,u==="r");u==="r"&&(f=S(f,function(h){return-h})),t[a+u]=f})});var i=Ne(n,t);return Oe(t,i),Ie(t,n.graph().align)}function Pe(n,r,e){return function(t,o,i){var a=t.node(o),u=t.node(i),d=0,c;if(d+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=-a.width/2;break;case"r":c=a.width/2;break}if(c&&(d+=e?c:-c),c=0,d+=(a.dummy?r:n)/2,d+=(u.dummy?r:n)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":c=u.width/2;break;case"r":c=-u.width/2;break}return c&&(d+=e?c:-c),c=0,d}}function Le(n,r){return n.node(r).width}function Re(n){n=bn(n),je(n),rr(_e(n),function(r,e){n.node(e).x=r})}function je(n){var r=C(n),e=n.graph().ranksep,t=0;s(r,function(o){var i=y(p(o,function(a){return n.node(a).height}));s(o,function(a){n.node(a).y=t+i/2}),t+=i+e})}function it(n,r){var e=Pr;e("layout",()=>{var t=e(" buildLayoutGraph",()=>qe(n));e(" runLayout",()=>Me(t,e)),e(" updateInputGraph",()=>Te(n,t))})}function Me(n,r){r(" makeSpaceForEdgeLabels",()=>ze(n)),r(" removeSelfEdges",()=>Xe(n)),r(" acyclic",()=>kr(n)),r(" nestingGraph.run",()=>Qr(n)),r(" rank",()=>Dr(bn(n))),r(" injectEdgeLabelProxies",()=>Ae(n)),r(" removeEmptyRanks",()=>Ir(n)),r(" nestingGraph.cleanup",()=>Zr(n)),r(" normalizeRanks",()=>Or(n)),r(" assignRankMinMax",()=>De(n)),r(" removeEdgeLabelProxies",()=>He(n)),r(" normalize.run",()=>Sr(n)),r(" parentDummyChains",()=>ve(n)),r(" addBorderSegments",()=>Lr(n)),r(" order",()=>he(n)),r(" insertSelfEdges",()=>We(n)),r(" adjustCoordinateSystem",()=>Rr(n)),r(" position",()=>Re(n)),r(" positionSelfEdges",()=>nt(n)),r(" removeBorderNodes",()=>Ze(n)),r(" normalize.undo",()=>$r(n)),r(" fixupEdgeLabelCoords",()=>Ke(n)),r(" undoCoordinateSystem",()=>jr(n)),r(" translateGraph",()=>Je(n)),r(" assignNodeIntersects",()=>Qe(n)),r(" reversePoints",()=>Ue(n)),r(" acyclic.undo",()=>Er(n))}function Te(n,r){s(n.nodes(),function(e){var t=n.node(e),o=r.node(e);t&&(t.x=o.x,t.y=o.y,r.children(e).length&&(t.width=o.width,t.height=o.height))}),s(n.edges(),function(e){var t=n.edge(e),o=r.edge(e);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)}),n.graph().width=r.graph().width,n.graph().height=r.graph().height}var Se=["nodesep","edgesep","ranksep","marginx","marginy"],Ce={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$e=["acyclicer","ranker","rankdir","align"],Ge=["width","height"],Fe={width:0,height:0},Ve=["minlen","weight","width","height","labeloffset"],Be={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ye=["labelpos"];function qe(n){var r=new m({multigraph:!0,compound:!0}),e=q(n.graph());return r.setGraph(A({},Ce,Y(e,Se),M(e,$e))),s(n.nodes(),function(t){var o=q(n.node(t));r.setNode(t,Gn(Y(o,Ge),Fe)),r.setParent(t,n.parent(t))}),s(n.edges(),function(t){var o=q(n.edge(t));r.setEdge(t,A({},Be,Y(o,Ve),M(o,Ye)))}),r}function ze(n){var r=n.graph();r.ranksep/=2,s(n.edges(),function(e){var t=n.edge(e);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(r.rankdir==="TB"||r.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Ae(n){s(n.edges(),function(r){var e=n.edge(r);if(e.width&&e.height){var t=n.node(r.v),o=n.node(r.w),i={rank:(o.rank-t.rank)/2+t.rank,e:r};O(n,"edge-proxy",i,"_ep")}})}function De(n){var r=0;s(n.nodes(),function(e){var t=n.node(e);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,r=y(r,t.maxRank))}),n.graph().maxRank=r}function He(n){s(n.nodes(),function(r){var e=n.node(r);e.dummy==="edge-proxy"&&(n.edge(e.e).labelRank=e.rank,n.removeNode(r))})}function Je(n){var r=Number.POSITIVE_INFINITY,e=0,t=Number.POSITIVE_INFINITY,o=0,i=n.graph(),a=i.marginx||0,u=i.marginy||0;function d(c){var f=c.x,h=c.y,g=c.width,v=c.height;r=Math.min(r,f-g/2),e=Math.max(e,f+g/2),t=Math.min(t,h-v/2),o=Math.max(o,h+v/2)}s(n.nodes(),function(c){d(n.node(c))}),s(n.edges(),function(c){var f=n.edge(c);Object.prototype.hasOwnProperty.call(f,"x")&&d(f)}),r-=a,t-=u,s(n.nodes(),function(c){var f=n.node(c);f.x-=r,f.y-=t}),s(n.edges(),function(c){var f=n.edge(c);s(f.points,function(h){h.x-=r,h.y-=t}),Object.prototype.hasOwnProperty.call(f,"x")&&(f.x-=r),Object.prototype.hasOwnProperty.call(f,"y")&&(f.y-=t)}),i.width=e-r+a,i.height=o-t+u}function Qe(n){s(n.edges(),function(r){var e=n.edge(r),t=n.node(r.v),o=n.node(r.w),i,a;e.points?(i=e.points[0],a=e.points[e.points.length-1]):(e.points=[],i=o,a=t),e.points.unshift(en(t,i)),e.points.push(en(o,a))})}function Ke(n){s(n.edges(),function(r){var e=n.edge(r);if(Object.prototype.hasOwnProperty.call(e,"x"))switch((e.labelpos==="l"||e.labelpos==="r")&&(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset;break}})}function Ue(n){s(n.edges(),function(r){var e=n.edge(r);e.reversed&&e.points.reverse()})}function Ze(n){s(n.nodes(),function(r){if(n.children(r).length){var e=n.node(r),t=n.node(e.borderTop),o=n.node(e.borderBottom),i=n.node(j(e.borderLeft)),a=n.node(j(e.borderRight));e.width=Math.abs(a.x-i.x),e.height=Math.abs(o.y-t.y),e.x=i.x+e.width/2,e.y=t.y+e.height/2}}),s(n.nodes(),function(r){n.node(r).dummy==="border"&&n.removeNode(r)})}function Xe(n){s(n.edges(),function(r){if(r.v===r.w){var e=n.node(r.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:r,label:n.edge(r)}),n.removeEdge(r)}})}function We(n){var r=C(n);s(r,function(e){var t=0;s(e,function(o,i){var a=n.node(o);a.order=i+t,s(a.selfEdges,function(u){O(n,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:i+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function nt(n){s(n.nodes(),function(r){var e=n.node(r);if(e.dummy==="selfedge"){var t=n.node(e.e.v),o=t.x+t.width/2,i=t.y,a=e.x-o,u=t.height/2;n.setEdge(e.e,e.label),n.removeNode(r),e.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],e.label.x=e.x,e.label.y=e.y}})}function Y(n,r){return S(M(n,r),Number)}function q(n){var r={};return s(n,function(e,t){r[t.toLowerCase()]=e}),r}export{it as o};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as ce}from"./chunk-55IACEB6-C4OH5_NF-
|
|
1
|
+
import{d as ce}from"./chunk-55IACEB6-C4OH5_NF-DrgL4Tv-.js";import{d as he}from"./chunk-QN33PNHL-DrWWTLTH-tpIkWiz1.js";import{R as a,O as I,Z as le,X as de,L as M,g as X,A as P,b9 as ge,aU as ue,aV as pe,aW as ye}from"./index-p0knuDQ9.js";const m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function fe(e,s=0){return(m[e[s+0]]+m[e[s+1]]+m[e[s+2]]+m[e[s+3]]+"-"+m[e[s+4]]+m[e[s+5]]+"-"+m[e[s+6]]+m[e[s+7]]+"-"+m[e[s+8]]+m[e[s+9]]+"-"+m[e[s+10]]+m[e[s+11]]+m[e[s+12]]+m[e[s+13]]+m[e[s+14]]+m[e[s+15]]).toLowerCase()}let W;const me=new Uint8Array(16);function Ee(){if(!W){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");W=crypto.getRandomValues.bind(crypto)}return W(me)}const _e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:_e};function be(e,s,i){var c;if(ne.randomUUID&&!e)return ne.randomUUID();e=e||{};const h=e.random??((c=e.rng)==null?void 0:c.call(e))??Ee();if(h.length<16)throw new Error("Random bytes length must be >= 16");return h[6]=h[6]&15|64,h[8]=h[8]&63|128,fe(h)}var q=function(){var e=a(function(S,t,r,o){for(r=r||{},o=S.length;o--;r[S[o]]=t);return r},"o"),s=[1,4],i=[1,13],c=[1,12],h=[1,15],y=[1,16],u=[1,20],g=[1,19],L=[6,7,8],p=[1,26],C=[1,24],z=[1,25],b=[6,7,11],Y=[1,6,13,15,16,19,22],J=[1,33],K=[1,34],R=[1,6,7,11,13,15,16,19,22],B={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:a(function(S,t,r,o,l,n,E){var d=n.length-1;switch(l){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",n[d].id),o.addNode(n[d-1].length,n[d].id,n[d].descr,n[d].type);break;case 16:o.getLogger().trace("Icon: ",n[d]),o.decorateNode({icon:n[d]});break;case 17:case 21:o.decorateNode({class:n[d]});break;case 18:o.getLogger().trace("SPACELIST");break;case 19:o.getLogger().trace("Node: ",n[d].id),o.addNode(0,n[d].id,n[d].descr,n[d].type);break;case 20:o.decorateNode({icon:n[d]});break;case 25:o.getLogger().trace("node found ..",n[d-2]),this.$={id:n[d-1],descr:n[d-1],type:o.getType(n[d-2],n[d])};break;case 26:this.$={id:n[d],descr:n[d],type:o.nodeType.DEFAULT};break;case 27:o.getLogger().trace("node found ..",n[d-3]),this.$={id:n[d-3],descr:n[d-1],type:o.getType(n[d-2],n[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:s},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:s},{6:i,7:[1,10],9:9,12:11,13:c,14:14,15:h,16:y,17:17,18:18,19:u,22:g},e(L,[2,3]),{1:[2,2]},e(L,[2,4]),e(L,[2,5]),{1:[2,6],6:i,12:21,13:c,14:14,15:h,16:y,17:17,18:18,19:u,22:g},{6:i,9:22,12:11,13:c,14:14,15:h,16:y,17:17,18:18,19:u,22:g},{6:p,7:C,10:23,11:z},e(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:u,22:g}),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,23]),e(b,[2,24]),e(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:p,7:C,10:32,11:z},{1:[2,7],6:i,12:21,13:c,14:14,15:h,16:y,17:17,18:18,19:u,22:g},e(Y,[2,14],{7:J,11:K}),e(R,[2,8]),e(R,[2,9]),e(R,[2,10]),e(b,[2,15]),e(b,[2,16]),e(b,[2,17]),{20:[1,35]},{21:[1,36]},e(Y,[2,13],{7:J,11:K}),e(R,[2,11]),e(R,[2,12]),{21:[1,37]},e(b,[2,25]),e(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:a(function(S,t){if(t.recoverable)this.trace(S);else{var r=new Error(S);throw r.hash=t,r}},"parseError"),parse:a(function(S){var t=this,r=[0],o=[],l=[null],n=[],E=this.table,d="",A=0,Q=0,se=2,V=1,re=n.slice.call(arguments,1),f=Object.create(this.lexer),x={yy:{}};for(var j in this.yy)Object.prototype.hasOwnProperty.call(this.yy,j)&&(x.yy[j]=this.yy[j]);f.setInput(S,x.yy),x.yy.lexer=f,x.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var F=f.yylloc;n.push(F);var oe=f.options&&f.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(N){r.length=r.length-2*N,l.length=l.length-N,n.length=n.length-N}a(ae,"popStack");function ee(){var N;return N=o.pop()||f.lex()||V,typeof N!="number"&&(N instanceof Array&&(o=N,N=o.pop()),N=t.symbols_[N]||N),N}a(ee,"lex");for(var _,T,D,G,O={},$,k,te,U;;){if(T=r[r.length-1],this.defaultActions[T]?D=this.defaultActions[T]:((_===null||typeof _>"u")&&(_=ee()),D=E[T]&&E[T][_]),typeof D>"u"||!D.length||!D[0]){var H="";U=[];for($ in E[T])this.terminals_[$]&&$>se&&U.push("'"+this.terminals_[$]+"'");f.showPosition?H="Parse error on line "+(A+1)+`:
|
|
2
2
|
`+f.showPosition()+`
|
|
3
3
|
Expecting `+U.join(", ")+", got '"+(this.terminals_[_]||_)+"'":H="Parse error on line "+(A+1)+": Unexpected "+(_==V?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(H,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:F,expected:U})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+_);switch(D[0]){case 1:r.push(_),l.push(f.yytext),n.push(f.yylloc),r.push(D[1]),_=null,Q=f.yyleng,d=f.yytext,A=f.yylineno,F=f.yylloc;break;case 2:if(k=this.productions_[D[1]][1],O.$=l[l.length-k],O._$={first_line:n[n.length-(k||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(k||1)].first_column,last_column:n[n.length-1].last_column},oe&&(O._$.range=[n[n.length-(k||1)].range[0],n[n.length-1].range[1]]),G=this.performAction.apply(O,[d,Q,A,x.yy,D[1],l,n].concat(re)),typeof G<"u")return G;k&&(r=r.slice(0,-1*k*2),l=l.slice(0,-1*k),n=n.slice(0,-1*k)),r.push(this.productions_[D[1]][0]),l.push(O.$),n.push(O._$),te=E[r[r.length-2]][r[r.length-1]],r.push(te);break;case 3:return!0}}return!0},"parse")},ie=function(){var S={EOF:1,parseError:a(function(t,r){if(this.yy.parser)this.yy.parser.parseError(t,r);else throw new Error(t)},"parseError"),setInput:a(function(t,r){return this.yy=r||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var r=t.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:a(function(t){var r=t.length,o=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===l.length?this.yylloc.first_column:0)+l[l.length-o.length].length-o[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(t){this.unput(this.match.slice(t))},"less"),pastInput:a(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var t=this.pastInput(),r=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as p,u as U,f as Z,l as _,s as j,r as J,o as K,O as z,g as Q,H as X,am as Y,ao as ee,ap as te,B as ae,w as ne,L as re,aq as w,ar as ie,as as R}from"./index-
|
|
1
|
+
import{R as p,u as U,f as Z,l as _,s as j,r as J,o as K,O as z,g as Q,H as X,am as Y,ao as ee,ap as te,B as ae,w as ne,L as re,aq as w,ar as ie,as as R}from"./index-p0knuDQ9.js";import{m as le}from"./chunk-4BX2VUAB-BeuiUsbc-DN2rdYji.js";import{N as se}from"./treemap-KMMF4GRG-C4GHjB3F-_nPgBK22.js";import{h as E}from"./arc-b8oyw-lz-1LLYREoj.js";import"./_baseUniq-Cd4llU-Q-Cdw60MU4.js";import"./_basePickBy-1MakYQmz-ydNwd1l_.js";import"./clone-DH1Kq5Y6-DxQT_fR1.js";function oe(e,a){return a<e?-1:a>e?1:a>=e?0:NaN}function ce(e){return e}function ue(){var e=ce,a=oe,f=null,s=w(0),o=w(R),y=w(0);function l(t){var r,c=(t=ie(t)).length,d,v,x=0,u=new Array(c),i=new Array(c),h=+s.apply(this,arguments),S=Math.min(R,Math.max(-R,o.apply(this,arguments)-h)),m,b=Math.min(Math.abs(S)/c,y.apply(this,arguments)),C=b*(S<0?-1:1),g;for(r=0;r<c;++r)(g=i[u[r]=r]=+e(t[r],r,t))>0&&(x+=g);for(a!=null?u.sort(function($,A){return a(i[$],i[A])}):f!=null&&u.sort(function($,A){return f(t[$],t[A])}),r=0,v=x?(S-c*C)/x:0;r<c;++r,h=m)d=u[r],g=i[d],m=h+(g>0?g*v:0)+C,i[d]={data:t[d],index:r,value:g,startAngle:h,endAngle:m,padAngle:b};return i}return l.value=function(t){return arguments.length?(e=typeof t=="function"?t:w(+t),l):e},l.sortValues=function(t){return arguments.length?(a=t,f=null,l):a},l.sort=function(t){return arguments.length?(f=t,a=null,l):f},l.startAngle=function(t){return arguments.length?(s=typeof t=="function"?t:w(+t),l):s},l.endAngle=function(t){return arguments.length?(o=typeof t=="function"?t:w(+t),l):o},l.padAngle=function(t){return arguments.length?(y=typeof t=="function"?t:w(+t),l):y},l}var pe=re.pie,N={sections:new Map,showData:!1},D=N.sections,B=N.showData,de=structuredClone(pe),ge=p(()=>structuredClone(de),"getConfig"),fe=p(()=>{D=new Map,B=N.showData,ne()},"clear"),he=p(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(e)||(D.set(e,a),z.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),me=p(()=>D,"getSections"),xe=p(e=>{B=e},"setShowData"),we=p(()=>B,"getShowData"),V={getConfig:ge,clear:fe,setDiagramTitle:K,getDiagramTitle:J,setAccTitle:j,getAccTitle:_,setAccDescription:Z,getAccDescription:U,addSection:he,getSections:me,setShowData:xe,getShowData:we},ye=p((e,a)=>{le(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),ve={parse:p(async e=>{const a=await se("pie",e);z.debug(a),ye(a,V)},"parse")},Se=p(e=>`
|
|
2
2
|
.pieCircle{
|
|
3
3
|
stroke: ${e.pieStrokeColor};
|
|
4
4
|
stroke-width : ${e.pieStrokeWidth};
|