1 line
135 KiB
JavaScript
1 line
135 KiB
JavaScript
!function(){var e,t,n;!function(r){function s(e,t){return x.call(e,t)}function i(e,t){var n,r,s,i,a,o,l,h,d,g,c,u=t&&t.split("/"),p=b.map,f=p&&p["*"]||{};if(e){for(a=(e=e.split("/")).length-1,b.nodeIdCompat&&w.test(e[a])&&(e[a]=e[a].replace(w,"")),"."===e[0].charAt(0)&&u&&(e=u.slice(0,u.length-1).concat(e)),d=0;d<e.length;d++)if("."===(c=e[d]))e.splice(d,1),d-=1;else if(".."===c){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((u||f)&&p){for(d=(n=e.split("/")).length;d>0;d-=1){if(r=n.slice(0,d).join("/"),u)for(g=u.length;g>0;g-=1)if((s=p[u.slice(0,g).join("/")])&&(s=s[r])){i=s,o=d;break}if(i)break;!l&&f&&f[r]&&(l=f[r],h=d)}!i&&l&&(i=l,o=h),i&&(n.splice(0,o,i),e=n.join("/"))}return e}function a(e,t){return function(){var n=k.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),c.apply(r,n.concat([e,t]))}}function o(e){return function(t){f[e]=t}}function l(e){if(s(m,e)){var t=m[e];delete m[e],y[e]=!0,g.apply(r,t)}if(!s(f,e)&&!s(y,e))throw new Error("No "+e);return f[e]}function h(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function d(e){return e?h(e):[]}var g,c,u,p,f={},m={},b={},y={},x=Object.prototype.hasOwnProperty,k=[].slice,w=/\.js$/;u=function(e,t){var n,r=h(e),s=r[0],a=t[1];return e=r[1],s&&(n=l(s=i(s,a))),s?e=n&&n.normalize?n.normalize(e,function(e){return function(t){return i(t,e)}}(a)):i(e,a):(s=(r=h(e=i(e,a)))[0],e=r[1],s&&(n=l(s))),{f:s?s+"!"+e:e,n:e,pr:s,p:n}},p={require:function(e){return a(e)},exports:function(e){var t=f[e];return void 0!==t?t:f[e]={}},module:function(e){return{id:e,uri:"",exports:f[e],config:function(e){return function(){return b&&b.config&&b.config[e]||{}}}(e)}}},g=function(e,t,n,i){var h,g,c,b,x,k,w,v=[],A=typeof n;if(i=i||e,k=d(i),"undefined"===A||"function"===A){for(t=!t.length&&n.length?["require","exports","module"]:t,x=0;x<t.length;x+=1)if(b=u(t[x],k),"require"===(g=b.f))v[x]=p.require(e);else if("exports"===g)v[x]=p.exports(e),w=!0;else if("module"===g)h=v[x]=p.module(e);else if(s(f,g)||s(m,g)||s(y,g))v[x]=l(g);else{if(!b.p)throw new Error(e+" missing "+g);b.p.load(b.n,a(i,!0),o(g),{}),v[x]=f[g]}c=n?n.apply(f[e],v):void 0,e&&(h&&h.exports!==r&&h.exports!==f[e]?f[e]=h.exports:c===r&&w||(f[e]=c))}else e&&(f[e]=n)},e=t=c=function(e,t,n,s,i){if("string"==typeof e)return p[e]?p[e](t):l(u(e,d(t)).f);if(!e.splice){if((b=e).deps&&c(b.deps,b.callback),!t)return;t.splice?(e=t,t=n,n=null):e=r}return t=t||function(){},"function"==typeof n&&(n=s,s=i),s?g(r,e,t,n):setTimeout(function(){g(r,e,t,n)},4),c},c.config=function(e){return c(e)},e._defined=f,(n=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),s(f,e)||s(m,e)||(m[e]=[e,t,n])}).amd={jQuery:!0}}(),n("../node_modules/almond/almond",function(){}),n("core/EventObject",[],()=>{"use strict";return class{constructor(){this.listeners=new Map,this.forwards=new Set}addEventListener(e,t){const n=this.listeners.get(e);n?n.push(t):this.listeners.set(e,[t])}removeEventListener(e,t){const n=this.listeners.get(e);if(!n)return;const r=n.indexOf(t);-1!==r&&n.splice(r,1)}countEventListeners(e){return(this.listeners.get(e)||[]).length}removeAllEventListeners(e){e?this.listeners.delete(e):this.listeners.clear()}addEventForwarding(e){this.forwards.add(e)}removeEventForwarding(e){this.forwards.delete(e)}removeAllEventForwardings(){this.forwards.clear()}trigger(e,t=[]){(this.listeners.get(e)||[]).forEach(e=>e.apply(null,t)),this.forwards.forEach(n=>n.trigger(e,t))}}}),n("core/ArrayUtilities",[],()=>{"use strict";function e(e,t,n=null){if(null===n)return e.indexOf(t);for(let r=0;r<e.length;++r)if(n(e[r],t))return r;return-1}function t(e,n,r,s){if(n>=e.length)return void s.push(r.slice());const i=e[n];if(!Array.isArray(i))return r.push(i),t(e,n+1,r,s),void r.pop();for(let a=0;a<i.length;++a)r.push(i[a]),t(e,n+1,r,s),r.pop()}return{indexOf:e,mergeSets:function(t,n=null,r=null){if(n)for(let s=0;s<n.length;++s)-1===e(t,n[s],r)&&t.push(n[s])},hasIntersection:function(t,n,r=null){for(let s=0;s<n.length;++s)if(-1!==e(t,n[s],r))return!0;return!1},removeAll:function(t,n=null,r=null){if(n)for(let s=0;s<n.length;++s){const i=e(t,n[s],r);-1!==i&&t.splice(i,1)}},remove:function(t,n,r=null){const s=e(t,n,r);-1!==s&&t.splice(s,1)},last:function(e){return e[e.length-1]},combine:function(e){const n=[];return t(e,0,[],n),n},flatMap:function(e,t){const n=[];return e.forEach(e=>{n.push(...t(e))}),n}}}),n("sequence/CodeMirrorMode",["core/ArrayUtilities"],e=>{"use strict";function t(e,t){return e.v===t.v&&e.prefix===t.prefix&&e.suffix===t.suffix&&e.q===t.q}function n(t,n,r){let s=r.suggest;return Array.isArray(s)||(s=[s]),e.flatMap(s,e=>!0===e?[function(e,t){return Object.keys(t.then).length>0?{v:e,suffix:" ",q:!1}:{v:e,suffix:"\n",q:!1}}(n,r)]:"object"==typeof e?e.known?t["known"+e.known]||[]:[e]:"string"==typeof e&&e?[{v:e,q:""===n}]:[])}function r(r,s){const i=[],a=e.last(s);return Object.keys(a.then).forEach(o=>{let l=a.then[o];"number"==typeof l&&(l=s[s.length-l-1]),e.mergeSets(i,n(r,o,l),t)}),i}function s(n,r,s,{suggest:i,override:a}){let o=null;"object"==typeof i&&i.known&&(o=i.known),r.type&&o!==r.type&&(a&&(r.type=a),e.mergeSets(n["known"+r.type],[{v:r.value,suffix:" ",q:!0}],t),r.type="",r.value=""),o&&(r.type=o,r.value&&(r.value+=s.s),r.value+=s.v)}function i(t,n,i){const a={type:"",value:""};let l=i;const h=[l];return t.line.forEach((n,i)=>{i===t.line.length-1&&(t.completions=r(t,h));const d=n.q?"":n.v;let g=l.then[d];void 0===g?(g=l.then[""],t.isVar=!0):t.isVar=n.q,"number"==typeof g?h.length-=g:h.push(g||o),l=e.last(h),s(t,a,n,l)}),n&&s(t,a,null,{}),t.nextCompletions=r(t,h),t.valid=Boolean(l.then["\n"])||0===Object.keys(l.then).length,l.type}function a(e){const t=e.baseToken||{};return{value:t.v||"",quoted:t.q||!1}}const o={type:"error line-error",then:{"":0}},l=(()=>{function e(e,t){return{type:"string",suggest:t,then:Object.assign({"":0},e)}}function t(e){return{type:"variable",suggest:{known:"Agent"},then:Object.assign({},e,{"":0,",":{type:"operator",suggest:!0,then:{"":1}}})}}function n(e){return{type:"keyword",suggest:[e+" of ",e+": "],then:{of:{type:"keyword",suggest:!0,then:{"":d}},":":{type:"operator",suggest:!0,then:{"":a}},"":d}}}function r(e,t){const n={type:"operator",suggest:!0,then:{"+":o,"-":o,"*":o,"!":o,"":e}};return{"+":{type:"operator",suggest:!0,then:{"+":o,"-":o,"*":n,"!":o,"":e}},"-":{type:"operator",suggest:!0,then:{"+":o,"-":o,"*":n,"!":{type:"operator",then:{"+":o,"-":o,"*":o,"!":o,"":e}},"":e}},"*":{type:"operator",suggest:!0,then:Object.assign({"+":n,"-":n,"*":o,"!":o,"":e},t)},"!":n,"":e}}const s={type:"",suggest:"\n",then:{}},i={type:"",then:{}},a=e({"\n":s}),l={type:"variable",suggest:{known:"Agent"},then:{"":0,"\n":s,",":{type:"operator",suggest:!0,then:{"":1}},as:{type:"keyword",suggest:!0,then:{"":{type:"variable",suggest:{known:"Agent"},then:{"":0,",":{type:"operator",suggest:!0,then:{"":3}},"\n":s}}}}}},h={type:"operator",suggest:!0,then:{"":a,"\n":i}},d=t({":":h}),g={type:"variable",suggest:{known:"Agent"},then:{"":0,",":{type:"operator",suggest:!0,then:{"":d}},":":o}},c={type:"variable",suggest:{known:"Agent"},then:{"":0,",":o,":":h}},u={type:"variable",suggest:{known:"Agent"},then:{"":0,":":{type:"operator",suggest:!0,then:{"":a,"\n":i}},"\n":s}},p={":":{type:"operator",suggest:!0,then:{"":e({as:{type:"keyword",suggest:!0,then:{"":{type:"variable",suggest:{known:"Agent"},then:{"":0,"\n":s}}}}})}}},f={type:"keyword",suggest:!0,then:Object.assign({over:{type:"keyword",suggest:!0,then:{"":t(p)}}},p)},m={"\n":s,":":{type:"operator",suggest:!0,then:{"":a,"\n":i}},with:{type:"keyword",suggest:["with height "],then:{height:{type:"keyword",suggest:!0,then:{"":{type:"number",suggest:["6 ","30 "],then:{"\n":s,":":{type:"operator",suggest:!0,then:{"":a,"\n":i}}}}}}}}},b={title:{type:"keyword",suggest:!0,then:{"":a}},theme:{type:"keyword",suggest:!0,then:{"":{type:"string",suggest:{global:"themes",suffix:"\n"},then:{"":0,"\n":s}}}},headers:{type:"keyword",suggest:!0,then:{none:{type:"keyword",suggest:!0,then:{}},cross:{type:"keyword",suggest:!0,then:{}},box:{type:"keyword",suggest:!0,then:{}},fade:{type:"keyword",suggest:!0,then:{}},bar:{type:"keyword",suggest:!0,then:{}}}},terminators:{type:"keyword",suggest:!0,then:{none:{type:"keyword",suggest:!0,then:{}},cross:{type:"keyword",suggest:!0,then:{}},box:{type:"keyword",suggest:!0,then:{}},fade:{type:"keyword",suggest:!0,then:{}},bar:{type:"keyword",suggest:!0,then:{}}}},divider:{type:"keyword",suggest:!0,then:Object.assign({line:{type:"keyword",suggest:!0,then:m},space:{type:"keyword",suggest:!0,then:m},delay:{type:"keyword",suggest:!0,then:m},tear:{type:"keyword",suggest:!0,then:m}},m)},define:{type:"keyword",suggest:!0,then:{"":l,as:o}},begin:{type:"keyword",suggest:!0,then:{"":l,reference:f,as:o}},end:{type:"keyword",suggest:!0,then:{"":l,as:o,"\n":s}},if:{type:"keyword",suggest:!0,then:{"":a,":":{type:"operator",suggest:!0,then:{"":a}},"\n":s}},else:{type:"keyword",suggest:["else\n","else if: "],then:{if:{type:"keyword",suggest:"if: ",then:{"":a,":":{type:"operator",suggest:!0,then:{"":a}}}},"\n":s}},repeat:{type:"keyword",suggest:!0,then:{"":a,":":{type:"operator",suggest:!0,then:{"":a}},"\n":s}},note:{type:"keyword",suggest:!0,then:{over:{type:"keyword",suggest:!0,then:{"":d}},left:n("left"),right:n("right"),between:{type:"keyword",suggest:!0,then:{"":g}}}},state:{type:"keyword",suggest:"state over ",then:{over:{type:"keyword",suggest:!0,then:{"":c}}}},text:{type:"keyword",suggest:!0,then:{left:n("left"),right:n("right")}},autolabel:{type:"keyword",suggest:!0,then:{off:{type:"keyword",suggest:!0,then:{}},"":e({"\n":s},[{v:"<label>",suffix:"\n",q:!0},{v:"[<inc>] <label>",suffix:"\n",q:!0},{v:"[<inc 1,0.01>] <label>",suffix:"\n",q:!0}])}},simultaneously:{type:"keyword",suggest:!0,then:{":":{type:"operator",suggest:!0,then:{}},with:{type:"keyword",suggest:!0,then:{"":{type:"variable",suggest:{known:"Label"},then:{"":0,":":{type:"operator",suggest:!0,then:{}}}}}}}}};return e=>({type:"error line-error",then:Object.assign({},b,function(e){const t={type:"keyword",suggest:!0,then:Object.assign({},r(u,{":":h,"\n":i}),{"...":{type:"operator",suggest:!0,then:{"":{type:"variable",suggest:{known:"DelayedAgent"},then:{"":0,":":o,"\n":s}}}}})},n={};e.forEach(e=>n[e]=t);const a={type:"operator",suggest:!1,override:"Label",then:{}},l={type:"variable",suggest:{known:"Agent"},then:Object.assign({"":0,":":{type:"operator",suggest:!0,override:"Label",then:{}}},n)},d={type:"variable",suggest:{known:"DelayedAgent"},then:Object.assign({"":0,":":a},n)};return Object.assign({"...":{type:"operator",suggest:!0,then:{"":d}}},r(l,Object.assign({"":l,":":a},n)))}(e))})})();return class{constructor(e,t){this.tokenDefinitions=e,this.commands=l(t),this.lineComment="#"}startState(){return{currentType:-1,current:"",currentSpace:"",currentQuoted:!1,knownAgent:[],knownDelayedAgent:[],knownLabel:[],beginCompletions:r({},[this.commands]),completions:[],nextCompletions:[],valid:!0,isVar:!0,line:[],indent:0}}_matchPattern(e,t,n){return t?(t.lastIndex=0,e.match(t,n)):null}_tokenBegin(e,t){t.currentSpace="";let n="";for(;;){if(e.eol())return!1;t.currentSpace+=n;for(let n=0;n<this.tokenDefinitions.length;++n){const r=this.tokenDefinitions[n];if(this._matchPattern(e,r.start,!0)){t.currentType=n;const{value:e,quoted:s}=a(r);return t.current=e,t.currentQuoted=s,!0}}n=e.next()}}_tokenCheckEscape(e,t,n){const r=this._matchPattern(e,n.escape,!0);r&&(t.current+=n.escapeWith(r))}_addToken(e){e.line.push({v:e.current,s:e.currentSpace,q:e.currentQuoted})}_tokenEndFound(e,t,n,r){return t.currentType=-1,n.includeEnd&&(t.current+=r[0]),n.omit?"comment":(this._addToken(t),i(t,e.eol(),this.commands))}_tokenEOLFound(e,t,n){if(t.current+="\n",n.omit)return"comment";this._addToken(t);const r=i(t,!1,this.commands);return t.line.pop(),r}_tokenEnd(e,t){for(;;){const n=this.tokenDefinitions[t.currentType];if(this._tokenCheckEscape(e,t,n),!n.end)return this._tokenEndFound(e,t,n,null);{const r=this._matchPattern(e,n.end,!0);if(r)return this._tokenEndFound(e,t,n,r)}if(e.eol())return this._tokenEOLFound(e,t,n);t.current+=e.next()}}token(e,t){t.completions=t.nextCompletions,t.isVar=!0,e.sol()&&-1===t.currentType&&(t.line.length=0);let n="";return(-1!==t.currentType||this._tokenBegin(e,t))&&(n=this._tokenEnd(e,t)),-1===t.currentType&&e.eol()&&!t.valid?"line-error "+n:n}indent(e){return e.indent}}}),n("sequence/Tokeniser",["./CodeMirrorMode"],e=>{"use strict";function t(e,t,n){return t.lastIndex=n,t.exec(e)}function n(e,n,r){return r?function(e,n,r){if(r.escape){const s=t(e,r.escape,n);if(s)return{newBlock:null,end:!1,appendSpace:"",appendValue:r.escapeWith(s),skip:s[0].length}}const s=t(e,r.end,n);return s?{newBlock:null,end:!0,appendSpace:"",appendValue:r.includeEnd?s[0]:"",skip:s[0].length}:{newBlock:null,end:!1,appendSpace:"",appendValue:e[n],skip:1}}(e,n,r):function(e,n){for(let r=0;r<s.length;++r){const i=s[r],a=t(e,i.start,n);if(a)return{newBlock:i,end:!i.end,appendSpace:"",appendValue:"",skip:a[0].length}}return{newBlock:null,end:!1,appendSpace:e[n],appendValue:"",skip:1}}(e,n)}function r(e){return{i:e.i,ln:e.ln,ch:e.ch}}const s=[{start:/#/y,end:/(?=\n)|$/y,omit:!0},{start:/"/y,end:/"/y,escape:/\\(.)/y,escapeWith:function(e){return"n"===e[1]?"\n":e[1]},baseToken:{q:!0}},{start:/\.\.\./y,baseToken:{v:"..."}},{start:/(?=[^ \t\r\n:+\-~*!<>,])/y,end:/(?=[ \t\r\n:+\-~*!<>,])|$/y},{start:/(?=[\-~<])/y,end:/(?=[^\-~<>x])|[\-~]x|[<>](?=x)|$/y,includeEnd:!0},{start:/,/y,baseToken:{v:","}},{start:/:/y,baseToken:{v:":"}},{start:/!/y,baseToken:{v:"!"}},{start:/\+/y,baseToken:{v:"+"}},{start:/\*/y,baseToken:{v:"*"}},{start:/\n/y,baseToken:{v:"\n"}}];class i{constructor(e){this.src=e,this.block=null,this.token=null,this.pos={i:0,ln:0,ch:0},this.reset()}isOver(){return this.pos.i>this.src.length}reset(){this.token={s:"",v:"",q:!1,b:null,e:null},this.block=null}beginToken(e){this.block=e.newBlock,Object.assign(this.token,this.block.baseToken),this.token.b=r(this.pos)}endToken(){let e=null;return this.block.omit||(this.token.e=r(this.pos),e=this.token),this.reset(),e}advance(){const e=n(this.src,this.pos.i,this.block);return e.newBlock&&this.beginToken(e),this.token.s+=e.appendSpace,this.token.v+=e.appendValue,function(e,t,n){for(let r=0;r<n;++r)++e.ch,"\n"===t[e.i+r]&&(++e.ln,e.ch=0);e.i+=n}(this.pos,this.src,e.skip),e.end?this.endToken():null}}return class{tokenise(e){const t=[],n=new i(e);for(;!n.isOver();){const e=n.advance();e&&t.push(e)}if(n.block)throw new Error("Unterminated literal (began at "+function(e){return"line "+(e.ln+1)+", character "+e.ch}(n.token.b)+")");return t}getCodeMirrorMode(t){return new e(s,t)}splitLines(e){const t=[];let n=[];return e.forEach(e=>{e.q||"\n"!==e.v?n.push(e):n.length>0&&(t.push(n),n=[])}),n.length>0&&t.push(n),t}}}),n("sequence/MarkdownParser",[],()=>{"use strict";function e(e,t,r){const s=" "+e+" ";let i=-1,a=s.length,o=0;return n.forEach(({begin:e,end:n,attrs:l},h)=>{const d=r[h]?n:e;d.lastIndex=t;const g=d.exec(s);g&&(g.index<a||g.index===a&&d.lastIndex>o)&&(i=h,a=g.index,o=d.lastIndex)}),{styleIndex:i,start:a,end:o-1}}function t(e,t){if(!e)return null;const r={};return t.forEach((e,t)=>{e&&Object.assign(r,n[t].attrs)}),r}const n=[{begin:/[\s_~`]\*(?=\S)/g,end:/\S\*(?=[\s_~`])/g,attrs:{"font-style":"italic"}},{begin:/[\s*~`]_(?=\S)/g,end:/\S_(?=[\s*~`])/g,attrs:{"font-style":"italic"}},{begin:/[\s_~`]\*\*(?=\S)/g,end:/\S\*\*(?=[\s_~`])/g,attrs:{"font-weight":"bolder"}},{begin:/[\s*~`]__(?=\S)/g,end:/\S__(?=[\s*~`])/g,attrs:{"font-weight":"bolder"}},{begin:/[\s_*`]~(?=\S)/g,end:/\S~(?=[\s_*`])/g,attrs:{"text-decoration":"line-through"}},{begin:/[\s_*~.]`(?=\S)/g,end:/\S`(?=[\s_*~.])/g,attrs:{"font-family":"monospace"}}];return function(r){if(!r)return[];const s=n.map(()=>!1);let i=0,a=null;const o=[];return r.split("\n").forEach(n=>{const r=[];let l=0;for(;;){const{styleIndex:o,start:h,end:d}=e(n,l,s);if(-1===o)break;s[o]?(s[o]=!1,--i):(s[o]=!0,++i),h>l&&r.push({text:n.substring(l,h),attrs:a}),a=t(i,s),l=d}l<n.length&&r.push({text:n.substr(l),attrs:a}),o.push(r)}),o}}),n("sequence/LabelPatternParser",[],()=>{"use strict";function e(e){const t=r.exec(e);return t&&t[1]?t[1].length:0}function t(t){if("label"===t)return{token:"label"};const n=t.indexOf(" ");let r=null,s=null;return-1===n?(r=t,s=[]):(r=t.substr(0,n),s=t.substr(n+1).split(",")),"inc"===r?function(t){let n=1,r=1,s=0;return t[0]&&(n=Number(t[0]),s=Math.max(s,e(t[0]))),t[1]&&(r=Number(t[1]),s=Math.max(s,e(t[1]))),{start:n,inc:r,dp:s}}(s):"<"+t+">"}const n=/(.*?)<([^<>]*)>/g,r=/\.([0-9]*)/;return function(e){const r=[];let s=null,i=0;for(n.lastIndex=0;s=n.exec(e);)s[1]&&r.push(s[1]),s[2]&&r.push(t(s[2])),i=n.lastIndex;const a=e.substr(i);return a&&r.push(a),r}}),n("sequence/Parser",["core/ArrayUtilities","./Tokeniser","./MarkdownParser","./LabelPatternParser"],(e,t,n,r)=>{"use strict";function s(e,t=null){let n="";return t&&(n=" at line "+(t.b.ln+1)+", character "+t.b.ch),new Error(e+n)}function i(e,t=0,n=null){if(null===n&&(n=e.length),n<=t)return"";let r=e[t].v;for(let s=t+1;s<n;++s)r+=e[s].s+e[s].v;return r}function a(e){return!e||e.q?null:e.v}function o(e,t,n,r=null){for(let i=0;i<n.length;++i){const o=n[i],l=e[t+i];if(a(l)!==o){if(r)throw s(r+'; expected "'+o+'"',l);return t}}return t+n.length}function l(e,t,{start:n=0,limit:r=null,orEnd:s=!1}={}){null===r&&(r=e.length),Array.isArray(t)||(t=[t]);for(let s=n;s<=r-t.length;++s)if(o(e,s,t)!==s)return s;return s?r:-1}function h(t,n,r,{flagTypes:o={},aliases:h=!1}={}){const d=[],g=[];let c=n,u=!1;for(;c<r;++c){const e=t[c],n=a(e),r=o[n];if(!r)break;if(d.includes(r.flag))throw s("Duplicate agent flag: "+n,e);u=u||Boolean(r.allowBlankName),d.push(r.flag),g.push(r.blankNameFlag)}const{name:p,alias:f}=function(t,n,r,{enableAlias:a,allowBlankName:o}){let h=-1;if(a&&(h=l(t,"as",{start:n})),(-1===h||h>=r)&&(h=r),n>=h&&!o){let r=t[n];throw r||(r={b:e.last(t).e}),s("Missing agent name",r)}return{name:i(t,n,h),alias:i(t,h+1,r)}}(t,c,r,{enableAlias:h,allowBlankName:u});return{name:p,alias:f,flags:p?d:g}}function d(e,t,n,r){const s=[];let i=-1;for(let o=t;o<n;++o){","===a(e[o])?-1!==i&&(s.push(h(e,i,o,r)),i=-1):-1===i&&(i=o)}return-1!==i&&s.push(h(e,i,n,r)),s}const g={if:{type:"block begin",blockType:"if",tag:"if",skip:[]},else:{type:"block split",blockType:"else",tag:"else",skip:["if"]},repeat:{type:"block begin",blockType:"repeat",tag:"repeat",skip:[]}},c={types:(()=>{const t=e.combine([[{tok:"",type:0},{tok:"<",type:1},{tok:"<<",type:2}],[{tok:"-",type:"solid"},{tok:"--",type:"dash"},{tok:"~",type:"wave"}],[{tok:"",type:0},{tok:">",type:1},{tok:">>",type:2},{tok:"x",type:3}]]).filter(e=>0!==e[0].type||0!==e[2].type),n=new Map;return t.forEach(e=>{n.set(e.map(e=>e.tok).join(""),{line:e[1].type,left:e[0].type,right:e[2].type})}),n})(),agentFlags:{"*":{flag:"begin",allowBlankName:!0,blankNameFlag:"source"},"+":{flag:"start"},"-":{flag:"stop"},"!":{flag:"end"}}},u=["none","box","cross","fade","bar"],p={text:{mode:"text",types:{left:{type:"note left",skip:["of"],min:0,max:null},right:{type:"note right",skip:["of"],min:0,max:null}}},note:{mode:"note",types:{over:{type:"note over",skip:[],min:0,max:null},left:{type:"note left",skip:["of"],min:0,max:null},right:{type:"note right",skip:["of"],min:0,max:null},between:{type:"note between",skip:[],min:2,max:null}}},state:{mode:"state",types:{over:{type:"note over",skip:[],min:1,max:1}}}},f={line:{defaultHeight:6},space:{defaultHeight:6},delay:{defaultHeight:30},tear:{defaultHeight:6}},m={define:{type:"agent define"},begin:{type:"agent begin",mode:"box"},end:{type:"agent end",mode:"cross"}},b=[(e,t)=>"title"!==a(e[0])?null:(t.title=i(e,1),!0),(e,t)=>"theme"!==a(e[0])?null:(t.theme=i(e,1),!0),(e,t)=>{if("terminators"!==a(e[0]))return null;const n=a(e[1]);if(!n)throw s("Unspecified termination",e[0]);if(-1===u.indexOf(n))throw s('Unknown termination "'+n+'"',e[1]);return t.terminators=n,!0},(e,t)=>{if("headers"!==a(e[0]))return null;const n=a(e[1]);if(!n)throw s("Unspecified header",e[0]);if(-1===u.indexOf(n))throw s('Unknown header "'+n+'"',e[1]);return t.headers=n,!0},e=>{if("divider"!==a(e[0]))return null;const t=l(e,":",{orEnd:!0}),n=l(e,["with","height"],{limit:t,orEnd:!0}),r=i(e,1,n)||"line";if(!f[r])throw s("Unknown divider type",e[1]);const o=function(e,t=0,n=null,r=Number.NAN){const s=i(e,t,n);return Number(s||r)}(e,n+2,t,f[r].defaultHeight);if(Number.isNaN(o)||o<0)throw s("Invalid divider height",e[n+2]);return{type:"divider",mode:r,height:o,label:i(e,t+1)}},e=>{if("autolabel"!==a(e[0]))return null;let t=null;return t="off"===a(e[1])?"<label>":i(e,1),{type:"label pattern",pattern:r(t)}},e=>{if("end"===a(e[0])&&1===e.length)return{type:"block end"};const t=g[a(e[0])];if(!t)return null;let n=1;return e.length>n&&(n=o(e,n,t.skip,"Invalid block command")),n=o(e,n,[":"]),{type:t.type,blockType:t.blockType,tag:t.tag,label:i(e,n)}},e=>{if("begin"!==a(e[0])||"reference"!==a(e[1]))return null;let t=[];const n=l(e,":");if("over"===a(e[2])&&n>3)t=d(e,3,n);else if(2!==n)throw s('Expected ":" or "over"',e[2]);const r=h(e,n+1,e.length,{aliases:!0});if(!r.alias)throw s("Reference must have an alias",e[n]);return{type:"group begin",agents:t,blockType:"ref",tag:"ref",label:r.name,alias:r.alias}},e=>{const t=m[a(e[0])];return!t||e.length<=1?null:Object.assign({agents:d(e,1,e.length,{aliases:!0})},t)},t=>{if("simultaneously"!==a(t[0]))return null;if(":"!==a(e.last(t)))return null;let n="";if(t.length>2){if("with"!==a(t[1]))return null;n=i(t,2,t.length-1)}return{type:"async",target:n}},e=>{const t=p[a(e[0])],n=l(e,":");if(!t||-1===n)return null;const r=t.types[a(e[1])];if(!r)return null;let h=2;const g=d(e,h=o(e,h,r.skip),n);if(g.length<r.min)throw s("Too few agents for "+t.mode,e[0]);if(null!==r.max&&g.length>r.max)throw s("Too many agents for "+t.mode,e[0]);return{type:r.type,agents:g,mode:t.mode,label:i(e,n+1)}},e=>{const t=l(e,":",{orEnd:!0}),n=function(e,t,{start:n=0,limit:r=null}={}){null===r&&(r=e.length);for(let s=n;s<r;++s){const n=t.get(a(e[s]));if(n)return{pos:s,value:n}}return null}(e,c.types,{start:0,limit:t-1});if(!n)return null;const r=n.pos,o={flagTypes:c.agentFlags};if("..."===a(e[0]))return{type:"connect-delay-end",tag:i(e,1,r),agent:h(e,r+1,t,o),label:i(e,t+1),options:n.value};if("..."===a(e[r+1])){if(t!==e.length)throw s("Cannot label beginning of delayed connection",e[t]);return{type:"connect-delay-begin",tag:i(e,r+2,t),agent:h(e,0,r,o),options:n.value}}return{type:"connect",agents:[h(e,0,r,o),h(e,r+1,t,o)],label:i(e,t+1),options:n.value}},t=>t.length<2||":"!==a(e.last(t))?null:{type:"mark",name:i(t,0,t.length-1)}],y=new t;return class{getCodeMirrorMode(){return y.getCodeMirrorMode(Array.from(c.types.keys()))}parseLines(e,t){const r={meta:{title:"",theme:"",code:t,terminators:"none",headers:"box",textFormatter:n},stages:[]};return e.forEach(e=>(function(e,{meta:t,stages:n}){let r=null;for(let n=0;n<b.length&&!(r=b[n](e,t));++n);if(!r)throw s("Unrecognised command: "+i(e),e[0]);"object"==typeof r&&(r.ln=e[0].b.ln,n.push(r))})(e,r)),r}parse(e){const t=y.tokenise(e),n=y.splitLines(t);return this.parseLines(n,e)}}}),n("sequence/Generator",["core/ArrayUtilities"],e=>{"use strict";function t(e,t){const n=p[e.type];return!(!n||e.type!==t.type)&&!n.check.some(n=>e[n]!==t[n])}function n(t,n){p[t.type].merge.forEach(r=>{e.mergeSets(t[r],n[r])})}function r(e,t){for(let n=0;n<e.length;){t(e[n],n)?e.splice(n,1):++n}}function s(e){r(e,(r,s)=>{for(let i=0;i<s;++i)if(t(e[i],r))return n(e[i],r),!0;return!1})}function i(e){const t=new Set,n=e.map(({type:e})=>e);return n.forEach(e=>{const r=p[e];r&&n.every(t=>e===t||r.siblings.has(t))&&t.add(e)}),t}function a(e,s,i,a){r(a,r=>{if(!e.has(r.type)||!s.has(r.type))return!1;for(let e=0;e<i.length;++e)if(t(i[e],r))return n(i[e],r),!0;return!1})}function o(e,t){if("agent begin"===e.type)return e.mode=t,!0;if("parallel"===e.type){let n=!1;return e.stages.forEach(e=>{"agent begin"===e.type&&(e.mode=t,n=!0)}),n}return!1}function l(t,n,r,s=null){e.remove(t,n,g.equals),e.remove(t,r,g.equals);let i=0,a=t.length;if(s){const e=s.map(e=>g.indexOf(t,e)).filter(e=>-1!==e);i=e.reduce((e,t)=>Math.min(e,t),t.length),a=e.reduce((e,t)=>Math.max(e,t),i)+1}return t.splice(i,0,n),t.splice(a+1,0,r),{indexL:i,indexR:a+1}}class h{constructor({visible:e=!1,locked:t=!1,blocked:n=!1,highlighted:r=!1,group:s=null,covered:i=!1}={}){this.visible=e,this.locked=t,this.blocked=n,this.highlighted=r,this.group=s,this.covered=i}}h.LOCKED=new h({locked:!0}),h.DEFAULT=new h;const d={equals:(e,t)=>e.name===t.name,hasFlag:(e,t=!0)=>n=>n.flags.includes(e)===t},g={equals:(e,t)=>e.id===t.id,make:(e,{anchorRight:t=!1,isVirtualSource:n=!1}={})=>({id:e,anchorRight:t,isVirtualSource:n}),indexOf:(t,n)=>e.indexOf(t,n,g.equals),hasIntersection:(t,n)=>e.hasIntersection(t,n,g.equals),addNearby:(t,n,r,s)=>{const i=e.indexOf(t,n,g.equals);-1===i?t.push(r):t.splice(i+s,0,r)}},c={"note over":[g.make("["),g.make("]")],"note left":[g.make("[")],"note right":[g.make("]")]},u=["[","]"],p={"agent begin":{check:["mode"],merge:["agentIDs"],siblings:new Set(["agent highlight"])},"agent end":{check:["mode"],merge:["agentIDs"],siblings:new Set(["agent highlight"])},"agent highlight":{check:["highlighted"],merge:["agentIDs"],siblings:new Set(["agent begin","agent end"])}};return class{constructor(){this.agentStates=new Map,this.agentAliases=new Map,this.activeGroups=new Map,this.gAgents=[],this.labelPattern=null,this.nextID=0,this.nesting=[],this.markers=new Set,this.currentSection=null,this.currentNest=null,this.stageHandlers={"block begin":this.handleBlockBegin.bind(this),"block split":this.handleBlockSplit.bind(this),"block end":this.handleBlockEnd.bind(this),"group begin":this.handleGroupBegin.bind(this),mark:this.handleMark.bind(this),async:this.handleAsync.bind(this),"agent define":this.handleAgentDefine.bind(this),"agent begin":this.handleAgentBegin.bind(this),"agent end":this.handleAgentEnd.bind(this),divider:this.handleDivider.bind(this),"label pattern":this.handleLabelPattern.bind(this),connect:this.handleConnect.bind(this),"connect-delay-begin":this.handleConnectDelayBegin.bind(this),"connect-delay-end":this.handleConnectDelayEnd.bind(this),"note over":this.handleNote.bind(this),"note left":this.handleNote.bind(this),"note right":this.handleNote.bind(this),"note between":this.handleNote.bind(this)},this.expandGroupedGAgent=this.expandGroupedGAgent.bind(this),this.handleStage=this.handleStage.bind(this),this.toGAgent=this.toGAgent.bind(this),this.endGroup=this.endGroup.bind(this)}toGAgent({name:e,alias:t,flags:n}){if(t){if(this.agentAliases.has(e))throw new Error("Cannot alias "+e+"; it is already an alias");const n=this.agentAliases.get(t);if(n&&n!==t||this.gAgents.some(e=>e.id===t))throw new Error("Cannot use "+t+" as an alias; it is already in use");this.agentAliases.set(t,e)}return g.make(this.agentAliases.get(e)||e,{isVirtualSource:n.includes("source")})}addStage(e,t=!0){e&&(void 0===e.ln&&(e.ln=this.latestLine),this.currentSection.stages.push(e),t&&(this.currentNest.hasContent=!0))}addParallelStages(e){const t=e.filter(e=>Boolean(e));if(0!==t.length)return 1===t.length?this.addStage(t[0]):(t.forEach(e=>{void 0===e.ln&&(e.ln=this.latestLine)}),this.addStage({type:"parallel",stages:t}))}defineGAgents(t){e.mergeSets(this.currentNest.gAgents,t.filter(e=>!u.includes(e.id)),g.equals),e.mergeSets(this.gAgents,t,g.equals)}getGAgentState(e){return this.agentStates.get(e.id)||h.DEFAULT}updateGAgentState(e,t){const n=this.agentStates.get(e.id);n?Object.assign(n,t):this.agentStates.set(e.id,new h(t))}replaceGAgentState(e,t){this.agentStates.set(e.id,t)}validateGAgents(e,{allowGrouped:t=!1,rejectGrouped:n=!1,allowVirtual:r=!1}={}){e.forEach(e=>{const s=this.getGAgentState(e);if(s.covered)throw new Error("Agent "+e.id+" is hidden behind group");if(n&&null!==s.group)throw new Error("Agent "+e.id+" is in a group");if(s.blocked&&(!t||null===s.group))throw new Error("Duplicate agent name: "+e.id);if(!r&&e.isVirtualSource)throw new Error("cannot use message source here");if(e.id.startsWith("__"))throw new Error(e.id+" is a reserved name")})}setGAgentVis(e,t,n,r=!1){const s=new Set,i=e.filter(e=>{if(s.has(e.id))return!1;s.add(e.id);const n=this.getGAgentState(e);if(n.locked||n.blocked){if(r)throw new Error("Cannot begin/end agent: "+e.id);return!1}return n.visible!==t});return 0===i.length?null:(i.forEach(e=>{this.updateGAgentState(e,{visible:t})}),this.defineGAgents(i),{type:t?"agent begin":"agent end",agentIDs:i.map(e=>e.id),mode:n})}setGAgentHighlight(e,t,n=!1){const r=e.filter(e=>{const r=this.getGAgentState(e);if(r.locked||r.blocked){if(n)throw new Error("Cannot highlight agent: "+e.id);return!1}return r.visible&&r.highlighted!==t});return 0===r.length?null:(r.forEach(e=>{this.updateGAgentState(e,{highlighted:t})}),{type:"agent highlight",agentIDs:r.map(e=>e.id),highlighted:t})}_makeSection(e,t){return{header:e,delayedConnections:new Map,stages:t}}_checkSectionEnd(){const e=this.currentSection.delayedConnections;if(e.size>0){const t=e.values().next().value;throw new Error('Unused delayed connection "'+t.tag+'" at line '+(t.ln+1))}}beginNested(e,{tag:t,label:n,name:r,ln:s}){const i=g.make(r+"[",{anchorRight:!0}),a=g.make(r+"]"),o=[i,a],l=[];return this.currentSection=this._makeSection({type:"block begin",blockType:e,tag:this.textFormatter(t),label:this.textFormatter(n),canHide:!0,left:i.id,right:a.id,ln:s},l),this.currentNest={blockType:e,gAgents:o,leftGAgent:i,rightGAgent:a,hasContent:!1,sections:[this.currentSection]},this.replaceGAgentState(i,h.LOCKED),this.replaceGAgentState(a,h.LOCKED),this.nesting.push(this.currentNest),{stages:l}}nextBlockName(){const e="__BLOCK"+this.nextID;return++this.nextID,e}nextVirtualAgentName(){const e="__"+this.nextID;return++this.nextID,e}handleBlockBegin({ln:e,blockType:t,tag:n,label:r}){this.beginNested(t,{tag:n,label:r,name:this.nextBlockName(),ln:e})}handleBlockSplit({ln:e,blockType:t,tag:n,label:r}){if("if"!==this.currentNest.blockType)throw new Error('Invalid block nesting ("else" inside '+this.currentNest.blockType+")");this._checkSectionEnd(),this.currentSection=this._makeSection({type:"block split",blockType:t,tag:this.textFormatter(n),label:this.textFormatter(r),left:this.currentNest.leftGAgent.id,right:this.currentNest.rightGAgent.id,ln:e},[]),this.currentNest.sections.push(this.currentSection)}handleBlockEnd(){if(this.nesting.length<=1)throw new Error('Invalid block nesting (too many "end"s)');this._checkSectionEnd();const t=this.nesting.pop();if(this.currentNest=e.last(this.nesting),this.currentSection=e.last(this.currentNest.sections),!t.hasContent)throw new Error("Empty block");this.defineGAgents(t.gAgents),l(this.gAgents,t.leftGAgent,t.rightGAgent,t.gAgents),t.sections.forEach(e=>{this.currentSection.stages.push(e.header),this.currentSection.stages.push(...e.stages)}),this.addStage({type:"block end",left:t.leftGAgent.id,right:t.rightGAgent.id})}makeGroupDetails(t,n){const r=t.map(this.toGAgent);if(this.validateGAgents(r,{rejectGrouped:!0}),this.agentStates.has(n))throw new Error("Duplicate agent name: "+n);const s=this.nextBlockName(),i=g.make(s+"[",{anchorRight:!0}),a=g.make(s+"]");this.replaceGAgentState(i,h.LOCKED),this.replaceGAgentState(a,h.LOCKED),this.updateGAgentState(g.make(n),{blocked:!0,group:n}),this.defineGAgents(r);const{indexL:o,indexR:d}=l(this.gAgents,i,a,r),c=[],u=r.slice();for(let e=o+1;e<d;++e)c.push(this.gAgents[e]);return e.removeAll(c,u,g.equals),{gAgents:r,leftGAgent:i,rightGAgent:a,gAgentsContained:u,gAgentsCovered:c}}handleGroupBegin({agents:e,blockType:t,tag:n,label:r,alias:s}){const i=this.makeGroupDetails(e,s);i.gAgentsContained.forEach(e=>{this.updateGAgentState(e,{group:s})}),i.gAgentsCovered.forEach(e=>{this.updateGAgentState(e,{covered:!0})}),this.activeGroups.set(s,i),this.addStage(this.setGAgentVis(i.gAgents,!0,"box")),this.addStage({type:"block begin",blockType:t,tag:this.textFormatter(n),canHide:!1,label:this.textFormatter(r),left:i.leftGAgent.id,right:i.rightGAgent.id})}endGroup({name:e}){const t=this.activeGroups.get(e);return t?(this.activeGroups.delete(e),t.gAgentsContained.forEach(e=>{this.updateGAgentState(e,{group:null})}),t.gAgentsCovered.forEach(e=>{this.updateGAgentState(e,{covered:!1})}),this.updateGAgentState(g.make(e),{group:null}),{type:"block end",left:t.leftGAgent.id,right:t.rightGAgent.id}):null}handleMark({name:e}){this.markers.add(e),this.addStage({type:"mark",name:e},!1)}handleDivider({mode:e,height:t,label:n}){this.addStage({type:"divider",mode:e,height:t,formattedLabel:this.textFormatter(n)},!1)}handleAsync({target:e}){if(""!==e&&!this.markers.has(e))throw new Error("Unknown marker: "+e);this.addStage({type:"async",target:e},!1)}handleLabelPattern({pattern:e}){this.labelPattern=e.slice();for(let e=0;e<this.labelPattern.length;++e){const t=this.labelPattern[e];"object"==typeof t&&void 0!==t.start&&(this.labelPattern[e]=Object.assign({current:t.start},t))}}applyLabelPattern(e){let t="";const n={label:e};return this.labelPattern.forEach(e=>{"string"==typeof e?t+=e:void 0!==e.token?t+=n[e.token]:void 0!==e.current&&(t+=e.current.toFixed(e.dp),e.current+=e.inc)}),t}expandGroupedGAgent(e){const t=this.getGAgentState(e).group;if(!t)return[e];const n=this.activeGroups.get(t);return[n.leftGAgent,n.rightGAgent]}expandGroupedGAgentConnection(t){const n=this.expandGroupedGAgent(t[0]),r=this.expandGroupedGAgent(t[1]);let s=g.indexOf(this.gAgents,n[0]),i=g.indexOf(this.gAgents,r[0]);return-1===s&&(s=n[0].isVirtualSource?-1:this.gAgents.length),-1===i&&(i=this.gAgents.length),s===i?[e.last(n),e.last(r)]:s<i?[e.last(n),r[0]]:[n[0],e.last(r)]}filterConnectFlags(t){const n=t.filter(d.hasFlag("begin")).map(this.toGAgent),r=t.filter(d.hasFlag("end")).map(this.toGAgent);if(g.hasIntersection(n,r))throw new Error("Cannot set agent visibility multiple times");const s=t.filter(d.hasFlag("start")).map(this.toGAgent),i=t.filter(d.hasFlag("stop")).map(this.toGAgent);if(e.mergeSets(i,r),g.hasIntersection(s,i))throw new Error("Cannot set agent highlighting multiple times");return this.validateGAgents(n),this.validateGAgents(r),this.validateGAgents(s),this.validateGAgents(i),{beginGAgents:n,endGAgents:r,startGAgents:s,stopGAgents:i}}makeVirtualAgent(e){const t=g.make(this.nextVirtualAgentName(),{anchorRight:e,isVirtualSource:!0});return this.replaceGAgentState(t,h.LOCKED),t}addNearbyAgent(e,t,n){g.addNearby(this.currentNest.gAgents,e,t,n),g.addNearby(this.gAgents,e,t,n)}expandVirtualSourceAgents(e){if(e[0].isVirtualSource){if(e[1].isVirtualSource)throw new Error("Cannot connect found messages");if(u.includes(e[1].id))throw new Error("Cannot connect found messages to special agents");const t=this.makeVirtualAgent(!0);return this.addNearbyAgent(e[1],t,0),[t,e[1]]}if(e[1].isVirtualSource){if(u.includes(e[0].id))throw new Error("Cannot connect found messages to special agents");const t=this.makeVirtualAgent(!1);return this.addNearbyAgent(e[0],t,1),[e[0],t]}return e}_handlePartialConnect(t){const n=this.filterConnectFlags(t),r=t.map(this.toGAgent);this.validateGAgents(r,{allowGrouped:!0,allowVirtual:!0}),this.defineGAgents(e.flatMap(r,this.expandGroupedGAgent).filter(e=>!e.isVirtualSource));const s=t.filter(d.hasFlag("begin",!1)).map(this.toGAgent).filter(e=>!e.isVirtualSource);return this.addStage(this.setGAgentVis(s,!0,"box")),{flags:n,gAgents:r}}_makeConnectParallelStages(e,t){return[this.setGAgentVis(e.beginGAgents,!0,"box",!0),this.setGAgentHighlight(e.startGAgents,!0,!0),t,this.setGAgentHighlight(e.stopGAgents,!1,!0),this.setGAgentVis(e.endGAgents,!1,"cross",!0)]}_isSelfConnect(e){const t=e.map(this.toGAgent),n=this.expandGroupedGAgentConnection(t);return n[0].id===n[1].id&&!n.some(e=>e.isVirtualSource)}handleConnect({agents:e,label:t,options:n}){if(this._isSelfConnect(e)){const r={};return this.handleConnectDelayBegin({agent:e[0],tag:r,options:n,ln:0}),void this.handleConnectDelayEnd({agent:e[1],tag:r,label:t,options:n})}let{flags:r,gAgents:s}=this._handlePartialConnect(e);s=this.expandGroupedGAgentConnection(s);const i={type:"connect",agentIDs:(s=this.expandVirtualSourceAgents(s)).map(e=>e.id),label:this.textFormatter(this.applyLabelPattern(t)),options:n};this.addParallelStages(this._makeConnectParallelStages(r,i))}handleConnectDelayBegin({agent:e,tag:t,options:n,ln:r}){const s=this.currentSection.delayedConnections;if(s.has(t))throw new Error('Duplicate delayed connection "'+t+'"');const{flags:i,gAgents:a}=this._handlePartialConnect([e]),o=this.nextVirtualAgentName(),l={type:"connect-delay-begin",tag:o,agentIDs:null,label:null,options:n};s.set(t,{tag:t,uniqueTag:o,ln:r,gAgents:a,connectStage:l}),this.addParallelStages(this._makeConnectParallelStages(i,l))}handleConnectDelayEnd({agent:e,tag:t,label:n,options:r}){const s=this.currentSection.delayedConnections,i=s.get(t);if(!i)throw new Error('Unknown delayed connection "'+t+'"');let{flags:a,gAgents:o}=this._handlePartialConnect([e]);o=this.expandGroupedGAgentConnection([...i.gAgents,...o]),o=this.expandVirtualSourceAgents(o);let l=i.connectStage.options;if(l.line!==r.line)throw new Error("Mismatched delayed connection arrows");r.right&&(l=Object.assign({},l,{right:r.right})),Object.assign(i.connectStage,{agentIDs:o.map(e=>e.id),label:this.textFormatter(this.applyLabelPattern(n)),options:l});const h={type:"connect-delay-end",tag:i.uniqueTag};this.addParallelStages(this._makeConnectParallelStages(a,h)),s.delete(t)}handleNote({type:t,agents:n,mode:r,label:s}){let i=null;i=0===n.length?c[t]||[]:n.map(this.toGAgent),this.validateGAgents(i,{allowGrouped:!0});const a=(i=e.flatMap(i,this.expandGroupedGAgent)).map(e=>e.id),o=new Set(a).size;if("note between"===t&&o<2)throw new Error("note between requires at least 2 agents");this.addStage(this.setGAgentVis(i,!0,"box")),this.defineGAgents(i),this.addStage({type:t,agentIDs:a,mode:r,label:this.textFormatter(s)})}handleAgentDefine({agents:e}){const t=e.map(this.toGAgent);this.validateGAgents(t),this.defineGAgents(t)}handleAgentBegin({agents:e,mode:t}){const n=e.map(this.toGAgent);this.validateGAgents(n),this.addStage(this.setGAgentVis(n,!0,t,!0))}handleAgentEnd({agents:e,mode:t}){const n=e.filter(e=>this.activeGroups.has(e.name)),r=e.filter(e=>!this.activeGroups.has(e.name)).map(this.toGAgent);this.validateGAgents(r),this.addParallelStages([this.setGAgentHighlight(r,!1),this.setGAgentVis(r,!1,t,!0),...n.map(this.endGroup)])}handleStage(e){this.latestLine=e.ln;try{const t=this.stageHandlers[e.type];if(!t)throw new Error("Unknown command: "+e.type);t(e)}catch(t){if("object"==typeof t&&t.message)throw t.message+=" at line "+(e.ln+1),t}}_reset(){this.agentStates.clear(),this.markers.clear(),this.agentAliases.clear(),this.activeGroups.clear(),this.gAgents.length=0,this.nextID=0,this.nesting.length=0,this.labelPattern=[{token:"label"}]}_finalise(e){l(this.gAgents,this.currentNest.leftGAgent,this.currentNest.rightGAgent),function(e){let t=[],n=new Set;for(let r=0;r<e.length;){const o=e[r];let l=null;s(l="parallel"===o.type?o.stages:[o]);const h=i(l);a(n,h,t,l),0===l.length?e.splice(r,1):("parallel"===o.type&&1===l.length&&e.splice(r,1,l[0]),n=h,t=l,++r)}}(e.stages),this.gAgents.forEach(e=>{e.formattedLabel=this.textFormatter(e.id)})}generate({stages:e,meta:t={}}){this._reset(),this.textFormatter=t.textFormatter;const n=this.beginNested("global",{tag:"",label:"",name:"",ln:0});if(e.forEach(this.handleStage),1!==this.nesting.length)throw new Error("Unterminated section at line "+(this.currentSection.header.ln+1));if(this.activeGroups.size>0)throw new Error("Unterminated group");this._checkSectionEnd();const r=t.terminators||"none";return this.addParallelStages([this.setGAgentHighlight(this.gAgents,!1),this.setGAgentVis(this.gAgents,!1,r)]),this._finalise(n),function(e,t){for(let n=0;n<e.length&&!o(e[n],t);++n);}(n.stages,t.headers||"box"),{meta:{title:this.textFormatter(t.title),theme:t.theme,code:t.code},agents:this.gAgents.slice(),stages:n.stages}}}}),n("svg/SVGUtilities",[],()=>{"use strict";function e(e,n={},r=[]){const s=document.createElementNS(t,e);for(const e in n)n.hasOwnProperty(e)&&s.setAttribute(e,n[e]);for(const e of r)s.appendChild(e);return s}const t="http://www.w3.org/2000/svg";return{makeText:function(e=""){return document.createTextNode(e)},make:e,makeContainer:function(n={}){return e("svg",Object.assign({xmlns:t,version:"1.1"},n))},empty:function(e){for(;e.childNodes.length>0;)e.removeChild(e.lastChild)}}}),n("svg/SVGTextBlock",["./SVGUtilities"],e=>{"use strict";function t(e){const t=Number(e["font-size"]);return{size:t,lineHeight:t*(Number(e["line-height"])||1)}}function n(t,n){if(!Array.isArray(n))throw new Error("Invalid formatted text line: "+n);n.forEach(({text:n,attrs:r})=>{const s=e.makeText(n);if(r){const n=e.make("tspan",r,[s]);t.appendChild(n)}else t.appendChild(s)})}const r=void 0!==window.InstallTrigger,s=[];class i{constructor(e,t={}){this.container=e,this.state={attrs:{},formatted:s,x:0,y:0},this.width=0,this.height=0,this.lines=[],this.set(t)}_rebuildLines(t){if(t>this.lines.length){const n=Object.assign({x:this.state.x},this.state.attrs);for(;this.lines.length<t;){const t=e.make("text",n);this.container.appendChild(t),this.lines.push({node:t,latest:""})}}else for(;this.lines.length>t;){const{node:e}=this.lines.pop();this.container.removeChild(e)}}_reset(){this._rebuildLines(0),this.width=0,this.height=0}_renderText(){const{formatted:t}=this.state;if(!t||!t.length)return void this._reset();if(!Array.isArray(t))throw new Error("Invalid formatted text: "+t);this._rebuildLines(t.length);let r=0;this.lines.forEach((s,i)=>{const a=JSON.stringify(t[i]);a!==s.latest&&(e.empty(s.node),n(s.node,t[i]),s.latest=a),r=Math.max(r,s.node.getComputedTextLength())}),this.width=r}_updateX(){this.lines.forEach(({node:e})=>{e.setAttribute("x",this.state.x)})}_updateY(){const{size:e,lineHeight:n}=t(this.state.attrs);this.lines.forEach(({node:t},r)=>{t.setAttribute("y",this.state.y+r*n+e)}),this.height=n*this.lines.length}firstLine(){return this.lines.length>0?this.lines[0].node:null}set(e){const t=Object.assign({},this.state);!function(e,t){for(const n in e)e.hasOwnProperty(n)&&null!==t[n]&&void 0!==t[n]&&(e[n]=t[n])}(this.state,e),this.state.attrs!==t.attrs&&(this._reset(),t.formatted=s);const n=this.lines.length;this.state.formatted!==t.formatted&&this._renderText(),this.state.x!==t.x&&this._updateX(),this.state.y===t.y&&this.lines.length===n||this._updateY()}}class a{constructor(t){this.testers=e.make("g",{display:r?"block":"none",visibility:"hidden"}),this.container=t,this.cache=new Map}measure(r,s){if(!s||!s.length)return{width:0,height:0};if(!Array.isArray(s))throw new Error("Invalid formatted text: "+s);let i=this.cache.get(r);i||(i=e.make("text",r),this.testers.appendChild(i),this.cache.set(r,i)),this.testers.parentNode||this.container.appendChild(this.testers);let a=0;return s.forEach(t=>{e.empty(i),n(i,t),a=Math.max(a,i.getComputedTextLength())}),{width:a,height:s.length*t(r).lineHeight}}measureHeight(e,n){if(!n)return 0;if(!Array.isArray(n))throw new Error("Invalid formatted text: "+n);return n.length*t(e).lineHeight}resetCache(){e.empty(this.testers),this.cache.clear()}detach(){this.testers.parentNode&&this.container.removeChild(this.testers)}}return i.SizeTester=a,i}),n("svg/PatternedLine",[],()=>{"use strict";return class{constructor(e=null,t=0){this.pattern=e,this.dw=e&&e.partWidth,this.points=[],this.phase=t,this.x=null,this.y=null,this.disconnect=0}_nextDelta(){return this.pattern.getDelta(this.phase++)}_link(){2===this.disconnect&&(this.points.push(this.x+" "+this.y),this.disconnect=0)}cap(){return this.disconnect>0&&(this.points.push(this.x+" "+this.y),this.disconnect=0),this}move(e,t){return this.cap(),this.x=e,this.y=t,this.disconnect=2,this}line(e,t,{patterned:n=!0}={}){if(this.pattern&&n){const n=Math.sqrt((e-this.x)*(e-this.x)+(t-this.y)*(t-this.y)),r=(e-this.x)/n,s=(t-this.y)/n,i=-s,a=r;for(let e=0;e+this.dw<=n;e+=this.dw){const t=this._nextDelta();this.points.push(this.x+e*r+t*i+" "+(this.y+e*s+t*a))}this.disconnect=1}else this._link(),this.disconnect=2;return this.x=e,this.y=t,this}arc(e,t,n){const r=Math.sqrt((e-this.x)*(e-this.x)+(t-this.y)*(t-this.y)),s=Math.atan2(this.x-e,t-this.y),i=e+Math.sin(s+n)*r,a=t-Math.cos(s+n)*r;if(this.pattern){const i=n<0?1:-1,a=this.dw/r;for(let o=s;o+a<=s+n;o+=a){const n=this._nextDelta()*i;this.points.push(e+Math.sin(o)*(r+n)+" "+(t-Math.cos(o)*(r+n)))}this.disconnect=1}else this.points.push(this.x+" "+this.y+"A"+r+" "+r+" 0 "+(Math.abs(n)>=Math.PI?"1 ":"0 ")+(n<0?"0 ":"1 ")+i+" "+a),this.disconnect=0;return this.x=i,this.y=a,this}asPath(){return this._link(),"M"+this.points.join("L")}}}),n("svg/SVGShapes",["./SVGUtilities","./SVGTextBlock","./PatternedLine"],(e,t,n)=>{"use strict";function r(t,n){return e.make("rect",Object.assign({},n,t))}return{renderBox:r,renderLine:function(t,n){return e.make("line",Object.assign({},n,t))},renderNote:function(t,n,r){const s=r.x,i=r.x+r.width,a=r.y,o=r.y+r.height;return e.make("g",{},[e.make("polygon",Object.assign({points:s+" "+a+" "+(i-7)+" "+a+" "+i+" "+(a+7)+" "+i+" "+o+" "+s+" "+o},t)),e.make("polyline",Object.assign({points:i-7+" "+a+" "+(i-7)+" "+(a+7)+" "+i+" "+(a+7)},n))])},renderBoxedText:function(e,{x:n,y:s,padding:i,boxAttrs:a,labelAttrs:o,boxLayer:l,labelLayer:h,boxRenderer:d=null,SVGTextBlockClass:g=t}){if(!e||!e.length)return{width:0,height:0,label:null,box:null};const{shift:c,anchorX:u}=function(e,t,n){let r=0,s=e;switch(o["text-anchor"]){case"middle":r=.5,s+=(n.left-n.right)/2;break;case"end":r=1,s-=n.right;break;default:r=0,s+=n.left}return{shift:r,anchorX:s}}(n,0,i),p=new g(h,{attrs:o,formatted:e,x:u,y:s+i.top}),f=p.width+i.left+i.right,m=p.height+i.top+i.bottom;let b=null;return b=d?d({x:u-p.width*c-i.left,y:s,width:f,height:m}):r(a,{x:u-p.width*c-i.left,y:s,width:f,height:m}),l===h?l.insertBefore(b,p.firstLine()):l.appendChild(b),{width:f,height:m,label:p,box:b}},TextBlock:t,PatternedLine:n}}),n("sequence/components/BaseComponent",[],()=>{"use strict";class e{makeState(){}resetState(e){this.makeState(e)}separationPre(){}separation(){}renderPre(){}render(){}renderHidden(){}shouldHide(){}}e.cleanRenderPreResult=(({agentIDs:e=[],topShift:t=0,y:n=null,asynchronousY:r=null}={},s=null)=>(null!==n&&null!==s&&(t=Math.max(t,n-s)),{agentIDs:e,topShift:t,y:n,asynchronousY:null!==r?r:s}));const t=new Map;return e.register=((e,n)=>{t.set(e,n)}),e.getComponents=(()=>t),e}),n("sequence/components/Block",["./BaseComponent","core/ArrayUtilities","svg/SVGUtilities","svg/SVGShapes"],(e,t,n,r)=>{"use strict";class s extends e{separation({left:e,right:t,tag:n,label:r},s){const i=s.state.blocks.get(e),a=s.theme.getBlock(i.type).section,o=s.textSizer.measure(a.tag.labelAttrs,n).width+a.tag.padding.left+a.tag.padding.right+s.textSizer.measure(a.label.labelAttrs,r).width+a.label.padding.left+a.label.padding.right;s.addSeparation(e,t,o)}renderPre({left:e,right:t}){return{agentIDs:[e,t]}}render({left:e,right:t,tag:s,label:i},a,o=!1){const l=a.state.blocks.get(e),h=a.theme.getBlock(l.type),d=a.agentInfos.get(e),g=a.agentInfos.get(t);let c=a.primaryY;o||(c+=h.section.padding.bottom);const u=a.makeRegion(),p=r.renderBoxedText(s,{x:d.x,y:c,padding:h.section.tag.padding,boxAttrs:h.section.tag.boxAttrs,boxRenderer:h.section.tag.boxRenderer,labelAttrs:h.section.tag.labelAttrs,boxLayer:l.hold,labelLayer:u,SVGTextBlockClass:a.SVGTextBlockClass}),f=r.renderBoxedText(i,{x:d.x+p.width,y:c,padding:h.section.label.padding,boxAttrs:{fill:"#000000"},labelAttrs:h.section.label.labelAttrs,boxLayer:a.lineMaskLayer,labelLayer:u,SVGTextBlockClass:a.SVGTextBlockClass}),m=Math.max(p.height,f.height);return u.insertBefore(n.make("rect",{x:d.x,y:c,width:g.x-d.x,height:m,fill:"transparent",class:"outline"}),u.firstChild),o?l.canHide&&u.setAttribute("class",u.getAttribute("class")+(l.hide?" collapsed":" expanded")):l.hold.appendChild(h.sepRenderer({x1:d.x,y1:c,x2:g.x,y2:c})),c+m+h.section.padding.top}}class i extends s{makeState(e){e.blocks=new Map}resetState(e){e.blocks.clear()}storeBlockInfo(e,t){const n=e.canHide,r={type:e.blockType,canHide:n,hide:n&&t.renderer.isCollapsed(e.ln),hold:null,startY:null};return t.state.blocks.set(e.left,r),r}separationPre(e,t){this.storeBlockInfo(e,t)}separation(e,n){t.mergeSets(n.visibleAgentIDs,[e.left,e.right]),super.separation(e,n)}renderPre(e,t){const n=this.storeBlockInfo(e,t),r=t.theme.getBlock(n.type);return{agentIDs:[e.left,e.right],topShift:r.margin.top}}render(e,t){const r=n.make("g");t.blockLayer.appendChild(r);const s=t.state.blocks.get(e.left);return s.hold=r,s.startY=t.primaryY,super.render(e,t,!0)}shouldHide({left:e},t){return{self:!1,nest:t.state.blocks.get(e).hide?1:0}}}class a extends e{separation({left:e,right:n},r){t.removeAll(r.visibleAgentIDs,[e,n])}renderPre({left:e,right:t},n){const r=n.state.blocks.get(e);return{agentIDs:[e,t],topShift:n.theme.getBlock(r.type).section.padding.bottom}}render({left:e,right:t},n){const r=n.state.blocks.get(e),s=n.theme.getBlock(r.type),i=n.agentInfos.get(e),a=n.agentInfos.get(t);let o=s.boxRenderer;r.hide&&(o=s.collapsedBoxRenderer||o);let l=o({x:i.x,y:r.startY,width:a.x-i.x,height:n.primaryY-r.startY});return l.shape||(l={shape:l}),r.hold.appendChild(l.shape),l.fill&&n.fillLayer.appendChild(l.fill),l.mask&&n.lineMaskLayer.appendChild(l.mask),n.primaryY+s.margin.bottom+n.theme.actionMargin}shouldHide({left:e},t){return{self:!1,nest:t.state.blocks.get(e).hide?-1:0}}}return e.register("block begin",new i),e.register("block split",new s),e.register("block end",new a),{BlockBegin:i,BlockSplit:s,BlockEnd:a}}),n("sequence/components/Parallel",["./BaseComponent","core/ArrayUtilities"],(e,t)=>{"use strict";function n(e=null,t=null){return null===e?t:null===t?e:Math.max(e,t)}function r(e,r){return t.mergeSets(e.agentIDs,r.agentIDs),{agentIDs:e.agentIDs,topShift:Math.max(e.topShift,r.topShift),y:n(e.y,r.y),asynchronousY:n(e.asynchronousY,r.asynchronousY)}}class s extends e{separationPre(e,t){e.stages.forEach(e=>{t.components.get(e.type).separationPre(e,t)})}separation(e,t){e.stages.forEach(e=>{t.components.get(e.type).separation(e,t)})}renderPre(t,n){return t.stages.map(t=>{const r=n.components.get(t.type).renderPre(t,n);return e.cleanRenderPreResult(r)}).reduce(r,{topShift:0,agentIDs:[],asynchronousY:null})}render(e,t){const n=t.makeRegion;let r=0;return e.stages.forEach(e=>{t.makeRegion=((t={})=>n(Object.assign({stageOverride:e},t)));const s=t.components.get(e.type).render(e,t)||0;r=Math.max(r,s)}),t.makeRegion=n,r}renderHidden(e,t){e.stages.forEach(e=>{t.components.get(e.type).renderHidden(e,t)})}shouldHide(e,t){const n={self:!1,nest:0};return e.stages.forEach(e=>{const r=t.components.get(e.type).shouldHide(e,t)||{};n.self=n.self||Boolean(r.self),n.nest+=r.nest||0}),n}}return e.register("parallel",new s),s}),n("sequence/components/Marker",["./BaseComponent"],e=>{"use strict";class t extends e{makeState(e){e.marks=new Map}resetState(e){e.marks.clear()}render({name:e},{topY:t,state:n}){n.marks.set(e,t)}renderHidden(e,t){this.render(e,t)}}class n extends e{renderPre({target:e},{state:t}){let n=0;return e&&t.marks&&(n=t.marks.get(e)||0),{asynchronousY:n}}}return e.register("mark",new t),e.register("async",new n),{Mark:t,Async:n}}),n("sequence/components/AgentCap",["./BaseComponent","core/ArrayUtilities","svg/SVGUtilities","svg/SVGShapes"],(e,t,n,r)=>{"use strict";class s{separation({formattedLabel:e},t){const n=t.theme.agentCap.box,r=t.textSizer.measure(n.labelAttrs,e).width+n.padding.left+n.padding.right;return{left:r/2,right:r/2,radius:r/2}}topShift({formattedLabel:e},t){const n=t.theme.agentCap.box,r=t.textSizer.measureHeight(n.labelAttrs,e)+n.padding.top+n.padding.bottom;return Math.max(0,r-n.arrowBottom)}render(e,{x:t,formattedLabel:s},i){const a=i.theme.agentCap.box,o=i.makeRegion(),l=r.renderBoxedText(s,{x:t,y:e,padding:a.padding,boxAttrs:a.boxAttrs,boxRenderer:a.boxRenderer,labelAttrs:a.labelAttrs,boxLayer:o,labelLayer:o,SVGTextBlockClass:i.SVGTextBlockClass});return o.insertBefore(n.make("rect",{x:t-l.width/2,y:e,width:l.width,height:l.height,fill:"transparent",class:"outline"}),l.label.firstLine()),{lineTop:0,lineBottom:l.height,height:l.height}}}class i{separation(e,t){const n=t.theme.agentCap.cross;return{left:n.size/2,right:n.size/2,radius:0}}topShift(e,t){return t.theme.agentCap.cross.size/2}render(e,{x:t},r){const s=r.theme.agentCap.cross,i=s.size/2,a=r.makeRegion();return a.appendChild(s.render({x:t,y:e+i,radius:i})),a.appendChild(n.make("rect",{x:t-i,y:e,width:2*i,height:2*i,fill:"transparent",class:"outline"})),{lineTop:i,lineBottom:i,height:2*i}}}class a{separation({formattedLabel:e},t){const n=t.theme.agentCap.box,r=t.textSizer.measure(n.labelAttrs,e).width+n.padding.left+n.padding.right;return{left:r/2,right:r/2,radius:r/2}}topShift(e,t){return t.theme.agentCap.bar.height/2}render(e,{x:t,formattedLabel:r},s){const i=s.theme.agentCap.box,a=s.theme.agentCap.bar,o=s.textSizer.measure(i.labelAttrs,r).width+i.padding.left+i.padding.right,l=a.height,h=s.makeRegion();return h.appendChild(a.render({x:t-o/2,y:e,width:o,height:l})),h.appendChild(n.make("rect",{x:t-o/2,y:e,width:o,height:l,fill:"transparent",class:"outline"})),{lineTop:0,lineBottom:l,height:l}}}class o{separation({currentRad:e}){return{left:e,right:e,radius:e}}topShift(e,t,n){const r=t.theme.agentCap.fade;return n?r.height:0}render(e,{x:t},r,s){const i=r.theme.agentCap.fade,a=i.height/(i.height+i.extend),o=r.addDef(s?"FadeIn":"FadeOut",()=>n.make("linearGradient",{x1:"0%",y1:s?"100%":"0%",x2:"0%",y2:s?"0%":"100%"},[n.make("stop",{offset:"0%","stop-color":"#FFFFFF"}),n.make("stop",{offset:(100*a).toFixed(3)+"%","stop-color":"#000000"})]));return r.lineMaskLayer.appendChild(n.make("rect",{x:t-i.width/2,y:e-(s?i.extend:0),width:i.width,height:i.height+i.extend,fill:"url(#"+o+")"})),r.makeRegion().appendChild(n.make("rect",{x:t-i.width/2,y:e,width:i.width,height:i.height,fill:"transparent",class:"outline"})),{lineTop:i.height,lineBottom:0,height:i.height}}}class l{separation({currentRad:e}){return{left:e,right:e,radius:e}}topShift(e,t){return t.theme.agentCap.none.height}render(e,{x:t},r){const s=r.theme.agentCap.none;return r.makeRegion().appendChild(n.make("rect",{x:t-5,y:e,width:10,height:s.height,fill:"transparent",class:"outline"})),{lineTop:s.height,lineBottom:0,height:s.height}}}const h={box:new s,cross:new i,bar:new a,fade:new o,none:new l};class d extends e{constructor(e){super(),this.begin=e}separationPre({mode:e,agentIDs:t},n){t.forEach(t=>{const r=n.agentInfos.get(t),s=h[e].separation(r,n,this.begin);n.addSpacing(t,s),r.currentMaxRad=Math.max(r.currentMaxRad,s.radius)})}separation({mode:e,agentIDs:n},r){this.begin?t.mergeSets(r.visibleAgentIDs,n):t.removeAll(r.visibleAgentIDs,n)}renderPre({mode:e,agentIDs:t},n){let r=0;return t.forEach(t=>{const s=n.agentInfos.get(t),i=h[e],a=i.topShift(s,n,this.begin);r=Math.max(r,a);const o=i.separation(s,n,this.begin).radius;s.currentMaxRad=Math.max(s.currentMaxRad,o)}),{agentIDs:t,topShift:r}}render({mode:e,agentIDs:t},n){let r=0;return t.forEach(t=>{const s=n.agentInfos.get(t),i=h[e],a=i.topShift(s,n,this.begin),o=n.primaryY-a,l=i.render(o,s,n,this.begin);r=Math.max(r,o+l.height),this.begin?n.drawAgentLine(t,o+l.lineBottom):n.drawAgentLine(t,o+l.lineTop,!0)}),r+n.theme.actionMargin}renderHidden({agentIDs:e},t){e.forEach(e=>{t.drawAgentLine(e,t.topY,!this.begin)})}}return e.register("agent begin",new d(!0)),e.register("agent end",new d(!1)),d}),n("sequence/components/AgentHighlight",["./BaseComponent"],e=>{"use strict";class t extends e{radius(e,t){return e?t.theme.agentLineHighlightRadius:0}separationPre({agentIDs:e,highlighted:t},n){const r=this.radius(t,n);e.forEach(e=>{const t=n.agentInfos.get(e);t.currentRad=r,t.currentMaxRad=Math.max(t.currentMaxRad,r)})}renderPre({agentIDs:e,highlighted:t},n){const r=this.radius(t,n);e.forEach(e=>{const t=n.agentInfos.get(e);t.currentMaxRad=Math.max(t.currentMaxRad,r)})}render({agentIDs:e,highlighted:t},n){const r=this.radius(t,n);return e.forEach(e=>{n.drawAgentLine(e,n.primaryY),n.agentInfos.get(e).currentRad=r}),n.primaryY+n.theme.actionMargin}renderHidden(e,t){this.render(e,t)}}return e.register("agent highlight",new t),t}),n("sequence/components/Connect",["core/ArrayUtilities","./BaseComponent","svg/SVGUtilities","svg/SVGShapes"],(e,t,n,r)=>{"use strict";class s{constructor(e){this.propName=e}getConfig(e){return e.connect.arrow[this.propName]}short(e){const t=this.getConfig(e),n=t.attrs["stroke-linejoin"]||"miter",r=.5*t.attrs["stroke-width"],s=.5*e.agentLineAttrs["stroke-width"];if("round"===n)return s+r;{const e=t.height/2,n=t.width;return s+r*Math.sqrt(n*n/(e*e)+1)}}render(e,t,n,r){const s=this.getConfig(t),i=this.short(t);e.appendChild(s.render(s.attrs,{x:n.x+i*r.dx,y:n.y+i*r.dy,width:s.width,height:s.height,dir:r}))}width(e){return this.short(e)+this.getConfig(e).width}height(e){return this.getConfig(e).height}lineGap(e,t){const n=this.getConfig(e),r=this.short(e);if("none"===n.attrs.fill){const e=n.height/2,s=n.width;return(r+(r+t["stroke-width"]/2*(s/e)))/2}return r+n.width/2}}class i{getConfig(e){return e.connect.arrow.cross}render(e,t,n,r){const s=this.getConfig(t);e.appendChild(s.render({x:n.x+s.short*r.dx,y:n.y+s.short*r.dy,radius:s.radius}))}width(e){const t=this.getConfig(e);return t.short+t.radius}height(e){return 2*this.getConfig(e).radius}lineGap(e){return this.getConfig(e).short}}const a=[{render:()=>{},width:()=>0,height:()=>0,lineGap:()=>0},new s("single"),new s("double"),new i];class o extends t{separationPre({agentIDs:e},t){const n=t.theme.connect.source.radius;e.forEach(e=>{const r=t.agentInfos.get(e);r.isVirtualSource&&(r.currentRad=n,r.currentMaxRad=Math.max(r.currentMaxRad,n))})}separation({label:t,agentIDs:n,options:r},s){const i=s.theme.connect,o=a[r.left],l=a[r.right];let h=s.textSizer.measure(i.label.attrs,t).width;h>0&&(h+=2*i.label.padding);const d=s.agentInfos.get(n[0]);if(n[0]===n[1])s.addSpacing(n[0],{left:0,right:d.currentMaxRad+Math.max(h+o.width(s.theme),l.width(s.theme))+i.loopbackRadius});else{const e=s.agentInfos.get(n[1]);s.addSeparation(n[0],n[1],d.currentMaxRad+e.currentMaxRad+h+2*Math.max(o.width(s.theme),l.width(s.theme)))}e.mergeSets(s.momentaryAgentIDs,n)}renderRevArrowLine({x1:e,y1:t,x2:n,y2:r,xR:s},i,o,l){const h=o.theme.connect,d=h.line[i.line],g=a[i.left],c=a[i.right],u=g.lineGap(o.theme,d.attrs),p=c.lineGap(o.theme,d.attrs),f=d.renderRev(d.attrs,{x1:e+u,y1:t,x2:n+p,y2:r,xR:s,rad:h.loopbackRadius});l.appendChild(f.shape),g.render(l,o.theme,{x:f.p1.x-u,y:f.p1.y},{dx:1,dy:0}),c.render(l,o.theme,{x:f.p2.x-p,y:f.p2.y},{dx:1,dy:0})}renderSelfConnect({label:e,agentIDs:t,options:s},i,o,l){const h=i.theme.connect,d=a[s.left],g=a[s.right],c=i.agentInfos.get(t[1]),u=e?i.textSizer.measureHeight(h.label.attrs,e)+h.label.margin.top+h.label.margin.bottom:0,p=o.x+o.currentMaxRad+d.width(i.theme)+(e?h.label.padding:0),f=i.makeRegion(),m=r.renderBoxedText(e,{x:p-h.mask.padding.left,y:l-u+h.label.margin.top,padding:h.mask.padding,boxAttrs:{fill:"#000000"},labelAttrs:h.label.loopbackAttrs,boxLayer:i.lineMaskLayer,labelLayer:f,SVGTextBlockClass:i.SVGTextBlockClass}),b=e?m.width+h.label.padding-h.mask.padding.left-h.mask.padding.right:0,y=Math.max(c.x+c.currentMaxRad+g.width(i.theme),p+b);this.renderRevArrowLine({x1:o.x+o.currentMaxRad,y1:l,x2:c.x+c.currentMaxRad,y2:i.primaryY,xR:y},s,i,f);const x=Math.max(u,d.height(i.theme)/2),k=g.height(i.theme)/2;return f.insertBefore(n.make("rect",{x:o.x,y:l-x,width:y+h.loopbackRadius-o.x,height:x+i.primaryY-l+k,fill:"transparent",class:"outline"}),f.firstChild),i.primaryY+Math.max(k,0)+i.theme.actionMargin}renderArrowLine({x1:e,y1:t,x2:n,y2:r},s,i,o){const l=i.theme.connect.line[s.line],h=a[s.left],d=a[s.right],g=Math.sqrt((n-e)*(n-e)+(r-t)*(r-t)),c=h.lineGap(i.theme,l.attrs),u=d.lineGap(i.theme,l.attrs),p=(n-e)/g,f=(r-t)/g,m=l.renderFlat(l.attrs,{x1:e+c*p,y1:t+c*f,x2:n-u*p,y2:r-u*f});o.appendChild(m.shape);const b={x:m.p1.x-c*p,y:m.p1.y-c*f},y={x:m.p2.x+u*p,y:m.p2.y+u*f};return h.render(o,i.theme,b,{dx:p,dy:f}),d.render(o,i.theme,y,{dx:-p,dy:-f}),{p1:b,p2:y,lArrow:h,rArrow:d}}renderVirtualSources({from:e,to:t,rendered:n},r,s){const i=r.theme.connect.source;e.isVirtualSource&&s.appendChild(i.render({x:n.p1.x-i.radius,y:n.p1.y,radius:i.radius})),t.isVirtualSource&&s.appendChild(i.render({x:n.p2.x+i.radius,y:n.p2.y,radius:i.radius}))}renderSimpleLabel(e,{layer:t,x1:s,x2:i,y1:a,y2:o,height:l},h){const d=h.theme.connect,g=(s+i)/2,c=(a+o)/2;let u=t;const p={fill:"#000000"};if(a!==o){const e="rotate("+180*Math.atan((o-a)/(i-s))/Math.PI+" "+g+","+c+")";p.transform=e,u=n.make("g",{transform:e}),t.appendChild(u)}r.renderBoxedText(e,{x:g,y:c+d.label.margin.top-l,padding:d.mask.padding,boxAttrs:p,labelAttrs:d.label.attrs,boxLayer:h.lineMaskLayer,labelLayer:u,SVGTextBlockClass:h.SVGTextBlockClass})}renderSimpleConnect({label:e,agentIDs:t,options:r},s,i,a){const o=s.theme.connect,l=s.agentInfos.get(t[1]),h=i.x<l.x?1:-1,d=s.textSizer.measureHeight(o.label.attrs,e)+o.label.margin.top+o.label.margin.bottom,g=i.x+i.currentMaxRad*h,c=l.x-l.currentMaxRad*h,u=s.makeRegion(),p=this.renderArrowLine({x1:g,y1:a,x2:c,y2:s.primaryY},r,s,u),f=Math.max(p.lArrow.height(s.theme),p.rArrow.height(s.theme))/2,m=Math.max(d,f);return this.renderVirtualSources({from:i,to:l,rendered:p},s,u),u.appendChild(n.make("path",{d:"M"+g+","+(a-m)+"L"+c+","+(s.primaryY-m)+"L"+c+","+(s.primaryY+f)+"L"+g+","+(a+f)+"Z",fill:"transparent",class:"outline"})),this.renderSimpleLabel(e,{layer:u,x1:g,y1:a,x2:c,y2:s.primaryY,height:d},s),s.primaryY+Math.max(f+s.theme.minActionMargin,s.theme.actionMargin)}renderPre({label:e,agentIDs:t,options:n},r){const s=r.theme.connect,i=a[n.left],o=a[n.right],l=r.textSizer.measureHeight(s.label.attrs,e)+s.label.margin.top+s.label.margin.bottom;let h=i.height(r.theme);return t[0]!==t[1]&&(h=Math.max(h,o.height(r.theme))),{agentIDs:t,topShift:Math.max(h/2,l)}}render(e,t,n=null,r=null){return null===n&&(n=t.agentInfos.get(e.agentIDs[0]),r=t.primaryY),e.agentIDs[0]===e.agentIDs[1]?this.renderSelfConnect(e,t,n,r):this.renderSimpleConnect(e,t,n,r)}}class l extends o{makeState(e){e.delayedConnections=new Map}resetState(e){e.delayedConnections.clear()}separation(t,n){super.separation(t,n),e.mergeSets(n.momentaryAgentIDs,[t.agentIDs[0]])}renderPre(e,t){return Object.assign(super.renderPre(e,t),{agentIDs:[e.agentIDs[0]]})}render(e,t){return t.state.delayedConnections.set(e.tag,{stage:e,from:Object.assign({},t.agentInfos.get(e.agentIDs[0])),y:t.primaryY}),t.primaryY+t.theme.actionMargin}renderHidden(e,t){this.render(e,t)}}class h extends o{separationPre(){}separation(){}renderPre({tag:e},t){const n=t.theme.connect,r=t.state.delayedConnections.get(e),s=r.stage,i=[s.agentIDs[1]];return s.agentIDs[0]===s.agentIDs[1]?{agentIDs:i,y:r.y+2*n.loopbackRadius}:Object.assign(super.renderPre(s,t),{agentIDs:i})}render({tag:e},t){const n=t.state.delayedConnections.get(e);return super.render(n.stage,t,n.from,n.y)}}return t.register("connect",new o),t.register("connect-delay-begin",new l),t.register("connect-delay-end",new h),{Connect:o,ConnectDelayBegin:l,ConnectDelayEnd:h}}),n("sequence/components/Note",["./BaseComponent","svg/SVGUtilities"],(e,t)=>{"use strict";function n(e,t){let n=null,r=null;return t.forEach(t=>{const s=e.get(t);(null===n||s.index<n.index)&&(n=s),(null===r||s.index>r.index)&&(r=s)}),{left:n.id,right:r.id}}class r extends e{renderPre({agentIDs:e}){return{agentIDs:e}}renderNote({xMid:e=null,x0:n=null,x1:r=null,anchor:s,mode:i,label:a},o){const l=o.theme.getNote(i),h=o.makeRegion(),d=o.topY+l.margin.top+l.padding.top,g=new o.SVGTextBlockClass(h,{attrs:l.labelAttrs,formatted:a,y:d}),c=g.width+l.padding.left+l.padding.right,u=l.padding.top+g.height+l.padding.bottom;switch(null===n&&null!==e&&(n=e-c/2),null===r&&null!==n?r=n+c:null===n&&(n=r-c),l.labelAttrs["text-anchor"]){case"middle":g.set({x:(n+l.padding.left+r-l.padding.right)/2,y:d});break;case"end":g.set({x:r-l.padding.right,y:d});break;default:g.set({x:n+l.padding.left,y:d})}return h.insertBefore(t.make("rect",{x:n,y:o.topY+l.margin.top,width:r-n,height:u,fill:"transparent",class:"outline"}),h.firstChild),h.insertBefore(l.boxRenderer({x:n,y:o.topY+l.margin.top,width:r-n,height:u}),h.firstChild),o.topY+l.margin.top+u+l.margin.bottom+o.theme.actionMargin}}class s extends r{separation({agentIDs:e,mode:t,label:r},s){const i=s.theme.getNote(t),a=s.textSizer.measure(i.labelAttrs,r).width+i.padding.left+i.padding.right,{left:o,right:l}=n(s.agentInfos,e),h=s.agentInfos.get(o),d=s.agentInfos.get(l);if(h!==d){const e=h.currentMaxRad+i.overlap.left,t=d.currentMaxRad+i.overlap.right;s.addSeparation(o,l,a-e-t),s.addSpacing(o,{left:e,right:0}),s.addSpacing(l,{left:0,right:t})}else s.addSpacing(o,{left:a/2,right:a/2})}render({agentIDs:e,mode:t,label:r},s){const i=s.theme.getNote(t),{left:a,right:o}=n(s.agentInfos,e),l=s.agentInfos.get(a),h=s.agentInfos.get(o);if(l!==h)return this.renderNote({x0:l.x-l.currentMaxRad-i.overlap.left,x1:h.x+h.currentMaxRad+i.overlap.right,anchor:"middle",mode:t,label:r},s);{const e=l.x;return this.renderNote({xMid:e,anchor:"middle",mode:t,label:r},s)}}}class i extends r{constructor(e){super(),this.isRight=e}separation({agentIDs:e,mode:t,label:r},s){const i=s.theme.getNote(t),{left:a,right:o}=n(s.agentInfos,e),l=s.textSizer.measure(i.labelAttrs,r).width+i.padding.left+i.padding.right+i.margin.left+i.margin.right;if(this.isRight){const e=s.agentInfos.get(o);s.addSpacing(o,{left:0,right:l+e.currentMaxRad})}else{const e=s.agentInfos.get(a);s.addSpacing(a,{left:l+e.currentMaxRad,right:0})}}render({agentIDs:e,mode:t,label:r},s){const i=s.theme.getNote(t),{left:a,right:o}=n(s.agentInfos,e);if(this.isRight){const e=s.agentInfos.get(o),n=e.x+e.currentMaxRad+i.margin.left;return this.renderNote({x0:n,anchor:"start",mode:t,label:r},s)}{const e=s.agentInfos.get(a),n=e.x-e.currentMaxRad-i.margin.right;return this.renderNote({x1:n,anchor:"end",mode:t,label:r},s)}}}class a extends r{separation({agentIDs:e,mode:t,label:r},s){const i=s.theme.getNote(t),{left:a,right:o}=n(s.agentInfos,e),l=s.agentInfos.get(a),h=s.agentInfos.get(o);s.addSeparation(a,o,s.textSizer.measure(i.labelAttrs,r).width+i.padding.left+i.padding.right+i.margin.left+i.margin.right+l.currentMaxRad+h.currentMaxRad)}render({agentIDs:e,mode:t,label:r},s){const{left:i,right:a}=n(s.agentInfos,e),o=s.agentInfos.get(i),l=s.agentInfos.get(a),h=(o.x+o.currentMaxRad+l.x-l.currentMaxRad)/2;return this.renderNote({xMid:h,anchor:"middle",mode:t,label:r},s)}}return r.NoteOver=s,r.NoteSide=i,r.NoteBetween=a,e.register("note over",new s),e.register("note left",new i(!1)),e.register("note right",new i(!0)),e.register("note between",new a),r}),n("sequence/components/Divider",["./BaseComponent","svg/SVGUtilities","svg/SVGShapes"],(e,t,n)=>{"use strict";class r extends e{separation({mode:e,formattedLabel:t},n){const r=n.theme.getDivider(e),s=n.textSizer.measure(r.labelAttrs,t).width+r.padding.left+r.padding.right;n.addSeparation("[","]",s),n.addSpacing("[",{left:r.extend,right:0}),n.addSpacing("]",{left:0,right:r.extend})}renderPre(){return{agentIDs:["[","]"]}}render({mode:e,height:r,formattedLabel:s},i){const a=i.theme.getDivider(e),o=i.agentInfos.get("["),l=i.agentInfos.get("]"),h=i.makeRegion({unmasked:!0});let d=0,g=0;s&&(g=i.textSizer.measureHeight(a.labelAttrs,s));const c=Math.max(r,g)+a.margin;if(s){d=n.renderBoxedText(s,{x:(o.x+l.x)/2,y:i.primaryY+(c-g)/2-a.padding.top,padding:a.padding,boxAttrs:{fill:"#000000"},labelAttrs:a.labelAttrs,boxLayer:i.fullMaskLayer,labelLayer:h,SVGTextBlockClass:i.SVGTextBlockClass}).width}const{shape:u,mask:p}=a.render({x:o.x-a.extend,y:i.primaryY+(c-r)/2,labelWidth:d,labelHeight:g,width:l.x-o.x+2*a.extend,height:r,env:i});return u&&h.insertBefore(u,h.firstChild),p&&i.fullMaskLayer.appendChild(p),h.insertBefore(t.make("rect",{x:o.x-a.extend,y:i.primaryY,width:l.x-o.x+2*a.extend,height:c,fill:"transparent",class:"outline"}),h.firstChild),i.primaryY+c+i.theme.actionMargin}}return e.register("divider",new r),r}),n("sequence/Renderer",["core/ArrayUtilities","core/EventObject","svg/SVGUtilities","svg/SVGShapes","./components/BaseComponent","./components/Block","./components/Parallel","./components/Marker","./components/AgentCap","./components/AgentHighlight","./components/Connect","./components/Note","./components/Divider"],(e,t,n,r,s)=>{"use strict";function i(e,t){let n=null,r=null;return t.forEach(t=>{const s=e.get(t);(null===n||s.index<n.index)&&(n=s),(null===r||s.index>r.index)&&(r=s)}),{left:n.id,right:r.id}}let a=0;return class extends t{constructor({themes:e=[],namespace:t=null,components:n=null,SVGTextBlockClass:i=r.TextBlock}={}){super(),null===n&&(n=s.getComponents()),this._bindMethods(),this.state={},this.width=0,this.height=0,this.themes=function(e){if(0===e.length)throw new Error("Cannot render without a theme");const t=new Map;return e.forEach(e=>{t.set(e.name,e)}),t.set("",e[0]),t}(e),this.theme=null,this.namespace=function(e){return null===e&&(e="R"+a,++a),e}(t),this.components=n,this.SVGTextBlockClass=i,this.knownThemeDefs=new Set,this.knownDefs=new Set,this.highlights=new Map,this.collapsed=new Set,this.currentHighlight=-1,this.buildStaticElements(),this.components.forEach(e=>{e.makeState(this.state)})}_bindMethods(){this.separationStage=this.separationStage.bind(this),this.renderStage=this.renderStage.bind(this),this.addThemeDef=this.addThemeDef.bind(this),this.addDef=this.addDef.bind(this)}addTheme(e){this.themes.set(e.name,e)}buildMetadata(){return this.metaCode=n.makeText(),n.make("metadata",{},[this.metaCode])}buildStaticElements(){this.base=n.makeContainer(),this.themeDefs=n.make("defs"),this.defs=n.make("defs"),this.fullMask=n.make("mask",{id:this.namespace+"FullMask",maskUnits:"userSpaceOnUse"}),this.lineMask=n.make("mask",{id:this.namespace+"LineMask",maskUnits:"userSpaceOnUse"}),this.fullMaskReveal=n.make("rect",{fill:"#FFFFFF"}),this.lineMaskReveal=n.make("rect",{fill:"#FFFFFF"}),this.backgroundFills=n.make("g"),this.agentLines=n.make("g",{mask:"url(#"+this.namespace+"LineMask)"}),this.blocks=n.make("g"),this.shapes=n.make("g"),this.unmaskedShapes=n.make("g"),this.base.appendChild(this.buildMetadata()),this.base.appendChild(this.themeDefs),this.base.appendChild(this.defs),this.base.appendChild(this.backgroundFills),this.base.appendChild(n.make("g",{mask:"url(#"+this.namespace+"FullMask)"},[this.agentLines,this.blocks,this.shapes])),this.base.appendChild(this.unmaskedShapes),this.title=new this.SVGTextBlockClass(this.base),this.sizer=new this.SVGTextBlockClass.SizeTester(this.base)}addThemeDef(e,t){const n=this.namespace+e;if(this.knownThemeDefs.has(e))return n;this.knownThemeDefs.add(e);const r=t();return r.setAttribute("id",n),this.themeDefs.appendChild(r),n}addDef(e,t){if("function"!=typeof t){const n=e;e="P"+this.knownDefs.size,t=(()=>n)}const n=this.namespace+e;if(this.knownDefs.has(e))return n;this.knownDefs.add(e);const r=t();return r.setAttribute("id",n),this.defs.appendChild(r),n}addSeparation(e,t,n){const r=this.agentInfos.get(e),s=this.agentInfos.get(t),i=r.separations.get(t)||0;r.separations.set(t,Math.max(i,n));const a=s.separations.get(e)||0;s.separations.set(e,Math.max(a,n))}checkHidden(e){const t=this.components.get(e.type),n={renderer:this,theme:this.theme,agentInfos:this.agentInfos,textSizer:this.sizer,state:this.state,components:this.components},r=t.shouldHide(e,n)||{},s=this.hideNest>0;this.hideNest+=r.nest||0;const i=this.hideNest>0;if(this.hideNest<0)throw new Error("Unexpected nesting in "+e.type);return s===i?i:Boolean(r.self)}separationStage(t){const n=new Map,r=this.visibleAgentIDs.slice(),s=[];this.agentInfos.forEach(e=>{const t=e.currentRad;e.currentMaxRad=t,n.set(e.id,{left:t,right:t})});const i={renderer:this,theme:this.theme,agentInfos:this.agentInfos,visibleAgentIDs:this.visibleAgentIDs,momentaryAgentIDs:r,textSizer:this.sizer,addSpacing:(e,{left:t,right:r})=>{const s=n.get(e);s.left=Math.max(s.left,t),s.right=Math.max(s.right,r)},addSeparation:(e,t,n)=>{s.push({agentID1:e,agentID2:t,dist:n})},state:this.state,components:this.components},a=this.components.get(t.type);if(!a)throw new Error("Unknown component: "+t.type);a.separationPre(t,i),a.separation(t,i),this.checkHidden(t)||(e.mergeSets(r,this.visibleAgentIDs),s.forEach(({agentID1:e,agentID2:t,dist:n})=>{this.addSeparation(e,t,n)}),r.forEach(e=>{const t=this.agentInfos.get(e),s=n.get(e);t.maxRPad=Math.max(t.maxRPad,s.right),t.maxLPad=Math.max(t.maxLPad,s.left),r.forEach(r=>{if(this.agentInfos.get(r).index>=t.index)return;const i=n.get(r);this.addSeparation(e,r,s.left+i.right+this.theme.agentMargin)})}))}checkAgentRange(e,t=0){if(0===e.length)return t;const{left:n,right:r}=i(this.agentInfos,e),s=this.agentInfos.get(n).x,a=this.agentInfos.get(r).x;let o=t;return this.agentInfos.forEach(e=>{e.x>=s&&e.x<=a&&(o=Math.max(o,e.latestY))}),o}markAgentRange(e,t){if(0===e.length)return;const{left:n,right:r}=i(this.agentInfos,e),s=this.agentInfos.get(n).x,a=this.agentInfos.get(r).x;this.agentInfos.forEach(e=>{e.x>=s&&e.x<=a&&(e.latestY=t)})}drawAgentLine(e,t){null===e.latestYStart||t<=e.latestYStart||this.agentLines.appendChild(this.theme.renderAgentLine({x:e.x,y0:e.latestYStart,y1:t,width:2*e.currentRad,className:"agent-"+e.index+"-line"}))}addHighlightObject(e,t){let n=this.highlights.get(e);n||(n=[],this.highlights.set(e,n)),n.push(t)}forwardEvent(e,t,n,r){e.addEventListener(t,this.trigger.bind(this,n,r))}renderStage(e){this.agentInfos.forEach(e=>{const t=e.currentRad;e.currentMaxRad=t});const t={renderer:this,theme:this.theme,agentInfos:this.agentInfos,textSizer:this.sizer,state:this.state,components:this.components},r=this.components.get(e.type),i=r.renderPre(e,t),{agentIDs:a,topShift:o,asynchronousY:l}=s.cleanRenderPreResult(i,this.currentY),h=this.checkAgentRange(a,l),d={renderer:this,topY:h,primaryY:h+o,fillLayer:this.backgroundFills,blockLayer:this.blocks,fullMaskLayer:this.fullMask,lineMaskLayer:this.lineMask,theme:this.theme,agentInfos:this.agentInfos,textSizer:this.sizer,SVGTextBlockClass:this.SVGTextBlockClass,state:this.state,drawAgentLine:(e,t,n=!1)=>{const r=this.agentInfos.get(e);this.drawAgentLine(r,t),r.latestYStart=n?null:t},addDef:this.addDef,makeRegion:({stageOverride:t=null,unmasked:r=!1}={})=>{const s=n.make("g"),i=t||e;return this.addHighlightObject(i.ln,s),s.setAttribute("class","region"),this.forwardEvent(s,"mouseenter","mouseover",[i]),this.forwardEvent(s,"mouseleave","mouseout",[i]),this.forwardEvent(s,"click","click",[i]),this.forwardEvent(s,"dblclick","dblclick",[i]),(r?this.unmaskedShapes:this.shapes).appendChild(s),s},components:this.components};let g=h;this.checkHidden(e)?(d.primaryY=h,r.renderHidden(e,d)):g=Math.max(g,r.render(e,d)||0),this.markAgentRange(a,g),this.currentY=g}positionAgents(){const e=[];this.agentInfos.forEach(t=>{let n=0;t.separations.forEach((e,r)=>{const s=this.agentInfos.get(r);s.index<t.index&&(n=Math.max(n,s.x+e))}),t.x=n,e.push(t)});let t={x:0};e.reverse().forEach(e=>{let n=t.x;t=e,e.anchorRight&&(e.separations.forEach((t,r)=>{const s=this.agentInfos.get(r);s.index>e.index&&(n=Math.min(n,s.x-t))}),e.x=n)}),this.agentInfos.forEach(({x:e,maxRPad:t,maxLPad:n})=>{this.minX=Math.min(this.minX,e-n),this.maxX=Math.max(this.maxX,e+t)})}buildAgentInfos(e,t){this.agentInfos=new Map,e.forEach((e,t)=>{this.agentInfos.set(e.id,{id:e.id,formattedLabel:e.formattedLabel,anchorRight:e.anchorRight,isVirtualSource:e.isVirtualSource,index:t,x:null,latestYStart:null,currentRad:0,currentMaxRad:0,latestY:0,maxRPad:0,maxLPad:0,separations:new Map})}),this.visibleAgentIDs=["[","]"],t.forEach(this.separationStage),this.positionAgents()}updateBounds(e){const t=(this.minX+this.maxX)/2,n=this.title.height>0?-this.theme.titleMargin-this.title.height:0;this.title.set({x:t,y:n});const r=this.title.width/2,s=this.theme.outerMargin,i=Math.min(this.minX,t-r)-s,a=Math.max(this.maxX,t+r)+s,o=n-s,l=e+s;this.width=a-i,this.height=l-o,this.fullMaskReveal.setAttribute("x",i),this.fullMaskReveal.setAttribute("y",o),this.fullMaskReveal.setAttribute("width",this.width),this.fullMaskReveal.setAttribute("height",this.height),this.lineMaskReveal.setAttribute("x",i),this.lineMaskReveal.setAttribute("y",o),this.lineMaskReveal.setAttribute("width",this.width),this.lineMaskReveal.setAttribute("height",this.height),this.base.setAttribute("viewBox",i+" "+o+" "+this.width+" "+this.height)}_resetState(){this.components.forEach(e=>{e.resetState(this.state)}),this.currentY=0,this.hideNest=0}_reset(e){e&&(this.knownThemeDefs.clear(),n.empty(this.themeDefs)),this.knownDefs.clear(),this.highlights.clear(),this.currentHighlight=-1,n.empty(this.defs),n.empty(this.fullMask),n.empty(this.lineMask),n.empty(this.backgroundFills),n.empty(this.agentLines),n.empty(this.blocks),n.empty(this.shapes),n.empty(this.unmaskedShapes),this.fullMask.appendChild(this.fullMaskReveal),this.lineMask.appendChild(this.lineMaskReveal),this.defs.appendChild(this.fullMask),this.defs.appendChild(this.lineMask),this._resetState()}setHighlight(e=null){null!==e&&this.highlights.has(e)||(e=-1),this.currentHighlight!==e&&(-1!==this.currentHighlight&&this.highlights.get(this.currentHighlight).forEach(e=>{e.setAttribute("class","region")}),-1!==e&&this.highlights.get(e).forEach(e=>{e.setAttribute("class","region focus")}),this.currentHighlight=e)}isCollapsed(e){return this.collapsed.has(e)}setCollapseAll(e){if(e)throw new Error("Cannot collapse all");return 0!==this.collapsed.size&&(this.collapsed.clear(),!0)}_setCollapsed(e,t){return"number"==typeof e&&(t!==this.isCollapsed(e)&&(t?this.collapsed.add(e):this.collapsed.delete(e),!0))}setCollapsed(e,t=!0){return null===e?this.setCollapseAll(t):Array.isArray(e)?e.map(e=>this._setCollapsed(e,t)).some(e=>e):this._setCollapsed(e,t)}render(e){const t=this.currentHighlight,n=this.theme;this.theme=this.getThemeNamed(e.meta.theme);const r=this.theme!==n;this._reset(r),this.theme.reset(),this.metaCode.nodeValue=e.meta.code,this.theme.addDefs(this.addThemeDef),this.title.set({attrs:this.theme.titleAttrs,formatted:e.meta.title}),this.minX=0,this.maxX=0,this.buildAgentInfos(e.agents,e.stages),this._resetState(),e.stages.forEach(this.renderStage);const s=this.checkAgentRange(["[","]"],this.currentY),i=Math.max(s-this.theme.actionMargin,0);this.updateBounds(i),this.sizer.resetCache(),this.sizer.detach(),this.setHighlight(t)}getThemeNames(){return Array.from(this.themes.keys()).filter(e=>""!==e)}getThemes(){return this.getThemeNames().map(e=>this.themes.get(e))}getThemeNamed(e){const t=this.themes.get(e);return t||this.themes.get("")}getAgentX(e){return this.agentInfos.get(e).x}svg(){return this.base}}}),n("sequence/Exporter",[],()=>{"use strict";const e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return class{constructor(){this.latestSVG=null,this.latestInternalSVG=null,this.canvas=null,this.context=null,this.indexPNG=0,this.latestPNGIndex=0,this.latestPNG=null}getSVGContent(e){let t=e.svg().outerHTML;return t=t.replace(/^<svg/,'<svg width="'+(e.width||1)+'" height="'+(e.height||1)+'" ')}getSVGBlob(e){return new Blob([this.getSVGContent(e)],{type:"image/svg+xml"})}getSVGURL(e){const t=this.getSVGBlob(e);return this.latestSVG&&URL.revokeObjectURL(this.latestSVG),this.latestSVG=URL.createObjectURL(t),this.latestSVG}getCanvas(t,n,r){this.canvas||(window.devicePixelRatio=1,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"));const s=(t.width||1)*n,i=(t.height||1)*n,a=new Image(s,i);let o=null;e&&((o=document.createElement("div")).style.position="absolute",o.style.visibility="hidden",o.appendChild(a),document.body.appendChild(o));const l=()=>{this.canvas.width=s,this.canvas.height=i,this.context.drawImage(a,0,0,s,i),o&&document.body.removeChild(o),r(this.canvas)};a.addEventListener("load",()=>{o?setTimeout(l,50):l()},{once:!0}),a.src=this.getSVGURL(t)}getPNGBlob(e,t,n){this.getCanvas(e,t,e=>{e.toBlob(n,"image/png")})}getPNGURL(e,t,n){++this.indexPNG;const r=this.indexPNG;this.getPNGBlob(e,t,e=>{const t=URL.createObjectURL(e);r>=this.latestPNGIndex?(this.latestPNG&&URL.revokeObjectURL(this.latestPNG),this.latestPNG=t,this.latestPNGIndex=r,n(t,!0)):(n(t,!1),URL.revokeObjectURL(t))})}}}),n("sequence/CodeMirrorHints",["core/ArrayUtilities"],e=>{"use strict";function t(e,t){return e.v===t.v&&e.prefix===t.prefix&&e.suffix===t.suffix&&e.q===t.q}function n(e,t,n){const r=e.getLine(t),s={word:{line:t,ch:n},squash:{line:t,ch:n}};return n>0&&" "===r[n-1]&&(a.after.includes(r[n-2])&&s.word.ch--,s.squash.ch--),s}function r(e,t,n){const r=function(e,t){!t&&l.test(e.v)&&(t='"');let n=e.v;return t&&e.q&&(n=t+n.replace(h,"\\$&")+t),(e.prefix||"")+n+(e.suffix||"")}(e,n),s=e.q?t.fromVar:t.fromKey;return"\n"===r?{text:"\n",displayText:"<END>",className:"pick-virtual",from:s.squash,to:t.to.squash,displayFrom:null}:{text:r,displayText:r.trim(),className:null,from:a.start.test(r)?s.squash:s.word,to:a.end.test(r)?t.to.squash:t.to.word,displayFrom:s.word}}function s({global:e,prefix:t="",suffix:n=""},r){const s=r[e];return s?s.map(e=>({v:e,prefix:t,suffix:n,q:!0})):[]}const i=/^([ \t]*)(.*)$/,a={start:/^[ \t\r\n:,]/,end:/[ \t\r\n]$/,after:".!+"},o=/^"(\\.|[^"])*$/,l=/[\r\n:,"<>\-~]/,h=/["\\]/g;return{getHints:function(a,l){const h=a.getCursor(),d=function(e,t){const n=e.getLineTokens(t.line);for(let e=0;e<n.length;++e)if(n[e].end>=t.ch){n.length=e+1;break}return n}(a,h),g=e.last(d)||a.getTokenAt(h),c=function(e,t){let n=0,r="",s=0,a=0;e.forEach((e,t)=>{e.state.isVar?(r+=e.string,a=e.end):(n=t+1,r="",s=e.end)}),a>t.ch&&(r=r.substr(0,t.ch-s));const l=i.exec(r);r=l[2];let h="";return o.test(r)&&(h=r[0],r=r.substr(1)),{partial:r,quote:h,from:s+l[1].length,valid:a>=s}}(d,h),u=function(e,t){let n=e.string;e.end>t.ch&&(n=n.substr(0,t.ch-e.start));const r=i.exec(n);return{partial:r[2],from:e.start+r[1].length,valid:!0}}(g,h),p=h.ch>0&&g.state.line.length>0;let f=p?g.state.completions:g.state.beginCompletions;p||(f=f.concat(g.state.knownAgent)),function(n,r={}){for(let i=0;i<n.length;)if(n[i].global){const a=s(n[i],r);e.mergeSets(n,a,t),n.splice(i,1)}else++i}(f,a.options.globals);const m={fromVar:n(a,h.line,c.from),fromKey:n(a,h.line,u.from),to:function(e,t,n){const r={word:{line:t,ch:n},squash:{line:t,ch:n}};return" "===e.getLine(t)[n]&&r.squash.ch++,r}(a,h.line,g.end)};let b=null;const y=f.filter(e=>(e.q||!c.quote)&&function(e,t){return t.valid&&e.startsWith(t.partial)}(e.v,e.q?c:u)).map(e=>l.completeSingle||e.v!==(e.q?c:u).partial?r(e,m,c.quote):(b=e,null)).filter(e=>null!==e);return b&&y.length>0&&y.unshift(r(b,m,c.quote)),{list:y,from:function(e,t){let n=null;return e.forEach(({displayFrom:e})=>{e&&(!n||e.line>n.line||e.line===n.line&&e.ch>n.ch)&&(n=e)}),n||t.word}(y,m.fromKey),to:m.to.word}}}}),n("sequence/themes/BaseTheme",["svg/SVGUtilities","svg/SVGShapes"],(e,t)=>{"use strict";function n(e){if("object"!=typeof e||!e)return e;const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=n(e[r]));return t}class r{constructor({name:e,settings:t,blocks:r,notes:s,dividers:i}){this.name=e,this.blocks=n(r),this.notes=n(s),this.dividers=n(i),Object.assign(this,n(t))}reset(){}addDefs(){}getBlock(e){return this.blocks[e]||this.blocks[""]}getNote(e){return this.notes[e]||this.notes[""]}getDivider(e){return this.dividers[e]||this.dividers[""]}renderAgentLine({x:t,y0:n,y1:r,width:s,className:i}){return s>0?e.make("rect",Object.assign({x:t-s/2,y:n,width:s,height:r-n,class:i},this.agentLineAttrs)):e.make("line",Object.assign({x1:t,y1:n,x2:t,y2:r,class:i},this.agentLineAttrs))}}return r.renderArrowHead=((t,{x:n,y:r,width:s,height:i,dir:a})=>{const o=s*a.dx,l=s*a.dy,h=.5*i*a.dx,d=.5*-i*a.dy;return e.make("none"===t.fill?"polyline":"polygon",Object.assign({points:n+o-d+" "+(r+l-h)+" "+n+" "+r+" "+(n+o+d)+" "+(r+l+h)},t))}),r.renderTag=((t,{x:n,y:r,width:s,height:i})=>{const{rx:a,ry:o}=t,l=n+s,h=r+i,d="M"+l+" "+r+"L"+l+" "+(h-o)+"L"+(l-a)+" "+h+"L"+n+" "+h,g=e.make("g");return"none"!==t.fill&&g.appendChild(e.make("path",Object.assign({d:d+"L"+n+" "+r},t,{stroke:"none"}))),"none"!==t.stroke&&g.appendChild(e.make("path",Object.assign({d:d},t,{fill:"none"}))),g}),r.renderCross=((t,{x:n,y:r,radius:s})=>e.make("path",Object.assign({d:"M"+(n-s)+" "+(r-s)+"l"+2*s+" "+2*s+"m0 "+2*-s+"l"+2*-s+" "+2*s},t))),r.renderRef=((e,n)=>({shape:t.renderBox(Object.assign({},e,{fill:"none"}),n),mask:t.renderBox(Object.assign({},e,{fill:"#000000",stroke:"none"}),n),fill:t.renderBox(Object.assign({},e,{stroke:"none"}),n)})),r.WavePattern=class{constructor(e,t){Array.isArray(t)?this.deltas=t:this.deltas=[0,2*-t/3,-t,2*-t/3,0,2*t/3,t,2*t/3],this.partWidth=e/this.deltas.length}getDelta(e){return this.deltas[e%this.deltas.length]}},r.renderFlatConnector=((n,r,{x1:s,y1:i,x2:a,y2:o})=>({shape:e.make("path",Object.assign({d:new t.PatternedLine(n).move(s,i).line(a,o).cap().asPath()},r)),p1:{x:s,y:i},p2:{x:a,y:o}})),r.renderRevConnector=((n,r,{x1:s,y1:i,x2:a,y2:o,xR:l,rad:h})=>{const d=(o-i)/2,g=new t.PatternedLine(n).move(s,i).line(l,i);return h<d?g.arc(l,i+h,Math.PI/2).line(l+h,o-h).arc(l,o-h,Math.PI/2):g.arc(l,(i+o)/2,Math.PI),{shape:e.make("path",Object.assign({d:g.line(a,o).cap().asPath()},r)),p1:{x:s,y:i},p2:{x:a,y:o}}}),r.renderLineDivider=(({lineAttrs:t},{x:n,y:r,labelWidth:s,width:i,height:a})=>{let o=null;const l=r+a/2;return o=s>0?e.make("g",{},[e.make("line",Object.assign({x1:n,y1:l,x2:n+(i-s)/2,y2:l,fill:"none"},t)),e.make("line",Object.assign({x1:n+(i+s)/2,y1:l,x2:n+i,y2:l,fill:"none"},t))]):e.make("line",Object.assign({x1:n,y1:l,x2:n+i,y2:l,fill:"none"},t)),{shape:o}}),r.renderDelayDivider=(({dotSize:t,gapSize:n},{x:r,y:s,width:i,height:a})=>{const o=e.make("g");for(let l=0;l+n<=a;l+=t+n)o.appendChild(e.make("rect",{x:r,y:s+l,width:i,height:n,fill:"#000000"}));return{mask:o}}),r.renderTearDivider=(({fadeBegin:n,fadeSize:s,pattern:i,zigWidth:a,zigHeight:o,lineAttrs:l},{x:h,y:d,labelWidth:g,labelHeight:c,width:u,height:p,env:f})=>{const m=f.addDef("tear-grad",()=>{const t=100/u;return e.make("linearGradient",{},[e.make("stop",{offset:n*t+"%","stop-color":"#000000"}),e.make("stop",{offset:(n+s)*t+"%","stop-color":"#FFFFFF"}),e.make("stop",{offset:100-(n+s)*t+"%","stop-color":"#FFFFFF"}),e.make("stop",{offset:100-n*t+"%","stop-color":"#000000"})])}),b=e.make("mask",{maskUnits:"userSpaceOnUse"},[e.make("rect",{x:h,y:d-5,width:u,height:p+10,fill:"url(#"+m+")"})]),y=f.addDef(b);g>0&&b.appendChild(e.make("rect",{x:h+(u-g)/2,y:d+(p-c)/2-1,width:g,height:c+2,rx:2,ry:2,fill:"#000000"})),i||(i=new r.WavePattern(a,[o,-o]));let x=null;const k=new t.PatternedLine(i).move(h,d).line(h+u,d),w=e.make("g",{mask:"url(#"+y+")"},[e.make("path",Object.assign({d:k.asPath(),fill:"none"},l))]);if(p>0){const n=new t.PatternedLine(i).move(h,d+p).line(h+u,d+p);w.appendChild(e.make("path",Object.assign({d:n.asPath(),fill:"none"},l))),k.line(n.x,n.y,{patterned:!1}).cap(),k.points.push(...n.points.reverse()),x=e.make("path",{d:k.asPath(),fill:"#000000"})}return{shape:w,mask:x}}),r}),n("sequence/themes/Basic",["./BaseTheme","svg/SVGUtilities","svg/SVGShapes"],(e,t,n)=>{"use strict";const r="sans-serif",s=new e.WavePattern(6,.5),i={titleMargin:10,outerMargin:5,agentMargin:10,actionMargin:10,minActionMargin:3,agentLineHighlightRadius:4,agentCap:{box:{padding:{top:5,left:10,right:10,bottom:5},arrowBottom:12.8,boxAttrs:{fill:"#FFFFFF",stroke:"#000000","stroke-width":1},labelAttrs:{"font-family":r,"font-size":12,"line-height":1.3,"text-anchor":"middle"}},cross:{size:20,render:e.renderCross.bind(null,{fill:"none",stroke:"#000000","stroke-width":1})},bar:{height:4,render:n.renderBox.bind(null,{fill:"#000000",stroke:"#000000","stroke-width":1})},fade:{width:5,height:6,extend:1},none:{height:10}},connect:{loopbackRadius:6,line:{solid:{attrs:{fill:"none",stroke:"#000000","stroke-width":1},renderFlat:e.renderFlatConnector.bind(null,null),renderRev:e.renderRevConnector.bind(null,null)},dash:{attrs:{fill:"none",stroke:"#000000","stroke-width":1,"stroke-dasharray":"4, 2"},renderFlat:e.renderFlatConnector.bind(null,null),renderRev:e.renderRevConnector.bind(null,null)},wave:{attrs:{fill:"none",stroke:"#000000","stroke-width":1,"stroke-linejoin":"round","stroke-linecap":"round"},renderFlat:e.renderFlatConnector.bind(null,s),renderRev:e.renderRevConnector.bind(null,s)}},arrow:{single:{width:5,height:10,render:e.renderArrowHead,attrs:{fill:"#000000","stroke-width":0,"stroke-linejoin":"miter"}},double:{width:4,height:6,render:e.renderArrowHead,attrs:{fill:"none",stroke:"#000000","stroke-width":1,"stroke-linejoin":"miter"}},cross:{short:7,radius:3,render:e.renderCross.bind(null,{fill:"none",stroke:"#000000","stroke-width":1})}},label:{padding:6,margin:{top:2,bottom:1},attrs:{"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"middle"},loopbackAttrs:{"font-family":r,"font-size":8,"line-height":1.3}},source:{radius:2,render:({x:e,y:n,radius:r})=>t.make("circle",{cx:e,cy:n,r:r,fill:"#000000",stroke:"#000000","stroke-width":1})},mask:{padding:{top:0,left:3,right:3,bottom:1}}},titleAttrs:{"font-family":r,"font-size":20,"line-height":1.3,"text-anchor":"middle",class:"title"},agentLineAttrs:{fill:"none",stroke:"#000000","stroke-width":1}},a={padding:{top:3,bottom:2},tag:{padding:{top:1,left:3,right:3,bottom:0},boxRenderer:e.renderTag.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1,rx:2,ry:2}),labelAttrs:{"font-family":r,"font-weight":"bold","font-size":9,"line-height":1.3,"text-anchor":"left"}},label:{padding:{top:1,left:5,right:3,bottom:0},labelAttrs:{"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"left"}}},o={ref:{margin:{top:0,bottom:0},boxRenderer:e.renderRef.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1.5,rx:2,ry:2}),section:a},"":{margin:{top:0,bottom:0},boxRenderer:n.renderBox.bind(null,{fill:"none",stroke:"#000000","stroke-width":1.5,rx:2,ry:2}),collapsedBoxRenderer:e.renderRef.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1.5,rx:2,ry:2}),section:a,sepRenderer:n.renderLine.bind(null,{stroke:"#000000","stroke-width":1.5,"stroke-dasharray":"4, 2"})}},l={"font-family":r,"font-size":8,"line-height":1.3},h={text:{margin:{top:0,left:2,right:2,bottom:0},padding:{top:2,left:2,right:2,bottom:2},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF"}),labelAttrs:l},note:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:5,left:5,right:10,bottom:5},overlap:{left:10,right:10},boxRenderer:n.renderNote.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1},{fill:"none",stroke:"#000000","stroke-width":1}),labelAttrs:l},state:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:7,left:7,right:7,bottom:7},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1,rx:10,ry:10}),labelAttrs:l}},d={"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"middle"},g={"":{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:0,margin:0,render:()=>({})},line:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:10,margin:0,render:e.renderLineDivider.bind(null,{lineAttrs:{stroke:"#000000"}})},delay:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:0,margin:0,render:e.renderDelayDivider.bind(null,{dotSize:1,gapSize:2})},tear:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:10,margin:10,render:e.renderTearDivider.bind(null,{fadeBegin:5,fadeSize:10,zigWidth:6,zigHeight:1,lineAttrs:{stroke:"#000000"}})}};return class extends e{constructor(){super({name:"basic",settings:i,blocks:o,notes:h,dividers:g})}}}),n("sequence/themes/Monospace",["./BaseTheme","svg/SVGUtilities","svg/SVGShapes"],(e,t,n)=>{"use strict";const r="monospace",s=new e.WavePattern(6,[0,-.25,-.5,-.25,0,.25,.5,.25]),i={titleMargin:8,outerMargin:4,agentMargin:12,actionMargin:12,minActionMargin:4,agentLineHighlightRadius:4,agentCap:{box:{padding:{top:4,left:8,right:8,bottom:4},arrowBottom:12,boxAttrs:{fill:"#FFFFFF",stroke:"#000000","stroke-width":1},labelAttrs:{"font-family":r,"font-size":12,"line-height":1.3,"text-anchor":"middle"}},cross:{size:16,render:e.renderCross.bind(null,{fill:"none",stroke:"#000000","stroke-width":1})},bar:{height:4,render:n.renderBox.bind(null,{fill:"#000000",stroke:"#000000","stroke-width":1})},fade:{width:5,height:8,extend:1},none:{height:8}},connect:{loopbackRadius:4,line:{solid:{attrs:{fill:"none",stroke:"#000000","stroke-width":1},renderFlat:e.renderFlatConnector.bind(null,null),renderRev:e.renderRevConnector.bind(null,null)},dash:{attrs:{fill:"none",stroke:"#000000","stroke-width":1,"stroke-dasharray":"4, 4"},renderFlat:e.renderFlatConnector.bind(null,null),renderRev:e.renderRevConnector.bind(null,null)},wave:{attrs:{fill:"none",stroke:"#000000","stroke-width":1},renderFlat:e.renderFlatConnector.bind(null,s),renderRev:e.renderRevConnector.bind(null,s)}},arrow:{single:{width:4,height:8,render:e.renderArrowHead,attrs:{fill:"#000000","stroke-width":0,"stroke-linejoin":"miter"}},double:{width:3,height:6,render:e.renderArrowHead,attrs:{fill:"none",stroke:"#000000","stroke-width":1,"stroke-linejoin":"miter"}},cross:{short:8,radius:4,render:e.renderCross.bind(null,{fill:"none",stroke:"#000000","stroke-width":1})}},label:{padding:4,margin:{top:2,bottom:1},attrs:{"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"middle"},loopbackAttrs:{"font-family":r,"font-size":8,"line-height":1.3}},source:{radius:2,render:({x:e,y:n,radius:r})=>t.make("circle",{cx:e,cy:n,r:r,fill:"#000000",stroke:"#000000","stroke-width":1})},mask:{padding:{top:0,left:3,right:3,bottom:1}}},titleAttrs:{"font-family":r,"font-size":20,"line-height":1.3,"text-anchor":"middle",class:"title"},agentLineAttrs:{fill:"none",stroke:"#000000","stroke-width":1}},a={padding:{top:3,bottom:2},tag:{padding:{top:2,left:4,right:4,bottom:2},boxRenderer:e.renderTag.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1,rx:3,ry:3}),labelAttrs:{"font-family":r,"font-weight":"bold","font-size":9,"line-height":1.3,"text-anchor":"left"}},label:{padding:{top:2,left:8,right:8,bottom:2},labelAttrs:{"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"left"}}},o={ref:{margin:{top:0,bottom:0},boxRenderer:e.renderRef.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":2}),section:a},"":{margin:{top:0,bottom:0},boxRenderer:n.renderBox.bind(null,{fill:"none",stroke:"#000000","stroke-width":2}),collapsedBoxRenderer:e.renderRef.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":2}),section:a,sepRenderer:n.renderLine.bind(null,{stroke:"#000000","stroke-width":2,"stroke-dasharray":"8, 4"})}},l={"font-family":r,"font-size":8,"line-height":1.3},h={text:{margin:{top:0,left:8,right:8,bottom:0},padding:{top:4,left:4,right:4,bottom:4},overlap:{left:8,right:8},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF"}),labelAttrs:l},note:{margin:{top:0,left:8,right:8,bottom:0},padding:{top:8,left:8,right:8,bottom:8},overlap:{left:8,right:8},boxRenderer:n.renderNote.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1},{fill:"none",stroke:"#000000","stroke-width":1}),labelAttrs:l},state:{margin:{top:0,left:8,right:8,bottom:0},padding:{top:8,left:8,right:8,bottom:8},overlap:{left:8,right:8},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1,rx:8,ry:8}),labelAttrs:l}},d={"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"middle"},g={"":{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:0,margin:0,render:()=>({})},line:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:8,margin:0,render:e.renderLineDivider.bind(null,{lineAttrs:{stroke:"#000000"}})},delay:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:0,margin:0,render:e.renderDelayDivider.bind(null,{dotSize:2,gapSize:2})},tear:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:8,margin:8,render:e.renderTearDivider.bind(null,{fadeBegin:4,fadeSize:4,zigWidth:4,zigHeight:1,lineAttrs:{stroke:"#000000"}})}};return class extends e{constructor(){super({name:"monospace",settings:i,blocks:o,notes:h,dividers:g})}}}),n("sequence/themes/Chunky",["./BaseTheme","svg/SVGUtilities","svg/SVGShapes"],(e,t,n)=>{"use strict";const r="sans-serif",s=new e.WavePattern(10,1),i={titleMargin:12,outerMargin:5,agentMargin:8,actionMargin:5,minActionMargin:5,agentLineHighlightRadius:4,agentCap:{box:{padding:{top:1,left:3,right:3,bottom:1},arrowBottom:11.1,boxAttrs:{fill:"#FFFFFF",stroke:"#000000","stroke-width":3,rx:4,ry:4},labelAttrs:{"font-family":r,"font-weight":"bold","font-size":14,"line-height":1.3,"text-anchor":"middle"}},cross:{size:20,render:e.renderCross.bind(null,{fill:"none",stroke:"#000000","stroke-width":3,"stroke-linecap":"round"})},bar:{height:4,render:n.renderBox.bind(null,{fill:"#000000",stroke:"#000000","stroke-width":3,rx:2,ry:2})},fade:{width:5,height:10,extend:1},none:{height:10}},connect:{loopbackRadius:8,line:{solid:{attrs:{fill:"none",stroke:"#000000","stroke-width":3},renderFlat:e.renderFlatConnector.bind(null,null),renderRev:e.renderRevConnector.bind(null,null)},dash:{attrs:{fill:"none",stroke:"#000000","stroke-width":3,"stroke-dasharray":"10, 4"},renderFlat:e.renderFlatConnector.bind(null,null),renderRev:e.renderRevConnector.bind(null,null)},wave:{attrs:{fill:"none",stroke:"#000000","stroke-width":3,"stroke-linejoin":"round","stroke-linecap":"round"},renderFlat:e.renderFlatConnector.bind(null,s),renderRev:e.renderRevConnector.bind(null,s)}},arrow:{single:{width:10,height:12,render:e.renderArrowHead,attrs:{fill:"#000000",stroke:"#000000","stroke-width":3,"stroke-linejoin":"round"}},double:{width:10,height:12,render:e.renderArrowHead,attrs:{fill:"none",stroke:"#000000","stroke-width":3,"stroke-linejoin":"round","stroke-linecap":"round"}},cross:{short:10,radius:5,render:e.renderCross.bind(null,{fill:"none",stroke:"#000000","stroke-width":3,"stroke-linejoin":"round","stroke-linecap":"round"})}},label:{padding:7,margin:{top:2,bottom:3},attrs:{"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"middle"},loopbackAttrs:{"font-family":r,"font-size":8,"line-height":1.3}},source:{radius:5,render:({x:e,y:n,radius:r})=>t.make("circle",{cx:e,cy:n,r:r,fill:"#000000",stroke:"#000000","stroke-width":3})},mask:{padding:{top:1,left:5,right:5,bottom:3}}},titleAttrs:{"font-family":r,"font-weight":"bolder","font-size":20,"line-height":1.3,"text-anchor":"middle",class:"title"},agentLineAttrs:{fill:"none",stroke:"#000000","stroke-width":3}},a={padding:{top:3,bottom:4},tag:{padding:{top:2,left:5,right:5,bottom:1},boxRenderer:e.renderTag.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":2,rx:3,ry:3}),labelAttrs:{"font-family":r,"font-weight":"bold","font-size":9,"line-height":1.3,"text-anchor":"left"}},label:{padding:{top:2,left:5,right:3,bottom:0},labelAttrs:{"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"left"}}},o={ref:{margin:{top:0,bottom:0},boxRenderer:e.renderRef.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":4,rx:5,ry:5}),section:a},"":{margin:{top:0,bottom:0},boxRenderer:n.renderBox.bind(null,{fill:"none",stroke:"#000000","stroke-width":4,rx:5,ry:5}),collapsedBoxRenderer:e.renderRef.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":4,rx:5,ry:5}),section:a,sepRenderer:n.renderLine.bind(null,{stroke:"#000000","stroke-width":2,"stroke-dasharray":"5, 3"})}},l={"font-family":r,"font-size":8,"line-height":1.3},h={text:{margin:{top:0,left:2,right:2,bottom:0},padding:{top:2,left:2,right:2,bottom:2},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF"}),labelAttrs:l},note:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:3,left:3,right:10,bottom:3},overlap:{left:10,right:10},boxRenderer:n.renderNote.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":2,"stroke-linejoin":"round"},{fill:"none",stroke:"#000000","stroke-width":1}),labelAttrs:l},state:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:5,left:7,right:7,bottom:5},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":3,rx:10,ry:10}),labelAttrs:l}},d={"font-family":r,"font-size":8,"line-height":1.3,"text-anchor":"middle"},g={"":{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:0,margin:0,render:()=>({})},line:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:10,margin:0,render:e.renderLineDivider.bind(null,{lineAttrs:{stroke:"#000000","stroke-width":2,"stroke-linecap":"round"}})},delay:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:0,margin:0,render:e.renderDelayDivider.bind(null,{dotSize:3,gapSize:3})},tear:{labelAttrs:d,padding:{top:2,left:5,right:5,bottom:2},extend:10,margin:10,render:e.renderTearDivider.bind(null,{fadeBegin:5,fadeSize:10,zigWidth:6,zigHeight:1,lineAttrs:{stroke:"#000000","stroke-width":2,"stroke-linejoin":"round"}})}};return class extends e{constructor(){super({name:"chunky",settings:i,blocks:o,notes:h,dividers:g})}}}),n("sequence/themes/HandleeFontData",[],()=>{"use strict";return{name:"Handlee",woff2:"d09GMgABAAAAAD3EAA4AAAAAi4QAAD1qAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhYbxV4cKgZgAIF8EQgKgbpIgZNlC4MGAAE2AiQDhggEIAWEDgeDKxuhdSXsmCEeByC2jBgVNYuS+mQUpZq0k+z/vyY3BgzxIa3ugqhFRlV1T4WqHliFgkLvX+Fguaf/tXTReCMU5hvZIfpErawhdoJhvGi60udSmcpUmZV+33txIHLMbEhRhomyZs7N2odsiOl7OmXseNPFL9fnzsBxPmouBP/3/Wbmvt+Om/2FCihaDcM063gCEX9NLAt4u0Mwt27RRQwYMGqMWgUxxtioahM7sANfMfL9svpDv1r7QwmKw9y7bx3k5w1Kx2CplAiGqIJEAx6gUICjf39+y0xK/qS6vwbT8sAy+yrlEHe3vNdJ+jauiqvOOWRpffhe8mecSXiGF4IGTtgLKLV2M6lzDvAXO0QkRtk8v62KREEBwaihHQPHQUZ7YfchZmHtcm8+Z6+az/v4cS/auKr51LlyEhygfzOnr94kmRQnbJcIXjvUGdVV1xbM/AtMwQWbE4NkWTgj7VNM7tsSphi6w7Xer64GAF9ZWaEQhamQGZvYSbJ32eOle7QPGCaZ8v8BQACca4LR5sPtg6JABnLj1wL8AT7Ig0UXwD88/7/XfvbvhPOLI9BloMsIxZsiDEJjTHLfvMw6c9alqsNd71f1JrRMfmuZUDJl+RESNELxW1Gh1Kq+QyiUQwiLBqH532XN5lbd0eXiwCGbNynX8me2JbTMXE2omWuTmaWEddCFA4eSW9ospRR3QvI8/vf70bJLSBvaprCxqOq7/933bfWsOurVtGuIZKolhswQGbJVhtI2JyxEQs+omyBJQJ8+owwHUkQk9Jq/DeT7/htzRkRE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tIaoz2ksFugRGjvYWy+2GWJ+E+uQEGWCW0nifgIORz05bDwEz2+EcTpEt/ESbltZDh9u8bk8JQE1DVEy0XA2irYO2lZPBw6H6HauFnDO3MMz/C1LhyUQVQzZlSEK1O60MCxHhA/5uzlDr5PBx+JaSjdQwMgpQZwWptFdOijlYbr3JAOS+5nabThuIu4DmSmae14QhnVwI+Dp23SwAhhIE9MUwZu7IYguAJUbd8Po+OpuOKHCuxG4xivyJt5PiijSx2kzNjZ1t1RXVrWJL24CCSF29dEIWx+X1Vd39ZTy1tYbGlpDT0fNJu1l/d0dqpfaV5Rd71wbN40WOkHfDW+rCus0VOUtHaFlh6uNos0bxbaWDy8Vn1VZXTlWUb2b91eV7XWsWhyNNNdm3lDK1bXdq4nbx7Rbv5Am864ZdqJRxa5GO9PHpglZjqn0ZulqqamNlzDq6nWqV1sqQ5uWZG99lRlTP3z4/iVw968DnxaQhFS/xRpWdHxXGG53OF1uj9fnPydIimZYLnARDIUjfPRyp3+9Qly8TiRT6Uw2l38kyXqD0WS2WG12hzM5JTXNle7O8GR6fVnZObl5+QWFRcVbxsZRWmHCAvOst8tco5aatNJsFy++s9uUfT5Z/09J6SJln916dWt/Z3fvttsHh/9Tudi9k8Ydc9RU19bXNWzS2NzU0tre1tHZ1dPd2993wmaDA0OGnXR/wCEPzjtDjjhu2qURx1x+3R5nnI2W/z0OAAA="}}),n("sequence/themes/Sketch",["./BaseTheme","svg/SVGUtilities","svg/SVGShapes","./HandleeFontData"],(e,t,n,r)=>{"use strict";const s="'"+r.name+"',cursive",i={normal:{stroke:"rgba(0,0,0,0.7)","stroke-width":.8,"stroke-linejoin":"round","stroke-linecap":"round"},thick:{stroke:"rgba(0,0,0,0.8)","stroke-width":1.2,"stroke-linejoin":"round","stroke-linecap":"round"}},a={titleMargin:10,outerMargin:5,agentMargin:10,actionMargin:10,minActionMargin:3,agentLineHighlightRadius:4,agentCap:{box:{padding:{top:5,left:10,right:10,bottom:5},arrowBottom:12.8,labelAttrs:{"font-family":s,"font-size":12,"line-height":1.5,"text-anchor":"middle"},boxRenderer:null},cross:{size:15,render:null},bar:{height:6,render:null},fade:{width:Math.ceil(12),height:6,extend:Math.ceil(2.5)},none:{height:10}},connect:{loopbackRadius:6,line:{solid:{attrs:Object.assign({fill:"none"},i.normal),renderFlat:null,renderRev:null},dash:{attrs:Object.assign({fill:"none","stroke-dasharray":"4, 2"},i.normal),renderFlat:null,renderRev:null},wave:{attrs:Object.assign({fill:"none","stroke-linejoin":"round","stroke-linecap":"round"},i.normal),renderFlat:null,renderRev:null}},arrow:{single:{width:5,height:6,attrs:Object.assign({fill:"rgba(0,0,0,0.9)"},i.normal),render:null},double:{width:4,height:8,attrs:Object.assign({fill:"none"},i.normal),render:null},cross:{short:5,radius:3,render:null}},label:{padding:6,margin:{top:2,bottom:1},attrs:{"font-family":s,"font-size":8,"line-height":1.5,"text-anchor":"middle"},loopbackAttrs:{"font-family":s,"font-size":8,"line-height":1.5}},source:{radius:1,render:({x:e,y:n,radius:r})=>t.make("circle",{cx:e,cy:n,r:r,fill:"#000000",stroke:"#000000","stroke-width":1})},mask:{padding:{top:0,left:3,right:3,bottom:1}}},titleAttrs:{"font-family":s,"font-size":20,"line-height":1.5,"text-anchor":"middle",class:"title"},agentLineAttrs:{fill:"none",stroke:"#000000","stroke-width":1}},o={padding:{top:3,bottom:2},tag:{padding:{top:2,left:3,right:5,bottom:0},boxRenderer:null,labelAttrs:{"font-family":s,"font-weight":"bold","font-size":9,"line-height":1.5,"text-anchor":"left"}},label:{padding:{top:2,left:5,right:3,bottom:0},labelAttrs:{"font-family":s,"font-size":8,"line-height":1.5,"text-anchor":"left"}}},l={ref:{margin:{top:0,bottom:0},boxRenderer:null,section:o},"":{margin:{top:0,bottom:0},boxRenderer:null,collapsedBoxRenderer:null,section:o,sepRenderer:null}},h={"font-family":s,"font-size":8,"line-height":1.5},d={text:{margin:{top:0,left:6,right:6,bottom:0},padding:{top:2,left:2,right:2,bottom:2},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF"}),labelAttrs:h},note:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:5,left:5,right:10,bottom:5},overlap:{left:10,right:10},boxRenderer:null,labelAttrs:h},state:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:7,left:7,right:7,bottom:7},overlap:{left:10,right:10},boxRenderer:null,labelAttrs:h}},g={"font-family":s,"font-size":8,"line-height":1.5,"text-anchor":"middle"},c={"":{labelAttrs:g,padding:{top:2,left:5,right:5,bottom:2},extend:0,margin:0,render:()=>({})},line:{labelAttrs:g,padding:{top:2,left:5,right:5,bottom:2},extend:10,margin:0,render:null},delay:{labelAttrs:g,padding:{top:2,left:5,right:5,bottom:2},extend:0,margin:0,render:e.renderDelayDivider.bind(null,{dotSize:1,gapSize:2})},tear:{labelAttrs:g,padding:{top:2,left:5,right:5,bottom:2},extend:10,margin:10,render:null}};class u{constructor(){this.s=new Uint32Array(4)}reset(){this.s[0]=394173556,this.s[1]=2926575054,this.s[2]=1022685995,this.s[3]=1178902408}nextFloat(){let e=this.s[0],t=this.s[1];const n=this.s[2],r=this.s[3];return this.s[0]=n,this.s[1]=r,e^=e<<23|t>>>9,t^=t<<23,this.s[2]=e^n^e>>>17^n>>>26,this.s[3]=t^r^(e<<15|t>>>17)^(n<<6|r>>>26),(this.s[3]+r>>>0)%4294967296/4294967296}}const p={};class f extends e.WavePattern{constructor(e,t){const n=[0,-.3,-.6,-.75,-.45,0,.45,.75,.6,.3];t!==p&&n.reverse(),super(6,n)}getDelta(e){return super.getDelta(e)+.5*Math.sin(.03*e)}}class m extends e{constructor(e=p){super({name:"",settings:a,blocks:l,notes:d,dividers:c}),e===p?(this.name="sketch",this.handedness=1):(this.name="sketch left handed",this.handedness=-1),this.random=new u,this.wave=new f(4,e),this._assignCapFunctions(),this._assignConnectFunctions(),this._assignNoteFunctions(),this._assignBlockFunctions(),this._assignDividerFunctions()}_assignCapFunctions(){this.renderBar=this.renderBar.bind(this),this.renderBox=this.renderBox.bind(this),this.agentCap.cross.render=this.renderCross.bind(this),this.agentCap.bar.render=this.renderBar,this.agentCap.box.boxRenderer=this.renderBox}_assignConnectFunctions(){this.renderArrowHead=this.renderArrowHead.bind(this),this.renderFlatConnector=this.renderFlatConnector.bind(this),this.renderRevConnector=this.renderRevConnector.bind(this),this.connect.arrow.single.render=this.renderArrowHead,this.connect.arrow.double.render=this.renderArrowHead,this.connect.arrow.cross.render=this.renderCross.bind(this),this.connect.line.solid.renderFlat=this.renderFlatConnector,this.connect.line.solid.renderRev=this.renderRevConnector,this.connect.line.dash.renderFlat=this.renderFlatConnector,this.connect.line.dash.renderRev=this.renderRevConnector,this.connect.line.wave.renderFlat=this.renderFlatConnectorWave.bind(this),this.connect.line.wave.renderRev=this.renderRevConnectorWave.bind(this)}_assignNoteFunctions(){this.notes.note.boxRenderer=this.renderNote.bind(this),this.notes.state.boxRenderer=this.renderState.bind(this)}_assignBlockFunctions(){this.renderTag=this.renderTag.bind(this),this.blocks.ref.boxRenderer=this.renderRefBlock.bind(this),this.blocks[""].boxRenderer=this.renderBlock.bind(this),this.blocks[""].collapsedBoxRenderer=this.renderCollapsedBlock.bind(this),this.blocks.ref.section.tag.boxRenderer=this.renderTag,this.blocks[""].section.tag.boxRenderer=this.renderTag,this.blocks[""].sepRenderer=this.renderSeparator.bind(this)}_assignDividerFunctions(){this.dividers.line.render=this.renderLineDivider.bind(this),this.dividers.tear.render=e.renderTearDivider.bind(null,{fadeBegin:5,fadeSize:10,pattern:this.wave,lineAttrs:i.normal})}reset(){this.random.reset()}addDefs(e){e("sketch_font",()=>{const e=document.createElement("style");return e.innerText='@font-face{font-family:"'+r.name+'";src:url("data:font/woff2;base64,'+r.woff2+'");}',e})}vary(e,t=0){if(!e)return t;const n=this.random.nextFloat();return t+2*Math.asin(2*n-1)*e/Math.PI}lineNodes(e,t,{var1:n=1,var2:r=1,varX:s=1,varY:i=1,move:a=!0}){const o=Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)),l=Math.min(.2*Math.sqrt(o),5),h=this.vary(n*s*l,e.x),d=this.vary(n*i*l,e.y),g=this.vary(r*s*l,t.x),c=this.vary(r*i*l,t.y),u=Math.max(-1,Math.min(1,(d-c)/(Math.abs(h-g)+.001)))/6+.5,p=this.vary(.5,.5)*l,f=this.vary(.5,.5)*l,m=h*(1-u)+g*u-p*this.handedness;return{nodes:(a?"M"+h+" "+d:"")+"C"+m+" "+(d*(1-u)+c*u-f)+","+g+" "+c+","+g+" "+c,p1:{x:h,y:d},p2:{x:g,y:c}}}renderLine(e,n,r){const s=this.lineNodes(e,n,r);return t.make("path",Object.assign({d:s.nodes,fill:"none","stroke-dasharray":r.dash?"6, 5":"none"},r.thick?i.thick:i.normal))}boxNodes({x:e,y:t,width:n,height:r}){const s=this.lineNodes({x:e,y:t},{x:e+n,y:t},{}),i=this.lineNodes({x:e+n,y:t+r},{x:e,y:t+r},{move:!1}),a=this.lineNodes(s.p2,i.p1,{var1:0,var2:0,move:!1}),o=this.lineNodes(i.p2,s.p1,{var1:0,var2:.3,move:!1});return s.nodes+a.nodes+i.nodes+o.nodes}renderBox(e,{fill:n=null,thick:r=!1}={}){return t.make("path",Object.assign({d:this.boxNodes(e),fill:n||"#FFFFFF"},r?i.thick:i.normal))}renderNote({x:e,y:n,width:r,height:s}){const a=this.lineNodes({x:e,y:n},{x:e+r-5,y:n},{}),o=this.lineNodes(a.p2,{x:e+r,y:n+5},{move:!1,var1:0}),l=this.lineNodes({x:e+r,y:n+s},{x:e,y:n+s},{move:!1}),h=this.lineNodes(o.p2,l.p1,{var1:0,var2:0,move:!1}),d=this.lineNodes(l.p2,a.p1,{var1:0,var2:.3,move:!1}),g=this.lineNodes(o.p1,{x:e+r-5,y:n+5},{var1:.3}),c=this.lineNodes(g.p2,o.p2,{var1:0,move:!1});return t.make("g",{},[t.make("path",Object.assign({d:a.nodes+o.nodes+h.nodes+l.nodes+d.nodes,fill:"#FFFFFF"},i.normal)),t.make("path",Object.assign({d:g.nodes+c.nodes,fill:"none"},i.normal))])}renderLineDivider({x:e,y:n,labelWidth:r,width:s,height:i}){let a=null;const o=n+i/2;return a=r>0?t.make("g",{},[this.renderLine({x:e,y:o},{x:e+(s-r)/2,y:o},{}),this.renderLine({x:e+(s+r)/2,y:o},{x:e+s,y:o},{})]):this.renderLine({x:e,y:o},{x:e+s,y:o},{}),{shape:a}}renderFlatConnector(e,{x1:n,y1:r,x2:s,y2:i}){const a=this.lineNodes({x:n,y:r},{x:s,y:i},{varX:.3});return{shape:t.make("path",Object.assign({d:a.nodes},e)),p1:a.p1,p2:a.p2}}renderRevConnector(e,{x1:n,y1:r,x2:s,y2:i,xR:a}){const o=Math.min(.06*(a-n),3),l=Math.min(.5*(a-n),6),h=n+this.vary(o,-1),d=r+this.vary(o,-1),g=a-l*this.vary(.2,1),c=r-this.vary(1,2),u=a,p=r+this.vary(1,1),f=a,m=i+this.vary(2),b=s+this.vary(o,-1),y=i+this.vary(o,-1);return{shape:t.make("path",Object.assign({d:"M"+h+" "+d+"C"+h+" "+d+","+g+" "+c+","+u+" "+p+"S"+f+" "+m+","+b+" "+y},e)),p1:{x:h,y:d},p2:{x:b,y:y}}}renderFlatConnectorWave(e,{x1:r,y1:s,x2:i,y2:a}){const o=r+this.vary(.3),l=i+this.vary(.3),h=s+this.vary(1),d=a+this.vary(1);return{shape:t.make("path",Object.assign({d:new n.PatternedLine(this.wave).move(o,h).line(l,d).cap().asPath()},e)),p1:{x:o,y:h},p2:{x:l,y:d}}}renderRevConnectorWave(e,{x1:r,y1:s,x2:i,y2:a,xR:o}){const l=r+this.vary(.3),h=i+this.vary(.3),d=s+this.vary(1),g=a+this.vary(1);return{shape:t.make("path",Object.assign({d:new n.PatternedLine(this.wave).move(l,d).line(o,s).arc(o,(s+a)/2,Math.PI).line(h,g).cap().asPath()},e)),p1:{x:l,y:d},p2:{x:h,y:g}}}renderArrowHead(e,{x:n,y:r,width:s,height:i,dir:a}){const o=s*this.vary(.2,1),l=i*this.vary(.3,1),h=o*a.dx,d=o*a.dy,g=.5*l*a.dx,c=.5*-l*a.dy,u=this.lineNodes({x:n+h-c,y:r+d-g},{x:n,y:r},{var1:2,var2:.2}),p=this.lineNodes(u.p2,{x:n+h+c,y:r+d+g},{var1:0,var2:2,move:!1}),f="none"===e.fill?{nodes:""}:this.lineNodes(p.p2,u.p1,{var1:0,var2:0,move:!1});return t.make("path",Object.assign({d:u.nodes+p.nodes+f.nodes},e))}renderState({x:e,y:n,width:r,height:s}){const a=Math.min(.06*r,3),o=Math.min(.06*s,3),l=e+a*this.vary(.6,1),h=n+o*this.vary(.6,1),d=e+r-a*this.vary(.6,1),g=n+o*this.vary(.6,1),c=e+a*this.vary(.6,1),u=n+s-o*this.vary(.6,1),p=e+r-a*this.vary(.6,1),f=n+s-o*this.vary(.6,1),m=e+r/2,b=n+s/2,y=a*this.vary(.2,1.2),x=o*this.vary(.2,1.2),k=n-Math.min(.005*r,1),w=n+s-Math.min(.01*r,2),v=e-Math.min(.01*s,2)*this.handedness,A=v+r;return t.make("path",Object.assign({d:"M"+l+" "+h+"C"+(l+y)+" "+(h-x)+","+(m-r*this.vary(.03,.3))+" "+k+","+m+" "+k+"S"+(d-y)+" "+(g-x)+","+d+" "+g+"S"+A+" "+(b-s*this.vary(.03,.3))+","+A+" "+b+"S"+(p+y)+" "+(f-x)+","+p+" "+f+"S"+(m+r*this.vary(.03,.3))+" "+w+","+m+" "+w+"S"+(c+y)+" "+(u+x)+","+c+" "+u+"S"+v+" "+(b+s*this.vary(.03,.3))+","+v+" "+b+"S"+(l-y)+" "+(h+x)+","+l+" "+h+"Z",fill:"#FFFFFF"},i.normal))}renderRefBlock(e){const n=this.boxNodes(e);return{shape:t.make("path",Object.assign({d:n,fill:"none"},i.thick)),mask:t.make("path",{d:n,fill:"#000000"}),fill:t.make("path",{d:n,fill:"#FFFFFF"})}}renderBlock(e){return this.renderBox(e,{fill:"none",thick:!0})}renderCollapsedBlock(e){return this.renderRefBlock(e)}renderTag({x:e,y:n,width:r,height:s}){const a=e+r,o=n+s,l=this.lineNodes({x:a+3,y:n},{x:a-2,y:o},{}),h=this.lineNodes(l.p2,{x:e,y:o+1},{var1:0,move:!1}),d=l.nodes+h.nodes;return t.make("g",{},[t.make("path",{d:d+"L"+e+" "+n,fill:"#FFFFFF"}),t.make("path",Object.assign({d:d,fill:"#FFFFFF"},i.normal))])}renderSeparator({x1:e,y1:t,x2:n,y2:r}){return this.renderLine({x:e,y:t},{x:n,y:r},{thick:!0,dash:!0})}renderBar({x:e,y:t,width:n,height:r}){return this.renderBox({x:e,y:t,width:n,height:r},{fill:"#000000"})}renderCross({x:e,y:n,radius:r}){const s=this.vary(.2,1)*r,a=this.lineNodes({x:e-s,y:n-s},{x:e+s,y:n+s},{}),o=this.vary(.2,1)*r,l=this.lineNodes({x:e+o,y:n-o},{x:e-o,y:n+o},{});return t.make("path",Object.assign({d:a.nodes+l.nodes,fill:"none"},i.normal))}renderAgentLine({x:e,y0:t,y1:n,width:r,className:s}){if(r>0){const i=this.renderBox({x:e-r/2,y:t,width:r,height:n-t},{fill:"none"});return i.setAttribute("class",s),i}{const r=this.renderLine({x:e,y:t},{x:e,y:n},{varY:.3});return r.setAttribute("class",s),r}}}return m.RIGHT=p,m.LEFT={},m}),n("sequence/SequenceDiagram",["core/EventObject","./Parser","./Generator","./Renderer","./Exporter","./CodeMirrorHints","./themes/BaseTheme","./themes/Basic","./themes/Monospace","./themes/Chunky","./themes/Sketch"],(e,t,n,r,s,i,a,o,l,h,d)=>{"use strict";function g(e,t="sequence"){e||(e=window.CodeMirror),e.defineMode(t,()=>b),e.registerHelper("hint",t,i.getHints)}function c(e){const t=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("metadata");return t?t.textContent:""}function u(e,t=null,n={}){if("svg"===e.tagName)return null;null===t?t=e.innerText:"object"==typeof t&&(t=(n=t).code);const r=function(e){return{namespace:e.dataset.sdNamespace||null,interactive:function(e){return void 0!==e&&"false"!==e}(e.dataset.sdInteractive)}}(e),s=new y(t,Object.assign(r,n)),i=s.dom();e.parentNode.insertBefore(i,e),e.parentNode.removeChild(e);const a=e.attributes;for(let e=0;e<a.length;++e)i.setAttribute(a[e].nodeName,a[e].nodeValue);return s}const p=[new o,new l,new h,new d(d.RIGHT),new d(d.LEFT)],f=new t,m=new n,b=f.getCodeMirrorMode();class y extends e{constructor(e=null,t={}){super(),e&&"object"==typeof e&&(e=(t=e).code),this.registerCodeMirrorMode=g,this.code=e,this.parser=f,this.generator=m,this.renderer=new r(Object.assign({themes:p},t)),this.exporter=new s,this.renderer.addEventForwarding(this),this.latestProcessed=null,this.isInteractive=!1,t.container&&t.container.appendChild(this.dom()),t.interactive&&this.addInteractivity(),"string"==typeof this.code&&this.render()}clone(e={}){return new y(Object.assign({code:this.code,container:null,themes:this.renderer.getThemes(),namespace:null,components:this.renderer.components,interactive:this.isInteractive,SVGTextBlockClass:this.renderer.SVGTextBlockClass},e))}set(e=""){this.code!==e&&(this.code=e,this.render())}process(e){const t=this.parser.parse(e);return this.generator.generate(t)}addTheme(e){this.renderer.addTheme(e)}setHighlight(e){this.renderer.setHighlight(e)}isCollapsed(e){return this.renderer.isCollapsed(e)}setCollapsed(e,t=!0,{render:n=!0}={}){return!!this.renderer.setCollapsed(e,t)&&(n&&this.latestProcessed&&this.render(this.latestProcessed),!0)}collapse(e,t){return this.setCollapsed(e,!0,t)}expand(e,t){return this.setCollapsed(e,!1,t)}toggleCollapsed(e,t){return this.setCollapsed(e,!this.isCollapsed(e),t)}expandAll(e){return this.setCollapsed(null,!1,e)}getThemeNames(){return this.renderer.getThemeNames()}getThemes(){return this.renderer.getThemes()}getSVGSynchronous(){return this.exporter.getSVGURL(this.renderer)}getSVG(){return Promise.resolve({url:this.getSVGSynchronous(),latest:!0})}getCanvas({resolution:e=1,size:t=null}={}){return t&&(this.renderer.width=t.width,this.renderer.height=t.height),new Promise(t=>{this.exporter.getCanvas(this.renderer,e,t)})}getPNG({resolution:e=1,size:t=null}={}){return t&&(this.renderer.width=t.width,this.renderer.height=t.height),new Promise(t=>{this.exporter.getPNGURL(this.renderer,e,(e,n)=>{t({url:e,latest:n})})})}getSize(){return{width:this.renderer.width,height:this.renderer.height}}render(e=null){const t=this.renderer.svg(),n=t.parentNode;document.body.contains(t)||(n&&n.removeChild(t),document.body.appendChild(t));try{e||(e=this.process(this.code)),this.renderer.render(e),this.latestProcessed=e,this.trigger("render",[this])}finally{t.parentNode!==n&&(document.body.removeChild(t),n&&n.appendChild(t))}}setContainer(e=null){const t=this.dom();t.parentNode&&t.parentNode.removeChild(t),e&&e.appendChild(t)}addInteractivity(){this.isInteractive||(this.isInteractive=!0,this.addEventListener("click",e=>{this.toggleCollapsed(e.ln)}))}extractCodeFromSVG(e){return c(e)}dom(){return this.renderer.svg()}}return Object.assign(y,{Parser:t,Generator:n,Renderer:r,Exporter:s,BaseTheme:a,themes:p,addTheme:function(e){p.push(e)},registerCodeMirrorMode:g,extractCodeFromSVG:c,convert:u,convertAll:function(e=null,t="sequence-diagram"){"string"==typeof e&&(t=e,e=null);let n=null;n=e&&void 0!==e.length?e:(e||document).getElementsByClassName(t);const r=[];for(let e=0;e<n.length;++e)r.push(n[e]);r.forEach(e=>u(e))}})}),e(["sequence/SequenceDiagram"],e=>{"use strict";const t=window.define;t&&t.amd?t(()=>e):(document.addEventListener("DOMContentLoaded",()=>{e.convertAll()},{once:!0}),window.CodeMirror&&e.registerCodeMirrorMode(window.CodeMirror),window.SequenceDiagram=e)},null,!0),n("standalone",function(){})}(); |