diff --git a/custom_plugins/mermaid/mermaid.js b/custom_plugins/mermaid/mermaid.js
new file mode 100644
index 0000000..8b51a65
--- /dev/null
+++ b/custom_plugins/mermaid/mermaid.js
@@ -0,0 +1,13 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).RevealMermaid=e()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var t={exports:{}};!function(t,e){t.exports=function(){var e;function n(){return e.apply(null,arguments)}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function s(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;for(var e in t)if(a(t,e))return;return 1}function o(t){return void 0===t}function l(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function c(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){for(var n=[],i=t.length,r=0;r>>0,i=0;i$t(t)?(a=t+1,e-$t(t)):(a=t,e),{year:a,dayOfYear:n}}function Wt(t,e,n){var i,r,a=zt(t.year(),e,n);return(a=Math.floor((t.dayOfYear()-a-1)/7)+1)<1?i=a+Ht(r=t.year()-1,e,n):a>Ht(t.year(),e,n)?(i=a-Ht(t.year(),e,n),r=t.year()+1):(r=t.year(),i=a),{week:i,year:r}}function Ht(t,e,n){var i=zt(t,e,n);return e=zt(t+1,e,n),($t(t)-i+e)/7}function qt(t,e){return t.slice(e,7).concat(t.slice(0,e))}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),U("week",5),U("isoWeek",5),dt("w",et),dt("ww",et,Q),dt("W",et),dt("WW",et,Q),bt(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=q(t)})),I("d",0,"do","day"),I("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),I("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),I("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),U("day",11),U("weekday",11),U("isoWeekday",11),dt("d",et),dt("e",et),dt("E",et),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),bt(["dd","ddd","dddd"],(function(t,e,n,i){null!=(i=n._locale.weekdaysParse(t,i,n._strict))?e.d=i:p(n).invalidWeekday=t})),bt(["d","e","E"],(function(t,e,n,i){e[i]=q(t)}));var Vt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Gt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Zt=ut,Qt=ut,Kt=ut;function Jt(){function t(t,e){return e.length-t.length}for(var e,n,i,r=[],a=[],s=[],o=[],l=0;l<7;l++)i=d([2e3,1]).day(l),e=ft(this.weekdaysMin(i,"")),n=ft(this.weekdaysShort(i,"")),i=ft(this.weekdays(i,"")),r.push(e),a.push(n),s.push(i),o.push(e),o.push(n),o.push(i);r.sort(t),a.sort(t),s.sort(t),o.sort(t),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function te(){return this.hours()%12||12}function ee(t,e){I(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function ne(t,e){return e._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,te),I("k",["kk",2],0,(function(){return this.hours()||24})),I("hmm",0,0,(function(){return""+te.apply(this)+L(this.minutes(),2)})),I("hmmss",0,0,(function(){return""+te.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)})),I("Hmm",0,0,(function(){return""+this.hours()+L(this.minutes(),2)})),I("Hmmss",0,0,(function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)})),ee("a",!0),ee("A",!1),P("hour","h"),U("hour",13),dt("a",ne),dt("A",ne),dt("H",et),dt("h",et),dt("k",et),dt("HH",et,Q),dt("hh",et,Q),dt("kk",et,Q),dt("hmm",nt),dt("hmmss",it),dt("Hmm",nt),dt("Hmmss",it),mt(["H","HH"],wt),mt(["k","kk"],(function(t,e,n){t=q(t),e[wt]=24===t?0:t})),mt(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),mt(["h","hh"],(function(t,e,n){e[wt]=q(t),p(n).bigHour=!0})),mt("hmm",(function(t,e,n){var i=t.length-2;e[wt]=q(t.substr(0,i)),e[Tt]=q(t.substr(i)),p(n).bigHour=!0})),mt("hmmss",(function(t,e,n){var i=t.length-4,r=t.length-2;e[wt]=q(t.substr(0,i)),e[Tt]=q(t.substr(i,2)),e[Ct]=q(t.substr(r)),p(n).bigHour=!0})),mt("Hmm",(function(t,e,n){var i=t.length-2;e[wt]=q(t.substr(0,i)),e[Tt]=q(t.substr(i))})),mt("Hmmss",(function(t,e,n){var i=t.length-4,r=t.length-2;e[wt]=q(t.substr(0,i)),e[Tt]=q(t.substr(i,2)),e[Ct]=q(t.substr(r))})),ut=V("Hours",!0);var ie,re={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Lt,monthsShort:Ot,week:{dow:0,doy:6},weekdays:Vt,weekdaysMin:Xt,weekdaysShort:Gt,meridiemParse:/[ap]\.?m?\.?/i},ae={},se={};function oe(t){return t&&t.toLowerCase().replace("_","-")}function le(t){for(var e,n,i,r,a=0;a=e&&function(t,e){for(var n=Math.min(t.length,e.length),i=0;i=e-1)break;e--}a++}return ie}function ce(e){var n;if(void 0===ae[e]&&t&&t.exports&&null!=e.match("^[^/\\\\]*$"))try{n=ie._abbr,function(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}("./locale/"+e),he(n)}catch(n){ae[e]=null}return ae[e]}function he(t,e){return t&&((e=o(e)?de(t):ue(t,e))?ie=e:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ie._abbr}function ue(t,e){if(null===e)return delete ae[t],null;var n,i=re;if(e.abbr=t,null!=ae[t])C("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=ae[t]._config;else if(null!=e.parentLocale)if(null!=ae[e.parentLocale])i=ae[e.parentLocale]._config;else{if(null==(n=ce(e.parentLocale)))return se[e.parentLocale]||(se[e.parentLocale]=[]),se[e.parentLocale].push({name:t,config:e}),null;i=n._config}return ae[t]=new A(S(i,e)),se[t]&&se[t].forEach((function(t){ue(t.name,t.config)})),he(t),ae[t]}function de(t){var e;if(!(t=t&&t._locale&&t._locale._abbr?t._locale._abbr:t))return ie;if(!i(t)){if(e=ce(t))return e;t=[t]}return le(t)}function pe(t){var e=t._a;return e&&-2===p(t).overflow&&(e=e[vt]<0||11Dt(e[xt],e[vt])?kt:e[wt]<0||24Ht(s,c,h)?p(r)._overflowWeeks=!0:null!=u?p(r)._overflowWeekday=!0:(d=Ut(s,o,l,c,h),r._a[xt]=d.year,r._dayOfYear=d.dayOfYear)),null!=t._dayOfYear&&(a=Ce(t._a[xt],i[xt]),(t._dayOfYear>$t(a)||0===t._dayOfYear)&&(p(t)._overflowDayOfYear=!0),u=jt(a,0,t._dayOfYear),t._a[vt]=u.getUTCMonth(),t._a[kt]=u.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=f[e]=i[e];for(;e<7;e++)t._a[e]=f[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[wt]&&0===t._a[Tt]&&0===t._a[Ct]&&0===t._a[Et]&&(t._nextDay=!0,t._a[wt]=0),t._d=(t._useUTC?jt:Yt).apply(null,f),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[wt]=24),t._w&&void 0!==t._w.d&&t._w.d!==s&&(p(t).weekdayMismatch=!0)}}function Se(t){if(t._f===n.ISO_8601)ke(t);else if(t._f===n.RFC_2822)Te(t);else{t._a=[],p(t).empty=!0;for(var e,i,r,s,o,l=""+t._i,c=l.length,h=0,u=R(t._f,t._locale).match(O)||[],d=u.length,f=0;ft.valueOf():t.valueOf()"}),Z.toJSON=function(){return this.isValid()?this.toISOString():null},Z.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Z.unix=function(){return Math.floor(this.valueOf()/1e3)},Z.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Z.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Z.eraName=function(){for(var t,e=this.localeData().eras(),n=0,i=e.length;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Z.isLocal=function(){return!!this.isValid()&&!this._isUTC},Z.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Z.isUtc=je,Z.isUTC=je,Z.zoneAbbr=function(){return this._isUTC?"UTC":""},Z.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Z.dates=w("dates accessor is deprecated. Use date instead.",at),Z.months=w("months accessor is deprecated. Use month instead",Ft),Z.years=w("years accessor is deprecated. Use year instead",Pt),Z.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?(this.utcOffset(t="string"!=typeof t?-t:t,e),this):-this.utcOffset()})),Z.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var t,e={};return _(e,this),(e=Ae(e))._a?(t=(e._isUTC?d:Le)(e._a),this._isDSTShifted=this.isValid()&&0e?1:t>=e?0:NaN}function d(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function p(t){let e,n,i;function r(t,i,r=0,a=t.length){if(r>>1;n(t[e],i)<0?r=e+1:a=e}while(ru(t(e),n),i=(e,n)=>t(e)-n):(e=t===u||t===d?t:f,n=t,i=t),{left:r,center:function(t,e,n=0,a=t.length){const s=r(t,e,n,a-1);return s>n&&i(t[s-1],e)>-i(t[s],e)?s-1:s},right:function(t,i,r=0,a=t.length){if(r>>1;n(t[e],i)<=0?r=e+1:a=e}while(r-1}(e))return e;var n=e.match(l);if(!n)return e;var i=n[0];return r.test(i)?"about:blank":e};const g=p(u).right;p((function(t){return null===t?NaN:+t})).center;var y=g;class m extends Map{constructor(t,e=_){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(b(this,t))}has(t){return super.has(b(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const i=e(n);t.has(i)&&(n=t.get(i),t.delete(i));return n}(this,t))}}function b({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function _(t){return null!==t&&"object"==typeof t?t.valueOf():t}const x=Math.sqrt(50),v=Math.sqrt(10),k=Math.sqrt(2);function w(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),a=i/Math.pow(10,r),s=a>=x?10:a>=v?5:a>=k?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/s,o=Math.round(t*c),l=Math.round(e*c),o/ce&&--l,c=-c):(c=Math.pow(10,r)*s,o=Math.round(t/c),l=Math.round(e/c),o*ce&&--l),l=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n=r)&&(n=r)}return n}function S(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function A(t){return t}var D=1,L=2,O=3,N=4,M=1e-6;function B(t){return"translate("+t+",0)"}function I(t){return"translate(0,"+t+")"}function F(t){return e=>+t(e)}function R(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function $(){return!this.__axis}function P(t,e){var n=[],i=null,r=null,a=6,s=6,o=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=t===D||t===N?-1:1,h=t===N||t===L?"x":"y",u=t===D||t===O?B:I;function d(d){var p=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,f=null==r?e.tickFormat?e.tickFormat.apply(e,n):A:r,g=Math.max(a,0)+o,y=e.range(),m=+y[0]+l,b=+y[y.length-1]+l,_=(e.bandwidth?R:F)(e.copy(),l),x=d.selection?d.selection():d,v=x.selectAll(".domain").data([null]),k=x.selectAll(".tick").data(p,e).order(),w=k.exit(),T=k.enter().append("g").attr("class","tick"),C=k.select("line"),E=k.select("text");v=v.merge(v.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(T),C=C.merge(T.append("line").attr("stroke","currentColor").attr(h+"2",c*a)),E=E.merge(T.append("text").attr("fill","currentColor").attr(h,c*g).attr("dy",t===D?"0em":t===O?"0.71em":"0.32em")),d!==x&&(v=v.transition(d),k=k.transition(d),C=C.transition(d),E=E.transition(d),w=w.transition(d).attr("opacity",M).attr("transform",(function(t){return isFinite(t=_(t))?u(t+l):this.getAttribute("transform")})),T.attr("opacity",M).attr("transform",(function(t){var e=this.parentNode.__axis;return u((e&&isFinite(e=e(t))?e:_(t))+l)}))),w.remove(),v.attr("d",t===N||t===L?s?"M"+c*s+","+m+"H"+l+"V"+b+"H"+c*s:"M"+l+","+m+"V"+b:s?"M"+m+","+c*s+"V"+l+"H"+b+"V"+c*s:"M"+m+","+l+"H"+b),k.attr("opacity",1).attr("transform",(function(t){return u(_(t)+l)})),C.attr(h+"2",c*a),E.attr(h,c*g).text(f),x.filter($).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===L?"start":t===N?"end":"middle"),x.each((function(){this.__axis=_}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(a=s=+t,d):a},d.tickSizeInner=function(t){return arguments.length?(a=+t,d):a},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(o=+t,d):o},d.offset=function(t){return arguments.length?(l=+t,d):l},d}var Y={value:()=>{}};function j(){for(var t,e=0,n=arguments.length,i={};e=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",i),a=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,i,r=new Array(n),a=0;a=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),q.hasOwnProperty(e)?{space:q[e],local:t}:t}function G(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===H&&e.documentElement.namespaceURI===H?e.createElement(t):e.createElementNS(n,t)}}function X(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Z(t){var e=V(t);return(e.local?X:G)(e)}function Q(){}function K(t){return null==t?Q:function(){return this.querySelector(t)}}function J(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function tt(){return[]}function et(t){return null==t?tt:function(){return this.querySelectorAll(t)}}function nt(t){return function(){return this.matches(t)}}function it(t){return function(e){return e.matches(t)}}var rt=Array.prototype.find;function at(){return this.firstElementChild}var st=Array.prototype.filter;function ot(){return Array.from(this.children)}function lt(t){return new Array(t.length)}function ct(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function ht(t,e,n,i,r,a){for(var s,o=0,l=e.length,c=a.length;oe?1:t>=e?0:NaN}function gt(t){return function(){this.removeAttribute(t)}}function yt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function mt(t,e){return function(){this.setAttribute(t,e)}}function bt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function _t(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function xt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function vt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function kt(t){return function(){this.style.removeProperty(t)}}function wt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Tt(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Ct(t,e){return t.style.getPropertyValue(e)||vt(t).getComputedStyle(t,null).getPropertyValue(e)}function Et(t){return function(){delete this[t]}}function St(t,e){return function(){this[t]=e}}function At(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Dt(t){return t.trim().split(/^|\s+/)}function Lt(t){return t.classList||new Ot(t)}function Ot(t){this._node=t,this._names=Dt(t.getAttribute("class")||"")}function Nt(t,e){for(var n=Lt(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var te=[null];function ee(t,e){this._groups=t,this._parents=e}function ne(){return new ee([[document.documentElement]],te)}function ie(t){return"string"==typeof t?new ee([[document.querySelector(t)]],[document.documentElement]):new ee([[t]],te)}function re(t){return"string"==typeof t?new ee([document.querySelectorAll(t)],[document.documentElement]):new ee([J(t)],te)}function ae(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function se(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function oe(){}ee.prototype=ne.prototype={constructor:ee,select:function(t){"function"!=typeof t&&(t=K(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=x&&(x=_+1);!(b=y[x])&&++x=0;)(i=r[a])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ft);for(var n=this._groups,i=n.length,r=new Array(i),a=0;a1?this.each((null==e?kt:"function"==typeof e?Tt:wt)(t,e,null==n?"":n)):Ct(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Et:"function"==typeof e?At:St)(t,e)):this.node()[t]},classed:function(t,e){var n=Dt(t+"");if(arguments.length<2){for(var i=Lt(this.node()),r=-1,a=n.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),s=a.length;if(!(arguments.length<2)){for(o=e?Zt:Xt,i=0;i>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ce(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ce(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=fe.exec(t))?new Ae(e[1],e[2],e[3],1):(e=ge.exec(t))?new Ae(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ye.exec(t))?Ce(e[1],e[2],e[3],e[4]):(e=me.exec(t))?Ce(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=be.exec(t))?Be(e[1],e[2]/100,e[3]/100,1):(e=_e.exec(t))?Be(e[1],e[2]/100,e[3]/100,e[4]):xe.hasOwnProperty(t)?Te(xe[t]):"transparent"===t?new Ae(NaN,NaN,NaN,0):null}function Te(t){return new Ae(t>>16&255,t>>8&255,255&t,1)}function Ce(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ae(t,e,n,i)}function Ee(t){return t instanceof oe||(t=we(t)),t?new Ae((t=t.rgb()).r,t.g,t.b,t.opacity):new Ae}function Se(t,e,n,i){return 1===arguments.length?Ee(t):new Ae(t,e,n,null==i?1:i)}function Ae(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function De(){return`#${Me(this.r)}${Me(this.g)}${Me(this.b)}`}function Le(){const t=Oe(this.opacity);return`${1===t?"rgb(":"rgba("}${Ne(this.r)}, ${Ne(this.g)}, ${Ne(this.b)}${1===t?")":`, ${t})`}`}function Oe(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ne(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Me(t){return((t=Ne(t))<16?"0":"")+t.toString(16)}function Be(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Fe(t,e,n,i)}function Ie(t){if(t instanceof Fe)return new Fe(t.h,t.s,t.l,t.opacity);if(t instanceof oe||(t=we(t)),!t)return new Fe;if(t instanceof Fe)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),s=NaN,o=a-r,l=(a+r)/2;return o?(s=e===a?(n-i)/o+6*(n0&&l<1?0:s,new Fe(s,o,l,t.opacity)}function Fe(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Re(t){return(t=(t||0)%360)<0?t+360:t}function $e(t){return Math.max(0,Math.min(1,t||0))}function Pe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}ae(oe,we,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ve,formatHex:ve,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ie(this).formatHsl()},formatRgb:ke,toString:ke}),ae(Ae,Se,se(oe,{brighter(t){return t=null==t?ce:Math.pow(ce,t),new Ae(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?le:Math.pow(le,t),new Ae(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ae(Ne(this.r),Ne(this.g),Ne(this.b),Oe(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:De,formatHex:De,formatHex8:function(){return`#${Me(this.r)}${Me(this.g)}${Me(this.b)}${Me(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Le,toString:Le})),ae(Fe,(function(t,e,n,i){return 1===arguments.length?Ie(t):new Fe(t,e,n,null==i?1:i)}),se(oe,{brighter(t){return t=null==t?ce:Math.pow(ce,t),new Fe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?le:Math.pow(le,t),new Fe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ae(Pe(t>=240?t-240:t+120,r,i),Pe(t,r,i),Pe(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Fe(Re(this.h),$e(this.s),$e(this.l),Oe(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Oe(this.opacity);return`${1===t?"hsl(":"hsla("}${Re(this.h)}, ${100*$e(this.s)}%, ${100*$e(this.l)}%${1===t?")":`, ${t})`}`}}));const Ye=Math.PI/180,je=180/Math.PI,ze=.96422,Ue=1,We=.82521,He=4/29,qe=6/29,Ve=3*qe*qe,Ge=qe*qe*qe;function Xe(t){if(t instanceof Ze)return new Ze(t.l,t.a,t.b,t.opacity);if(t instanceof nn)return rn(t);t instanceof Ae||(t=Ee(t));var e,n,i=tn(t.r),r=tn(t.g),a=tn(t.b),s=Qe((.2225045*i+.7168786*r+.0606169*a)/Ue);return i===r&&r===a?e=n=s:(e=Qe((.4360747*i+.3850649*r+.1430804*a)/ze),n=Qe((.0139322*i+.0971045*r+.7141733*a)/We)),new Ze(116*s-16,500*(e-s),200*(s-n),t.opacity)}function Ze(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function Qe(t){return t>Ge?Math.pow(t,1/3):t/Ve+He}function Ke(t){return t>qe?t*t*t:Ve*(t-He)}function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function tn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function en(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof nn)return new nn(t.h,t.c,t.l,t.opacity);if(t instanceof Ze||(t=Xe(t)),0===t.a&&0===t.b)return new nn(NaN,0()=>t;function sn(t,e){return function(n){return t+n*e}}function on(t){return 1==(t=+t)?ln:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):an(isNaN(e)?n:e)}}function ln(t,e){var n=e-t;return n?sn(t,n):an(isNaN(t)?e:t)}var cn=function t(e){var n=on(e);function i(t,e){var i=n((t=Se(t)).r,(e=Se(e)).r),r=n(t.g,e.g),a=n(t.b,e.b),s=ln(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=a(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function hn(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(a){for(n=0;na&&(r=e.slice(a,r),o[s]?o[s]+=r:o[++s]=r),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:pn(n,i)})),a=yn.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(r(n)+"rotate(",null,i)-2,x:pn(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(a.rotate,s.rotate,o,l),function(t,e,n,a){t!==e?a.push({i:n.push(r(n)+"skewX(",null,i)-2,x:pn(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(a.skewX,s.skewX,o,l),function(t,e,n,i,a,s){if(t!==n||e!==i){var o=a.push(r(a)+"scale(",null,",",null,")");s.push({i:o-4,x:pn(t,n)},{i:o-2,x:pn(e,i)})}else 1===n&&1===i||a.push(r(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,o,l),a=s=null,function(t){for(var e,n=-1,i=l.length;++n180||n<-180?n-360*Math.round(n/360):n):an(isNaN(t)?e:t)})),Ln=0,On=0,Nn=0,Mn=1e3,Bn=0,In=0,Fn=0,Rn="object"==typeof performance&&performance.now?performance:Date,$n="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Pn(){return In||($n(Yn),In=Rn.now()+Fn)}function Yn(){In=0}function jn(){this._call=this._time=this._next=null}function zn(t,e,n){var i=new jn;return i.restart(t,e,n),i}function Un(){In=(Bn=Rn.now())+Fn,Ln=On=0;try{!function(){Pn(),++Ln;for(var t,e=Sn;e;)(t=In-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ln}()}finally{Ln=0,function(){var t,e,n=Sn,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Sn=e);An=t,Hn(i)}(),In=0}}function Wn(){var t=Rn.now(),e=t-Bn;e>Mn&&(Fn-=e,Bn=t)}function Hn(t){Ln||(On&&(On=clearTimeout(On)),t-In>24?(t<1/0&&(On=setTimeout(Un,t-Rn.now()-Fn)),Nn&&(Nn=clearInterval(Nn))):(Nn||(Bn=Rn.now(),Nn=setInterval(Wn,Mn)),Ln=1,$n(Un)))}function qn(t,e,n){var i=new jn;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}jn.prototype=zn.prototype={constructor:jn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Pn():+n)+(null==e?0:+e),this._next||An===this||(An?An._next=this:Sn=this,An=this),this._call=t,this._time=n,Hn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hn())}};var Vn=j("start","end","cancel","interrupt"),Gn=[],Xn=0,Zn=1,Qn=2,Kn=3,Jn=4,ti=5,ei=6;function ni(t,e,n,i,r,a){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function a(t){n.state=Zn,n.timer.restart(s,n.delay,n.time),n.delay<=t&&s(t-n.delay)}function s(a){var c,h,u,d;if(n.state!==Zn)return l();for(c in r)if((d=r[c]).name===n.name){if(d.state===Kn)return qn(s);d.state===Jn?(d.state=ei,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+cXn)throw new Error("too late; already scheduled");return n}function ri(t,e){var n=ai(t,e);if(n.state>Kn)throw new Error("too late; already running");return n}function ai(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function si(t,e){var n,i;return function(){var r=ri(this,t),a=r.tween;if(a!==n)for(var s=0,o=(i=n=a).length;s=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ii:ri;return function(){var s=a(this,t),o=s.on;o!==i&&(r=(i=o).copy()).on(e,n),s.on=r}}(n,t,e))},attr:function(t,e){var n=V(t),i="transform"===n?En:ci;return this.attrTween(t,"function"==typeof e?(n.local?gi:fi)(n,i,li(this,"attr."+t,e)):null==e?(n.local?ui:hi)(n):(n.local?pi:di)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=V(t);return this.tween(n,(i.local?yi:mi)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Cn:ci;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var a=Ct(this,t),s=(this.style.removeProperty(t),Ct(this,t));return a===s?null:a===n&&s===i?r:r=e(n=a,i=s)}}(t,i)).on("end.style."+t,wi(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,a;return function(){var s=Ct(this,t),o=n(this),l=o+"";return null==o&&(this.style.removeProperty(t),l=o=Ct(this,t)),s===l?null:s===i&&l===r?a:(r=l,a=e(i=s,o))}}(t,i,li(this,"style."+t,e))).each(function(t,e){var n,i,r,a,s="style."+e,o="end."+s;return function(){var l=ri(this,t),c=l.on,h=null==l.value[s]?a||(a=wi(e)):void 0;c===n&&r===h||(i=(n=c).copy()).on(o,r=h),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,a=n+"";return function(){var s=Ct(this,t);return s===a?null:s===i?r:r=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function a(){var a=e.apply(this,arguments);return a!==r&&(i=(r=a)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,a,n)),i}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(li(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=ai(this.node(),n).tween,a=0,s=r.length;aQn&&n.state=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Bi;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;eNi)if(Math.abs(h*o-l*c)>Ni&&r){let d=n-a,p=i-s,f=o*o+l*l,g=d*d+p*p,y=Math.sqrt(f),m=Math.sqrt(u),b=r*Math.tan((Li-Math.acos((f+u-g)/(2*y*m)))/2),_=b/m,x=b/y;Math.abs(_-1)>Ni&&this._append`L${t+_*c},${e+_*h}`,this._append`A${r},${r},0,0,${+(h*d>c*p)},${this._x1=t+x*o},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,i,r,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),o=n*Math.sin(i),l=t+s,c=e+o,h=1^a,u=a?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Ni||Math.abs(this._y1-c)>Ni)&&this._append`L${l},${c}`,n&&(u<0&&(u=u%Oi+Oi),u>Mi?this._append`A${n},${n},0,1,${h},${t-s},${e-o}A${n},${n},0,1,${h},${this._x1=l},${this._y1=c}`:u>Ni&&this._append`A${n},${n},0,${+(u>=Li)},${h},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Fi(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Ri(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function $i(t){return(t=Ri(Math.abs(t)))?t[1]:NaN}var Pi,Yi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ji(t){if(!(e=Yi.exec(t)))throw new Error("invalid format: "+t);var e;return new zi({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function zi(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ui(t,e){var n=Ri(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}ji.prototype=zi.prototype,zi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Wi={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ui(100*t,e),r:Ui,s:function(t,e){var n=Ri(t,e);if(!n)return t+"";var i=n[0],r=n[1],a=r-(Pi=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return a===s?i:a>s?i+new Array(a-s+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+Ri(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Hi(t){return t}var qi,Vi,Gi,Xi=Array.prototype.map,Zi=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Qi(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Hi:(e=Xi.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,a=[],s=0,o=e[0],l=0;r>0&&o>0&&(l+o+1>i&&(o=Math.max(1,i-l)),a.push(t.substring(r-=o,r+o)),!((l+=o+1)>i));)o=e[s=(s+1)%e.length];return a.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Hi:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Xi.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=ji(t)).fill,n=t.align,u=t.sign,d=t.symbol,p=t.zero,f=t.width,g=t.comma,y=t.precision,m=t.trim,b=t.type;"n"===b?(g=!0,b="g"):Wi[b]||(void 0===y&&(y=12),m=!0,b="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var _="$"===d?r:"#"===d&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",x="$"===d?a:/[%p]/.test(b)?l:"",v=Wi[b],k=/[defgprs%]/.test(b);function w(t){var r,a,l,d=_,w=x;if("c"===b)w=v(t)+w,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:v(Math.abs(t),y),m&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),T&&0==+t&&"+"!==u&&(T=!1),d=(T?"("===u?u:c:"-"===u||"("===u?"":u)+d,w=("s"===b?Zi[8+Pi/3]:"")+w+(T&&"("===u?")":""),k)for(r=-1,a=t.length;++r(l=t.charCodeAt(r))||l>57){w=(46===l?s+t.slice(r+1):t.slice(r))+w,t=t.slice(0,r);break}}g&&!p&&(t=i(t,1/0));var C=d.length+t.length+w.length,E=C>1)+d+t+w+E.slice(C);break;default:t=E+d+t+w}return o(t)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),w.toString=function(){return t+""},w}return{format:u,formatPrefix:function(t,e){var n=u(((t=ji(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor($i(e)/3))),r=Math.pow(10,-i),a=Zi[8+i/3];return function(t){return n(r*t)+a}}}}function Ki(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}qi=Qi({thousands:",",grouping:[3],currency:["$",""]}),Vi=qi.format,Gi=qi.formatPrefix;const Ji=Symbol("implicit");function tr(){var t=new m,e=[],n=[],i=Ji;function r(r){let a=t.get(r);if(void 0===a){if(i!==Ji)return i;t.set(r,a=e.push(r)-1)}return n[a%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new m;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return tr(e,n).unknown(i)},Ki.apply(r,arguments),r}function er(t){return+t}var nr=[0,1];function ir(t){return t}function rr(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function ar(t,e,n){var i=t[0],r=t[1],a=e[0],s=e[1];return re&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?sr:ar,r=a=null,u}function u(e){return null==e||isNaN(e=+e)?n:(r||(r=i(s.map(t),o,l)))(t(c(e)))}return u.invert=function(n){return c(e((a||(a=i(o,s.map(t),pn)))(n)))},u.domain=function(t){return arguments.length?(s=Array.from(t,er),h()):s.slice()},u.range=function(t){return arguments.length?(o=Array.from(t),h()):o.slice()},u.rangeRound=function(t){return o=Array.from(t),l=_n,h()},u.clamp=function(t){return arguments.length?(c=!!t||ir,h()):c!==ir},u.interpolate=function(t){return arguments.length?(l=t,h()):l},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,i){return t=n,e=i,h()}}function cr(){return lr()(ir,ir)}function hr(t,e,n,i){var r,a=C(t,e,n);switch((i=ji(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor($i(e)/3)))-$i(Math.abs(t)))}(a,s))||(i.precision=r),Gi(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,$i(e)-$i(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-$i(Math.abs(t)))}(a))||(i.precision=r-2*("%"===i.type))}return Vi(i)}function ur(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const i=e=r))return[];const o=a-r+1,l=new Array(o);if(i)if(s<0)for(let t=0;t0;){if((r=T(l,c,n))===i)return a[s]=l,a[o]=c,e(a);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function dr(){var t=cr();return t.copy=function(){return or(t,dr())},Ki.apply(t,arguments),ur(t)}const pr=new Date,fr=new Date;function gr(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,a)=>{const s=[];if(n=r.ceil(n),a=null==a?1:Math.floor(a),!(n0))return s;let o;do{s.push(o=new Date(+n)),e(n,a),t(n)}while(ogr((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(pr.setTime(+e),fr.setTime(+i),t(pr),t(fr),Math.floor(n(pr,fr))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t==0:e=>r.count(0,e)%t==0):r:null)),r}const yr=gr((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));yr.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?gr((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):yr:null),yr.range;const mr=1e3,br=60*mr,_r=60*br,xr=24*_r,vr=7*xr,kr=30*xr,wr=365*xr,Tr=gr((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*mr)}),((t,e)=>(e-t)/mr),(t=>t.getUTCSeconds()));Tr.range;const Cr=gr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mr)}),((t,e)=>{t.setTime(+t+e*br)}),((t,e)=>(e-t)/br),(t=>t.getMinutes()));Cr.range;const Er=gr((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*br)}),((t,e)=>(e-t)/br),(t=>t.getUTCMinutes()));Er.range;const Sr=gr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mr-t.getMinutes()*br)}),((t,e)=>{t.setTime(+t+e*_r)}),((t,e)=>(e-t)/_r),(t=>t.getHours()));Sr.range;const Ar=gr((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*_r)}),((t,e)=>(e-t)/_r),(t=>t.getUTCHours()));Ar.range;const Dr=gr((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*br)/xr),(t=>t.getDate()-1));Dr.range;const Lr=gr((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/xr),(t=>t.getUTCDate()-1));Lr.range;const Or=gr((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/xr),(t=>Math.floor(t/xr)));function Nr(t){return gr((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*br)/vr))}Or.range;const Mr=Nr(0),Br=Nr(1),Ir=Nr(2),Fr=Nr(3),Rr=Nr(4),$r=Nr(5),Pr=Nr(6);function Yr(t){return gr((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/vr))}Mr.range,Br.range,Ir.range,Fr.range,Rr.range,$r.range,Pr.range;const jr=Yr(0),zr=Yr(1),Ur=Yr(2),Wr=Yr(3),Hr=Yr(4),qr=Yr(5),Vr=Yr(6);jr.range,zr.range,Ur.range,Wr.range,Hr.range,qr.range,Vr.range;const Gr=gr((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()));Gr.range;const Xr=gr((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));Xr.range;const Zr=gr((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));Zr.every=t=>isFinite(t=Math.floor(t))&&t>0?gr((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,Zr.range;const Qr=gr((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));function Kr(t,e,n,i,r,a){const s=[[Tr,1,mr],[Tr,5,5*mr],[Tr,15,15*mr],[Tr,30,30*mr],[a,1,br],[a,5,5*br],[a,15,15*br],[a,30,30*br],[r,1,_r],[r,3,3*_r],[r,6,6*_r],[r,12,12*_r],[i,1,xr],[i,2,2*xr],[n,1,vr],[e,1,kr],[e,3,3*kr],[t,1,wr]];function o(e,n,i){const r=Math.abs(n-e)/i,a=p((([,,t])=>t)).right(s,r);if(a===s.length)return t.every(C(e/wr,n/wr,i));if(0===a)return yr.every(Math.max(C(e,n,i),1));const[o,l]=s[r/s[a-1][2]isFinite(t=Math.floor(t))&&t>0?gr((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Qr.range,Kr(Qr,Xr,jr,Or,Ar,Er);const[Jr,ta]=Kr(Zr,Gr,Mr,Dr,Sr,Cr);function ea(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function na(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ia(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var ra,aa,sa={"-":"",_:" ",0:"0"},oa=/^\s*\d+/,la=/^%/,ca=/[\\^$*+?|[\]().{}]/g;function ha(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",a=r.length;return i+(a[t.toLowerCase(),e])))}function fa(t,e,n){var i=oa.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function ga(t,e,n){var i=oa.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function ya(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function ma(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function ba(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function _a(t,e,n){var i=oa.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function xa(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function va(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function ka(t,e,n){var i=oa.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function wa(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Ta(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Ca(t,e,n){var i=oa.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Ea(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Sa(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Aa(t,e,n){var i=oa.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Da(t,e,n){var i=oa.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function La(t,e,n){var i=oa.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Oa(t,e,n){var i=la.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function Na(t,e,n){var i=oa.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Ma(t,e,n){var i=oa.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Ba(t,e){return ha(t.getDate(),e,2)}function Ia(t,e){return ha(t.getHours(),e,2)}function Fa(t,e){return ha(t.getHours()%12||12,e,2)}function Ra(t,e){return ha(1+Dr.count(Zr(t),t),e,3)}function $a(t,e){return ha(t.getMilliseconds(),e,3)}function Pa(t,e){return $a(t,e)+"000"}function Ya(t,e){return ha(t.getMonth()+1,e,2)}function ja(t,e){return ha(t.getMinutes(),e,2)}function za(t,e){return ha(t.getSeconds(),e,2)}function Ua(t){var e=t.getDay();return 0===e?7:e}function Wa(t,e){return ha(Mr.count(Zr(t)-1,t),e,2)}function Ha(t){var e=t.getDay();return e>=4||0===e?Rr(t):Rr.ceil(t)}function qa(t,e){return t=Ha(t),ha(Rr.count(Zr(t),t)+(4===Zr(t).getDay()),e,2)}function Va(t){return t.getDay()}function Ga(t,e){return ha(Br.count(Zr(t)-1,t),e,2)}function Xa(t,e){return ha(t.getFullYear()%100,e,2)}function Za(t,e){return ha((t=Ha(t)).getFullYear()%100,e,2)}function Qa(t,e){return ha(t.getFullYear()%1e4,e,4)}function Ka(t,e){var n=t.getDay();return ha((t=n>=4||0===n?Rr(t):Rr.ceil(t)).getFullYear()%1e4,e,4)}function Ja(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ha(e/60|0,"0",2)+ha(e%60,"0",2)}function ts(t,e){return ha(t.getUTCDate(),e,2)}function es(t,e){return ha(t.getUTCHours(),e,2)}function ns(t,e){return ha(t.getUTCHours()%12||12,e,2)}function is(t,e){return ha(1+Lr.count(Qr(t),t),e,3)}function rs(t,e){return ha(t.getUTCMilliseconds(),e,3)}function as(t,e){return rs(t,e)+"000"}function ss(t,e){return ha(t.getUTCMonth()+1,e,2)}function os(t,e){return ha(t.getUTCMinutes(),e,2)}function ls(t,e){return ha(t.getUTCSeconds(),e,2)}function cs(t){var e=t.getUTCDay();return 0===e?7:e}function hs(t,e){return ha(jr.count(Qr(t)-1,t),e,2)}function us(t){var e=t.getUTCDay();return e>=4||0===e?Hr(t):Hr.ceil(t)}function ds(t,e){return t=us(t),ha(Hr.count(Qr(t),t)+(4===Qr(t).getUTCDay()),e,2)}function ps(t){return t.getUTCDay()}function fs(t,e){return ha(zr.count(Qr(t)-1,t),e,2)}function gs(t,e){return ha(t.getUTCFullYear()%100,e,2)}function ys(t,e){return ha((t=us(t)).getUTCFullYear()%100,e,2)}function ms(t,e){return ha(t.getUTCFullYear()%1e4,e,4)}function bs(t,e){var n=t.getUTCDay();return ha((t=n>=4||0===n?Hr(t):Hr.ceil(t)).getUTCFullYear()%1e4,e,4)}function _s(){return"+0000"}function xs(){return"%"}function vs(t){return+t}function ks(t){return Math.floor(+t/1e3)}function ws(t){return new Date(t)}function Ts(t){return t instanceof Date?+t:+new Date(+t)}function Cs(t,e,n,i,r,a,s,o,l,c){var h=cr(),u=h.invert,d=h.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),y=c("%I %p"),m=c("%a %d"),b=c("%b %d"),_=c("%B"),x=c("%Y");function v(t){return(l(t)=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:vs,s:ks,S:za,u:Ua,U:Wa,V:qa,w:Va,W:Ga,x:null,X:null,y:Xa,Y:Qa,Z:Ja,"%":xs},x={a:function(t){return s[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return o[t.getUTCMonth()]},c:null,d:ts,e:ts,f:as,g:ys,G:bs,H:es,I:ns,j:is,L:rs,m:ss,M:os,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:vs,s:ks,S:ls,u:cs,U:hs,V:ds,w:ps,W:fs,x:null,X:null,y:gs,Y:ms,Z:_s,"%":xs},v={a:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.w=f.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=b.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return T(t,e,n,i)},d:Ta,e:Ta,f:La,g:xa,G:_a,H:Ea,I:Ea,j:Ca,L:Da,m:wa,M:Sa,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=h.get(i[0].toLowerCase()),n+i[0].length):-1},q:ka,Q:Na,s:Ma,S:Aa,u:ga,U:ya,V:ma,w:fa,W:ba,x:function(t,e,i){return T(t,n,e,i)},X:function(t,e,n){return T(t,i,e,n)},y:xa,Y:_a,Z:va,"%":Oa};function k(t,e){return function(n){var i,r,a,s=[],o=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++o53)return null;"w"in a||(a.w=1),"Z"in a?(r=(i=na(ia(a.y,0,1))).getUTCDay(),i=r>4||0===r?zr.ceil(i):zr(i),i=Lr.offset(i,7*(a.V-1)),a.y=i.getUTCFullYear(),a.m=i.getUTCMonth(),a.d=i.getUTCDate()+(a.w+6)%7):(r=(i=ea(ia(a.y,0,1))).getDay(),i=r>4||0===r?Br.ceil(i):Br(i),i=Dr.offset(i,7*(a.V-1)),a.y=i.getFullYear(),a.m=i.getMonth(),a.d=i.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),r="Z"in a?na(ia(a.y,0,1)).getUTCDay():ea(ia(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(r+5)%7:a.w+7*a.U-(r+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,na(a)):ea(a)}}function T(t,e,n,i){for(var r,a,s=0,o=e.length,l=n.length;s=l)return-1;if(37===(r=e.charCodeAt(s++))){if(r=e.charAt(s++),!(a=v[r in sa?e.charAt(s++):r])||(i=a(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return _.x=k(n,_),_.X=k(i,_),_.c=k(e,_),x.x=k(n,x),x.X=k(i,x),x.c=k(e,x),{format:function(t){var e=k(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=w(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=k(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=w(t+="",!0);return e.toString=function(){return t},e}}}(t),aa=ra.format,ra.parse,ra.utcFormat,ra.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});const As=Math.abs,Ds=Math.atan2,Ls=Math.cos,Os=Math.max,Ns=Math.min,Ms=Math.sin,Bs=Math.sqrt,Is=1e-12,Fs=Math.PI,Rs=Fs/2,$s=2*Fs;function Ps(t){return t>=1?Rs:t<=-1?-Rs:Math.asin(t)}function Ys(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Ii(e)}function js(t){return t.innerRadius}function zs(t){return t.outerRadius}function Us(t){return t.startAngle}function Ws(t){return t.endAngle}function Hs(t){return t&&t.padAngle}function qs(t,e,n,i,r,a,s){var o=t-n,l=e-i,c=(s?a:-a)/Bs(o*o+l*l),h=c*l,u=-c*o,d=t+h,p=e+u,f=n+h,g=i+u,y=(d+f)/2,m=(p+g)/2,b=f-d,_=g-p,x=b*b+_*_,v=r-a,k=d*g-f*p,w=(_<0?-1:1)*Bs(Os(0,v*v*x-k*k)),T=(k*_-b*w)/x,C=(-k*b-_*w)/x,E=(k*_+b*w)/x,S=(-k*b+_*w)/x,A=T-y,D=C-m,L=E-y,O=S-m;return A*A+D*D>L*L+O*O&&(T=E,C=S),{cx:T,cy:C,x01:-h,y01:-u,x11:T*(r/v-1),y11:C*(r/v-1)}}function Vs(){var t=js,e=zs,n=Ss(0),i=null,r=Us,a=Ws,s=Hs,o=null,l=Ys(c);function c(){var c,h,u=+t.apply(this,arguments),d=+e.apply(this,arguments),p=r.apply(this,arguments)-Rs,f=a.apply(this,arguments)-Rs,g=As(f-p),y=f>p;if(o||(o=c=l()),dIs)if(g>$s-Is)o.moveTo(d*Ls(p),d*Ms(p)),o.arc(0,0,d,p,f,!y),u>Is&&(o.moveTo(u*Ls(f),u*Ms(f)),o.arc(0,0,u,f,p,y));else{var m,b,_=p,x=f,v=p,k=f,w=g,T=g,C=s.apply(this,arguments)/2,E=C>Is&&(i?+i.apply(this,arguments):Bs(u*u+d*d)),S=Ns(As(d-u)/2,+n.apply(this,arguments)),A=S,D=S;if(E>Is){var L=Ps(E/u*Ms(C)),O=Ps(E/d*Ms(C));(w-=2*L)>Is?(v+=L*=y?1:-1,k-=L):(w=0,v=k=(p+f)/2),(T-=2*O)>Is?(_+=O*=y?1:-1,x-=O):(T=0,_=x=(p+f)/2)}var N=d*Ls(_),M=d*Ms(_),B=u*Ls(k),I=u*Ms(k);if(S>Is){var F,R=d*Ls(x),$=d*Ms(x),P=u*Ls(v),Y=u*Ms(v);if(g1?0:t<-1?Fs:Math.acos(t)}((j*U+z*W)/(Bs(j*j+z*z)*Bs(U*U+W*W)))/2),q=Bs(F[0]*F[0]+F[1]*F[1]);A=Ns(S,(u-q)/(H-1)),D=Ns(S,(d-q)/(H+1))}else A=D=0}T>Is?D>Is?(m=qs(P,Y,N,M,d,D,y),b=qs(R,$,B,I,d,D,y),o.moveTo(m.cx+m.x01,m.cy+m.y01),DIs&&w>Is?A>Is?(m=qs(B,I,R,$,u,-A,y),b=qs(N,M,P,Y,u,-A,y),o.lineTo(m.cx+m.x01,m.cy+m.y01),At?1:e>=t?0:NaN}function eo(t){return t}function no(){}function io(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ro(t){this._context=t}function ao(t){return new ro(t)}function so(t){this._context=t}function oo(t){this._context=t}function lo(t){this._context=t}function co(t){return t<0?-1:1}function ho(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||r<0&&-0),s=(n-t._y1)/(r||i<0&&-0),o=(a*r+s*i)/(i+r);return(co(a)+co(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function uo(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function po(t,e,n){var i=t._x0,r=t._y0,a=t._x1,s=t._y1,o=(a-i)/3;t._context.bezierCurveTo(i+o,r+o*e,a-o,s-o*n,a,s)}function fo(t){this._context=t}function go(t){this._context=new yo(t)}function yo(t){this._context=t}function mo(t){this._context=t}function bo(t){var e,n,i=t.length-1,r=new Array(i),a=new Array(i),s=new Array(i);for(r[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e=0;--e)r[e]=(s[e]-r[e+1])/a[e];for(a[i-1]=(t[i]+r[i-1])/2,e=0;et.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},xo.prototype={constructor:xo,scale:function(t){return 1===t?this:new xo(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new xo(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new xo(1,0,0),xo.prototype;var Eo=Object.hasOwnProperty,So=Object.setPrototypeOf,Ao=Object.isFrozen,Do=Object.getPrototypeOf,Lo=Object.getOwnPropertyDescriptor,Oo=Object.freeze,No=Object.seal,Mo=Object.create,Bo="undefined"!=typeof Reflect&&Reflect,Io=Bo.apply,Fo=Bo.construct;Io||(Io=function(t,e,n){return t.apply(e,n)}),Oo||(Oo=function(t){return t}),No||(No=function(t){return t}),Fo||(Fo=function(t,e){return wo(t,To(e))});var Ro,$o=Xo(Array.prototype.forEach),Po=Xo(Array.prototype.pop),Yo=Xo(Array.prototype.push),jo=Xo(String.prototype.toLowerCase),zo=Xo(String.prototype.toString),Uo=Xo(String.prototype.match),Wo=Xo(String.prototype.replace),Ho=Xo(String.prototype.indexOf),qo=Xo(String.prototype.trim),Vo=Xo(RegExp.prototype.test),Go=(Ro=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n1?n-1:0),r=1;r/gm),dl=No(/\${[\w\W]*}/gm),pl=No(/^data-[\-\w.\u00B7-\uFFFF]/),fl=No(/^aria-[\-\w]+$/),gl=No(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yl=No(/^(?:\w+script|data):/i),ml=No(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bl=No(/^html$/i),_l=function(){return"undefined"==typeof window?null:window},xl=function(t,e){if("object"!==vo(t)||"function"!=typeof t.createPolicy)return null;var n=null,i="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(i)&&(n=e.currentScript.getAttribute(i));var r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};var vl=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_l(),n=function(e){return t(e)};if(n.version="2.4.1",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;var i=e.document,r=e.document,a=e.DocumentFragment,s=e.HTMLTemplateElement,o=e.Node,l=e.Element,c=e.NodeFilter,h=e.NamedNodeMap,u=void 0===h?e.NamedNodeMap||e.MozNamedAttrMap:h,d=e.HTMLFormElement,p=e.DOMParser,f=e.trustedTypes,g=l.prototype,y=Ko(g,"cloneNode"),m=Ko(g,"nextSibling"),b=Ko(g,"childNodes"),_=Ko(g,"parentNode");if("function"==typeof s){var x=r.createElement("template");x.content&&x.content.ownerDocument&&(r=x.content.ownerDocument)}var v=xl(f,i),k=v?v.createHTML(""):"",w=r,T=w.implementation,C=w.createNodeIterator,E=w.createDocumentFragment,S=w.getElementsByTagName,A=i.importNode,D={};try{D=Qo(r).documentMode?r.documentMode:{}}catch(t){}var L={};n.isSupported="function"==typeof _&&T&&void 0!==T.createHTMLDocument&&9!==D;var O,N,M=hl,B=ul,I=dl,F=pl,R=fl,$=yl,P=ml,Y=gl,j=null,z=Zo({},[].concat(To(Jo),To(tl),To(el),To(il),To(al))),U=null,W=Zo({},[].concat(To(sl),To(ol),To(ll),To(cl))),H=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,V=null,G=!0,X=!0,Z=!1,Q=!1,K=!1,J=!1,tt=!1,et=!1,nt=!1,it=!1,rt=!0,at=!1,st=!0,ot=!1,lt={},ct=null,ht=Zo({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ut=null,dt=Zo({},["audio","video","img","source","image","track"]),pt=null,ft=Zo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gt="http://www.w3.org/1998/Math/MathML",yt="http://www.w3.org/2000/svg",mt="http://www.w3.org/1999/xhtml",bt=mt,_t=!1,xt=null,vt=Zo({},[gt,yt,mt],zo),kt=["application/xhtml+xml","text/html"],wt=null,Tt=r.createElement("form"),Ct=function(t){return t instanceof RegExp||t instanceof Function},Et=function(t){wt&&wt===t||(t&&"object"===vo(t)||(t={}),t=Qo(t),O=O=-1===kt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,N="application/xhtml+xml"===O?zo:jo,j="ALLOWED_TAGS"in t?Zo({},t.ALLOWED_TAGS,N):z,U="ALLOWED_ATTR"in t?Zo({},t.ALLOWED_ATTR,N):W,xt="ALLOWED_NAMESPACES"in t?Zo({},t.ALLOWED_NAMESPACES,zo):vt,pt="ADD_URI_SAFE_ATTR"in t?Zo(Qo(ft),t.ADD_URI_SAFE_ATTR,N):ft,ut="ADD_DATA_URI_TAGS"in t?Zo(Qo(dt),t.ADD_DATA_URI_TAGS,N):dt,ct="FORBID_CONTENTS"in t?Zo({},t.FORBID_CONTENTS,N):ht,q="FORBID_TAGS"in t?Zo({},t.FORBID_TAGS,N):{},V="FORBID_ATTR"in t?Zo({},t.FORBID_ATTR,N):{},lt="USE_PROFILES"in t&&t.USE_PROFILES,G=!1!==t.ALLOW_ARIA_ATTR,X=!1!==t.ALLOW_DATA_ATTR,Z=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Q=t.SAFE_FOR_TEMPLATES||!1,K=t.WHOLE_DOCUMENT||!1,et=t.RETURN_DOM||!1,nt=t.RETURN_DOM_FRAGMENT||!1,it=t.RETURN_TRUSTED_TYPE||!1,tt=t.FORCE_BODY||!1,rt=!1!==t.SANITIZE_DOM,at=t.SANITIZE_NAMED_PROPS||!1,st=!1!==t.KEEP_CONTENT,ot=t.IN_PLACE||!1,Y=t.ALLOWED_URI_REGEXP||Y,bt=t.NAMESPACE||mt,t.CUSTOM_ELEMENT_HANDLING&&Ct(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Ct(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Q&&(X=!1),nt&&(et=!0),lt&&(j=Zo({},To(al)),U=[],!0===lt.html&&(Zo(j,Jo),Zo(U,sl)),!0===lt.svg&&(Zo(j,tl),Zo(U,ol),Zo(U,cl)),!0===lt.svgFilters&&(Zo(j,el),Zo(U,ol),Zo(U,cl)),!0===lt.mathMl&&(Zo(j,il),Zo(U,ll),Zo(U,cl))),t.ADD_TAGS&&(j===z&&(j=Qo(j)),Zo(j,t.ADD_TAGS,N)),t.ADD_ATTR&&(U===W&&(U=Qo(U)),Zo(U,t.ADD_ATTR,N)),t.ADD_URI_SAFE_ATTR&&Zo(pt,t.ADD_URI_SAFE_ATTR,N),t.FORBID_CONTENTS&&(ct===ht&&(ct=Qo(ct)),Zo(ct,t.FORBID_CONTENTS,N)),st&&(j["#text"]=!0),K&&Zo(j,["html","head","body"]),j.table&&(Zo(j,["tbody"]),delete q.tbody),Oo&&Oo(t),wt=t)},St=Zo({},["mi","mo","mn","ms","mtext"]),At=Zo({},["foreignobject","desc","title","annotation-xml"]),Dt=Zo({},["title","style","font","a","script"]),Lt=Zo({},tl);Zo(Lt,el),Zo(Lt,nl);var Ot=Zo({},il);Zo(Ot,rl);var Nt=function(t){Yo(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){try{t.outerHTML=k}catch(e){t.remove()}}},Mt=function(t,e){try{Yo(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){Yo(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!U[t])if(et||nt)try{Nt(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Bt=function(t){var e,n;if(tt)t=""+t;else{var i=Uo(t,/^[\r\n\t ]+/);n=i&&i[0]}"application/xhtml+xml"===O&&bt===mt&&(t=''+t+"");var a=v?v.createHTML(t):t;if(bt===mt)try{e=(new p).parseFromString(a,O)}catch(t){}if(!e||!e.documentElement){e=T.createDocument(bt,"template",null);try{e.documentElement.innerHTML=_t?"":a}catch(t){}}var s=e.body||e.documentElement;return t&&n&&s.insertBefore(r.createTextNode(n),s.childNodes[0]||null),bt===mt?S.call(e,K?"html":"body")[0]:K?e.documentElement:s},It=function(t){return C.call(t.ownerDocument||t,t,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Ft=function(t){return"object"===vo(o)?t instanceof o:t&&"object"===vo(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Rt=function(t,e,i){L[t]&&$o(L[t],(function(t){t.call(n,e,i,wt)}))},$t=function(t){var e,i;if(Rt("beforeSanitizeElements",t,null),(i=t)instanceof d&&("string"!=typeof i.nodeName||"string"!=typeof i.textContent||"function"!=typeof i.removeChild||!(i.attributes instanceof u)||"function"!=typeof i.removeAttribute||"function"!=typeof i.setAttribute||"string"!=typeof i.namespaceURI||"function"!=typeof i.insertBefore||"function"!=typeof i.hasChildNodes))return Nt(t),!0;if(Vo(/[\u0080-\uFFFF]/,t.nodeName))return Nt(t),!0;var r=N(t.nodeName);if(Rt("uponSanitizeElement",t,{tagName:r,allowedTags:j}),t.hasChildNodes()&&!Ft(t.firstElementChild)&&(!Ft(t.content)||!Ft(t.content.firstElementChild))&&Vo(/<[/\w]/g,t.innerHTML)&&Vo(/<[/\w]/g,t.textContent))return Nt(t),!0;if("select"===r&&Vo(/=0;--o)a.insertBefore(y(s[o],!0),m(t))}return Nt(t),!0}return t instanceof l&&!function(t){var e=_(t);e&&e.tagName||(e={namespaceURI:bt,tagName:"template"});var n=jo(t.tagName),i=jo(e.tagName);return!!xt[t.namespaceURI]&&(t.namespaceURI===yt?e.namespaceURI===mt?"svg"===n:e.namespaceURI===gt?"svg"===n&&("annotation-xml"===i||St[i]):Boolean(Lt[n]):t.namespaceURI===gt?e.namespaceURI===mt?"math"===n:e.namespaceURI===yt?"math"===n&&At[i]:Boolean(Ot[n]):t.namespaceURI===mt?!(e.namespaceURI===yt&&!At[i])&&!(e.namespaceURI===gt&&!St[i])&&!Ot[n]&&(Dt[n]||!Lt[n]):!("application/xhtml+xml"!==O||!xt[t.namespaceURI]))}(t)?(Nt(t),!0):"noscript"!==r&&"noembed"!==r||!Vo(/<\/no(script|embed)/i,t.innerHTML)?(Q&&3===t.nodeType&&(e=t.textContent,e=Wo(e,M," "),e=Wo(e,B," "),e=Wo(e,I," "),t.textContent!==e&&(Yo(n.removed,{element:t.cloneNode()}),t.textContent=e)),Rt("afterSanitizeElements",t,null),!1):(Nt(t),!0)},Pt=function(t,e,n){if(rt&&("id"===e||"name"===e)&&(n in r||n in Tt))return!1;if(X&&!V[e]&&Vo(F,e));else if(G&&Vo(R,e));else if(!U[e]||V[e]){if(!(Yt(t)&&(H.tagNameCheck instanceof RegExp&&Vo(H.tagNameCheck,t)||H.tagNameCheck instanceof Function&&H.tagNameCheck(t))&&(H.attributeNameCheck instanceof RegExp&&Vo(H.attributeNameCheck,e)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(e))||"is"===e&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&Vo(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(pt[e]);else if(Vo(Y,Wo(n,P,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==Ho(n,"data:")||!ut[t]){if(Z&&!Vo($,Wo(n,P,"")));else if(n)return!1}else;return!0},Yt=function(t){return t.indexOf("-")>0},jt=function(t){var e,i,r,a;Rt("beforeSanitizeAttributes",t,null);var s=t.attributes;if(s){var o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U};for(a=s.length;a--;){var l=e=s[a],c=l.name,h=l.namespaceURI;if(i="value"===c?e.value:qo(e.value),r=N(c),o.attrName=r,o.attrValue=i,o.keepAttr=!0,o.forceKeepAttr=void 0,Rt("uponSanitizeAttribute",t,o),i=o.attrValue,!o.forceKeepAttr&&(Mt(c,t),o.keepAttr))if(Vo(/\/>/i,i))Mt(c,t);else{Q&&(i=Wo(i,M," "),i=Wo(i,B," "),i=Wo(i,I," "));var u=N(t.nodeName);if(Pt(u,r,i)){if(!at||"id"!==r&&"name"!==r||(Mt(c,t),i="user-content-"+i),v&&"object"===vo(f)&&"function"==typeof f.getAttributeType)if(h);else switch(f.getAttributeType(u,r)){case"TrustedHTML":i=v.createHTML(i);break;case"TrustedScriptURL":i=v.createScriptURL(i)}try{h?t.setAttributeNS(h,c,i):t.setAttribute(c,i),Po(n.removed)}catch(t){}}}}Rt("afterSanitizeAttributes",t,null)}},zt=function t(e){var n,i=It(e);for(Rt("beforeSanitizeShadowDOM",e,null);n=i.nextNode();)Rt("uponSanitizeShadowNode",n,null),$t(n)||(n.content instanceof a&&t(n.content),jt(n));Rt("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(t){var r,s,l,c,h,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((_t=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Ft(t)){if("function"!=typeof t.toString)throw Go("toString is not a function");if("string"!=typeof(t=t.toString()))throw Go("dirty is not a string, aborting")}if(!n.isSupported){if("object"===vo(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof t)return e.toStaticHTML(t);if(Ft(t))return e.toStaticHTML(t.outerHTML)}return t}if(J||Et(u),n.removed=[],"string"==typeof t&&(ot=!1),ot){if(t.nodeName){var d=N(t.nodeName);if(!j[d]||q[d])throw Go("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof o)1===(s=(r=Bt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?r=s:r.appendChild(s);else{if(!et&&!Q&&!K&&-1===t.indexOf("<"))return v&&it?v.createHTML(t):t;if(!(r=Bt(t)))return et?null:it?k:""}r&&tt&&Nt(r.firstChild);for(var p=It(ot?t:r);l=p.nextNode();)3===l.nodeType&&l===c||$t(l)||(l.content instanceof a&&zt(l.content),jt(l),c=l);if(c=null,ot)return t;if(et){if(nt)for(h=E.call(r.ownerDocument);r.firstChild;)h.appendChild(r.firstChild);else h=r;return U.shadowroot&&(h=A.call(i,h,!0)),h}var f=K?r.outerHTML:r.innerHTML;return K&&j["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Vo(bl,r.ownerDocument.doctype.name)&&(f="\n"+f),Q&&(f=Wo(f,M," "),f=Wo(f,B," "),f=Wo(f,I," ")),v&&it?v.createHTML(f):f},n.setConfig=function(t){Et(t),J=!0},n.clearConfig=function(){wt=null,J=!1},n.isValidAttribute=function(t,e,n){wt||Et({});var i=N(t),r=N(e);return Pt(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&(L[t]=L[t]||[],Yo(L[t],e))},n.removeHook=function(t){if(L[t])return Po(L[t])},n.removeHooks=function(t){L[t]&&(L[t]=[])},n.removeAllHooks=function(){L={}},n}();const kl={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},i)=>{if(!e)return 2.55*n;t/=360,e/=100;const r=(n/=100)<.5?n*(1+e):n+e-n*e,a=2*n-r;switch(i){case"r":return 255*kl.hue2rgb(a,r,t+1/3);case"g":return 255*kl.hue2rgb(a,r,t);case"b":return 255*kl.hue2rgb(a,r,t-1/3)}},rgb2hsl:({r:t,g:e,b:n},i)=>{t/=255,e/=255,n/=255;const r=Math.max(t,e,n),a=Math.min(t,e,n),s=(r+a)/2;if("l"===i)return 100*s;if(r===a)return 0;const o=r-a;if("s"===i)return 100*(s>.5?o/(2-r-a):o/(r+a));switch(r){case t:return 60*((e-n)/o+(ee>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(1e10*t)/1e10};const Tl={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}};var Cl={channel:kl,lang:wl,unit:Tl};const El={};for(let t=0;t<=255;t++)El[t]=Cl.unit.dec2hex(t);const Sl=0,Al=1,Dl=2;var Ll=class{constructor(){this.type=Sl}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Sl}is(t){return this.type===t}};var Ol=class{constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new Ll}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=Sl,this}_ensureHSL(){const t=this.data,{h:e,s:n,l:i}=t;void 0===e&&(t.h=Cl.channel.rgb2hsl(t,"h")),void 0===n&&(t.s=Cl.channel.rgb2hsl(t,"s")),void 0===i&&(t.l=Cl.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:e,g:n,b:i}=t;void 0===e&&(t.r=Cl.channel.hsl2rgb(t,"r")),void 0===n&&(t.g=Cl.channel.hsl2rgb(t,"g")),void 0===i&&(t.b=Cl.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,e=t.r;return this.type.is(Dl)||void 0===e?(this._ensureHSL(),Cl.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(Dl)||void 0===e?(this._ensureHSL(),Cl.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(Dl)||void 0===e?(this._ensureHSL(),Cl.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(Al)||void 0===e?(this._ensureRGB(),Cl.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(Al)||void 0===e?(this._ensureRGB(),Cl.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(Al)||void 0===e?(this._ensureRGB(),Cl.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(Al),this.changed=!0,this.data.r=t}set g(t){this.type.set(Al),this.changed=!0,this.data.g=t}set b(t){this.type.set(Al),this.changed=!0,this.data.b=t}set h(t){this.type.set(Dl),this.changed=!0,this.data.h=t}set s(t){this.type.set(Dl),this.changed=!0,this.data.s=t}set l(t){this.type.set(Dl),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}};var Nl=new Ol({r:0,g:0,b:0,a:0},"transparent");const Ml={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(35!==t.charCodeAt(0))return;const e=t.match(Ml.re);if(!e)return;const n=e[1],i=parseInt(n,16),r=n.length,a=r%4==0,s=r>4,o=s?1:17,l=s?8:4,c=a?0:-1,h=s?255:15;return Nl.set({r:(i>>l*(c+3)&h)*o,g:(i>>l*(c+2)&h)*o,b:(i>>l*(c+1)&h)*o,a:a?(i&h)*o/255:1},t)},stringify:t=>{const{r:e,g:n,b:i,a:r}=t;return r<1?`#${El[Math.round(e)]}${El[Math.round(n)]}${El[Math.round(i)]}${El[Math.round(255*r)]}`:`#${El[Math.round(e)]}${El[Math.round(n)]}${El[Math.round(i)]}`}};var Bl=Ml;const Il={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Il.hueRe);if(e){const[,t,n]=e;switch(n){case"grad":return Cl.channel.clamp.h(.9*parseFloat(t));case"rad":return Cl.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return Cl.channel.clamp.h(360*parseFloat(t))}}return Cl.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const n=t.match(Il.re);if(!n)return;const[,i,r,a,s,o]=n;return Nl.set({h:Il._hue2deg(i),s:Cl.channel.clamp.s(parseFloat(r)),l:Cl.channel.clamp.l(parseFloat(a)),a:s?Cl.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:n,l:i,a:r}=t;return r<1?`hsla(${Cl.lang.round(e)}, ${Cl.lang.round(n)}%, ${Cl.lang.round(i)}%, ${r})`:`hsl(${Cl.lang.round(e)}, ${Cl.lang.round(n)}%, ${Cl.lang.round(i)}%)`}};var Fl=Il;const Rl={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Rl.colors[t];if(e)return Bl.parse(e)},stringify:t=>{const e=Bl.stringify(t);for(const t in Rl.colors)if(Rl.colors[t]===e)return t}};var $l=Rl;const Pl={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(114!==e&&82!==e)return;const n=t.match(Pl.re);if(!n)return;const[,i,r,a,s,o,l,c,h]=n;return Nl.set({r:Cl.channel.clamp.r(r?2.55*parseFloat(i):parseFloat(i)),g:Cl.channel.clamp.g(s?2.55*parseFloat(a):parseFloat(a)),b:Cl.channel.clamp.b(l?2.55*parseFloat(o):parseFloat(o)),a:c?Cl.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{const{r:e,g:n,b:i,a:r}=t;return r<1?`rgba(${Cl.lang.round(e)}, ${Cl.lang.round(n)}, ${Cl.lang.round(i)}, ${Cl.lang.round(r)})`:`rgb(${Cl.lang.round(e)}, ${Cl.lang.round(n)}, ${Cl.lang.round(i)})`}};var Yl=Pl;const jl={format:{keyword:$l,hex:Bl,rgb:Yl,rgba:Yl,hsl:Fl,hsla:Fl},parse:t=>{if("string"!=typeof t)return t;const e=Bl.parse(t)||Yl.parse(t)||Fl.parse(t)||$l.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Dl)||void 0===t.data.r?Fl.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Yl.stringify(t):Bl.stringify(t)};var zl=jl;var Ul=(t,e)=>{const n=zl.parse(t);for(const t in e)n[t]=Cl.channel.clamp[t](e[t]);return zl.stringify(n)};var Wl=(t,e,n=0,i=1)=>{if("number"!=typeof t)return Ul(t,{a:e});const r=Nl.set({r:Cl.channel.clamp.r(t),g:Cl.channel.clamp.g(e),b:Cl.channel.clamp.b(n),a:Cl.channel.clamp.a(i)});return zl.stringify(r)};var Hl=(t,e,n)=>{const i=zl.parse(t),r=i[e],a=Cl.channel.clamp[e](r+n);return r!==a&&(i[e]=a),zl.stringify(i)};var ql=(t,e)=>Hl(t,"l",e);var Vl=(t,e)=>Hl(t,"l",-e);var Gl=(t,e)=>{const n=zl.parse(t),i={};for(const t in e)e[t]&&(i[t]=n[t]+e[t]);return Ul(t,i)};var Xl=(t,e,n=50)=>{const{r:i,g:r,b:a,a:s}=zl.parse(t),{r:o,g:l,b:c,a:h}=zl.parse(e),u=n/100,d=2*u-1,p=s-h,f=((d*p==-1?d:(d+p)/(1+d*p))+1)/2,g=1-f;return Wl(i*f+o*g,r*f+l*g,a*f+c*g,s*u+h*(1-u))};var Zl=(t,e=100)=>{const n=zl.parse(t);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,Xl(n,t,e)},Ql="object"==typeof global&&global&&global.Object===Object&&global,Kl="object"==typeof self&&self&&self.Object===Object&&self,Jl=Ql||Kl||Function("return this")(),tc=Jl.Symbol,ec=Object.prototype,nc=ec.hasOwnProperty,ic=ec.toString,rc=tc?tc.toStringTag:void 0;var ac=Object.prototype.toString;var sc="[object Null]",oc="[object Undefined]",lc=tc?tc.toStringTag:void 0;function cc(t){return null==t?void 0===t?oc:sc:lc&&lc in Object(t)?function(t){var e=nc.call(t,rc),n=t[rc];try{t[rc]=void 0;var i=!0}catch(t){}var r=ic.call(t);return i&&(e?t[rc]=n:delete t[rc]),r}(t):function(t){return ac.call(t)}(t)}function hc(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var uc="[object AsyncFunction]",dc="[object Function]",pc="[object GeneratorFunction]",fc="[object Proxy]";function gc(t){if(!hc(t))return!1;var e=cc(t);return e==dc||e==pc||e==uc||e==fc}var yc,mc=Jl["__core-js_shared__"],bc=(yc=/[^.]+$/.exec(mc&&mc.keys&&mc.keys.IE_PROTO||""))?"Symbol(src)_1."+yc:"";var _c=Function.prototype.toString;function xc(t){if(null!=t){try{return _c.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var vc=/^\[object .+?Constructor\]$/,kc=Function.prototype,wc=Object.prototype,Tc=kc.toString,Cc=wc.hasOwnProperty,Ec=RegExp("^"+Tc.call(Cc).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sc(t){return!(!hc(t)||function(t){return!!bc&&bc in t}(t))&&(gc(t)?Ec:vc).test(xc(t))}function Ac(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Sc(n)?n:void 0}var Dc=Ac(Object,"create");var Lc="__lodash_hash_undefined__",Oc=Object.prototype.hasOwnProperty;var Nc=Object.prototype.hasOwnProperty;var Mc="__lodash_hash_undefined__";function Bc(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},$c.prototype.set=function(t,e){var n=this.__data__,i=Fc(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};var Pc=Ac(Jl,"Map");function Yc(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function jc(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0?th(hh,--lh):0,sh--,10===ch&&(sh=1,ah--),ch}function ph(){return ch=lh2||mh(ch)>3?"":" "}function xh(t,e){for(;--e&&ph()&&!(ch<48||ch>102||ch>57&&ch<65||ch>70&&ch<97););return yh(t,gh()+(e<6&&32==fh()&&32==ph()))}function vh(t){for(;ph();)switch(ch){case t:return lh;case 34:case 39:34!==t&&39!==t&&vh(ch);break;case 40:41===t&&vh(t);break;case 92:ph()}return lh}function kh(t,e){for(;ph()&&t+ch!==57&&(t+ch!==84||47!==fh()););return"/*"+yh(e,lh-1)+"*"+Zc(47===t?t:ph())}function wh(t){for(;!mh(fh());)ph();return yh(t,lh)}function Th(t){return function(t){return hh="",t}(Ch("",null,null,null,[""],t=function(t){return ah=sh=1,oh=nh(hh=t),lh=0,[]}(t),0,[0],t))}function Ch(t,e,n,i,r,a,s,o,l){for(var c=0,h=0,u=s,d=0,p=0,f=0,g=1,y=1,m=1,b=0,_="",x=r,v=a,k=i,w=_;y;)switch(f=b,b=ph()){case 40:if(108!=f&&58==th(w,u-1)){-1!=Jc(w+=Kc(bh(b),"&","&\f"),"&\f")&&(m=-1);break}case 34:case 39:case 91:w+=bh(b);break;case 9:case 10:case 13:case 32:w+=_h(f);break;case 92:w+=xh(gh()-1,7);continue;case 47:switch(fh()){case 42:case 47:rh(Sh(kh(ph(),gh()),e,n),l);break;default:w+="/"}break;case 123*g:o[c++]=nh(w)*m;case 125*g:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+h:p>0&&nh(w)-u&&rh(p>32?Ah(w+";",i,n,u-1):Ah(Kc(w," ","")+";",i,n,u-2),l);break;case 59:w+=";";default:if(rh(k=Eh(w,e,n,c,h,r,o,_,x=[],v=[],u),a),123===b)if(0===h)Ch(w,e,k,k,x,a,u,o,v);else switch(99===d&&110===th(w,3)?100:d){case 100:case 109:case 115:Ch(t,k,k,i&&rh(Eh(t,k,k,0,0,r,o,_,r,x=[],u),v),r,v,u,o,i?x:v);break;default:Ch(w,k,k,k,[""],v,0,o,v)}}c=h=p=0,g=m=1,_=w="",u=s;break;case 58:u=1+nh(w),p=f;default:if(g<1)if(123==b)--g;else if(125==b&&0==g++&&125==dh())continue;switch(w+=Zc(b),b*g){case 38:m=h>0?1:(w+="\f",-1);break;case 44:o[c++]=(nh(w)-1)*m,m=1;break;case 64:45===fh()&&(w+=bh(ph())),d=fh(),h=u=nh(_=w+=wh(gh())),b++;break;case 45:45===f&&2==nh(w)&&(g=0)}}return a}function Eh(t,e,n,i,r,a,s,o,l,c,h){for(var u=r-1,d=0===r?a:[""],p=ih(d),f=0,g=0,y=0;f0?d[m]+" "+b:Kc(b,/&\f/g,d[m])))&&(l[y++]=_);return uh(t,e,n,0===r?Hc:o,l,c,h)}function Sh(t,e,n){return uh(t,e,n,Wc,Zc(ch),eh(t,2,-2),0)}function Ah(t,e,n,i){return uh(t,e,n,qc,eh(t,0,i),eh(t,i+1,-1),i)}function Dh(t,e){for(var n="",i=ih(t),r=0;r0){if(++e>=iu)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(cu),uu=hu;function du(t,e){for(var n=-1,i=null==t?0:t.length;++n-1}var yu=9007199254740991,mu=/^(?:0|[1-9]\d*)$/;function bu(t,e){var n=typeof t;return!!(e=null==e?yu:e)&&("number"==n||"symbol"!=n&&mu.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Eu}function Au(t){return null!=t&&Su(t.length)&&!gc(t)}function Du(t,e,n){if(!hc(n))return!1;var i=typeof e;return!!("number"==i?Au(n)&&bu(e,n.length):"string"==i&&e in n)&&Ic(n[e],t)}var Lu=Object.prototype;function Ou(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Lu)}var Nu="[object Arguments]";function Mu(t){return Oh(t)&&cc(t)==Nu}var Bu=Object.prototype,Iu=Bu.hasOwnProperty,Fu=Bu.propertyIsEnumerable,Ru=Mu(function(){return arguments}())?Mu:function(t){return Oh(t)&&Iu.call(t,"callee")&&!Fu.call(t,"callee")},$u=Ru;var Pu="object"==typeof exports&&exports&&!exports.nodeType&&exports,Yu=Pu&&"object"==typeof module&&module&&!module.nodeType&&module,ju=Yu&&Yu.exports===Pu?Jl.Buffer:void 0,zu=(ju?ju.isBuffer:void 0)||function(){return!1},Uu={};function Wu(t){return function(e){return t(e)}}Uu["[object Float32Array]"]=Uu["[object Float64Array]"]=Uu["[object Int8Array]"]=Uu["[object Int16Array]"]=Uu["[object Int32Array]"]=Uu["[object Uint8Array]"]=Uu["[object Uint8ClampedArray]"]=Uu["[object Uint16Array]"]=Uu["[object Uint32Array]"]=!0,Uu["[object Arguments]"]=Uu["[object Array]"]=Uu["[object ArrayBuffer]"]=Uu["[object Boolean]"]=Uu["[object DataView]"]=Uu["[object Date]"]=Uu["[object Error]"]=Uu["[object Function]"]=Uu["[object Map]"]=Uu["[object Number]"]=Uu["[object Object]"]=Uu["[object RegExp]"]=Uu["[object Set]"]=Uu["[object String]"]=Uu["[object WeakMap]"]=!1;var Hu="object"==typeof exports&&exports&&!exports.nodeType&&exports,qu=Hu&&"object"==typeof module&&module&&!module.nodeType&&module,Vu=qu&&qu.exports===Hu&&Ql.process,Gu=function(){try{var t=qu&&qu.require&&qu.require("util").types;return t||Vu&&Vu.binding&&Vu.binding("util")}catch(t){}}(),Xu=Gu,Zu=Xu&&Xu.isTypedArray,Qu=Zu?Wu(Zu):function(t){return Oh(t)&&Su(t.length)&&!!Uu[cc(t)]},Ku=Object.prototype.hasOwnProperty;function Ju(t,e){var n=Ih(t),i=!n&&$u(t),r=!n&&!i&&zu(t),a=!n&&!i&&!r&&Qu(t),s=n||i||r||a,o=s?function(t,e){for(var n=-1,i=Array(t);++n0&&n(o)?e>1?Td(o,e-1,n,i,r):vd(r,o):i||(r[r.length]=o)}return r}function Cd(t){return(null==t?0:t.length)?Td(t,1):[]}var Ed=td(Object.getPrototypeOf,Object),Sd="[object Object]",Ad=Function.prototype,Dd=Object.prototype,Ld=Ad.toString,Od=Dd.hasOwnProperty,Nd=Ld.call(Object);function Md(t){if(!Oh(t)||cc(t)!=Sd)return!1;var e=Ed(t);if(null===e)return!0;var n=Od.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ld.call(n)==Nd}function Bd(t,e,n,i){var r=-1,a=null==t?0:t.length;for(i&&a&&(n=t[++r]);++ro))return!1;var c=a.get(t),h=a.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,p=n&df?new lf:void 0;for(a.set(t,e),a.set(e,t);++u2?e[2]:void 0;for(r&&Du(e[0],e[1],r)&&(i=1);++n-1?i[r?t[a]:a]:void 0}),Tg=wg;function Cg(t,e){var n=-1,i=Au(t)?Array(t.length):[];return rg(t,(function(t,r,a){i[++n]=e(t,r,a)})),i}function Eg(t,e){return(Ih(t)?Bh:Cg)(t,Kf(e))}function Sg(t,e){return t>e}var Ag=Object.prototype.hasOwnProperty;function Dg(t,e){return null!=t&&Ag.call(t,e)}function Lg(t,e){return null!=t&&qf(t,e,Dg)}function Og(t){return null==t?[]:function(t,e){return Bh(e,(function(e){return t[e]}))}(t,rd(t))}var Ng="[object Map]",Mg="[object Set]",Bg=Object.prototype.hasOwnProperty;function Ig(t){if(null==t)return!0;if(Au(t)&&(Ih(t)||"string"==typeof t||"function"==typeof t.splice||zu(t)||Qu(t)||$u(t)))return!t.length;var e=pp(t);if(e==Ng||e==Mg)return!t.size;if(Ou(t))return!id(t).length;for(var n in t)if(Bg.call(t,n))return!1;return!0}function Fg(t){return void 0===t}function Rg(t,e){return t1?e[i-1]:void 0,a=i>2?e[2]:void 0;for(r=jg.length>3&&"function"==typeof r?(i--,r):void 0,a&&Du(e[0],e[1],a)&&(r=i<3?void 0:r,i=1),t=Object(t);++ne||a&&s&&l&&!o&&!c||i&&s&&l||!n&&l||!r)return 1;if(!i&&!a&&!c&&t=o?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)}))}function Xg(t,e){return function(t,e,n){for(var i=-1,r=e.length,a={};++i1&&Du(t,e[0],e[1])?e=[]:n>2&&Du(e[0],e[1],e[2])&&(e=[e[0]]),Gg(t,Td(e,1),[])})),ay=ry,sy=ep&&1/gf(new ep([,-0]))[1]==1/0?function(t){return new ep(t)}:function(){},oy=sy,ly=200;var cy=Cu((function(t){return function(t,e,n){var i=-1,r=gu,a=t.length,s=!0,o=[],l=o;if(n)s=!1,r=gg;else if(a>=ly){var c=e?null:oy(t);if(c)return gf(c);s=!1,r=hf,l=new lf}else l=e?[]:o;t:for(;++i1?i.setNode(t,e):i.setNode(t)})),this}setNode(t,e){return Lg(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=fy,this._children[t]={},this._children[fy][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Lg(this._nodes,t)}removeNode(t){var e=this;if(Lg(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],bg(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),bg(rd(this._in[t]),n),delete this._in[t],delete this._preds[t],bg(rd(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Fg(e))e=fy;else{for(var n=e+="";!Fg(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==fy)return e}}children(t){if(Fg(t)&&(t=fy),this._isCompound){var e=this._children[t];if(e)return rd(e)}else{if(t===fy)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return rd(e)}successors(t){var e=this._sucs[t];if(e)return rd(e)}neighbors(t){var e=this.predecessors(t);if(e)return hy(e,this.successors(t))}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;bg(this._nodes,(function(n,i){t(i)&&e.setNode(i,n)})),bg(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var i={};function r(t){var a=n.parent(t);return void 0===a||e.hasNode(a)?(i[t]=a,a):a in i?i[a]:r(a)}return this._isCompound&&bg(e.nodes(),(function(t){e.setParent(t,r(t))})),e}setDefaultEdgeLabel(t){return gc(t)||(t=su(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Og(this._edgeObjs)}setPath(t,e){var n=this,i=arguments;return iy(t,(function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r})),this}setEdge(){var t,e,n,i,r=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(t=a.v,e=a.w,n=a.name,2===arguments.length&&(i=arguments[1],r=!0)):(t=a,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),t=""+t,e=""+e,Fg(n)||(n=""+n);var s=_y(this._isDirected,t,e,n);if(Lg(this._edgeLabels,s))return r&&(this._edgeLabels[s]=i),this;if(!Fg(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[s]=r?i:this._defaultEdgeLabelFn(t,e,n);var o=function(t,e,n,i){var r=""+e,a=""+n;if(!t&&r>a){var s=r;r=a,a=s}var o={v:r,w:a};i&&(o.name=i);return o}(this._isDirected,t,e,n);return t=o.v,e=o.w,Object.freeze(o),this._edgeObjs[s]=o,my(this._preds[e],t),my(this._sucs[t],e),this._in[e][s]=o,this._out[t][s]=o,this._edgeCount++,this}edge(t,e,n){var i=1===arguments.length?xy(this._isDirected,arguments[0]):_y(this._isDirected,t,e,n);return this._edgeLabels[i]}hasEdge(t,e,n){var i=1===arguments.length?xy(this._isDirected,arguments[0]):_y(this._isDirected,t,e,n);return Lg(this._edgeLabels,i)}removeEdge(t,e,n){var i=1===arguments.length?xy(this._isDirected,arguments[0]):_y(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],by(this._preds[e],t),by(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var i=Og(n);return e?xg(i,(function(t){return t.v===e})):i}}outEdges(t,e){var n=this._out[t];if(n){var i=Og(n);return e?xg(i,(function(t){return t.w===e})):i}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}}function my(t,e){t[e]?t[e]++:t[e]=1}function by(t,e){--t[e]||delete t[e]}function _y(t,e,n,i){var r=""+e,a=""+n;if(!t&&r>a){var s=r;r=a,a=s}return r+gy+a+gy+(Fg(i)?py:i)}function xy(t,e){return _y(t,e.v,e.w,e.name)}yy.prototype._nodeCount=0,yy.prototype._edgeCount=0;class vy{constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,e=t._prev;if(e!==t)return ky(e),e}enqueue(t){var e=this._sentinel;t._prev&&t._next&&ky(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,wy)),n=n._prev;return"["+t.join(", ")+"]"}}function ky(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function wy(t,e){if("_next"!==t&&"_prev"!==t)return e}var Ty=su(1);function Cy(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new yy,i=0,r=0;bg(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),bg(t.edges(),(function(t){var a=n.edge(t.v,t.w)||0,s=e(t),o=a+s;n.setEdge(t.v,t.w,o),r=Math.max(r,n.node(t.v).out+=s),i=Math.max(i,n.node(t.w).in+=s)}));var a=ey(r+i+3).map((function(){return new vy})),s=i+1;return bg(n.nodes(),(function(t){Sy(a,s,n.node(t))})),{graph:n,buckets:a,zeroIdx:s}}(t,e||Ty),i=function(t,e,n){var i,r=[],a=e[e.length-1],s=e[0];for(;t.nodeCount();){for(;i=s.dequeue();)Ey(t,e,n,i);for(;i=a.dequeue();)Ey(t,e,n,i);if(t.nodeCount())for(var o=e.length-2;o>0;--o)if(i=e[o].dequeue()){r=r.concat(Ey(t,e,n,i,!0));break}}return r}(n.graph,n.buckets,n.zeroIdx);return Cd(Eg(i,(function(e){return t.outEdges(e.v,e.w)})))}function Ey(t,e,n,i,r){var a=r?[]:void 0;return bg(t.inEdges(i.v),(function(i){var s=t.edge(i),o=t.node(i.v);r&&a.push({v:i.v,w:i.w}),o.out-=s,Sy(e,n,o)})),bg(t.outEdges(i.v),(function(i){var r=t.edge(i),a=i.w,s=t.node(a);s.in-=r,Sy(e,n,s)})),t.removeNode(i.v),a}function Sy(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}function Ay(t){var e="greedy"===t.graph().acyclicer?Cy(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};function r(a){Lg(i,a)||(i[a]=!0,n[a]=!0,bg(t.outEdges(a),(function(t){Lg(n,t.w)?e.push(t):r(t.w)})),delete n[a])}return bg(t.nodes(),r),e}(t);bg(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,dy("rev"))}))}function Dy(t,e,n,i){var r;do{r=dy(i)}while(t.hasNode(r));return n.dummy=e,t.setNode(r,n),r}function Ly(t){var e=new yy({multigraph:t.isMultigraph()}).setGraph(t.graph());return bg(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),bg(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e}function Oy(t,e){var n,i,r=t.x,a=t.y,s=e.x-r,o=e.y-a,l=t.width/2,c=t.height/2;if(!s&&!o)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),n=c*s/o,i=c):(s<0&&(l=-l),n=l,i=l*o/s),{x:r+n,y:a+i}}function Ny(t){var e=Eg(ey(By(t)+1),(function(){return[]}));return bg(t.nodes(),(function(n){var i=t.node(n),r=i.rank;Fg(r)||(e[r][i.order]=n)})),e}function My(t,e,n,i){var r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Dy(t,"border",r,e)}function By(t){return Yg(Eg(t.nodes(),(function(e){var n=t.node(e).rank;if(!Fg(n))return n})))}function Iy(t,e){var n=ag();try{return e()}finally{console.log(t+" time: "+(ag()-n)+"ms")}}function Fy(t,e){return e()}function Ry(t,e,n,i,r,a){var s={width:0,height:0,rank:a,borderType:e},o=r[e][a-1],l=Dy(t,"border",s,n);r[e][a]=l,t.setParent(l,i),o&&t.setEdge(o,l,{weight:1})}function $y(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){bg(t.nodes(),(function(e){jy(t.node(e))})),bg(t.edges(),(function(e){var n=t.edge(e);bg(n.points,jy),Lg(n,"y")&&jy(n)}))}(t),"lr"!==e&&"rl"!==e||(!function(t){bg(t.nodes(),(function(e){zy(t.node(e))})),bg(t.edges(),(function(e){var n=t.edge(e);bg(n.points,zy),Lg(n,"x")&&zy(n)}))}(t),Py(t))}function Py(t){bg(t.nodes(),(function(e){Yy(t.node(e))})),bg(t.edges(),(function(e){Yy(t.edge(e))}))}function Yy(t){var e=t.width;t.width=t.height,t.height=e}function jy(t){t.y=-t.y}function zy(t){var e=t.x;t.x=t.y,t.y=e}function Uy(t){var e=Dy(t,"root",{},"_root"),n=function(t){var e={};function n(i,r){var a=t.children(i);a&&a.length&&bg(a,(function(t){n(t,r+1)})),e[i]=r}return bg(t.children(),(function(t){n(t,1)})),e}(t),i=Yg(Og(n))-1,r=2*i+1;t.graph().nestingRoot=e,bg(t.edges(),(function(e){t.edge(e).minlen*=r}));var a=function(t){return iy(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;bg(t.children(),(function(s){Wy(t,e,r,a,i,n,s)})),t.graph().nodeRankFactor=r}function Wy(t,e,n,i,r,a,s){var o=t.children(s);if(o.length){var l=My(t,"_bt"),c=My(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(c,s),h.borderBottom=c,bg(o,(function(o){Wy(t,e,n,i,r,a,o);var h=t.node(o),u=h.borderTop?h.borderTop:o,d=h.borderBottom?h.borderBottom:o,p=h.borderTop?i:2*i,f=u!==d?1:r-a[s]+1;t.setEdge(l,u,{weight:p,minlen:f,nestingEdge:!0}),t.setEdge(d,c,{weight:p,minlen:f,nestingEdge:!0})})),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:r+a[s]})}else s!==e&&t.setEdge(e,s,{weight:0,minlen:n})}function Hy(t,e,n){var i=function(t){var e;for(;t.hasNode(e=dy("_root")););return e}(t),r=new yy({compound:!0}).setGraph({root:i}).setDefaultNodeLabel((function(e){return t.node(e)}));return bg(t.nodes(),(function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(r.setNode(a),r.setParent(a,o||i),bg(t[n](a),(function(e){var n=e.v===a?e.w:e.v,i=r.edge(n,a),s=Fg(i)?0:i.weight;r.setEdge(n,a,{weight:t.edge(e).weight+s})})),Lg(s,"minRank")&&r.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),r}function qy(t,e){for(var n=0,i=1;i0;)e%2&&(n+=o[e+1]),o[e=e-1>>1]+=t.weight;l+=t.weight*n}))),l}function Gy(t,e){var n={};return bg(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};Fg(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight)})),bg(e.edges(),(function(t){var e=n[t.v],i=n[t.w];Fg(e)||Fg(i)||(i.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(Fg(e.barycenter)||Fg(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,i=0;t.weight&&(n+=t.barycenter*t.weight,i+=t.weight);e.weight&&(n+=e.barycenter*e.weight,i+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var r=t.pop();e.push(r),bg(r.in.reverse(),n(r)),bg(r.out,i(r))}return Eg(xg(e,(function(t){return!t.merged})),(function(t){return Qg(t,["vs","i","barycenter","weight"])}))}(xg(n,(function(t){return!t.indegree})))}function Xy(t,e){var n,i=function(t,e){var n={lhs:[],rhs:[]};return bg(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n}(t,(function(t){return Lg(t,"barycenter")})),r=i.lhs,a=ay(i.rhs,(function(t){return-t.i})),s=[],o=0,l=0,c=0;r.sort((n=!!e,function(t,e){return t.barycentere.barycenter?1:n?e.i-t.i:t.i-e.i})),c=Zy(s,a,c),bg(r,(function(t){c+=t.vs.length,s.push(t.vs),o+=t.barycenter*t.weight,l+=t.weight,c=Zy(s,a,c)}));var h={vs:Cd(s)};return l&&(h.barycenter=o/l,h.weight=l),h}function Zy(t,e,n){for(var i;e.length&&(i=yg(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}function Qy(t,e,n,i){var r=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(r=xg(r,(function(t){return t!==s&&t!==o})));var c=function(t,e){return Eg(e,(function(e){var n=t.inEdges(e);if(n.length){var i=iy(n,(function(e,n){var i=t.edge(n),r=t.node(n.v);return{sum:e.sum+i.weight*r.order,weight:e.weight+i.weight}}),{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}}))}(t,r);bg(c,(function(e){if(t.children(e.v).length){var r=Qy(t,e.v,n,i);l[e.v]=r,Lg(r,"barycenter")&&(s=r,Fg((a=e).barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s}));var h=Gy(c,n);!function(t,e){bg(t,(function(t){t.vs=Cd(t.vs.map((function(t){return e[t]?e[t].vs:t})))}))}(h,l);var u=Xy(h,i);if(s&&(u.vs=Cd([s,u.vs,o]),t.predecessors(s).length)){var d=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Lg(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+d.order+p.order)/(u.weight+2),u.weight+=2}return u}function Ky(t){var e=By(t),n=Jy(t,ey(1,e+1),"inEdges"),i=Jy(t,ey(e-1,-1,-1),"outEdges"),r=function(t){var e={},n=xg(t.nodes(),(function(e){return!t.children(e).length})),i=Yg(Eg(n,(function(e){return t.node(e).rank}))),r=Eg(ey(i+1),(function(){return[]}));return bg(ay(n,(function(e){return t.node(e).rank})),(function n(i){if(!Lg(e,i)){e[i]=!0;var a=t.node(i);r[a.rank].push(i),bg(t.successors(i),n)}})),r}(t);em(t,r);for(var a,s=Number.POSITIVE_INFINITY,o=0,l=0;l<4;++o,++l){tm(o%2?n:i,o%4>=2);var c=qy(t,r=Ny(t));cl||c>e[r].lim));a=r,r=i;for(;(r=t.parent(r))!==a;)o.push(r);return{path:s.concat(o.reverse()),lca:a}}(t,e,r.v,r.w),s=a.path,o=a.lca,l=0,c=s[l],h=!0;n!==r.w;){if(i=t.node(n),h){for(;(c=s[l])!==o&&t.node(c).maxRankn){var i=e;e=n,n=i}var r=t[e];r||(t[e]=r={}),r[n]=!0}function am(t,e,n){if(e>n){var i=e;e=n,n=i}return Lg(t[e],n)}function sm(t,e,n,i,r){var a={},s=function(t,e,n,i){var r=new yy,a=t.graph(),s=function(t,e,n){return function(i,r,a){var s,o=i.node(r),l=i.node(a),c=0;if(c+=o.width/2,Lg(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=-o.width/2;break;case"r":s=o.width/2}if(s&&(c+=n?s:-s),s=0,c+=(o.dummy?e:t)/2,c+=(l.dummy?e:t)/2,c+=l.width/2,Lg(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=l.width/2;break;case"r":s=-l.width/2}return s&&(c+=n?s:-s),s=0,c}}(a.nodesep,a.edgesep,i);return bg(e,(function(e){var i;bg(e,(function(e){var a=n[e];if(r.setNode(a),i){var o=n[i],l=r.edge(o,a);r.setEdge(o,a,Math.max(s(t,e,i),l||0))}i=e}))})),r}(t,e,n,r),o=r?"borderLeft":"borderRight";function l(t,e){for(var n=s.nodes(),i=n.pop(),r={};i;)r[i]?t(i):(r[i]=!0,n.push(i),n=n.concat(e(i))),i=n.pop()}return l((function(t){a[t]=s.inEdges(t).reduce((function(t,e){return Math.max(t,a[e.v]+s.edge(e))}),0)}),s.predecessors.bind(s)),l((function(e){var n=s.outEdges(e).reduce((function(t,e){return Math.min(t,a[e.w]-s.edge(e))}),Number.POSITIVE_INFINITY),i=t.node(e);n!==Number.POSITIVE_INFINITY&&i.borderType!==o&&(a[e]=Math.max(a[e],n))}),s.successors.bind(s)),bg(i,(function(t){a[t]=a[n[t]]})),a}function om(t,e){return Hg(Og(e),(function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return function(t,e){null==t||eg(t,mg(e),od)}(e,(function(e,r){var a=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+a,n),i=Math.min(e-a,i)})),n-i}))}function lm(t){var e,n=Ny(t),i=Ug(im(t,n),function(t,e){var n={};function i(e,i,r,a,s){var o;bg(ey(i,r),(function(i){o=e[i],t.node(o).dummy&&bg(t.predecessors(o),(function(e){var i=t.node(e);i.dummy&&(i.orders)&&rm(n,e,o)}))}))}return iy(e,(function(e,n){var r,a=-1,s=0;return bg(n,(function(o,l){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(r=t.node(c[0]).order,i(n,s,l,a,r),s=l,a=r)}i(n,s,n.length,r,e.length)})),n})),n}(t,n)),r={};bg(["u","d"],(function(a){e="u"===a?n:Og(n).reverse(),bg(["l","r"],(function(n){"r"===n&&(e=Eg(e,(function(t){return Og(t).reverse()})));var s=("u"===a?t.predecessors:t.successors).bind(t),o=function(t,e,n,i){var r={},a={},s={};return bg(e,(function(t){bg(t,(function(t,e){r[t]=t,a[t]=t,s[t]=e}))})),bg(e,(function(t){var e=-1;bg(t,(function(t){var o=i(t);if(o.length){o=ay(o,(function(t){return s[t]}));for(var l=(o.length-1)/2,c=Math.floor(l),h=Math.ceil(l);c<=h;++c){var u=o[c];a[t]===t&&es.lim&&(o=s,l=!0);var c=xg(e.edges(),(function(e){return l===Rm(t,t.node(e.v),o)&&l!==Rm(t,t.node(e.w),o)}));return Hg(c,(function(t){return km(e,t)}))}function Fm(t,e,n,i){var r=n.v,a=n.w;t.removeEdge(r,a),t.setEdge(i.v,i.w,{}),Nm(t),Lm(t,e),function(t,e){var n=Tg(t.nodes(),(function(t){return!e.node(t).parent})),i=function(t,e){return Sm(t,e,"pre")}(t,n);bg(i=i.slice(1),(function(n){var i=t.node(n).parent,r=e.edge(n,i),a=!1;r||(r=e.edge(i,n),a=!0),e.node(n).rank=e.node(i).rank+(a?r.minlen:-r.minlen)}))}(t,e)}function Rm(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}new Error,Dm.initLowLimValues=Nm,Dm.initCutValues=Lm,Dm.calcCutValue=Om,Dm.leaveEdge=Bm,Dm.enterEdge=Im,Dm.exchangeEdges=Fm;var $m=vm;function Pm(t){Dm(t)}function Ym(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:jm(t),edges:zm(t)};return Fg(t.graph())||(e.value=nf(t.graph(),rf)),e}function jm(t){return Eg(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),r={v:e};return Fg(n)||(r.value=n),Fg(i)||(r.parent=i),r}))}function zm(t){return Eg(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return Fg(e.name)||(i.name=e.name),Fg(n)||(i.value=n),i}))}let Um;const Wm=new Uint8Array(16);function Hm(){if(!Um&&(Um="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Um))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Um(Wm)}const qm=[];for(let t=0;t<256;++t)qm.push((t+256).toString(16).slice(1));var Vm={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Gm(t,e,n){if(Vm.randomUUID&&!e&&!t)return Vm.randomUUID();const i=(t=t||{}).random||(t.rng||Hm)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return function(t,e=0){return(qm[t[e+0]]+qm[t[e+1]]+qm[t[e+2]]+qm[t[e+3]]+"-"+qm[t[e+4]]+qm[t[e+5]]+"-"+qm[t[e+6]]+qm[t[e+7]]+"-"+qm[t[e+8]]+qm[t[e+9]]+"-"+qm[t[e+10]]+qm[t[e+11]]+qm[t[e+12]]+qm[t[e+13]]+qm[t[e+14]]+qm[t[e+15]]).toLowerCase()}(i)}function Xm(t,e){e&&t.attr("style",e)}function Zm(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div");i.attr("xmlns","http://www.w3.org/1999/xhtml");var r=e.label;switch(typeof r){case"function":i.insert(r);break;case"object":i.insert((function(){return r}));break;default:i.html(r)}Xm(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var a=i.node().getBoundingClientRect();return n.attr("width",a.width).attr("height",a.height),n}var Qm=Object.defineProperty,Km=(t,e,n)=>(((t,e,n)=>{e in t?Qm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);const Jm={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},tb={trace:(...t)=>{},debug:(...t)=>{},info:(...t)=>{},warn:(...t)=>{},error:(...t)=>{},fatal:(...t)=>{}},eb=function(t="fatal"){let e=Jm.fatal;"string"==typeof t?(t=t.toLowerCase())in Jm&&(e=Jm[t]):"number"==typeof t&&(e=t),tb.trace=()=>{},tb.debug=()=>{},tb.info=()=>{},tb.warn=()=>{},tb.error=()=>{},tb.fatal=()=>{},e<=Jm.fatal&&(tb.fatal=console.error?console.error.bind(console,nb("FATAL"),"color: orange"):console.log.bind(console,"[35m",nb("FATAL"))),e<=Jm.error&&(tb.error=console.error?console.error.bind(console,nb("ERROR"),"color: orange"):console.log.bind(console,"[31m",nb("ERROR"))),e<=Jm.warn&&(tb.warn=console.warn?console.warn.bind(console,nb("WARN"),"color: orange"):console.log.bind(console,"[33m",nb("WARN"))),e<=Jm.info&&(tb.info=console.info?console.info.bind(console,nb("INFO"),"color: lightblue"):console.log.bind(console,"[34m",nb("INFO"))),e<=Jm.debug&&(tb.debug=console.debug?console.debug.bind(console,nb("DEBUG"),"color: lightgreen"):console.log.bind(console,"[32m",nb("DEBUG"))),e<=Jm.trace&&(tb.trace=console.debug?console.debug.bind(console,nb("TRACE"),"color: lightgreen"):console.log.bind(console,"[32m",nb("TRACE")))},nb=t=>`%c${e().format("ss.SSS")} : ${t} : `,ib=t=>vl.sanitize(t),rb=(t,e)=>{var n;if(!1!==(null==(n=e.flowchart)?void 0:n.htmlLabels)){const n=e.securityLevel;"antiscript"===n||"strict"===n?t=ib(t):"loose"!==n&&(t=(t=(t=lb(t)).replace(//g,">")).replace(/=/g,"="),t=ob(t))}return t},ab=(t,e)=>t?t=e.dompurifyConfig?vl.sanitize(rb(t,e),e.dompurifyConfig).toString():vl.sanitize(rb(t,e),{FORBID_TAGS:["style"]}).toString():t,sb=/
/gi,ob=t=>t.replace(/#br#/g,"
"),lb=t=>t.replace(sb,"#br#"),cb=t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase()),hb=function(t){let e=t;return t.includes("~")?(e=e.replace(/~([^~].*)/,"<$1"),e=e.replace(/~([^~]*)$/,">$1"),hb(e)):e},ub={getRows:t=>{if(!t)return[""];return lb(t).replace(/\\n/g,"#br#").split("#br#")},sanitizeText:ab,sanitizeTextOrArray:(t,e)=>"string"==typeof t?ab(t,e):t.flat().map((t=>ab(t,e))),hasBreaks:t=>sb.test(t),splitBreaks:t=>t.split(sb),lineBreakRegex:sb,removeScript:ib,getUrl:t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e},evaluate:cb},db=(t,e)=>Gl(t,e?{s:-40,l:10}:{s:-40,l:-10}),pb="#ffffff",fb="#f2f2f2";class gb{constructor(){this.background="#f4f4f4",this.darkMode=!1,this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Gl(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Gl(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||db(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||db(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||db(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||db(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Zl(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Zl(this.tertiaryColor),this.lineColor=this.lineColor||Zl(this.background),this.textColor=this.textColor||this.primaryTextColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Vl(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||"grey",this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Vl(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Zl(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ql(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Gl(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gl(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gl(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gl(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gl(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gl(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Gl(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gl(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gl(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}class yb{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ql(this.primaryColor,16),this.tertiaryColor=Gl(this.primaryColor,{h:-160}),this.primaryBorderColor=Zl(this.background),this.secondaryBorderColor=db(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=db(this.tertiaryColor,this.darkMode),this.primaryTextColor=Zl(this.primaryColor),this.secondaryTextColor=Zl(this.secondaryColor),this.tertiaryTextColor=Zl(this.tertiaryColor),this.lineColor=Zl(this.background),this.textColor=Zl(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ql(Zl("#323D47"),10),this.lineColor="calculated",this.border1="#81B1DB",this.border2=Wl(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=Vl("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.taskBorderColor=Wl(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Wl(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder="calculated",this.personBkg="calculated",this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=ql(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=ql(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.mainContrastColor,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=ql(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Gl(this.primaryColor,{h:64}),this.fillType3=Gl(this.secondaryColor,{h:64}),this.fillType4=Gl(this.primaryColor,{h:-64}),this.fillType5=Gl(this.secondaryColor,{h:-64}),this.fillType6=Gl(this.primaryColor,{h:128}),this.fillType7=Gl(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Gl(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gl(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gl(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gl(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gl(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gl(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gl(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gl(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gl(this.primaryColor,{h:330});for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}class mb{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Gl(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Gl(this.primaryColor,{h:-160}),this.primaryBorderColor=db(this.primaryColor,this.darkMode),this.secondaryBorderColor=db(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=db(this.tertiaryColor,this.darkMode),this.primaryTextColor=Zl(this.primaryColor),this.secondaryTextColor=Zl(this.secondaryColor),this.tertiaryTextColor=Zl(this.tertiaryColor),this.lineColor=Zl(this.background),this.textColor=Zl(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#e8e8e8",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="grey",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=Wl(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Gl(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gl(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gl(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gl(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gl(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gl(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gl(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gl(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gl(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Vl(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Vl(this.tertiaryColor,40);for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}class bb{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=ql("#cde498",10),this.primaryBorderColor=db(this.primaryColor,this.darkMode),this.secondaryBorderColor=db(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=db(this.tertiaryColor,this.darkMode),this.primaryTextColor=Zl(this.primaryColor),this.secondaryTextColor=Zl(this.secondaryColor),this.tertiaryTextColor=Zl(this.primaryColor),this.lineColor=Zl(this.background),this.textColor=Zl(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="grey",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Gl(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gl(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gl(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gl(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gl(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gl(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gl(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gl(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gl(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Vl(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Vl(this.tertiaryColor,40);for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}class _b{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=ql(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Gl(this.primaryColor,{h:-160}),this.primaryBorderColor=db(this.primaryColor,this.darkMode),this.secondaryBorderColor=db(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=db(this.tertiaryColor,this.darkMode),this.primaryTextColor=Zl(this.primaryColor),this.secondaryTextColor=Zl(this.secondaryColor),this.tertiaryTextColor=Zl(this.tertiaryColor),this.lineColor=Zl(this.background),this.textColor=Zl(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=ql(this.contrast,55),this.border2=this.contrast,this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}const xb={base:{getThemeVariables:t=>{const e=new gb;return e.calculate(t),e}},dark:{getThemeVariables:t=>{const e=new yb;return e.calculate(t),e}},default:{getThemeVariables:t=>{const e=new mb;return e.calculate(t),e}},forest:{getThemeVariables:t=>{const e=new bb;return e.calculate(t),e}},neutral:{getThemeVariables:t=>{const e=new _b;return e.calculate(t),e}}},vb={theme:"default",themeVariables:xb.default.getThemeVariables(),themeCSS:void 0,maxTextSize:5e4,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize"],deterministicIds:!1,deterministicIDSeed:void 0,flowchart:{titleTopMargin:25,diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,useMaxWidth:!0,defaultRenderer:"dagre-wrapper"},sequence:{hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20,messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},noteFont:function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},actorFont:function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",tickInterval:void 0,useMaxWidth:!0,topAxis:!1,useWidth:void 0},journey:{diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,useMaxWidth:!0,defaultRenderer:"dagre-wrapper"},state:{titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,useMaxWidth:!0,defaultRenderer:"dagre-wrapper"},er:{titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12,useMaxWidth:!0},pie:{useWidth:void 0,useMaxWidth:!0},requirement:{useWidth:void 0,useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},gitGraph:{titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0},c4:{useWidth:void 0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,useMaxWidth:!0,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,personFont:function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},external_personFont:function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},systemFont:function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},external_systemFont:function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},system_dbFont:function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},external_system_dbFont:function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},system_queueFont:function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},external_system_queueFont:function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},containerFont:function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},external_containerFont:function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},container_dbFont:function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},external_container_dbFont:function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},container_queueFont:function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},external_container_queueFont:function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},componentFont:function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},external_componentFont:function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},component_dbFont:function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},external_component_dbFont:function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},component_queueFont:function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},external_component_queueFont:function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},boundaryFont:function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},fontSize:16};vb.class&&(vb.class.arrowMarkerAbsolute=vb.arrowMarkerAbsolute),vb.gitGraph&&(vb.gitGraph.arrowMarkerAbsolute=vb.arrowMarkerAbsolute);const kb=(t,e="")=>Object.keys(t).reduce(((n,i)=>Array.isArray(t[i])?n:"object"==typeof t[i]&&null!==t[i]?[...n,e+i,...kb(t[i],"")]:[...n,e+i]),[]),wb=kb(vb,""),Tb=vb;
+/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
+function Cb(t){return null==t}var Eb=function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},Sb=function(t,e){var n,i,r,a;if(e)for(n=0,i=(a=Object.keys(e)).length;no&&(e=i-o+(a=" ... ").length),n-i>o&&(n=i+o-(s=" ...").length),{str:a+t.slice(e,n).replace(/\t/g,"→")+s,pos:i-e+a.length}}function Mb(t,e){return Ab.repeat(" ",e-t.length)+t}var Bb=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,r=[0],a=[],s=-1;n=i.exec(t.buffer);)a.push(n.index),r.push(n.index+n[0].length),t.position<=n.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);var o,l,c="",h=Math.min(t.line+e.linesAfter,a.length).toString().length,u=e.maxLength-(e.indent+h+3);for(o=1;o<=e.linesBefore&&!(s-o<0);o++)l=Nb(t.buffer,r[s-o],a[s-o],t.position-(r[s]-r[s-o]),u),c=Ab.repeat(" ",e.indent)+Mb((t.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=Nb(t.buffer,r[s],a[s],t.position,u),c+=Ab.repeat(" ",e.indent)+Mb((t.line+1).toString(),h)+" | "+l.str+"\n",c+=Ab.repeat("-",e.indent+h+3+l.pos)+"^\n",o=1;o<=e.linesAfter&&!(s+o>=a.length);o++)l=Nb(t.buffer,r[s+o],a[s+o],t.position-(r[s]-r[s+o]),u),c+=Ab.repeat(" ",e.indent)+Mb((t.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")},Ib=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Fb=["scalar","sequence","mapping"];var Rb=function(t,e){var n,i;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===Ib.indexOf(e))throw new Ob('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=(n=e.styleAliases||null,i={},null!==n&&Object.keys(n).forEach((function(t){n[t].forEach((function(e){i[String(e)]=t}))})),i),-1===Fb.indexOf(this.kind))throw new Ob('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function $b(t,e){var n=[];return t[e].forEach((function(t){var e=n.length;n.forEach((function(n,i){n.tag===t.tag&&n.kind===t.kind&&n.multi===t.multi&&(e=i)})),n[e]=t})),n}function Pb(t){return this.extend(t)}Pb.prototype.extend=function(t){var e=[],n=[];if(t instanceof Rb)n.push(t);else if(Array.isArray(t))n=n.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new Ob("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof Rb))throw new Ob("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new Ob("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new Ob("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(t){if(!(t instanceof Rb))throw new Ob("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(Pb.prototype);return i.implicit=(this.implicit||[]).concat(e),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=$b(i,"implicit"),i.compiledExplicit=$b(i,"explicit"),i.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(t){t.multi?(n.multi[t.kind].push(t),n.multi.fallback.push(t)):n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),qb=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Vb=/^[-+]?[0-9]+e/;var Gb=new Rb("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!qb.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||Ab.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ab.isNegativeZero(t))return"-0.0";return n=t.toString(10),Vb.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),Xb=Yb.extend({implicit:[jb,zb,Hb,Gb]}),Zb=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Qb=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var Kb=new Rb("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==Zb.exec(t)||null!==Qb.exec(t))},construct:function(t){var e,n,i,r,a,s,o,l,c=0,h=null;if(null===(e=Zb.exec(t))&&(e=Qb.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],i=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(n,i,r));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(h=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),l=new Date(Date.UTC(n,i,r,a,s,o,c)),h&&l.setTime(l.getTime()-h),l},instanceOf:Date,represent:function(t){return t.toISOString()}});var Jb=new Rb("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),t_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var e_=new Rb("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=0,r=t.length,a=t_;for(n=0;n64)){if(e<0)return!1;i+=6}return i%8==0},construct:function(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,a=t_,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(255&s)),s=s<<6|a.indexOf(i.charAt(e));return 0===(n=r%4*6)?(o.push(s>>16&255),o.push(s>>8&255),o.push(255&s)):18===n?(o.push(s>>10&255),o.push(s>>2&255)):12===n&&o.push(s>>4&255),new Uint8Array(o)},predicate:function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)},represent:function(t){var e,n,i="",r=0,a=t.length,s=t_;for(e=0;e>18&63],i+=s[r>>12&63],i+=s[r>>6&63],i+=s[63&r]),r=(r<<8)+t[e];return 0===(n=a%3)?(i+=s[r>>18&63],i+=s[r>>12&63],i+=s[r>>6&63],i+=s[63&r]):2===n?(i+=s[r>>10&63],i+=s[r>>4&63],i+=s[r<<2&63],i+=s[64]):1===n&&(i+=s[r>>2&63],i+=s[r<<4&63],i+=s[64],i+=s[64]),i}}),n_=Object.prototype.hasOwnProperty,i_=Object.prototype.toString;var r_=new Rb("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,i,r,a,s=[],o=t;for(e=0,n=o.length;e>10),56320+(t-65536&1023))}for(var O_=new Array(256),N_=new Array(256),M_=0;M_<256;M_++)O_[M_]=D_(M_)?1:0,N_[M_]=D_(M_);function B_(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||c_,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function I_(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=Bb(n),new Ob(e,n)}function F_(t,e){throw I_(t,e)}function R_(t,e){t.onWarning&&t.onWarning.call(null,I_(t,e))}var $_={YAML:function(t,e,n){var i,r,a;null!==t.version&&F_(t,"duplication of %YAML directive"),1!==n.length&&F_(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&F_(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),a=parseInt(i[2],10),1!==r&&F_(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&R_(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var i,r;2!==n.length&&F_(t,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],v_.test(i)||F_(t,"ill-formed tag handle (first argument) of the TAG directive"),h_.call(t.tagMap,i)&&F_(t,'there is a previously declared suffix for "'+i+'" tag handle'),k_.test(r)||F_(t,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(e){F_(t,"tag prefix is malformed: "+r)}t.tagMap[i]=r}};function P_(t,e,n,i){var r,a,s,o;if(e1&&(t.result+=Ab.repeat("\n",e-1))}function q_(t,e){var n,i,r=t.tag,a=t.anchor,s=[],o=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=s),i=t.input.charCodeAt(t.position);0!==i&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,F_(t,"tab characters must not be used in indentation")),45===i)&&E_(t.input.charCodeAt(t.position+1));)if(o=!0,t.position++,U_(t,!0,-1)&&t.lineIndent<=e)s.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,X_(t,e,p_,!1,!0),s.push(t.result),U_(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)F_(t,"bad indentation of a sequence entry");else if(t.lineIndente?f=1:t.lineIndent===e?f=0:t.lineIndente?f=1:t.lineIndent===e?f=0:t.lineIndente)&&(m&&(s=t.line,o=t.lineStart,l=t.position),X_(t,e,f_,!0,r)&&(m?g=t.result:y=t.result),m||(j_(t,d,p,f,g,y,s,o,l),f=g=y=null),U_(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&0!==c)F_(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===r?F_(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?F_(t,"repeat of an indentation width identifier"):(h=e+r-1,c=!0)}if(C_(a)){do{a=t.input.charCodeAt(++t.position)}while(C_(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!T_(a)&&0!==a)}for(;0!==a;){for(z_(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!c||t.lineIndenth&&(h=t.lineIndent),T_(a))u++;else{if(t.lineIndent0){for(r=s,a=0;r>0;r--)(s=A_(o=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+s:F_(t,"expected hexadecimal character");t.result+=L_(a),t.position++}else F_(t,"unknown escape sequence");n=i=t.position}else T_(o)?(P_(t,n,i,!0),H_(t,U_(t,!1,e)),n=i=t.position):t.position===t.lineStart&&W_(t)?F_(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}F_(t,"unexpected end of the stream within a double quoted scalar")}(t,d)?y=!0:!function(t){var e,n,i;if(42!==(i=t.input.charCodeAt(t.position)))return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!E_(i)&&!S_(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&F_(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),h_.call(t.anchorMap,n)||F_(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],U_(t,!0,-1),!0}(t)?function(t,e,n){var i,r,a,s,o,l,c,h,u=t.kind,d=t.result;if(E_(h=t.input.charCodeAt(t.position))||S_(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(E_(i=t.input.charCodeAt(t.position+1))||n&&S_(i)))return!1;for(t.kind="scalar",t.result="",r=a=t.position,s=!1;0!==h;){if(58===h){if(E_(i=t.input.charCodeAt(t.position+1))||n&&S_(i))break}else if(35===h){if(E_(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&W_(t)||n&&S_(h))break;if(T_(h)){if(o=t.line,l=t.lineStart,c=t.lineIndent,U_(t,!1,-1),t.lineIndent>=e){s=!0,h=t.input.charCodeAt(t.position);continue}t.position=a,t.line=o,t.lineStart=l,t.lineIndent=c;break}}s&&(P_(t,r,a,!1),H_(t,t.line-o),r=a=t.position,s=!1),C_(h)||(a=t.position+1),h=t.input.charCodeAt(++t.position)}return P_(t,r,a,!1),!!t.result||(t.kind=u,t.result=d,!1)}(t,d,u_===n)&&(y=!0,null===t.tag&&(t.tag="?")):(y=!0,null===t.tag&&null===t.anchor||F_(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===f&&(y=o&&q_(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&F_(t,'unacceptable node kind for !> tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l"),null!==t.result&&u.kind!==t.kind&&F_(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+u.kind+'", not "'+t.kind+'"'),u.resolve(t.result,t.tag)?(t.result=u.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):F_(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||y}function Z_(t){var e,n,i,r,a=t.position,s=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(r=t.input.charCodeAt(t.position))&&(U_(t,!0,-1),r=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==r));){for(s=!0,r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!E_(r);)r=t.input.charCodeAt(++t.position);for(i=[],(n=t.input.slice(e,t.position)).length<1&&F_(t,"directive name must not be less than one character in length");0!==r;){for(;C_(r);)r=t.input.charCodeAt(++t.position);if(35===r){do{r=t.input.charCodeAt(++t.position)}while(0!==r&&!T_(r));break}if(T_(r))break;for(e=t.position;0!==r&&!E_(r);)r=t.input.charCodeAt(++t.position);i.push(t.input.slice(e,t.position))}0!==r&&z_(t),h_.call($_,n)?$_[n](t,n,i):R_(t,'unknown document directive "'+n+'"')}U_(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,U_(t,!0,-1)):s&&F_(t,"directives end mark is expected"),X_(t,t.lineIndent-1,f_,!1,!0),U_(t,!0,-1),t.checkLineBreaks&&__.test(t.input.slice(a,t.position))&&R_(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&W_(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,U_(t,!0,-1)):t.position{if(rx[t])throw new Error(`Detector with key ${t} already exists`);rx[t]={detector:e,loader:n},tb.debug(`Detector with key ${t} added${n?" with loader":""}`)},ox=function(t,e,n){const{depth:i,clobber:r}=Object.assign({depth:2,clobber:!1},n);return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>ox(t,e,n))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||i<=0?null!=t&&"object"==typeof t&&"object"==typeof e?Object.assign(t,e):e:(void 0!==e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).forEach((n=>{"object"!=typeof e[n]||void 0!==t[n]&&"object"!=typeof t[n]?(r||"object"!=typeof t[n]&&"object"!=typeof e[n])&&(t[n]=e[n]):(void 0===t[n]&&(t[n]=Array.isArray(e[n])?[]:{}),t[n]=ox(t[n],e[n],{depth:i-1,clobber:r}))})),t)},lx=ox,cx={curveBasis:ao,curveBasisClosed:function(t){return new so(t)},curveBasisOpen:function(t){return new oo(t)},curveLinear:Zs,curveLinearClosed:function(t){return new lo(t)},curveMonotoneX:function(t){return new fo(t)},curveMonotoneY:function(t){return new go(t)},curveNatural:function(t){return new mo(t)},curveStep:function(t){return new _o(t,.5)},curveStepAfter:function(t){return new _o(t,1)},curveStepBefore:function(t){return new _o(t,0)}},hx=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ux=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,dx=function(t,e=null){try{const n=new RegExp(`[%]{2}(?![{]${ux.source})(?=[}][%]{2}).*\n`,"ig");let i;t=t.trim().replace(n,"").replace(/'/gm,'"'),tb.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const r=[];for(;null!==(i=hx.exec(t));)if(i.index===hx.lastIndex&&hx.lastIndex++,i&&!e||e&&i[1]&&i[1].match(e)||e&&i[2]&&i[2].match(e)){const t=i[1]?i[1]:i[2],e=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;r.push({type:t,args:e})}return 0===r.length&&r.push({type:t,args:null}),1===r.length?r[0]:r}catch(n){return tb.error(`ERROR: ${n.message} - Unable to parse directive\n ${null!==e?" type:"+e:""} based on the text:${t}`),{type:null,args:null}}};function px(t,e){if(!t)return e;const n=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return cx[n]||e}function fx(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function gx(t){let e="",n="";for(const i of t)void 0!==i&&(i.startsWith("color:")||i.startsWith("text-align:")?n=n+i+";":e=e+i+";");return{style:e,labelStyle:n}}let yx=0;const mx=()=>(yx++,"id-"+Math.random().toString(36).substr(2,12)+"-"+yx);const bx=t=>function(t){let e="";const n="0123456789abcdef",i=n.length;for(let r=0;r{if(!t)return t;if(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},n),ub.lineBreakRegex.test(t))return t;const i=t.split(" "),r=[];let a="";return i.forEach(((t,s)=>{const o=wx(`${t} `,n),l=wx(a,n);if(o>e){const{hyphenatedStrings:i,remainingWord:s}=vx(t,e,"-",n);r.push(a,...i),a=s}else l+o>=e?(r.push(a),a=t):a=[a,t].filter(Boolean).join(" ");s+1===i.length&&r.push(a)})),r.filter((t=>""!==t)).join(n.joinWith)}),((t,e,n)=>`${t}${e}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`)),vx=Uc(((t,e,n="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const r=[...t],a=[];let s="";return r.forEach(((t,o)=>{const l=`${s}${t}`;if(wx(l,i)>=e){const t=o+1,e=r.length===t,i=`${l}${n}`;a.push(e?l:i),s=""}else s=l})),{hyphenatedStrings:a,remainingWord:s}}),((t,e,n="-",i)=>`${t}${e}${n}${i.fontSize}${i.fontWeight}${i.fontFamily}`));function kx(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:15},e),Tx(t,e).height}function wx(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e),Tx(t,e).width}const Tx=Uc(((t,e)=>{e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e);const{fontSize:n,fontFamily:i,fontWeight:r}=e;if(!t)return{width:0,height:0};const a=["sans-serif",i],s=t.split(ub.lineBreakRegex),o=[],l=ie("body");if(!l.remove)return{width:0,height:0,lineHeight:0};const c=l.append("svg");for(const t of a){let e=0;const i={width:0,height:0,lineHeight:0};for(const a of s){const s={x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0};s.text=a;const o=_x(c,s).style("font-size",n).style("font-weight",r).style("font-family",t),l=(o._groups||o)[0][0].getBBox();i.width=Math.round(Math.max(i.width,l.width)),e=Math.round(l.height),i.height+=e,i.lineHeight=Math.round(Math.max(i.lineHeight,e))}o.push(i)}c.remove();return o[isNaN(o[1].height)||isNaN(o[1].width)||isNaN(o[1].lineHeight)||o[0].height>o[1].height&&o[0].width>o[1].width&&o[0].lineHeight>o[1].lineHeight?0:1]}),((t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`));let Cx;const Ex=t=>{if(tb.debug("directiveSanitizer called with",t),"object"==typeof t&&(t.length?t.forEach((t=>Ex(t))):Object.keys(t).forEach((e=>{tb.debug("Checking key",e),e.startsWith("__")&&(tb.debug("sanitize deleting __ option",e),delete t[e]),e.includes("proto")&&(tb.debug("sanitize deleting proto option",e),delete t[e]),e.includes("constr")&&(tb.debug("sanitize deleting constr option",e),delete t[e]),e.includes("themeCSS")&&(tb.debug("sanitizing themeCss option"),t[e]=Sx(t[e])),e.includes("fontFamily")&&(tb.debug("sanitizing fontFamily option"),t[e]=Sx(t[e])),e.includes("altFontFamily")&&(tb.debug("sanitizing altFontFamily option"),t[e]=Sx(t[e])),wb.includes(e)?"object"==typeof t[e]&&(tb.debug("sanitize deleting object",e),Ex(t[e])):(tb.debug("sanitize deleting option",e),delete t[e])}))),t.themeVariables){const e=Object.keys(t.themeVariables);for(const n of e){const e=t.themeVariables[n];e&&e.match&&!e.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[n]="")}}tb.debug("After sanitization",t)},Sx=t=>{let e=0,n=0;for(const i of t){if(et.args));Ex(t),i=lx(i,[...t])}else i=n.args;if(i){let n=ax(t,e);["config"].forEach((t=>{void 0!==i[t]&&("flowchart-v2"===n&&(n="flowchart"),i[n]=i[t],delete i[t])}))}return i},detectDirective:dx,isSubstringInArray:function(t,e){for(const[n,i]of e.entries())if(i.match(t))return n;return-1},interpolateToCurve:px,calcLabelPosition:function(t){return 1===t.length?t[0]:function(t){let e,n=0;t.forEach((t=>{n+=fx(t,e),e=t}));let i,r=n/2;return e=void 0,t.forEach((t=>{if(e&&!i){const n=fx(t,e);if(n=1&&(i={x:t.x,y:t.y}),a>0&&a<1&&(i={x:(1-a)*e.x+a*t.x,y:(1-a)*e.y+a*t.y})}}e=t})),i}(t)},calcCardinalityPosition:(t,e,n)=>{let i;tb.info(`our points ${JSON.stringify(e)}`),e[0]!==n&&(e=e.reverse());let r,a=25;i=void 0,e.forEach((t=>{if(i&&!r){const e=fx(t,i);if(e=1&&(r={x:t.x,y:t.y}),n>0&&n<1&&(r={x:(1-n)*i.x+n*t.x,y:(1-n)*i.y+n*t.y})}}i=t}));const s=t?10:5,o=Math.atan2(e[0].y-r.y,e[0].x-r.x),l={x:0,y:0};return l.x=Math.sin(o)*s+(e[0].x+r.x)/2,l.y=-Math.cos(o)*s+(e[0].y+r.y)/2,l},calcTerminalLabelPosition:function(t,e,n){let i,r=JSON.parse(JSON.stringify(n));tb.info("our points",r),"start_left"!==e&&"start_right"!==e&&(r=r.reverse()),r.forEach((t=>{i=t}));let a,s=25+t;i=void 0,r.forEach((t=>{if(i&&!a){const e=fx(t,i);if(e=1&&(a={x:t.x,y:t.y}),n>0&&n<1&&(a={x:(1-n)*i.x+n*t.x,y:(1-n)*i.y+n*t.y})}}i=t}));const o=10+.5*t,l=Math.atan2(r[0].y-a.y,r[0].x-a.x),c={x:0,y:0};return c.x=Math.sin(l)*o+(r[0].x+a.x)/2,c.y=-Math.cos(l)*o+(r[0].y+a.y)/2,"start_left"===e&&(c.x=Math.sin(l+Math.PI)*o+(r[0].x+a.x)/2,c.y=-Math.cos(l+Math.PI)*o+(r[0].y+a.y)/2),"end_right"===e&&(c.x=Math.sin(l-Math.PI)*o+(r[0].x+a.x)/2-5,c.y=-Math.cos(l-Math.PI)*o+(r[0].y+a.y)/2-5),"end_left"===e&&(c.x=Math.sin(l)*o+(r[0].x+a.x)/2-5,c.y=-Math.cos(l)*o+(r[0].y+a.y)/2-5),c},formatUrl:function(t,e){const n=t.trim();if(n)return"loose"!==e.securityLevel?i(n):n},getStylesFromArray:gx,generateId:mx,random:bx,runFunc:(t,...e)=>{const n=t.split("."),i=n.length-1,r=n[i];let a=window;for(let t=0;t{if(!i)return;const r=t.node().getBBox();t.append("text").text(i).attr("x",r.x+r.width/2).attr("y",-n).attr("class",e)}},Lx="9.3.0",Ox=Object.freeze(Tb);let Nx,Mx=lx({},Ox),Bx=[],Ix=lx({},Ox);const Fx=(t,e)=>{let n=lx({},t),i={};for(const t of e)zx(t),i=lx(i,t);if(n=lx(n,i),i.theme&&i.theme in xb){const t=lx({},Nx),e=lx(t.themeVariables||{},i.themeVariables);n.theme&&n.theme in xb&&(n.themeVariables=xb[n.theme].getThemeVariables(e))}return Ix=n,Vx(Ix),Ix},Rx=t=>(Mx=lx({},Ox),Mx=lx(Mx,t),t.theme&&xb[t.theme]&&(Mx.themeVariables=xb[t.theme].getThemeVariables(t.themeVariables)),Fx(Mx,Bx),Mx),$x=t=>{Nx=lx({},t)},Px=()=>lx({},Mx),Yx=t=>(Vx(t),lx(Ix,t),jx()),jx=()=>lx({},Ix),zx=t=>{var e;["secure",...null!=(e=Mx.secure)?e:[]].forEach((e=>{void 0!==t[e]&&(tb.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])})),Object.keys(t).forEach((e=>{0===e.indexOf("__")&&delete t[e]})),Object.keys(t).forEach((e=>{"string"==typeof t[e]&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],"object"==typeof t[e]&&zx(t[e])}))},Ux=t=>{t.fontFamily&&(t.themeVariables&&t.themeVariables.fontFamily||(t.themeVariables={fontFamily:t.fontFamily})),Bx.push(t),Fx(Mx,Bx)},Wx=(t=Mx)=>{Bx=[],Fx(t,Bx)};var Hx=(t=>(t.LAZY_LOAD_DEPRECATED="The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",t))(Hx||{});const qx={},Vx=t=>{var e;t&&((t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&(qx[e="LAZY_LOAD_DEPRECATED"]||(tb.warn(Hx[e]),qx[e]=!0)))},Gx=function(t,e,n,i){const r=function(t,e,n){let i=new Map;return n?(i.set("width","100%"),i.set("style",`max-width: ${e}px;`)):(i.set("height",t),i.set("width",e)),i}(e,n,i);!function(t,e){for(let n of e)t.attr(n[0],n[1])}(t,r)},Xx=function(t,e,n,i){const r=e.node().getBBox(),a=r.width,s=r.height;tb.info(`SVG bounds: ${a}x${s}`,r);let o=0,l=0;tb.info(`Graph bounds: ${o}x${l}`,t),o=a+2*n,l=s+2*n,tb.info(`Calculated bounds: ${o}x${l}`),Gx(e,l,o,i);const c=`${r.x-n} ${r.y-n} ${r.width+2*n} ${r.height+2*n}`;e.attr("viewBox",c)},Zx=t=>`g.classGroup text {\n fill: ${t.nodeBorder};\n fill: ${t.classText};\n stroke: none;\n font-family: ${t.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${t.classText};\n}\n.edgeLabel .label rect {\n fill: ${t.mainBkg};\n}\n.label text {\n fill: ${t.classText};\n}\n.edgeLabel .label span {\n background: ${t.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${t.nodeBorder};\n stroke: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${t.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${t.lineColor} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n fill: ${t.mainBkg} !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`,Qx=t=>`\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxOdd {\n fill: ${t.attributeBackgroundColorOdd};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxEven {\n fill: ${t.attributeBackgroundColorEven};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n }\n\n .entityTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n } \n`,Kx=()=>"",Jx=t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`,tv=t=>`\n .mermaid-main-font {\n font-family: "trebuchet ms", verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n .exclude-range {\n fill: ${t.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${t.sectionBkgColor};\n }\n\n .section2 {\n fill: ${t.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${t.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n // font-size: ${t.ganttFontSize};\n // text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${t.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n text {\n font-family: ${t.fontFamily};\n fill: ${t.textColor};\n }\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${t.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n // .taskText:not([font-size]) {\n // font-size: ${t.ganttFontSize};\n // }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n // font-size: ${t.ganttFontSize};\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n .taskTextOutsideLeft {\n fill: ${t.taskTextDarkColor};\n text-anchor: end;\n // font-size: ${t.ganttFontSize};\n }\n\n /* Special case clickable */\n .task.clickable {\n cursor: pointer;\n }\n .taskText.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${t.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${t.taskBkgColor};\n stroke: ${t.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${t.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${t.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${t.activeTaskBkgColor};\n stroke: ${t.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${t.doneTaskBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor} ;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n`,ev=()=>"",nv=t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`,iv=t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 100%;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 100%;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`,rv=t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`,av=t=>`\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`,sv=t=>`.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`,ov=t=>`.person {\n stroke: ${t.personBorder};\n fill: ${t.personBkg};\n }\n`,lv={flowchart:Jx,"flowchart-v2":Jx,sequence:rv,gantt:tv,classDiagram:Zx,"classDiagram-v2":Zx,class:Zx,stateDiagram:av,state:av,info:ev,pie:nv,er:Qx,error:Kx,journey:sv,requirement:iv,c4:ov},cv=(t,e,n)=>{let i="";return t in lv&&lv[t]?i=lv[t](n):tb.warn(`No theme found for ${t}`),` & {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n fill: ${n.textColor}\n }\n\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${n.errorBkgColor};\n }\n & .error-text {\n fill: ${n.errorTextColor};\n stroke: ${n.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 2px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${n.lineColor};\n stroke: ${n.lineColor};\n }\n & .marker.cross {\n stroke: ${n.lineColor};\n }\n\n & svg {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n }\n\n ${i}\n\n ${e}\n`},hv=tb,uv=eb,dv=jx,pv=t=>ab(t,dv()),fv=Xx,gv={},yv=(t,e,n)=>{if(gv[t])throw new Error(`Diagram ${t} already registered.`);var i,r;gv[t]=e,n&&sx(t,n),i=t,r=e.styles,lv[i]=r,e.injectUtils&&e.injectUtils(hv,uv,dv,pv,fv)},mv=t=>{if(t in gv)return gv[t];throw new Error(`Diagram ${t} not found.`)};var bv=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,4],i=[1,7],r=[1,5],a=[1,9],s=[1,6],o=[2,6],l=[1,16],c=[6,8,14,20,22,24,25,27,29,32,37,40,50,55],h=[8,14,20,22,24,25,27,29,32,37,40],u=[8,13,14,20,22,24,25,27,29,32,37,40],d=[1,26],p=[6,8,14,50,55],f=[8,14,55],g=[1,53],y=[1,52],m=[8,14,30,33,35,38,55],b=[1,67],_=[1,68],x=[1,69],v=[8,14,33,35,42,55],k={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,GG:6,document:7,EOF:8,":":9,DIR:10,options:11,body:12,OPT:13,NL:14,line:15,statement:16,commitStatement:17,mergeStatement:18,cherryPickStatement:19,acc_title:20,acc_title_value:21,acc_descr:22,acc_descr_value:23,acc_descr_multiline_value:24,section:25,branchStatement:26,CHECKOUT:27,ref:28,BRANCH:29,ORDER:30,NUM:31,CHERRY_PICK:32,COMMIT_ID:33,STR:34,COMMIT_TAG:35,EMPTYSTR:36,MERGE:37,COMMIT_TYPE:38,commitType:39,COMMIT:40,commit_arg:41,COMMIT_MSG:42,NORMAL:43,REVERSE:44,HIGHLIGHT:45,openDirective:46,typeDirective:47,closeDirective:48,argDirective:49,open_directive:50,type_directive:51,arg_directive:52,close_directive:53,ID:54,";":55,$accept:0,$end:1},terminals_:{2:"error",6:"GG",8:"EOF",9:":",10:"DIR",13:"OPT",14:"NL",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"CHECKOUT",29:"BRANCH",30:"ORDER",31:"NUM",32:"CHERRY_PICK",33:"COMMIT_ID",34:"STR",35:"COMMIT_TAG",36:"EMPTYSTR",37:"MERGE",38:"COMMIT_TYPE",40:"COMMIT",42:"COMMIT_MSG",43:"NORMAL",44:"REVERSE",45:"HIGHLIGHT",50:"open_directive",51:"type_directive",52:"arg_directive",53:"close_directive",54:"ID",55:";"},productions_:[0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,1],[16,2],[16,2],[16,1],[16,1],[16,1],[16,2],[26,2],[26,4],[19,3],[19,5],[19,5],[19,5],[19,5],[18,2],[18,4],[18,4],[18,4],[18,6],[18,6],[18,6],[18,6],[18,6],[18,6],[18,8],[18,8],[18,8],[18,8],[18,8],[18,8],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[41,0],[41,1],[39,1],[39,1],[39,1],[5,3],[5,5],[46,1],[47,1],[49,1],[48,1],[28,1],[28,1],[4,1],[4,1],[4,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 3:return a[o];case 4:return a[o-1];case 5:return i.setDirection(a[o-3]),a[o-1];case 7:i.setOptions(a[o-1]),this.$=a[o];break;case 8:a[o-1]+=a[o],this.$=a[o-1];break;case 10:this.$=[];break;case 11:a[o-1].push(a[o]),this.$=a[o-1];break;case 12:this.$=a[o-1];break;case 17:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 18:case 19:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 20:i.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 22:i.checkout(a[o]);break;case 23:i.branch(a[o]);break;case 24:i.branch(a[o-2],a[o]);break;case 25:i.cherryPick(a[o],"",void 0);break;case 26:i.cherryPick(a[o-2],"",a[o]);break;case 27:case 29:i.cherryPick(a[o-2],"","");break;case 28:i.cherryPick(a[o],"",a[o-2]);break;case 30:i.merge(a[o],"","","");break;case 31:i.merge(a[o-2],a[o],"","");break;case 32:i.merge(a[o-2],"",a[o],"");break;case 33:i.merge(a[o-2],"","",a[o]);break;case 34:i.merge(a[o-4],a[o],"",a[o-2]);break;case 35:i.merge(a[o-4],"",a[o],a[o-2]);break;case 36:i.merge(a[o-4],"",a[o-2],a[o]);break;case 37:i.merge(a[o-4],a[o-2],a[o],"");break;case 38:i.merge(a[o-4],a[o-2],"",a[o]);break;case 39:i.merge(a[o-4],a[o],a[o-2],"");break;case 40:i.merge(a[o-6],a[o-4],a[o-2],a[o]);break;case 41:i.merge(a[o-6],a[o],a[o-4],a[o-2]);break;case 42:i.merge(a[o-6],a[o-4],a[o],a[o-2]);break;case 43:i.merge(a[o-6],a[o-2],a[o-4],a[o]);break;case 44:i.merge(a[o-6],a[o],a[o-2],a[o-4]);break;case 45:i.merge(a[o-6],a[o-2],a[o],a[o-4]);break;case 46:i.commit(a[o]);break;case 47:i.commit("","",i.commitType.NORMAL,a[o]);break;case 48:i.commit("","",a[o],"");break;case 49:i.commit("","",a[o],a[o-2]);break;case 50:i.commit("","",a[o-2],a[o]);break;case 51:i.commit("",a[o],i.commitType.NORMAL,"");break;case 52:i.commit("",a[o-2],i.commitType.NORMAL,a[o]);break;case 53:i.commit("",a[o],i.commitType.NORMAL,a[o-2]);break;case 54:i.commit("",a[o-2],a[o],"");break;case 55:i.commit("",a[o],a[o-2],"");break;case 56:i.commit("",a[o-4],a[o-2],a[o]);break;case 57:i.commit("",a[o-4],a[o],a[o-2]);break;case 58:i.commit("",a[o-2],a[o-4],a[o]);break;case 59:i.commit("",a[o],a[o-4],a[o-2]);break;case 60:i.commit("",a[o],a[o-2],a[o-4]);break;case 61:i.commit("",a[o-2],a[o],a[o-4]);break;case 62:i.commit(a[o],"",i.commitType.NORMAL,"");break;case 63:i.commit(a[o],"",i.commitType.NORMAL,a[o-2]);break;case 64:i.commit(a[o-2],"",i.commitType.NORMAL,a[o]);break;case 65:i.commit(a[o-2],"",a[o],"");break;case 66:i.commit(a[o],"",a[o-2],"");break;case 67:i.commit(a[o],a[o-2],i.commitType.NORMAL,"");break;case 68:i.commit(a[o-2],a[o],i.commitType.NORMAL,"");break;case 69:i.commit(a[o-4],"",a[o-2],a[o]);break;case 70:i.commit(a[o-4],"",a[o],a[o-2]);break;case 71:i.commit(a[o-2],"",a[o-4],a[o]);break;case 72:i.commit(a[o],"",a[o-4],a[o-2]);break;case 73:i.commit(a[o],"",a[o-2],a[o-4]);break;case 74:i.commit(a[o-2],"",a[o],a[o-4]);break;case 75:i.commit(a[o-4],a[o],a[o-2],"");break;case 76:i.commit(a[o-4],a[o-2],a[o],"");break;case 77:i.commit(a[o-2],a[o],a[o-4],"");break;case 78:i.commit(a[o],a[o-2],a[o-4],"");break;case 79:i.commit(a[o],a[o-4],a[o-2],"");break;case 80:i.commit(a[o-2],a[o-4],a[o],"");break;case 81:i.commit(a[o-4],a[o],i.commitType.NORMAL,a[o-2]);break;case 82:i.commit(a[o-4],a[o-2],i.commitType.NORMAL,a[o]);break;case 83:i.commit(a[o-2],a[o],i.commitType.NORMAL,a[o-4]);break;case 84:i.commit(a[o],a[o-2],i.commitType.NORMAL,a[o-4]);break;case 85:i.commit(a[o],a[o-4],i.commitType.NORMAL,a[o-2]);break;case 86:i.commit(a[o-2],a[o-4],i.commitType.NORMAL,a[o]);break;case 87:i.commit(a[o-6],a[o-4],a[o-2],a[o]);break;case 88:i.commit(a[o-6],a[o-4],a[o],a[o-2]);break;case 89:i.commit(a[o-6],a[o-2],a[o-4],a[o]);break;case 90:i.commit(a[o-6],a[o],a[o-4],a[o-2]);break;case 91:i.commit(a[o-6],a[o-2],a[o],a[o-4]);break;case 92:i.commit(a[o-6],a[o],a[o-2],a[o-4]);break;case 93:i.commit(a[o-4],a[o-6],a[o-2],a[o]);break;case 94:i.commit(a[o-4],a[o-6],a[o],a[o-2]);break;case 95:i.commit(a[o-2],a[o-6],a[o-4],a[o]);break;case 96:i.commit(a[o],a[o-6],a[o-4],a[o-2]);break;case 97:i.commit(a[o-2],a[o-6],a[o],a[o-4]);break;case 98:i.commit(a[o],a[o-6],a[o-2],a[o-4]);break;case 99:i.commit(a[o],a[o-4],a[o-2],a[o-6]);break;case 100:i.commit(a[o-2],a[o-4],a[o],a[o-6]);break;case 101:i.commit(a[o],a[o-2],a[o-4],a[o-6]);break;case 102:i.commit(a[o-2],a[o],a[o-4],a[o-6]);break;case 103:i.commit(a[o-4],a[o-2],a[o],a[o-6]);break;case 104:i.commit(a[o-4],a[o],a[o-2],a[o-6]);break;case 105:i.commit(a[o-2],a[o-4],a[o-6],a[o]);break;case 106:i.commit(a[o],a[o-4],a[o-6],a[o-2]);break;case 107:i.commit(a[o-2],a[o],a[o-6],a[o-4]);break;case 108:i.commit(a[o],a[o-2],a[o-6],a[o-4]);break;case 109:i.commit(a[o-4],a[o-2],a[o-6],a[o]);break;case 110:i.commit(a[o-4],a[o],a[o-6],a[o-2]);break;case 111:this.$="";break;case 112:this.$=a[o];break;case 113:this.$=i.commitType.NORMAL;break;case 114:this.$=i.commitType.REVERSE;break;case 115:this.$=i.commitType.HIGHLIGHT;break;case 118:i.parseDirective("%%{","open_directive");break;case 119:i.parseDirective(a[o],"type_directive");break;case 120:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 121:i.parseDirective("}%%","close_directive","gitGraph")}},table:[{3:1,4:2,5:3,6:n,8:i,14:r,46:8,50:a,55:s},{1:[3]},{3:10,4:2,5:3,6:n,8:i,14:r,46:8,50:a,55:s},{3:11,4:2,5:3,6:n,8:i,14:r,46:8,50:a,55:s},{7:12,8:o,9:[1,13],10:[1,14],11:15,14:l},e(c,[2,124]),e(c,[2,125]),e(c,[2,126]),{47:17,51:[1,18]},{51:[2,118]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:o,11:15,14:l},{9:[1,21]},e(h,[2,10],{12:22,13:[1,23]}),e(u,[2,9]),{9:[1,25],48:24,53:d},e([9,53],[2,119]),{1:[2,3]},{8:[1,27]},{7:28,8:o,11:15,14:l},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],37:[1,42],40:[1,41]},e(u,[2,8]),e(p,[2,116]),{49:45,52:[1,46]},e(p,[2,121]),{1:[2,4]},{8:[1,47]},e(h,[2,11]),{4:48,8:i,14:r,55:s},e(h,[2,13]),e(f,[2,14]),e(f,[2,15]),e(f,[2,16]),{21:[1,49]},{23:[1,50]},e(f,[2,19]),e(f,[2,20]),e(f,[2,21]),{28:51,34:g,54:y},e(f,[2,111],{41:54,33:[1,57],34:[1,59],35:[1,55],38:[1,56],42:[1,58]}),{28:60,34:g,54:y},{33:[1,61],35:[1,62]},{28:63,34:g,54:y},{48:64,53:d},{53:[2,120]},{1:[2,5]},e(h,[2,12]),e(f,[2,17]),e(f,[2,18]),e(f,[2,22]),e(m,[2,122]),e(m,[2,123]),e(f,[2,46]),{34:[1,65]},{39:66,43:b,44:_,45:x},{34:[1,70]},{34:[1,71]},e(f,[2,112]),e(f,[2,30],{33:[1,72],35:[1,74],38:[1,73]}),{34:[1,75]},{34:[1,76],36:[1,77]},e(f,[2,23],{30:[1,78]}),e(p,[2,117]),e(f,[2,47],{33:[1,80],38:[1,79],42:[1,81]}),e(f,[2,48],{33:[1,83],35:[1,82],42:[1,84]}),e(v,[2,113]),e(v,[2,114]),e(v,[2,115]),e(f,[2,51],{35:[1,85],38:[1,86],42:[1,87]}),e(f,[2,62],{33:[1,90],35:[1,88],38:[1,89]}),{34:[1,91]},{39:92,43:b,44:_,45:x},{34:[1,93]},e(f,[2,25],{35:[1,94]}),{33:[1,95]},{33:[1,96]},{31:[1,97]},{39:98,43:b,44:_,45:x},{34:[1,99]},{34:[1,100]},{34:[1,101]},{34:[1,102]},{34:[1,103]},{34:[1,104]},{39:105,43:b,44:_,45:x},{34:[1,106]},{34:[1,107]},{39:108,43:b,44:_,45:x},{34:[1,109]},e(f,[2,31],{35:[1,111],38:[1,110]}),e(f,[2,32],{33:[1,113],35:[1,112]}),e(f,[2,33],{33:[1,114],38:[1,115]}),{34:[1,116],36:[1,117]},{34:[1,118]},{34:[1,119]},e(f,[2,24]),e(f,[2,49],{33:[1,120],42:[1,121]}),e(f,[2,53],{38:[1,122],42:[1,123]}),e(f,[2,63],{33:[1,125],38:[1,124]}),e(f,[2,50],{33:[1,126],42:[1,127]}),e(f,[2,55],{35:[1,128],42:[1,129]}),e(f,[2,66],{33:[1,131],35:[1,130]}),e(f,[2,52],{38:[1,132],42:[1,133]}),e(f,[2,54],{35:[1,134],42:[1,135]}),e(f,[2,67],{35:[1,137],38:[1,136]}),e(f,[2,64],{33:[1,139],38:[1,138]}),e(f,[2,65],{33:[1,141],35:[1,140]}),e(f,[2,68],{35:[1,143],38:[1,142]}),{39:144,43:b,44:_,45:x},{34:[1,145]},{34:[1,146]},{34:[1,147]},{34:[1,148]},{39:149,43:b,44:_,45:x},e(f,[2,26]),e(f,[2,27]),e(f,[2,28]),e(f,[2,29]),{34:[1,150]},{34:[1,151]},{39:152,43:b,44:_,45:x},{34:[1,153]},{39:154,43:b,44:_,45:x},{34:[1,155]},{34:[1,156]},{34:[1,157]},{34:[1,158]},{34:[1,159]},{34:[1,160]},{34:[1,161]},{39:162,43:b,44:_,45:x},{34:[1,163]},{34:[1,164]},{34:[1,165]},{39:166,43:b,44:_,45:x},{34:[1,167]},{39:168,43:b,44:_,45:x},{34:[1,169]},{34:[1,170]},{34:[1,171]},{39:172,43:b,44:_,45:x},{34:[1,173]},e(f,[2,37],{35:[1,174]}),e(f,[2,38],{38:[1,175]}),e(f,[2,36],{33:[1,176]}),e(f,[2,39],{35:[1,177]}),e(f,[2,34],{38:[1,178]}),e(f,[2,35],{33:[1,179]}),e(f,[2,60],{42:[1,180]}),e(f,[2,73],{33:[1,181]}),e(f,[2,61],{42:[1,182]}),e(f,[2,84],{38:[1,183]}),e(f,[2,74],{33:[1,184]}),e(f,[2,83],{38:[1,185]}),e(f,[2,59],{42:[1,186]}),e(f,[2,72],{33:[1,187]}),e(f,[2,58],{42:[1,188]}),e(f,[2,78],{35:[1,189]}),e(f,[2,71],{33:[1,190]}),e(f,[2,77],{35:[1,191]}),e(f,[2,57],{42:[1,192]}),e(f,[2,85],{38:[1,193]}),e(f,[2,56],{42:[1,194]}),e(f,[2,79],{35:[1,195]}),e(f,[2,80],{35:[1,196]}),e(f,[2,86],{38:[1,197]}),e(f,[2,70],{33:[1,198]}),e(f,[2,81],{38:[1,199]}),e(f,[2,69],{33:[1,200]}),e(f,[2,75],{35:[1,201]}),e(f,[2,76],{35:[1,202]}),e(f,[2,82],{38:[1,203]}),{34:[1,204]},{39:205,43:b,44:_,45:x},{34:[1,206]},{34:[1,207]},{39:208,43:b,44:_,45:x},{34:[1,209]},{34:[1,210]},{34:[1,211]},{34:[1,212]},{39:213,43:b,44:_,45:x},{34:[1,214]},{39:215,43:b,44:_,45:x},{34:[1,216]},{34:[1,217]},{34:[1,218]},{34:[1,219]},{34:[1,220]},{34:[1,221]},{34:[1,222]},{39:223,43:b,44:_,45:x},{34:[1,224]},{34:[1,225]},{34:[1,226]},{39:227,43:b,44:_,45:x},{34:[1,228]},{39:229,43:b,44:_,45:x},{34:[1,230]},{34:[1,231]},{34:[1,232]},{39:233,43:b,44:_,45:x},e(f,[2,40]),e(f,[2,42]),e(f,[2,41]),e(f,[2,43]),e(f,[2,45]),e(f,[2,44]),e(f,[2,101]),e(f,[2,102]),e(f,[2,99]),e(f,[2,100]),e(f,[2,104]),e(f,[2,103]),e(f,[2,108]),e(f,[2,107]),e(f,[2,106]),e(f,[2,105]),e(f,[2,110]),e(f,[2,109]),e(f,[2,98]),e(f,[2,97]),e(f,[2,96]),e(f,[2,95]),e(f,[2,93]),e(f,[2,94]),e(f,[2,92]),e(f,[2,91]),e(f,[2,90]),e(f,[2,89]),e(f,[2,87]),e(f,[2,88])],defaultActions:{9:[2,118],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,120],47:[2,5]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},w=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),50;case 1:return this.begin("type_directive"),51;case 2:return this.popState(),this.begin("arg_directive"),9;case 3:return this.popState(),this.popState(),53;case 4:return 52;case 5:return this.begin("acc_title"),20;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),22;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:case 34:case 38:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:return 14;case 13:case 14:break;case 15:return 6;case 16:return 40;case 17:return 33;case 18:return 38;case 19:return 42;case 20:return 43;case 21:return 44;case 22:return 45;case 23:return 35;case 24:return 29;case 25:return 30;case 26:return 37;case 27:return 32;case 28:return 27;case 29:case 30:return 10;case 31:return 9;case 32:return"CARET";case 33:this.begin("options");break;case 35:return 13;case 36:return 36;case 37:this.begin("string");break;case 39:return 34;case 40:return 31;case 41:return 54;case 42:return 8}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit(?=\s|$))/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch(?=\s|$))/i,/^(?:order:)/i,/^(?:merge(?=\s|$))/i,/^(?:cherry-pick(?=\s|$))/i,/^(?:checkout(?=\s|$))/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[0-9]+(?=\s|$))/i,/^(?:\w([-\./\w]*[-\w])?)/i,/^(?:$)/i,/^(?:\s+)/i],conditions:{acc_descr_multiline:{rules:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},options:{rules:[34,35],inclusive:!1},string:{rules:[38,39],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,36,37,40,41,42,43],inclusive:!0}}},t);function T(){this.yy={}}return k.lexer=w,T.prototype=k,k.Parser=T,new T}();bv.parser=bv;const _v=bv,xv=t=>null!==t.match(/^\s*gitGraph/);let vv="",kv="",wv="";const Tv=t=>ab(t,jx()),Cv=function(){vv="",wv="",kv=""},Ev=function(t){vv=Tv(t).replace(/^\s+/g,"")},Sv=function(){return vv||kv},Av=function(t){wv=Tv(t).replace(/\n\s+/g,"\n")},Dv=function(){return wv},Lv=function(t){kv=Tv(t)},Ov=function(){return kv};let Nv=jx().gitGraph.mainBranchName,Mv=jx().gitGraph.mainBranchOrder,Bv={},Iv=null,Fv={};Fv[Nv]={name:Nv,order:Mv};let Rv={};Rv[Nv]=Iv;let $v=Nv,Pv="LR",Yv=0;function jv(){return bx({length:7})}let zv={};const Uv=function(t){if(t=ub.sanitizeText(t,jx()),void 0===Rv[t]){let e=new Error('Trying to checkout branch which is not yet created. (Help try using "branch '+t+'")');throw e.hash={text:"checkout "+t,token:"checkout "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"branch '+t+'"']},e}{$v=t;const e=Rv[$v];Iv=Bv[e]}};function Wv(t,e,n){const i=t.indexOf(e);-1===i?t.push(n):t.splice(i,1,n)}function Hv(t){const e=t.reduce(((t,e)=>t.seq>e.seq?t:e),t[0]);let n="";t.forEach((function(t){n+=t===e?"\t*":"\t|"}));const i=[n,e.id,e.seq];for(let t in Rv)Rv[t]===e.id&&i.push(t);if(tb.debug(i.join(" ")),e.parents&&2==e.parents.length){const n=Bv[e.parents[0]];Wv(t,e,n),t.push(Bv[e.parents[1]])}else{if(0==e.parents.length)return;{const n=Bv[e.parents];Wv(t,e,n)}}Hv(t=function(t,e){const n=Object.create(null);return t.reduce(((t,i)=>{const r=e(i);return n[r]||(n[r]=!0,t.push(i)),t}),[])}(t,(t=>t.id)))}const qv=function(){const t=Object.keys(Bv).map((function(t){return Bv[t]}));return t.forEach((function(t){tb.debug(t.id)})),t.sort(((t,e)=>t.seq-e.seq)),t},Vv={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Gv={parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().gitGraph,setDirection:function(t){Pv=t},setOptions:function(t){tb.debug("options str",t),t=(t=t&&t.trim())||"{}";try{zv=JSON.parse(t)}catch(t){tb.error("error while parsing gitGraph options",t.message)}},getOptions:function(){return zv},commit:function(t,e,n,i){tb.debug("Entering commit:",t,e,n,i),e=ub.sanitizeText(e,jx()),t=ub.sanitizeText(t,jx()),i=ub.sanitizeText(i,jx());const r={id:e||Yv+"-"+jv(),message:t,seq:Yv++,type:n||Vv.NORMAL,tag:i||"",parents:null==Iv?[]:[Iv.id],branch:$v};Iv=r,Bv[r.id]=r,Rv[$v]=r.id,tb.debug("in pushCommit "+r.id)},branch:function(t,e){if(t=ub.sanitizeText(t,jx()),void 0!==Rv[t]){let e=new Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout '+t+'")');throw e.hash={text:"branch "+t,token:"branch "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+t+'"']},e}Rv[t]=null!=Iv?Iv.id:null,Fv[t]={name:t,order:e?parseInt(e,10):null},Uv(t),tb.debug("in createBranch")},merge:function(t,e,n,i){t=ub.sanitizeText(t,jx()),e=ub.sanitizeText(e,jx());const r=Bv[Rv[$v]],a=Bv[Rv[t]];if($v===t){let e=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},e}if(void 0===r||!r){let e=new Error('Incorrect usage of "merge". Current branch ('+$v+")has no commits");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["commit"]},e}if(void 0===Rv[t]){let e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch "+t]},e}if(void 0===a||!a){let e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"commit"']},e}if(r===a){let e=new Error('Incorrect usage of "merge". Both branches have same head');throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},e}if(e&&void 0!==Bv[e]){let r=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom Id");throw r.hash={text:"merge "+t+e+n+i,token:"merge "+t+e+n+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["merge "+t+" "+e+"_UNIQUE "+n+" "+i]},r}const s={id:e||Yv+"-"+jv(),message:"merged branch "+t+" into "+$v,seq:Yv++,parents:[null==Iv?null:Iv.id,Rv[t]],branch:$v,type:Vv.MERGE,customType:n,customId:!!e,tag:i||""};Iv=s,Bv[s.id]=s,Rv[$v]=s.id,tb.debug(Rv),tb.debug("in mergeBranch")},cherryPick:function(t,e,n){if(tb.debug("Entering cherryPick:",t,e,n),t=ub.sanitizeText(t,jx()),e=ub.sanitizeText(e,jx()),n=ub.sanitizeText(n,jx()),!t||void 0===Bv[t]){let n=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw n.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},n}let i=Bv[t],r=i.branch;if(i.type===Vv.MERGE){let n=new Error('Incorrect usage of "cherryPick". Source commit should not be a merge commit');throw n.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},n}if(!e||void 0===Bv[e]){if(r===$v){let n=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw n.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},n}const a=Bv[Rv[$v]];if(void 0===a||!a){let n=new Error('Incorrect usage of "cherry-pick". Current branch ('+$v+")has no commits");throw n.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},n}const s={id:Yv+"-"+jv(),message:"cherry-picked "+i+" into "+$v,seq:Yv++,parents:[null==Iv?null:Iv.id,i.id],branch:$v,type:Vv.CHERRY_PICK,tag:null!=n?n:"cherry-pick:"+i.id};Iv=s,Bv[s.id]=s,Rv[$v]=s.id,tb.debug(Rv),tb.debug("in cherryPick")}},checkout:Uv,prettyPrint:function(){tb.debug(Bv);Hv([qv()[0]])},clear:function(){Bv={},Iv=null;let t=jx().gitGraph.mainBranchName,e=jx().gitGraph.mainBranchOrder;Rv={},Rv[t]=null,Fv={},Fv[t]={name:t,order:e},$v=t,Yv=0,Cv()},getBranchesAsObjArray:function(){const t=Object.values(Fv).map(((t,e)=>null!==t.order?t:{...t,order:parseFloat(`0.${e}`,10)})).sort(((t,e)=>t.order-e.order)).map((({name:t})=>({name:t})));return t},getBranches:function(){return Rv},getCommits:function(){return Bv},getCommitsArray:qv,getCurrentBranch:function(){return $v},getDirection:function(){return Pv},getHead:function(){return Iv},setAccTitle:Ev,getAccTitle:Sv,getAccDescription:Dv,setAccDescription:Av,setDiagramTitle:Lv,getDiagramTitle:Ov,commitType:Vv};let Xv={};const Zv=0,Qv=1,Kv=2,Jv=3,tk=4;let ek={},nk={},ik=[],rk=0;const ak=(t,e,n)=>{const i=dv().gitGraph,r=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=0;Object.keys(e).sort(((t,n)=>e[t].seq-e[n].seq)).forEach((t=>{const o=e[t],l=ek[o.branch].pos,c=s+10;if(n){let t,e=void 0!==o.customType&&""!==o.customType?o.customType:o.type;switch(e){case Zv:t="commit-normal";break;case Qv:t="commit-reverse";break;case Kv:t="commit-highlight";break;case Jv:t="commit-merge";break;case tk:t="commit-cherry-pick";break;default:t="commit-normal"}if(e===Kv){const e=r.append("rect");e.attr("x",c-10),e.attr("y",l-10),e.attr("height",20),e.attr("width",20),e.attr("class",`commit ${o.id} commit-highlight${ek[o.branch].index%8} ${t}-outer`),r.append("rect").attr("x",c-6).attr("y",l-6).attr("height",12).attr("width",12).attr("class",`commit ${o.id} commit${ek[o.branch].index%8} ${t}-inner`)}else if(e===tk)r.append("circle").attr("cx",c).attr("cy",l).attr("r",10).attr("class",`commit ${o.id} ${t}`),r.append("circle").attr("cx",c-3).attr("cy",l+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${o.id} ${t}`),r.append("circle").attr("cx",c+3).attr("cy",l+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${o.id} ${t}`),r.append("line").attr("x1",c+3).attr("y1",l+1).attr("x2",c).attr("y2",l-5).attr("stroke","#fff").attr("class",`commit ${o.id} ${t}`),r.append("line").attr("x1",c-3).attr("y1",l+1).attr("x2",c).attr("y2",l-5).attr("stroke","#fff").attr("class",`commit ${o.id} ${t}`);else{const n=r.append("circle");if(n.attr("cx",c),n.attr("cy",l),n.attr("r",o.type===Jv?9:10),n.attr("class",`commit ${o.id} commit${ek[o.branch].index%8}`),e===Jv){const e=r.append("circle");e.attr("cx",c),e.attr("cy",l),e.attr("r",6),e.attr("class",`commit ${t} ${o.id} commit${ek[o.branch].index%8}`)}if(e===Qv){r.append("path").attr("d",`M ${c-5},${l-5}L${c+5},${l+5}M${c-5},${l+5}L${c+5},${l-5}`).attr("class",`commit ${t} ${o.id} commit${ek[o.branch].index%8}`)}}}if(nk[o.id]={x:s+10,y:l},n){const t=4,e=2;if(o.type!==tk&&(o.customId&&o.type===Jv||o.type!==Jv)&&i.showCommitLabel){const t=a.append("g"),n=t.insert("rect").attr("class","commit-label-bkg"),r=t.append("text").attr("x",s).attr("y",l+25).attr("class","commit-label").text(o.id);let c=r.node().getBBox();if(n.attr("x",s+10-c.width/2-e).attr("y",l+13.5).attr("width",c.width+2*e).attr("height",c.height+2*e),r.attr("x",s+10-c.width/2),i.rotateCommitLabel){let e=-7.5-(c.width+10)/25*9.5,n=10+c.width/25*8.5;t.attr("transform","translate("+e+", "+n+") rotate("+"-45, "+s+", "+l+")")}}if(o.tag){const n=a.insert("polygon"),i=a.append("circle"),r=a.append("text").attr("y",l-16).attr("class","tag-label").text(o.tag);let c=r.node().getBBox();r.attr("x",s+10-c.width/2);const h=c.height/2,u=l-19.2;n.attr("class","tag-label-bkg").attr("points",`\n ${s-c.width/2-t/2},${u+e}\n ${s-c.width/2-t/2},${u-e}\n ${s+10-c.width/2-t},${u-h-e}\n ${s+10+c.width/2+t},${u-h-e}\n ${s+10+c.width/2+t},${u+h+e}\n ${s+10-c.width/2-t},${u+h+e}`),i.attr("cx",s-c.width/2+t/2).attr("cy",u).attr("r",1.5).attr("class","tag-hole")}}s+=50,s>rk&&(rk=s)}))},sk=(t,e,n=0)=>{const i=t+Math.abs(t-e)/2;if(n>5)return i;if(ik.every((t=>Math.abs(t-i)>=10)))return ik.push(i),i;const r=Math.abs(t-e);return sk(t,e-r/5,n+1)},ok=(t,e,n,i)=>{const r=nk[e.id],a=nk[n.id],s=((t,e,n)=>Object.keys(n).filter((i=>n[i].branch===e.branch&&n[i].seq>t.seq&&n[i].seq0)(e,n,i);let o,l="",c="",h=0,u=0,d=ek[n.branch].index;if(s){l="A 10 10, 0, 0, 0,",c="A 10 10, 0, 0, 1,",h=10,u=10,d=ek[n.branch].index;const t=r.ya.y&&(l="A 20 20, 0, 0, 0,",h=20,u=20,d=ek[e.branch].index,o=`M ${r.x} ${r.y} L ${a.x-h} ${r.y} ${l} ${a.x} ${r.y-u} L ${a.x} ${a.y}`),r.y===a.y&&(d=ek[e.branch].index,o=`M ${r.x} ${r.y} L ${r.x} ${a.y-h} ${l} ${r.x+u} ${a.y} L ${a.x} ${a.y}`);t.append("path").attr("d",o).attr("class","arrow arrow"+d%8)},lk=(t,e)=>{const n=dv().gitGraph,i=t.append("g");e.forEach(((t,e)=>{const r=e%8,a=ek[t.name].pos,s=i.append("line");s.attr("x1",0),s.attr("y1",a),s.attr("x2",rk),s.attr("y2",a),s.attr("class","branch branch"+r),ik.push(a);const o=(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");let n=[];n="string"==typeof t?t.split(/\\n|\n|
/gi):Array.isArray(t)?t:[];for(const t of n){const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),n.setAttribute("class","row"),n.textContent=t.trim(),e.appendChild(n)}return e})(t.name),l=i.insert("rect"),c=i.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+r);c.node().appendChild(o);let h=o.getBBox();l.attr("class","branchLabelBkg label"+r).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===n.rotateCommitLabel?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4),c.attr("transform","translate("+(-h.width-14-(!0===n.rotateCommitLabel?30:0))+", "+(a-h.height/2-1)+")"),l.attr("transform","translate(-19, "+(a-h.height/2)+")")}))},ck={draw:function(t,e,n,i){var r;ek={},nk={},Xv={},rk=0,ik=[];const a=dv(),s=a.gitGraph;tb.debug("in gitgraph renderer",t+"\n","id:",e,n),Xv=i.db.getCommits();const o=i.db.getBranchesAsObjArray();let l=0;o.forEach(((t,e)=>{ek[t.name]={pos:l,index:e},l+=50+(s.rotateCommitLabel?40:0)}));const c=ie(`[id="${e}"]`);ak(c,Xv,!1),s.showBranches&&lk(c,o),((t,e)=>{const n=t.append("g").attr("class","commit-arrows");Object.keys(e).forEach((t=>{const i=e[t];i.parents&&i.parents.length>0&&i.parents.forEach((t=>{ok(n,e[t],i,e)}))}))})(c,Xv),ak(c,Xv,!0),Dx.insertTitle(c,"gitTitleText",s.titleTopMargin,i.db.getDiagramTitle()),fv(void 0,c,s.diagramPadding,null!=(r=s.useMaxWidth)?r:a.useMaxWidth)}},hk=t=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map((e=>`\n .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${e} { fill: ${t["git"+e]}; }\n .arrow${e} { stroke: ${t["git"+e]}; }\n `)).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${t.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n .commit-reverse {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n }\n`;var uk=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,6],i=[1,7],r=[1,8],a=[1,9],s=[1,16],o=[1,11],l=[1,12],h=[1,13],u=[1,14],d=[1,15],p=[1,27],f=[1,33],g=[1,34],y=[1,35],m=[1,36],b=[1,37],_=[1,72],x=[1,73],v=[1,74],k=[1,75],w=[1,76],T=[1,77],C=[1,78],E=[1,38],S=[1,39],A=[1,40],D=[1,41],L=[1,42],O=[1,43],N=[1,44],M=[1,45],B=[1,46],I=[1,47],F=[1,48],R=[1,49],$=[1,50],P=[1,51],Y=[1,52],j=[1,53],z=[1,54],U=[1,55],W=[1,56],H=[1,57],q=[1,59],V=[1,60],G=[1,61],X=[1,62],Z=[1,63],Q=[1,64],K=[1,65],J=[1,66],tt=[1,67],et=[1,68],nt=[1,69],it=[24,52],rt=[24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],at=[15,24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],st=[1,94],ot=[1,95],lt=[1,96],ct=[1,97],ht=[15,24,52],ut=[7,8,9,10,18,22,25,26,27,28],dt=[15,24,43,52],pt=[15,24,43,52,86,87,89,90],ft=[15,43],gt=[44,46,47,48,49,50,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],yt={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,directive:6,direction_tb:7,direction_bt:8,direction_rl:9,direction_lr:10,graphConfig:11,openDirective:12,typeDirective:13,closeDirective:14,NEWLINE:15,":":16,argDirective:17,open_directive:18,type_directive:19,arg_directive:20,close_directive:21,C4_CONTEXT:22,statements:23,EOF:24,C4_CONTAINER:25,C4_COMPONENT:26,C4_DYNAMIC:27,C4_DEPLOYMENT:28,otherStatements:29,diagramStatements:30,otherStatement:31,title:32,accDescription:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,boundaryStatement:39,boundaryStartStatement:40,boundaryStopStatement:41,boundaryStart:42,LBRACE:43,ENTERPRISE_BOUNDARY:44,attributes:45,SYSTEM_BOUNDARY:46,BOUNDARY:47,CONTAINER_BOUNDARY:48,NODE:49,NODE_L:50,NODE_R:51,RBRACE:52,diagramStatement:53,PERSON:54,PERSON_EXT:55,SYSTEM:56,SYSTEM_DB:57,SYSTEM_QUEUE:58,SYSTEM_EXT:59,SYSTEM_EXT_DB:60,SYSTEM_EXT_QUEUE:61,CONTAINER:62,CONTAINER_DB:63,CONTAINER_QUEUE:64,CONTAINER_EXT:65,CONTAINER_EXT_DB:66,CONTAINER_EXT_QUEUE:67,COMPONENT:68,COMPONENT_DB:69,COMPONENT_QUEUE:70,COMPONENT_EXT:71,COMPONENT_EXT_DB:72,COMPONENT_EXT_QUEUE:73,REL:74,BIREL:75,REL_U:76,REL_D:77,REL_L:78,REL_R:79,REL_B:80,REL_INDEX:81,UPDATE_EL_STYLE:82,UPDATE_REL_STYLE:83,UPDATE_LAYOUT_CONFIG:84,attribute:85,STR:86,STR_KEY:87,STR_VALUE:88,ATTRIBUTE:89,ATTRIBUTE_EMPTY:90,$accept:0,$end:1},terminals_:{2:"error",7:"direction_tb",8:"direction_bt",9:"direction_rl",10:"direction_lr",15:"NEWLINE",16:":",18:"open_directive",19:"type_directive",20:"arg_directive",21:"close_directive",22:"C4_CONTEXT",24:"EOF",25:"C4_CONTAINER",26:"C4_COMPONENT",27:"C4_DYNAMIC",28:"C4_DEPLOYMENT",32:"title",33:"accDescription",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",43:"LBRACE",44:"ENTERPRISE_BOUNDARY",46:"SYSTEM_BOUNDARY",47:"BOUNDARY",48:"CONTAINER_BOUNDARY",49:"NODE",50:"NODE_L",51:"NODE_R",52:"RBRACE",54:"PERSON",55:"PERSON_EXT",56:"SYSTEM",57:"SYSTEM_DB",58:"SYSTEM_QUEUE",59:"SYSTEM_EXT",60:"SYSTEM_EXT_DB",61:"SYSTEM_EXT_QUEUE",62:"CONTAINER",63:"CONTAINER_DB",64:"CONTAINER_QUEUE",65:"CONTAINER_EXT",66:"CONTAINER_EXT_DB",67:"CONTAINER_EXT_QUEUE",68:"COMPONENT",69:"COMPONENT_DB",70:"COMPONENT_QUEUE",71:"COMPONENT_EXT",72:"COMPONENT_EXT_DB",73:"COMPONENT_EXT_QUEUE",74:"REL",75:"BIREL",76:"REL_U",77:"REL_D",78:"REL_L",79:"REL_R",80:"REL_B",81:"REL_INDEX",82:"UPDATE_EL_STYLE",83:"UPDATE_REL_STYLE",84:"UPDATE_LAYOUT_CONFIG",86:"STR",87:"STR_KEY",88:"STR_VALUE",89:"ATTRIBUTE",90:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[11,4],[11,4],[11,4],[11,4],[23,1],[23,1],[23,2],[29,1],[29,2],[29,3],[31,1],[31,1],[31,2],[31,2],[31,1],[39,3],[40,3],[40,3],[40,4],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[41,1],[30,1],[30,2],[30,3],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,1],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[45,1],[45,2],[85,1],[85,2],[85,1],[85,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 4:i.setDirection("TB");break;case 5:i.setDirection("BT");break;case 6:i.setDirection("RL");break;case 7:i.setDirection("LR");break;case 11:i.parseDirective("%%{","open_directive");break;case 12:break;case 13:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 14:i.parseDirective("}%%","close_directive","c4Context");break;case 15:case 16:case 17:case 18:case 19:i.setC4Type(a[o-3]);break;case 26:i.setTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 27:i.setAccDescription(a[o].substring(15)),this.$=a[o].substring(15);break;case 28:this.$=a[o].trim(),i.setTitle(this.$);break;case 29:case 30:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 35:case 36:a[o].splice(2,0,"ENTERPRISE"),i.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 37:i.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 38:a[o].splice(2,0,"CONTAINER"),i.addContainerBoundary(...a[o]),this.$=a[o];break;case 39:i.addDeploymentNode("node",...a[o]),this.$=a[o];break;case 40:i.addDeploymentNode("nodeL",...a[o]),this.$=a[o];break;case 41:i.addDeploymentNode("nodeR",...a[o]),this.$=a[o];break;case 42:i.popBoundaryParseStack();break;case 46:i.addPersonOrSystem("person",...a[o]),this.$=a[o];break;case 47:i.addPersonOrSystem("external_person",...a[o]),this.$=a[o];break;case 48:i.addPersonOrSystem("system",...a[o]),this.$=a[o];break;case 49:i.addPersonOrSystem("system_db",...a[o]),this.$=a[o];break;case 50:i.addPersonOrSystem("system_queue",...a[o]),this.$=a[o];break;case 51:i.addPersonOrSystem("external_system",...a[o]),this.$=a[o];break;case 52:i.addPersonOrSystem("external_system_db",...a[o]),this.$=a[o];break;case 53:i.addPersonOrSystem("external_system_queue",...a[o]),this.$=a[o];break;case 54:i.addContainer("container",...a[o]),this.$=a[o];break;case 55:i.addContainer("container_db",...a[o]),this.$=a[o];break;case 56:i.addContainer("container_queue",...a[o]),this.$=a[o];break;case 57:i.addContainer("external_container",...a[o]),this.$=a[o];break;case 58:i.addContainer("external_container_db",...a[o]),this.$=a[o];break;case 59:i.addContainer("external_container_queue",...a[o]),this.$=a[o];break;case 60:i.addComponent("component",...a[o]),this.$=a[o];break;case 61:i.addComponent("component_db",...a[o]),this.$=a[o];break;case 62:i.addComponent("component_queue",...a[o]),this.$=a[o];break;case 63:i.addComponent("external_component",...a[o]),this.$=a[o];break;case 64:i.addComponent("external_component_db",...a[o]),this.$=a[o];break;case 65:i.addComponent("external_component_queue",...a[o]),this.$=a[o];break;case 67:i.addRel("rel",...a[o]),this.$=a[o];break;case 68:i.addRel("birel",...a[o]),this.$=a[o];break;case 69:i.addRel("rel_u",...a[o]),this.$=a[o];break;case 70:i.addRel("rel_d",...a[o]),this.$=a[o];break;case 71:i.addRel("rel_l",...a[o]),this.$=a[o];break;case 72:i.addRel("rel_r",...a[o]),this.$=a[o];break;case 73:i.addRel("rel_b",...a[o]),this.$=a[o];break;case 74:a[o].splice(0,1),i.addRel("rel",...a[o]),this.$=a[o];break;case 75:i.updateElStyle("update_el_style",...a[o]),this.$=a[o];break;case 76:i.updateRelStyle("update_rel_style",...a[o]),this.$=a[o];break;case 77:i.updateLayoutConfig("update_layout_config",...a[o]),this.$=a[o];break;case 78:this.$=[a[o]];break;case 79:a[o].unshift(a[o-1]),this.$=a[o];break;case 80:case 82:this.$=a[o].trim();break;case 81:let t={};t[a[o-1].trim()]=a[o].trim(),this.$=t;break;case 83:this.$=""}},table:[{3:1,4:2,5:3,6:4,7:n,8:i,9:r,10:a,11:5,12:10,18:s,22:o,25:l,26:h,27:u,28:d},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:n,8:i,9:r,10:a,11:5,12:10,18:s,22:o,25:l,26:h,27:u,28:d},{1:[2,8]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{13:18,19:[1,19]},{15:[1,20]},{15:[1,21]},{15:[1,22]},{15:[1,23]},{15:[1,24]},{19:[2,11]},{1:[2,3]},{14:25,16:[1,26],21:p},e([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:f,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:N,61:M,62:B,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{23:79,29:29,30:30,31:31,32:f,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:N,61:M,62:B,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{23:80,29:29,30:30,31:31,32:f,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:N,61:M,62:B,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{23:81,29:29,30:30,31:31,32:f,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:N,61:M,62:B,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{23:82,29:29,30:30,31:31,32:f,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:N,61:M,62:B,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},e(it,[2,20],{53:32,39:58,40:70,42:71,30:87,44:_,46:x,47:v,48:k,49:w,50:T,51:C,54:E,55:S,56:A,57:D,58:L,59:O,60:N,61:M,62:B,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt}),e(it,[2,21]),e(rt,[2,23],{15:[1,88]}),e(it,[2,43],{15:[1,89]}),e(at,[2,26]),e(at,[2,27]),{35:[1,90]},{37:[1,91]},e(at,[2,30]),{45:92,85:93,86:st,87:ot,89:lt,90:ct},{45:98,85:93,86:st,87:ot,89:lt,90:ct},{45:99,85:93,86:st,87:ot,89:lt,90:ct},{45:100,85:93,86:st,87:ot,89:lt,90:ct},{45:101,85:93,86:st,87:ot,89:lt,90:ct},{45:102,85:93,86:st,87:ot,89:lt,90:ct},{45:103,85:93,86:st,87:ot,89:lt,90:ct},{45:104,85:93,86:st,87:ot,89:lt,90:ct},{45:105,85:93,86:st,87:ot,89:lt,90:ct},{45:106,85:93,86:st,87:ot,89:lt,90:ct},{45:107,85:93,86:st,87:ot,89:lt,90:ct},{45:108,85:93,86:st,87:ot,89:lt,90:ct},{45:109,85:93,86:st,87:ot,89:lt,90:ct},{45:110,85:93,86:st,87:ot,89:lt,90:ct},{45:111,85:93,86:st,87:ot,89:lt,90:ct},{45:112,85:93,86:st,87:ot,89:lt,90:ct},{45:113,85:93,86:st,87:ot,89:lt,90:ct},{45:114,85:93,86:st,87:ot,89:lt,90:ct},{45:115,85:93,86:st,87:ot,89:lt,90:ct},{45:116,85:93,86:st,87:ot,89:lt,90:ct},e(ht,[2,66]),{45:117,85:93,86:st,87:ot,89:lt,90:ct},{45:118,85:93,86:st,87:ot,89:lt,90:ct},{45:119,85:93,86:st,87:ot,89:lt,90:ct},{45:120,85:93,86:st,87:ot,89:lt,90:ct},{45:121,85:93,86:st,87:ot,89:lt,90:ct},{45:122,85:93,86:st,87:ot,89:lt,90:ct},{45:123,85:93,86:st,87:ot,89:lt,90:ct},{45:124,85:93,86:st,87:ot,89:lt,90:ct},{45:125,85:93,86:st,87:ot,89:lt,90:ct},{45:126,85:93,86:st,87:ot,89:lt,90:ct},{45:127,85:93,86:st,87:ot,89:lt,90:ct},{30:128,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:N,61:M,62:B,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{15:[1,130],43:[1,129]},{45:131,85:93,86:st,87:ot,89:lt,90:ct},{45:132,85:93,86:st,87:ot,89:lt,90:ct},{45:133,85:93,86:st,87:ot,89:lt,90:ct},{45:134,85:93,86:st,87:ot,89:lt,90:ct},{45:135,85:93,86:st,87:ot,89:lt,90:ct},{45:136,85:93,86:st,87:ot,89:lt,90:ct},{45:137,85:93,86:st,87:ot,89:lt,90:ct},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},e(ut,[2,9]),{14:142,21:p},{21:[2,13]},{1:[2,15]},e(it,[2,22]),e(rt,[2,24],{31:31,29:143,32:f,33:g,34:y,36:m,38:b}),e(it,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:f,33:g,34:y,36:m,38:b,44:_,46:x,47:v,48:k,49:w,50:T,51:C,54:E,55:S,56:A,57:D,58:L,59:O,60:N,61:M,62:B,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt}),e(at,[2,28]),e(at,[2,29]),e(ht,[2,46]),e(dt,[2,78],{85:93,45:145,86:st,87:ot,89:lt,90:ct}),e(pt,[2,80]),{88:[1,146]},e(pt,[2,82]),e(pt,[2,83]),e(ht,[2,47]),e(ht,[2,48]),e(ht,[2,49]),e(ht,[2,50]),e(ht,[2,51]),e(ht,[2,52]),e(ht,[2,53]),e(ht,[2,54]),e(ht,[2,55]),e(ht,[2,56]),e(ht,[2,57]),e(ht,[2,58]),e(ht,[2,59]),e(ht,[2,60]),e(ht,[2,61]),e(ht,[2,62]),e(ht,[2,63]),e(ht,[2,64]),e(ht,[2,65]),e(ht,[2,67]),e(ht,[2,68]),e(ht,[2,69]),e(ht,[2,70]),e(ht,[2,71]),e(ht,[2,72]),e(ht,[2,73]),e(ht,[2,74]),e(ht,[2,75]),e(ht,[2,76]),e(ht,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},e(ft,[2,35]),e(ft,[2,36]),e(ft,[2,37]),e(ft,[2,38]),e(ft,[2,39]),e(ft,[2,40]),e(ft,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},e(rt,[2,25]),e(it,[2,45]),e(dt,[2,79]),e(pt,[2,81]),e(ht,[2,31]),e(ht,[2,42]),e(gt,[2,32]),e(gt,[2,33],{15:[1,152]}),e(ut,[2,10]),e(gt,[2,34])],defaultActions:{2:[2,1],3:[2,2],5:[2,8],6:[2,4],7:[2,5],8:[2,6],9:[2,7],16:[2,11],17:[2,3],27:[2,14],85:[2,13],86:[2,15],138:[2,16],139:[2,17],140:[2,18],141:[2,19]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},mt=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),18;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 10;case 5:return this.begin("type_directive"),19;case 6:return this.popState(),this.begin("arg_directive"),16;case 7:return this.popState(),this.popState(),21;case 8:return 20;case 9:return 32;case 10:return 33;case 11:return this.begin("acc_title"),34;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),36;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:case 78:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:case 21:case 75:break;case 19:c;break;case 20:return 15;case 22:return 22;case 23:return 25;case 24:return 26;case 25:return 27;case 26:return 28;case 27:return this.begin("person_ext"),55;case 28:return this.begin("person"),54;case 29:return this.begin("system_ext_queue"),61;case 30:return this.begin("system_ext_db"),60;case 31:return this.begin("system_ext"),59;case 32:return this.begin("system_queue"),58;case 33:return this.begin("system_db"),57;case 34:return this.begin("system"),56;case 35:return this.begin("boundary"),47;case 36:return this.begin("enterprise_boundary"),44;case 37:return this.begin("system_boundary"),46;case 38:return this.begin("container_ext_queue"),67;case 39:return this.begin("container_ext_db"),66;case 40:return this.begin("container_ext"),65;case 41:return this.begin("container_queue"),64;case 42:return this.begin("container_db"),63;case 43:return this.begin("container"),62;case 44:return this.begin("container_boundary"),48;case 45:return this.begin("component_ext_queue"),73;case 46:return this.begin("component_ext_db"),72;case 47:return this.begin("component_ext"),71;case 48:return this.begin("component_queue"),70;case 49:return this.begin("component_db"),69;case 50:return this.begin("component"),68;case 51:case 52:return this.begin("node"),49;case 53:return this.begin("node_l"),50;case 54:return this.begin("node_r"),51;case 55:return this.begin("rel"),74;case 56:return this.begin("birel"),75;case 57:case 58:return this.begin("rel_u"),76;case 59:case 60:return this.begin("rel_d"),77;case 61:case 62:return this.begin("rel_l"),78;case 63:case 64:return this.begin("rel_r"),79;case 65:return this.begin("rel_b"),80;case 66:return this.begin("rel_index"),81;case 67:return this.begin("update_el_style"),82;case 68:return this.begin("update_rel_style"),83;case 69:return this.begin("update_layout_config"),84;case 70:return"EOF_IN_STRUCT";case 71:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 72:this.begin("attribute");break;case 73:case 84:this.popState(),this.popState();break;case 74:case 76:return 90;case 77:this.begin("string");break;case 79:case 85:return"STR";case 80:this.begin("string_kv");break;case 81:return this.begin("string_kv_key"),"STR_KEY";case 82:this.popState(),this.begin("string_kv_value");break;case 83:return"STR_VALUE";case 86:return"LBRACE";case 87:return"RBRACE";case 88:return"SPACE";case 89:return"EOL";case 90:return 24}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},string_kv_value:{rules:[83,84],inclusive:!1},string_kv_key:{rules:[82],inclusive:!1},string_kv:{rules:[81],inclusive:!1},string:{rules:[78,79],inclusive:!1},attribute:{rules:[73,74,75,76,77,80,85],inclusive:!1},update_layout_config:{rules:[70,71,72,73],inclusive:!1},update_rel_style:{rules:[70,71,72,73],inclusive:!1},update_el_style:{rules:[70,71,72,73],inclusive:!1},rel_b:{rules:[70,71,72,73],inclusive:!1},rel_r:{rules:[70,71,72,73],inclusive:!1},rel_l:{rules:[70,71,72,73],inclusive:!1},rel_d:{rules:[70,71,72,73],inclusive:!1},rel_u:{rules:[70,71,72,73],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[70,71,72,73],inclusive:!1},node_r:{rules:[70,71,72,73],inclusive:!1},node_l:{rules:[70,71,72,73],inclusive:!1},node:{rules:[70,71,72,73],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[70,71,72,73],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[70,71,72,73],inclusive:!1},component_ext:{rules:[70,71,72,73],inclusive:!1},component_queue:{rules:[70,71,72,73],inclusive:!1},component_db:{rules:[70,71,72,73],inclusive:!1},component:{rules:[70,71,72,73],inclusive:!1},container_boundary:{rules:[70,71,72,73],inclusive:!1},container_ext_queue:{rules:[],inclusive:!1},container_ext_db:{rules:[70,71,72,73],inclusive:!1},container_ext:{rules:[70,71,72,73],inclusive:!1},container_queue:{rules:[70,71,72,73],inclusive:!1},container_db:{rules:[70,71,72,73],inclusive:!1},container:{rules:[70,71,72,73],inclusive:!1},birel:{rules:[70,71,72,73],inclusive:!1},system_boundary:{rules:[70,71,72,73],inclusive:!1},enterprise_boundary:{rules:[70,71,72,73],inclusive:!1},boundary:{rules:[70,71,72,73],inclusive:!1},system_ext_queue:{rules:[70,71,72,73],inclusive:!1},system_ext_db:{rules:[70,71,72,73],inclusive:!1},system_ext:{rules:[70,71,72,73],inclusive:!1},system_queue:{rules:[70,71,72,73],inclusive:!1},system_db:{rules:[70,71,72,73],inclusive:!1},system:{rules:[70,71,72,73],inclusive:!1},person_ext:{rules:[70,71,72,73],inclusive:!1},person:{rules:[70,71,72,73],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,86,87,88,89,90],inclusive:!0}}},t);function bt(){this.yy={}}return yt.lexer=mt,bt.prototype=yt,yt.Parser=bt,new bt}();uk.parser=uk;const dk=uk,pk=t=>null!==t.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/);let fk=[],gk=[""],yk="global",mk="",bk=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],_k=[],xk="",vk=!1,kk=4,wk=2;var Tk;const Ck=function(t){return null==t?fk:fk.filter((e=>e.parentBoundary===t))},Ek=function(){return vk},Sk={addPersonOrSystem:function(t,e,n,i,r,a,s){if(null===e||null===n)return;let o={};const l=fk.find((t=>t.alias===e));if(l&&e===l.alias?o=l:(o.alias=e,fk.push(o)),o.label=null==n?{text:""}:{text:n},null==i)o.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]={text:e}}else o.descr={text:i};if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]=e}else o.sprite=r;if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=e}else o.tags=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=e}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=yk,o.wrap=Ek()},addPersonOrSystemBoundary:function(t,e,n,i,r){if(null===t||null===e)return;let a={};const s=bk.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,bk.push(a)),a.label=null==e?{text:""}:{text:e},null==n)a.type={text:"system"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]={text:e}}else a.type={text:n};if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.tags=i;if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]=e}else a.link=r;a.parentBoundary=yk,a.wrap=Ek(),mk=yk,yk=t,gk.push(mk)},addContainer:function(t,e,n,i,r,a,s,o){if(null===e||null===n)return;let l={};const c=fk.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,fk.push(l)),l.label=null==n?{text:""}:{text:n},null==i)l.techn={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.techn={text:i};if(null==r)l.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.descr={text:r};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=Ek(),l.typeC4Shape={text:t},l.parentBoundary=yk},addContainerBoundary:function(t,e,n,i,r){if(null===t||null===e)return;let a={};const s=bk.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,bk.push(a)),a.label=null==e?{text:""}:{text:e},null==n)a.type={text:"container"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]={text:e}}else a.type={text:n};if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.tags=i;if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]=e}else a.link=r;a.parentBoundary=yk,a.wrap=Ek(),mk=yk,yk=t,gk.push(mk)},addComponent:function(t,e,n,i,r,a,s,o){if(null===e||null===n)return;let l={};const c=fk.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,fk.push(l)),l.label=null==n?{text:""}:{text:n},null==i)l.techn={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.techn={text:i};if(null==r)l.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.descr={text:r};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.wrap=Ek(),l.typeC4Shape={text:t},l.parentBoundary=yk},addDeploymentNode:function(t,e,n,i,r,a,s,o){if(null===e||null===n)return;let l={};const c=bk.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,bk.push(l)),l.label=null==n?{text:""}:{text:n},null==i)l.type={text:"node"};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];l[t]={text:e}}else l.type={text:i};if(null==r)l.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.descr={text:r};if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]=e}else l.tags=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.link=o;l.nodeType=t,l.parentBoundary=yk,l.wrap=Ek(),mk=yk,yk=e,gk.push(mk)},popBoundaryParseStack:function(){yk=mk,gk.pop(),mk=gk.pop(),gk.push(mk)},addRel:function(t,e,n,i,r,a,s,o,l){if(null==t||null==e||null==n||null==i)return;let c={};const h=_k.find((t=>t.from===e&&t.to===n));if(h?c=h:_k.push(c),c.type=t,c.from=e,c.to=n,c.label={text:i},null==r)c.techn={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];c[t]={text:e}}else c.techn={text:r};if(null==a)c.descr={text:""};else if("object"==typeof a){let[t,e]=Object.entries(a)[0];c[t]={text:e}}else c.descr={text:a};if("object"==typeof s){let[t,e]=Object.entries(s)[0];c[t]=e}else c.sprite=s;if("object"==typeof o){let[t,e]=Object.entries(o)[0];c[t]=e}else c.tags=o;if("object"==typeof l){let[t,e]=Object.entries(l)[0];c[t]=e}else c.link=l;c.wrap=Ek()},updateElStyle:function(t,e,n,i,r,a,s,o,l,c,h){let u=fk.find((t=>t.alias===e));if(void 0!==u||(u=bk.find((t=>t.alias===e)),void 0!==u)){if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];u[t]=e}else u.bgColor=n;if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];u[t]=e}else u.fontColor=i;if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];u[t]=e}else u.borderColor=r;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];u[t]=e}else u.shadowing=a;if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];u[t]=e}else u.shape=s;if(null!=o)if("object"==typeof o){let[t,e]=Object.entries(o)[0];u[t]=e}else u.sprite=o;if(null!=l)if("object"==typeof l){let[t,e]=Object.entries(l)[0];u[t]=e}else u.techn=l;if(null!=c)if("object"==typeof c){let[t,e]=Object.entries(c)[0];u[t]=e}else u.legendText=c;if(null!=h)if("object"==typeof h){let[t,e]=Object.entries(h)[0];u[t]=e}else u.legendSprite=h}},updateRelStyle:function(t,e,n,i,r,a,s){const o=_k.find((t=>t.from===e&&t.to===n));if(void 0!==o){if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]=e}else o.textColor=i;if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]=e}else o.lineColor=r;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=parseInt(e)}else o.offsetX=parseInt(a);if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=parseInt(e)}else o.offsetY=parseInt(s)}},updateLayoutConfig:function(t,e,n){let i=kk,r=wk;if("object"==typeof e){const t=Object.values(e)[0];i=parseInt(t)}else i=parseInt(e);if("object"==typeof n){const t=Object.values(n)[0];r=parseInt(t)}else r=parseInt(n);i>=1&&(kk=i),r>=1&&(wk=r)},autoWrap:Ek,setWrap:function(t){vk=t},getC4ShapeArray:Ck,getC4Shape:function(t){return fk.find((e=>e.alias===t))},getC4ShapeKeys:function(t){return Object.keys(Ck(t))},getBoundarys:function(t){return null==t?bk:bk.filter((e=>e.parentBoundary===t))},getCurrentBoundaryParse:function(){return yk},getParentBoundaryParse:function(){return mk},getRels:function(){return _k},getTitle:function(){return xk},getC4Type:function(){return Tk},getC4ShapeInRow:function(){return kk},getC4BoundaryInRow:function(){return wk},setAccTitle:Ev,getAccTitle:Sv,getAccDescription:Dv,setAccDescription:Av,parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().c4,clear:function(){fk=[],bk=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],mk="",yk="global",gk=[""],_k=[],gk=[""],xk="",vk=!1,kk=4,wk=2},LINETYPE:{SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:function(t){let e=ab(t,jx());xk=e},setC4Type:function(t){let e=ab(t,jx());Tk=e}},Ak=function(t,e){const n=t.append("rect");if(n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),"undefined"!==e.attrs&&null!==e.attrs)for(let t in e.attrs)n.attr(t,e.attrs[t]);return"undefined"!==e.class&&n.attr("class",e.class),n},Dk=function(t,e,n,r,a,s){const o=t.append("image");o.attr("width",e),o.attr("height",n),o.attr("x",r),o.attr("y",a);let l=s.startsWith("data:image/png;base64")?s:i(s);o.attr("xlink:href",l)},Lk=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},Ok=(t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),Nk=function(){function t(t,e,n,r,a,s,o){i(e.append("text").attr("x",n+a/2).attr("y",r+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,n,r,a,s,o,l){const{fontSize:c,fontFamily:h,fontWeight:u}=l,d=t.split(ub.lineBreakRegex);for(let t=0;t>"),e.typeC4Shape.text){case"person":case"external_person":Dk(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s)}let h=n[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,Nk(n)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=n[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.thchn&&""!==e.thchn.text?Nk(n)(e.thchn.text,o,e.x,e.y+e.thchn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&""!==e.type.text&&Nk(n)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&""!==e.descr.text&&(h=n.personFont(),h.fontColor=a,Nk(n)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},Ik=(t,e,n)=>{const i=t.append("g");let r=0;for(let t of e){let e=t.textColor?t.textColor:"#444444",a=t.lineColor?t.lineColor:"#444444",s=t.offsetX?parseInt(t.offsetX):0,o=t.offsetY?parseInt(t.offsetY):0,l="";if(0===r){let e=i.append("line");e.attr("x1",t.startPoint.x),e.attr("y1",t.startPoint.y),e.attr("x2",t.endPoint.x),e.attr("y2",t.endPoint.y),e.attr("stroke-width","1"),e.attr("stroke",a),e.style("fill","none"),"rel_b"!==t.type&&e.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+l+"#arrowend)"),r=-1}else{let e=i.append("path");e.attr("fill","none").attr("stroke-width","1").attr("stroke",a).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",t.startPoint.x).replaceAll("starty",t.startPoint.y).replaceAll("controlx",t.startPoint.x+(t.endPoint.x-t.startPoint.x)/2-(t.endPoint.x-t.startPoint.x)/4).replaceAll("controly",t.startPoint.y+(t.endPoint.y-t.startPoint.y)/2).replaceAll("stopx",t.endPoint.x).replaceAll("stopy",t.endPoint.y)),"rel_b"!==t.type&&e.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+l+"#arrowend)")}let c=n.messageFont();Nk(n)(t.label.text,i,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+s,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+o,t.label.width,t.label.height,{fill:e},c),t.techn&&""!==t.techn.text&&(c=n.messageFont(),Nk(n)("["+t.techn.text+"]",i,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+s,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+n.messageFontSize+5+o,Math.max(t.label.width,t.techn.width),t.techn.height,{fill:e,"font-style":"italic"},c))}},Fk=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},Rk=function(t){t.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},$k=function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},Pk=function(t){const e=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);e.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),e.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},Yk=function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},jk=function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},zk=function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")};let Uk=0,Wk=0,Hk=4,qk=2;uk.yy=Sk;let Vk={};class Gk{constructor(t){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,Xk(t.db.getConfig())}setData(t,e,n,i){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=e,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])}insert(t){this.nextData.cnt=this.nextData.cnt+1;let e=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+t.margin:this.nextData.stopx+2*t.margin,n=e+t.width,i=this.nextData.starty+2*t.margin,r=i+t.height;(e>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Hk)&&(e=this.nextData.startx+t.margin+Vk.nextLinePaddingX,i=this.nextData.stopy+2*t.margin,this.nextData.stopx=n=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=r=i+t.height,this.nextData.cnt=1),t.x=e,t.y=i,this.updateVal(this.data,"startx",e,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",r,Math.max),this.updateVal(this.nextData,"startx",e,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",r,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},Xk(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}}const Xk=function(t){lx(Vk,t),t.fontFamily&&(Vk.personFontFamily=Vk.systemFontFamily=Vk.messageFontFamily=t.fontFamily),t.fontSize&&(Vk.personFontSize=Vk.systemFontSize=Vk.messageFontSize=t.fontSize),t.fontWeight&&(Vk.personFontWeight=Vk.systemFontWeight=Vk.messageFontWeight=t.fontWeight)},Zk=(t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),Qk=t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight});function Kk(t,e,n,i,r){if(!e[t].width)if(n)e[t].text=xx(e[t].text,r,i),e[t].textLines=e[t].text.split(ub.lineBreakRegex).length,e[t].width=r,e[t].height=kx(e[t].text,i);else{let n=e[t].text.split(ub.lineBreakRegex);e[t].textLines=n.length;let r=0;e[t].height=0,e[t].width=0;for(const a of n)e[t].width=Math.max(wx(a,i),e[t].width),r=kx(a,i),e[t].height=e[t].height+r}}const Jk=function(t,e,n){e.x=n.data.startx,e.y=n.data.starty,e.width=n.data.stopx-n.data.startx,e.height=n.data.stopy-n.data.starty,e.label.y=Vk.c4ShapeMargin-35;let i=e.wrap&&Vk.wrap,r=Qk(Vk);r.fontSize=r.fontSize+2,r.fontWeight="bold",Kk("label",e,i,r,wx(e.label.text,r)),Mk(t,e,Vk)},tw=function(t,e,n,i){let r=0;for(const a of i){r=0;const i=n[a];let s=Zk(Vk,i.typeC4Shape.text);switch(s.fontSize=s.fontSize-2,i.typeC4Shape.width=wx("<<"+i.typeC4Shape.text+">>",s),i.typeC4Shape.height=s.fontSize+2,i.typeC4Shape.Y=Vk.c4ShapePadding,r=i.typeC4Shape.Y+i.typeC4Shape.height-4,i.image={width:0,height:0,Y:0},i.typeC4Shape.text){case"person":case"external_person":i.image.width=48,i.image.height=48,i.image.Y=r,r=i.image.Y+i.image.height}i.sprite&&(i.image.width=48,i.image.height=48,i.image.Y=r,r=i.image.Y+i.image.height);let o=i.wrap&&Vk.wrap,l=Vk.width-2*Vk.c4ShapePadding,c=Zk(Vk,i.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",Kk("label",i,o,c,l),i.label.Y=r+8,r=i.label.Y+i.label.height,i.type&&""!==i.type.text){i.type.text="["+i.type.text+"]",Kk("type",i,o,Zk(Vk,i.typeC4Shape.text),l),i.type.Y=r+5,r=i.type.Y+i.type.height}else if(i.techn&&""!==i.techn.text){i.techn.text="["+i.techn.text+"]",Kk("techn",i,o,Zk(Vk,i.techn.text),l),i.techn.Y=r+5,r=i.techn.Y+i.techn.height}let h=r,u=i.label.width;if(i.descr&&""!==i.descr.text){Kk("descr",i,o,Zk(Vk,i.typeC4Shape.text),l),i.descr.Y=r+20,r=i.descr.Y+i.descr.height,u=Math.max(i.label.width,i.descr.width),h=r-5*i.descr.textLines}u+=Vk.c4ShapePadding,i.width=Math.max(i.width||Vk.width,u,Vk.width),i.height=Math.max(i.height||Vk.height,h,Vk.height),i.margin=i.margin||Vk.c4ShapeMargin,t.insert(i),Bk(e,i,Vk)}t.bumpLastMargin(Vk.c4ShapeMargin)};class ew{constructor(t,e){this.x=t,this.y=e}}let nw=function(t,e){let n=t.x,i=t.y,r=e.x,a=e.y,s=n+t.width/2,o=i+t.height/2,l=Math.abs(n-r),c=Math.abs(i-a),h=c/l,u=t.height/t.width,d=null;return i==a&&nr?d=new ew(n,o):n==r&&ia&&(d=new ew(s,i)),n>r&&i=h?new ew(n,o+h*t.width/2):new ew(s-l/c*t.height/2,i+t.height):n=h?new ew(n+t.width,o+h*t.width/2):new ew(s+l/c*t.height/2,i+t.height):na?d=u>=h?new ew(n+t.width,o-h*t.width/2):new ew(s+t.height/2*l/c,i):n>r&&i>a&&(d=u>=h?new ew(n,o-t.width/2*h):new ew(s-t.height/2*l/c,i)),d},iw=function(t,e){let n={x:0,y:0};n.x=e.x+e.width/2,n.y=e.y+e.height/2;let i=nw(t,n);return n.x=t.x+t.width/2,n.y=t.y+t.height/2,{startPoint:i,endPoint:nw(e,n)}};function rw(t,e,n,i,r){let a=new Gk(r);a.data.widthLimit=n.data.widthLimit/Math.min(qk,i.length);for(let[s,o]of i.entries()){let i=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=i,i=o.image.Y+o.image.height);let l=o.wrap&&Vk.wrap,c=Qk(Vk);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",Kk("label",o,l,c,a.data.widthLimit),o.label.Y=i+8,i=o.label.Y+o.label.height,o.type&&""!==o.type.text){o.type.text="["+o.type.text+"]",Kk("type",o,l,Qk(Vk),a.data.widthLimit),o.type.Y=i+5,i=o.type.Y+o.type.height}if(o.descr&&""!==o.descr.text){let t=Qk(Vk);t.fontSize=t.fontSize-2,Kk("descr",o,l,t,a.data.widthLimit),o.descr.Y=i+20,i=o.descr.Y+o.descr.height}if(0==s||s%qk==0){let t=n.data.startx+Vk.diagramMarginX,e=n.data.stopy+Vk.diagramMarginY+i;a.setData(t,t,e,e)}else{let t=a.data.stopx!==a.data.startx?a.data.stopx+Vk.diagramMarginX:a.data.startx,e=a.data.starty;a.setData(t,t,e,e)}a.name=o.alias;let h=r.db.getC4ShapeArray(o.alias),u=r.db.getC4ShapeKeys(o.alias);u.length>0&&tw(a,t,h,u),e=o.alias;let d=r.db.getBoundarys(e);d.length>0&&rw(t,e,a,d,r),"global"!==o.alias&&Jk(t,o,a),n.data.stopy=Math.max(a.data.stopy+Vk.c4ShapeMargin,n.data.stopy),n.data.stopx=Math.max(a.data.stopx+Vk.c4ShapeMargin,n.data.stopx),Uk=Math.max(Uk,n.data.stopx),Wk=Math.max(Wk,n.data.stopy)}}const aw={drawPersonOrSystemArray:tw,drawBoundary:Jk,setConf:Xk,draw:function(t,e,n,i){Vk=jx().c4;const r=jx().securityLevel;let a;"sandbox"===r&&(a=ie("#i"+e));const s=ie("sandbox"===r?a.nodes()[0].contentDocument.body:"body");let o=i.db;i.db.setWrap(Vk.wrap),Hk=o.getC4ShapeInRow(),qk=o.getC4BoundaryInRow(),tb.debug(`C:${JSON.stringify(Vk,null,2)}`);const l="sandbox"===r?s.select(`[id="${e}"]`):ie(`[id="${e}"]`);jk(l),Yk(l),zk(l);let c=new Gk(i);c.setData(Vk.diagramMarginX,Vk.diagramMarginX,Vk.diagramMarginY,Vk.diagramMarginY),c.data.widthLimit=screen.availWidth,Uk=Vk.diagramMarginX,Wk=Vk.diagramMarginY;const h=i.db.getTitle();rw(l,"",c,i.db.getBoundarys(""),i),Fk(l),Rk(l),Pk(l),$k(l),function(t,e,n,i){let r=0;for(let t of e){r+=1;let e=t.wrap&&Vk.wrap,s={fontFamily:(a=Vk).messageFontFamily,fontSize:a.messageFontSize,fontWeight:a.messageFontWeight};"C4Dynamic"===i.db.getC4Type()&&(t.label.text=r+": "+t.label.text);let o=wx(t.label.text,s);Kk("label",t,e,s,o),t.techn&&""!==t.techn.text&&(o=wx(t.techn.text,s),Kk("techn",t,e,s,o)),t.descr&&""!==t.descr.text&&(o=wx(t.descr.text,s),Kk("descr",t,e,s,o));let l=n(t.from),c=n(t.to),h=iw(l,c);t.startPoint=h.startPoint,t.endPoint=h.endPoint}var a;Ik(t,e,Vk)}(l,i.db.getRels(),i.db.getC4Shape,i),c.data.stopx=Uk,c.data.stopy=Wk;const u=c.data;let d=u.stopy-u.starty+2*Vk.diagramMarginY;const p=u.stopx-u.startx+2*Vk.diagramMarginX;h&&l.append("text").text(h).attr("x",(u.stopx-u.startx)/2-4*Vk.diagramMarginX).attr("y",u.starty+Vk.diagramMarginY),Gx(l,d,p,Vk.useMaxWidth);const f=h?60:0;l.attr("viewBox",u.startx-Vk.diagramMarginX+" -"+(Vk.diagramMarginY+f)+" "+p+" "+(d+f)),tb.debug("models:",u)}};var sw=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,3],i=[1,7],r=[1,8],a=[1,9],s=[1,10],o=[1,13],l=[1,12],c=[1,16,25],h=[1,20],u=[1,32],d=[1,33],p=[1,34],f=[1,36],g=[1,39],y=[1,37],m=[1,38],b=[1,44],_=[1,45],x=[1,40],v=[1,41],k=[1,42],w=[1,43],T=[1,48],C=[1,49],E=[1,50],S=[1,51],A=[16,25],D=[1,65],L=[1,66],O=[1,67],N=[1,68],M=[1,69],B=[1,70],I=[1,71],F=[1,80],R=[16,25,32,45,46,54,60,61,62,63,64,65,66,71,73],$=[16,25,30,32,45,46,50,54,60,61,62,63,64,65,66,71,73,88,89,90,91],P=[5,8,9,10,11,16,19,23,25],Y=[54,88,89,90,91],j=[54,65,66,88,89,90,91],z=[54,60,61,62,63,64,88,89,90,91],U=[16,25,32],W=[1,107],H={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statments:5,direction:6,directive:7,direction_tb:8,direction_bt:9,direction_rl:10,direction_lr:11,graphConfig:12,openDirective:13,typeDirective:14,closeDirective:15,NEWLINE:16,":":17,argDirective:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,CLASS_DIAGRAM:23,statements:24,EOF:25,statement:26,className:27,alphaNumToken:28,classLiteralName:29,GENERICTYPE:30,relationStatement:31,LABEL:32,classStatement:33,methodStatement:34,annotationStatement:35,clickStatement:36,cssClassStatement:37,noteStatement:38,acc_title:39,acc_title_value:40,acc_descr:41,acc_descr_value:42,acc_descr_multiline_value:43,CLASS:44,STYLE_SEPARATOR:45,STRUCT_START:46,members:47,STRUCT_STOP:48,ANNOTATION_START:49,ANNOTATION_END:50,MEMBER:51,SEPARATOR:52,relation:53,STR:54,NOTE_FOR:55,noteText:56,NOTE:57,relationType:58,lineType:59,AGGREGATION:60,EXTENSION:61,COMPOSITION:62,DEPENDENCY:63,LOLLIPOP:64,LINE:65,DOTTED_LINE:66,CALLBACK:67,LINK:68,LINK_TARGET:69,CLICK:70,CALLBACK_NAME:71,CALLBACK_ARGS:72,HREF:73,CSSCLASS:74,commentToken:75,textToken:76,graphCodeTokens:77,textNoTagsToken:78,TAGSTART:79,TAGEND:80,"==":81,"--":82,PCT:83,DEFAULT:84,SPACE:85,MINUS:86,keywords:87,UNICODE_TEXT:88,NUM:89,ALPHA:90,BQUOTE_STR:91,$accept:0,$end:1},terminals_:{2:"error",5:"statments",8:"direction_tb",9:"direction_bt",10:"direction_rl",11:"direction_lr",16:"NEWLINE",17:":",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",23:"CLASS_DIAGRAM",25:"EOF",30:"GENERICTYPE",32:"LABEL",39:"acc_title",40:"acc_title_value",41:"acc_descr",42:"acc_descr_value",43:"acc_descr_multiline_value",44:"CLASS",45:"STYLE_SEPARATOR",46:"STRUCT_START",48:"STRUCT_STOP",49:"ANNOTATION_START",50:"ANNOTATION_END",51:"MEMBER",52:"SEPARATOR",54:"STR",55:"NOTE_FOR",57:"NOTE",60:"AGGREGATION",61:"EXTENSION",62:"COMPOSITION",63:"DEPENDENCY",64:"LOLLIPOP",65:"LINE",66:"DOTTED_LINE",67:"CALLBACK",68:"LINK",69:"LINK_TARGET",70:"CLICK",71:"CALLBACK_NAME",72:"CALLBACK_ARGS",73:"HREF",74:"CSSCLASS",77:"graphCodeTokens",79:"TAGSTART",80:"TAGEND",81:"==",82:"--",83:"PCT",84:"DEFAULT",85:"SPACE",86:"MINUS",87:"keywords",88:"UNICODE_TEXT",89:"NUM",90:"ALPHA",91:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[3,1],[3,2],[6,1],[6,1],[6,1],[6,1],[4,1],[7,4],[7,6],[13,1],[14,1],[18,1],[15,1],[12,4],[24,1],[24,2],[24,3],[27,1],[27,1],[27,2],[27,2],[27,2],[26,1],[26,2],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,2],[26,2],[26,1],[33,2],[33,4],[33,5],[33,7],[35,4],[47,1],[47,2],[34,1],[34,2],[34,1],[34,1],[31,3],[31,4],[31,4],[31,5],[38,3],[38,2],[53,3],[53,2],[53,2],[53,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[36,3],[36,4],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[37,3],[75,1],[75,1],[76,1],[76,1],[76,1],[76,1],[76,1],[76,1],[76,1],[78,1],[78,1],[78,1],[78,1],[28,1],[28,1],[28,1],[29,1],[56,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 5:i.setDirection("TB");break;case 6:i.setDirection("BT");break;case 7:i.setDirection("RL");break;case 8:i.setDirection("LR");break;case 12:i.parseDirective("%%{","open_directive");break;case 13:i.parseDirective(a[o],"type_directive");break;case 14:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 15:i.parseDirective("}%%","close_directive","class");break;case 20:case 21:this.$=a[o];break;case 22:this.$=a[o-1]+a[o];break;case 23:case 24:this.$=a[o-1]+"~"+a[o];break;case 25:i.addRelation(a[o]);break;case 26:a[o-1].title=i.cleanupLabel(a[o]),i.addRelation(a[o-1]);break;case 35:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 36:case 37:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 38:i.addClass(a[o]);break;case 39:i.addClass(a[o-2]),i.setCssClass(a[o-2],a[o]);break;case 40:i.addClass(a[o-3]),i.addMembers(a[o-3],a[o-1]);break;case 41:i.addClass(a[o-5]),i.setCssClass(a[o-5],a[o-3]),i.addMembers(a[o-5],a[o-1]);break;case 42:i.addAnnotation(a[o],a[o-2]);break;case 43:this.$=[a[o]];break;case 44:a[o].push(a[o-1]),this.$=a[o];break;case 45:case 47:case 48:break;case 46:i.addMember(a[o-1],i.cleanupLabel(a[o]));break;case 49:this.$={id1:a[o-2],id2:a[o],relation:a[o-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:a[o-3],id2:a[o],relation:a[o-1],relationTitle1:a[o-2],relationTitle2:"none"};break;case 51:this.$={id1:a[o-3],id2:a[o],relation:a[o-2],relationTitle1:"none",relationTitle2:a[o-1]};break;case 52:this.$={id1:a[o-4],id2:a[o],relation:a[o-2],relationTitle1:a[o-3],relationTitle2:a[o-1]};break;case 53:i.addNote(a[o],a[o-1]);break;case 54:i.addNote(a[o]);break;case 55:this.$={type1:a[o-2],type2:a[o],lineType:a[o-1]};break;case 56:this.$={type1:"none",type2:a[o],lineType:a[o-1]};break;case 57:this.$={type1:a[o-1],type2:"none",lineType:a[o]};break;case 58:this.$={type1:"none",type2:"none",lineType:a[o]};break;case 59:this.$=i.relationType.AGGREGATION;break;case 60:this.$=i.relationType.EXTENSION;break;case 61:this.$=i.relationType.COMPOSITION;break;case 62:this.$=i.relationType.DEPENDENCY;break;case 63:this.$=i.relationType.LOLLIPOP;break;case 64:this.$=i.lineType.LINE;break;case 65:this.$=i.lineType.DOTTED_LINE;break;case 66:case 72:this.$=a[o-2],i.setClickEvent(a[o-1],a[o]);break;case 67:case 73:this.$=a[o-3],i.setClickEvent(a[o-2],a[o-1]),i.setTooltip(a[o-2],a[o]);break;case 68:case 76:this.$=a[o-2],i.setLink(a[o-1],a[o]);break;case 69:case 77:this.$=a[o-3],i.setLink(a[o-2],a[o-1],a[o]);break;case 70:case 78:this.$=a[o-3],i.setLink(a[o-2],a[o-1]),i.setTooltip(a[o-2],a[o]);break;case 71:case 79:this.$=a[o-4],i.setLink(a[o-3],a[o-2],a[o]),i.setTooltip(a[o-3],a[o-1]);break;case 74:this.$=a[o-3],i.setClickEvent(a[o-2],a[o-1],a[o]);break;case 75:this.$=a[o-4],i.setClickEvent(a[o-3],a[o-2],a[o-1]),i.setTooltip(a[o-3],a[o]);break;case 80:i.setCssClass(a[o-1],a[o])}},table:[{3:1,4:2,5:n,6:4,7:5,8:i,9:r,10:a,11:s,12:6,13:11,19:o,23:l},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{3:14,4:2,5:n,6:4,7:5,8:i,9:r,10:a,11:s,12:6,13:11,19:o,23:l},{1:[2,9]},e(c,[2,5]),e(c,[2,6]),e(c,[2,7]),e(c,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:h},e([17,22],[2,13]),{6:31,7:30,8:i,9:r,10:a,11:s,13:11,19:o,24:21,26:22,27:35,28:46,29:47,31:23,33:24,34:25,35:26,36:27,37:28,38:29,39:u,41:d,43:p,44:f,49:g,51:y,52:m,55:b,57:_,67:x,68:v,70:k,74:w,88:T,89:C,90:E,91:S},{16:[1,52]},{18:53,21:[1,54]},{16:[2,15]},{25:[1,55]},{16:[1,56],25:[2,17]},e(A,[2,25],{32:[1,57]}),e(A,[2,27]),e(A,[2,28]),e(A,[2,29]),e(A,[2,30]),e(A,[2,31]),e(A,[2,32]),e(A,[2,33]),e(A,[2,34]),{40:[1,58]},{42:[1,59]},e(A,[2,37]),e(A,[2,45],{53:60,58:63,59:64,32:[1,62],54:[1,61],60:D,61:L,62:O,63:N,64:M,65:B,66:I}),{27:72,28:46,29:47,88:T,89:C,90:E,91:S},e(A,[2,47]),e(A,[2,48]),{28:73,88:T,89:C,90:E},{27:74,28:46,29:47,88:T,89:C,90:E,91:S},{27:75,28:46,29:47,88:T,89:C,90:E,91:S},{27:76,28:46,29:47,88:T,89:C,90:E,91:S},{54:[1,77]},{27:78,28:46,29:47,88:T,89:C,90:E,91:S},{54:F,56:79},e(R,[2,20],{28:46,29:47,27:81,30:[1,82],88:T,89:C,90:E,91:S}),e(R,[2,21],{30:[1,83]}),e($,[2,94]),e($,[2,95]),e($,[2,96]),e([16,25,30,32,45,46,54,60,61,62,63,64,65,66,71,73],[2,97]),e(P,[2,10]),{15:84,22:h},{22:[2,14]},{1:[2,16]},{6:31,7:30,8:i,9:r,10:a,11:s,13:11,19:o,24:85,25:[2,18],26:22,27:35,28:46,29:47,31:23,33:24,34:25,35:26,36:27,37:28,38:29,39:u,41:d,43:p,44:f,49:g,51:y,52:m,55:b,57:_,67:x,68:v,70:k,74:w,88:T,89:C,90:E,91:S},e(A,[2,26]),e(A,[2,35]),e(A,[2,36]),{27:86,28:46,29:47,54:[1,87],88:T,89:C,90:E,91:S},{53:88,58:63,59:64,60:D,61:L,62:O,63:N,64:M,65:B,66:I},e(A,[2,46]),{59:89,65:B,66:I},e(Y,[2,58],{58:90,60:D,61:L,62:O,63:N,64:M}),e(j,[2,59]),e(j,[2,60]),e(j,[2,61]),e(j,[2,62]),e(j,[2,63]),e(z,[2,64]),e(z,[2,65]),e(A,[2,38],{45:[1,91],46:[1,92]}),{50:[1,93]},{54:[1,94]},{54:[1,95]},{71:[1,96],73:[1,97]},{28:98,88:T,89:C,90:E},{54:F,56:99},e(A,[2,54]),e(A,[2,98]),e(R,[2,22]),e(R,[2,23]),e(R,[2,24]),{16:[1,100]},{25:[2,19]},e(U,[2,49]),{27:101,28:46,29:47,88:T,89:C,90:E,91:S},{27:102,28:46,29:47,54:[1,103],88:T,89:C,90:E,91:S},e(Y,[2,57],{58:104,60:D,61:L,62:O,63:N,64:M}),e(Y,[2,56]),{28:105,88:T,89:C,90:E},{47:106,51:W},{27:108,28:46,29:47,88:T,89:C,90:E,91:S},e(A,[2,66],{54:[1,109]}),e(A,[2,68],{54:[1,111],69:[1,110]}),e(A,[2,72],{54:[1,112],72:[1,113]}),e(A,[2,76],{54:[1,115],69:[1,114]}),e(A,[2,80]),e(A,[2,53]),e(P,[2,11]),e(U,[2,51]),e(U,[2,50]),{27:116,28:46,29:47,88:T,89:C,90:E,91:S},e(Y,[2,55]),e(A,[2,39],{46:[1,117]}),{48:[1,118]},{47:119,48:[2,43],51:W},e(A,[2,42]),e(A,[2,67]),e(A,[2,69]),e(A,[2,70],{69:[1,120]}),e(A,[2,73]),e(A,[2,74],{54:[1,121]}),e(A,[2,77]),e(A,[2,78],{69:[1,122]}),e(U,[2,52]),{47:123,51:W},e(A,[2,40]),{48:[2,44]},e(A,[2,71]),e(A,[2,75]),e(A,[2,79]),{48:[1,124]},e(A,[2,41])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],6:[2,9],13:[2,12],14:[2,4],20:[2,15],54:[2,14],55:[2,16],85:[2,19],119:[2,44]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},q=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),19;case 1:return 8;case 2:return 9;case 3:return 10;case 4:return 11;case 5:return this.begin("type_directive"),20;case 6:return this.popState(),this.begin("arg_directive"),17;case 7:return this.popState(),this.popState(),22;case 8:return 21;case 9:case 10:case 19:case 27:break;case 11:return this.begin("acc_title"),39;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),41;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:case 39:case 42:case 45:case 48:case 51:case 54:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:return 16;case 20:case 21:return 23;case 22:return this.begin("struct"),46;case 23:return"EDGE_STATE";case 24:return"EOF_IN_STRUCT";case 25:return"OPEN_IN_STRUCT";case 26:return this.popState(),48;case 28:return"MEMBER";case 29:return 44;case 30:return 74;case 31:return 67;case 32:return 68;case 33:return 70;case 34:return 55;case 35:return 57;case 36:return 49;case 37:return 50;case 38:this.begin("generic");break;case 40:return"GENERICTYPE";case 41:this.begin("string");break;case 43:return"STR";case 44:this.begin("bqstring");break;case 46:return"BQUOTE_STR";case 47:this.begin("href");break;case 49:return 73;case 50:this.begin("callback_name");break;case 52:this.popState(),this.begin("callback_args");break;case 53:return 71;case 55:return 72;case 56:case 57:case 58:case 59:return 69;case 60:case 61:return 61;case 62:case 63:return 63;case 64:return 62;case 65:return 60;case 66:return 64;case 67:return 65;case 68:return 66;case 69:return 32;case 70:return 45;case 71:return 86;case 72:return"DOT";case 73:return"PLUS";case 74:return 83;case 75:case 76:return"EQUALS";case 77:return 90;case 78:return"PUNCTUATION";case 79:return 89;case 80:return 88;case 81:return 85;case 82:return 25}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:\[\*\])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},callback_args:{rules:[54,55],inclusive:!1},callback_name:{rules:[51,52,53],inclusive:!1},href:{rules:[48,49],inclusive:!1},struct:{rules:[23,24,25,26,27,28],inclusive:!1},generic:{rules:[39,40],inclusive:!1},bqstring:{rules:[45,46],inclusive:!1},string:{rules:[42,43],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,29,30,31,32,33,34,35,36,37,38,41,44,47,50,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82],inclusive:!0}}},t);function V(){this.yy={}}return H.lexer=q,V.prototype=H,H.Parser=V,new V}();sw.parser=sw;const ow=sw,lw=(t,e)=>{var n;return"dagre-wrapper"!==(null==(n=null==e?void 0:e.class)?void 0:n.defaultRenderer)&&null!==t.match(/^\s*classDiagram/)},cw=(t,e)=>{var n;return null!==t.match(/^\s*classDiagram/)&&"dagre-wrapper"===(null==(n=null==e?void 0:e.class)?void 0:n.defaultRenderer)||null!==t.match(/^\s*classDiagram-v2/)},hw="classid-";let uw=[],dw={},pw=[],fw=0,gw=[];const yw=t=>ub.sanitizeText(t,jx()),mw=function(t){let e="",n=t;if(t.indexOf("~")>0){let i=t.split("~");n=i[0],e=ub.sanitizeText(i[1],jx())}return{className:n,type:e}},bw=function(t){let e=mw(t);void 0===dw[e.className]&&(dw[e.className]={id:e.className,type:e.type,cssClasses:[],methods:[],members:[],annotations:[],domId:hw+e.className+"-"+fw},fw++)},_w=function(t){const e=Object.keys(dw);for(const n of e)if(dw[n].id===t)return dw[n].domId},xw=function(t,e){const n=mw(t).className,i=dw[n];if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?i.annotations.push(yw(t.substring(2,t.length-2))):t.indexOf(")")>0?i.methods.push(yw(t)):t&&i.members.push(yw(t))}},vw=function(t,e){t.split(",").forEach((function(t){let n=t;t[0].match(/\d/)&&(n=hw+n),void 0!==dw[n]&&dw[n].cssClasses.push(e)}))},kw=function(t,e,n){const i=jx();let r=t,a=_w(r);if("loose"===i.securityLevel&&void 0!==e&&void 0!==dw[r]){let t=[];if("string"==typeof n){t=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);ie(this).classed("hover",!1)}))};gw.push(ww);let Tw="TB";const Cw={parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},setAccTitle:Ev,getAccTitle:Sv,getAccDescription:Dv,setAccDescription:Av,getConfig:()=>jx().class,addClass:bw,bindFunctions:function(t){gw.forEach((function(e){e(t)}))},clear:function(){uw=[],dw={},pw=[],gw=[],gw.push(ww),Cv()},getClass:function(t){return dw[t]},getClasses:function(){return dw},getNotes:function(){return pw},addAnnotation:function(t,e){const n=mw(t).className;dw[n].annotations.push(e)},addNote:function(t,e){const n={id:`note${pw.length}`,class:e,text:t};pw.push(n)},getRelations:function(){return uw},addRelation:function(t){tb.debug("Adding relation: "+JSON.stringify(t)),bw(t.id1),bw(t.id2),t.id1=mw(t.id1).className,t.id2=mw(t.id2).className,t.relationTitle1=ub.sanitizeText(t.relationTitle1.trim(),jx()),t.relationTitle2=ub.sanitizeText(t.relationTitle2.trim(),jx()),uw.push(t)},getDirection:()=>Tw,setDirection:t=>{Tw=t},addMember:xw,addMembers:function(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((e=>xw(t,e))))},cleanupLabel:function(t){return":"===t.substring(0,1)?ub.sanitizeText(t.substr(1).trim(),jx()):yw(t.trim())},lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},setClickEvent:function(t,e,n){t.split(",").forEach((function(t){kw(t,e,n),dw[t].haveCallback=!0})),vw(t,"clickable")},setCssClass:vw,setLink:function(t,e,n){const i=jx();t.split(",").forEach((function(t){let r=t;t[0].match(/\d/)&&(r=hw+r),void 0!==dw[r]&&(dw[r].link=Dx.formatUrl(e,i),"sandbox"===i.securityLevel?dw[r].linkTarget="_top":dw[r].linkTarget="string"==typeof n?yw(n):"_blank")})),vw(t,"clickable")},getTooltip:function(t){return dw[t].tooltip},setTooltip:function(t,e){const n=jx();t.split(",").forEach((function(t){void 0!==e&&(dw[t].tooltip=ub.sanitizeText(e,n))}))},lookUpDomId:_w,setDiagramTitle:Lv,getDiagramTitle:Ov};let Ew=0;const Sw=function(t){let e=t.match(/^([#+~-])?(\w+)(~\w+~|\[])?\s+(\w+) *([$*])?$/),n=t.match(/^([#+|~-])?(\w+) *\( *(.*)\) *([$*])? *(\w*[[\]|~]*\s*\w*~?)$/);return e&&!n?Aw(e):n?Dw(n):Lw(t)},Aw=function(t){let e="",n="";try{let i=t[1]?t[1].trim():"",r=t[2]?t[2].trim():"",a=t[3]?hb(t[3].trim()):"",s=t[4]?t[4].trim():"",o=t[5]?t[5].trim():"";n=i+r+a+" "+s,e=Nw(o)}catch(e){n=t}return{displayText:n,cssStyle:e}},Dw=function(t){let e="",n="";try{let i=t[1]?t[1].trim():"",r=t[2]?t[2].trim():"",a=t[3]?hb(t[3].trim()):"",s=t[4]?t[4].trim():"";n=i+r+"("+a+")"+(t[5]?" : "+hb(t[5]).trim():""),e=Nw(s)}catch(e){n=t}return{displayText:n,cssStyle:e}},Lw=function(t){let e="",n="",i="",r=t.indexOf("("),a=t.indexOf(")");if(r>1&&a>r&&a<=t.length){let s="",o="",l=t.substring(0,1);l.match(/\w/)?o=t.substring(0,r).trim():(l.match(/[#+~-]/)&&(s=l),o=t.substring(1,r).trim());const c=t.substring(r+1,a);t.substring(a+1,1),n=Nw(t.substring(a+1,a+2)),e=s+o+"("+hb(c.trim())+")",a");const h=o.append("tspan").text(c).attr("class","title");l||h.attr("dy",n.textHeight);const u=o.node().getBBox().height,d=s.append("line").attr("x1",0).attr("y1",n.padding+u+n.dividerMargin/2).attr("y2",n.padding+u+n.dividerMargin/2),p=s.append("text").attr("x",n.padding).attr("y",u+n.dividerMargin+n.textHeight).attr("fill","white").attr("class","classText");l=!0,e.members.forEach((function(t){Ow(p,t,l,n),l=!1}));const f=p.node().getBBox(),g=s.append("line").attr("x1",0).attr("y1",n.padding+u+n.dividerMargin+f.height).attr("y2",n.padding+u+n.dividerMargin+f.height),y=s.append("text").attr("x",n.padding).attr("y",u+2*n.dividerMargin+f.height+n.textHeight).attr("fill","white").attr("class","classText");l=!0,e.methods.forEach((function(t){Ow(y,t,l,n),l=!1}));const m=s.node().getBBox();var b=" ";e.cssClasses.length>0&&(b+=e.cssClasses.join(" "));const _=s.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",m.width+2*n.padding).attr("height",m.height+n.padding+.5*n.dividerMargin).attr("class",b).node().getBBox().width;return o.node().childNodes.forEach((function(t){t.setAttribute("x",(_-t.getBBox().width)/2)})),e.tooltip&&o.insert("title").text(e.tooltip),d.attr("x2",_),g.attr("x2",_),a.width=_,a.height=m.height+n.padding+.5*n.dividerMargin,a},Bw=function(t,e,n,i,r){const a=function(t){switch(t){case r.db.relationType.AGGREGATION:return"aggregation";case r.db.relationType.EXTENSION:return"extension";case r.db.relationType.COMPOSITION:return"composition";case r.db.relationType.DEPENDENCY:return"dependency";case r.db.relationType.LOLLIPOP:return"lollipop"}};e.points=e.points.filter((t=>!Number.isNaN(t.y)));const s=e.points,o=Js().x((function(t){return t.x})).y((function(t){return t.y})).curve(ao),l=t.append("path").attr("d",o(s)).attr("id","edge"+Ew).attr("class","relation");let c,h,u="";i.arrowMarkerAbsolute&&(u=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,u=u.replace(/\(/g,"\\("),u=u.replace(/\)/g,"\\)")),1==n.relation.lineType&&l.attr("class","relation dashed-line"),10==n.relation.lineType&&l.attr("class","relation dotted-line"),"none"!==n.relation.type1&&l.attr("marker-start","url("+u+"#"+a(n.relation.type1)+"Start)"),"none"!==n.relation.type2&&l.attr("marker-end","url("+u+"#"+a(n.relation.type2)+"End)");const d=e.points.length;let p,f,g,y,m=Dx.calcLabelPosition(e.points);if(c=m.x,h=m.y,d%2!=0&&d>1){let t=Dx.calcCardinalityPosition("none"!==n.relation.type1,e.points,e.points[0]),i=Dx.calcCardinalityPosition("none"!==n.relation.type2,e.points,e.points[d-1]);tb.debug("cardinality_1_point "+JSON.stringify(t)),tb.debug("cardinality_2_point "+JSON.stringify(i)),p=t.x,f=t.y,g=i.x,y=i.y}if(void 0!==n.title){const e=t.append("g").attr("class","classLabel"),r=e.append("text").attr("class","label").attr("x",c).attr("y",h).attr("fill","red").attr("text-anchor","middle").text(n.title);window.label=r;const a=r.node().getBBox();e.insert("rect",":first-child").attr("class","box").attr("x",a.x-i.padding/2).attr("y",a.y-i.padding/2).attr("width",a.width+i.padding).attr("height",a.height+i.padding)}if(tb.info("Rendering relation "+JSON.stringify(n)),void 0!==n.relationTitle1&&"none"!==n.relationTitle1){t.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",p).attr("y",f).attr("fill","black").attr("font-size","6").text(n.relationTitle1)}if(void 0!==n.relationTitle2&&"none"!==n.relationTitle2){t.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",g).attr("y",y).attr("fill","black").attr("font-size","6").text(n.relationTitle2)}Ew++},Iw=function(t,e,n,i){tb.debug("Rendering note ",e,n);const r=e.id,a={id:r,text:e.text,width:0,height:0},s=t.append("g").attr("id",r).attr("class","classGroup");let o=s.append("text").attr("y",n.textHeight+n.padding).attr("x",0);const l=JSON.parse(`"${e.text}"`).split("\n");l.forEach((function(t){tb.debug(`Adding line: ${t}`),o.append("tspan").text(t).attr("class","title").attr("dy",n.textHeight)}));const c=s.node().getBBox(),h=s.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",c.width+2*n.padding).attr("height",c.height+l.length*n.textHeight+n.padding+.5*n.dividerMargin).node().getBBox().width;return o.node().childNodes.forEach((function(t){t.setAttribute("x",(h-t.getBBox().width)/2)})),a.width=h,a.height=c.height+l.length*n.textHeight+n.padding+.5*n.dividerMargin,a};let Fw={};const Rw=function(t){const e=Object.entries(Fw).find((e=>e[1].label===t));if(e)return e[0]},$w={draw:function(t,e,n,i){const r=jx().class;Fw={},tb.info("Rendering diagram "+t);const a=jx().securityLevel;let s;"sandbox"===a&&(s=ie("#i"+e));const o=ie("sandbox"===a?s.nodes()[0].contentDocument.body:"body"),l=o.select(`[id='${e}']`);var c;(c=l).append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),c.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),c.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),c.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),c.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),c.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),c.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),c.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z");const h=new yy({multigraph:!0});h.setGraph({isMultiGraph:!0}),h.setDefaultEdgeLabel((function(){return{}}));const u=i.db.getClasses(),d=Object.keys(u);for(const t of d){const e=u[t],n=Mw(l,e,r,i);Fw[n.id]=n,h.setNode(n.id,n),tb.info("Org height: "+n.height)}i.db.getRelations().forEach((function(t){tb.info("tjoho"+Rw(t.id1)+Rw(t.id2)+JSON.stringify(t)),h.setEdge(Rw(t.id1),Rw(t.id2),{relation:t},t.title||"DEFAULT")}));i.db.getNotes().forEach((function(t){tb.debug(`Adding note: ${JSON.stringify(t)}`);const e=Iw(l,t,r,i);Fw[e.id]=e,h.setNode(e.id,e),t.class&&t.class in u&&h.setEdge(t.id,Rw(t.class),{relation:{id1:t.id,id2:t.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")})),hm(h),h.nodes().forEach((function(t){void 0!==t&&void 0!==h.node(t)&&(tb.debug("Node "+t+": "+JSON.stringify(h.node(t))),o.select("#"+(i.db.lookUpDomId(t)||t)).attr("transform","translate("+(h.node(t).x-h.node(t).width/2)+","+(h.node(t).y-h.node(t).height/2)+" )"))})),h.edges().forEach((function(t){void 0!==t&&void 0!==h.edge(t)&&(tb.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(h.edge(t))),Bw(l,h.edge(t),h.edge(t).relation,r,i))}));const p=l.node().getBBox(),f=p.width+40,g=p.height+40;Gx(l,g,f,r.useMaxWidth);const y=`${p.x-20} ${p.y-20} ${f} ${g}`;tb.debug(`viewBox ${y}`),l.attr("viewBox",y)}},Pw={extension:(t,e,n)=>{tb.trace("Making markers for ",n),t.append("defs").append("marker").attr("id",e+"-extensionStart").attr("class","marker extension "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},composition:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-compositionStart").attr("class","marker composition "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},aggregation:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},dependency:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},lollipop:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","white").attr("cx",6).attr("cy",7).attr("r",6)},point:(t,e)=>{t.append("marker").attr("id",e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},circle:(t,e)=>{t.append("marker").attr("id",e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},cross:(t,e)=>{t.append("marker").attr("id",e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},barb:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}},Yw=(t,e,n,i)=>{e.forEach((e=>{Pw[e](t,n,i)}))};const jw=(t,e,n,i)=>{let r=t||"";if("object"==typeof r&&(r=r[0]),cb(jx().flowchart.htmlLabels)){r=r.replace(/\\n|\n/g,"
"),tb.info("vertexText"+r);let t=function(t){const e=ie(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=e.append("xhtml:div"),i=t.label,r=t.isNode?"nodeLabel":"edgeLabel";var a,s;return n.html('"+i+""),a=n,(s=t.labelStyle)&&a.attr("style",s),n.style("display","inline-block"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}({isNode:i,label:HD(r).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>``)),labelStyle:e.replace("fill:","color:")});return t}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let i=[];i="string"==typeof r?r.split(/\\n|\n|
/gi):Array.isArray(r)?r:[];for(const e of i){const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),n?i.setAttribute("class","title-row"):i.setAttribute("class","row"),i.textContent=e.trim(),t.appendChild(i)}return t}},zw=(t,e,n,i)=>{let r;r=n||"node default";const a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",e.labelStyle);let o;o=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];const l=s.node().appendChild(jw(ab(HD(o),jx()),e.labelStyle,!1,i));let c=l.getBBox();if(cb(jx().flowchart.htmlLabels)){const t=l.children[0],e=ie(l);c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}const h=e.padding/2;return s.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),{shapeSvg:a,bbox:c,halfPadding:h,label:s}},Uw=(t,e)=>{const n=e.node().getBBox();t.width=n.width,t.height=n.height};function Ww(t,e,n,i){return t.insert("polygon",":first-child").attr("points",i.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+n/2+")")}let Hw={},qw={},Vw={};const Gw=(t,e)=>(tb.trace("In isDecendant",e," ",t," = ",qw[e].includes(t)),!!qw[e].includes(t)),Xw=(t,e,n,i)=>{tb.warn("Copying children of ",t,"root",i,"data",e.node(t),i);const r=e.children(t)||[];t!==i&&r.push(t),tb.warn("Copying (nodes) clusterId",t,"nodes",r),r.forEach((r=>{if(e.children(r).length>0)Xw(r,e,n,i);else{const a=e.node(r);tb.info("cp ",r," to ",i," with parent ",t),n.setNode(r,a),i!==e.parent(r)&&(tb.warn("Setting parent",r,e.parent(r)),n.setParent(r,e.parent(r))),t!==i&&r!==t?(tb.debug("Setting parent",r,t),n.setParent(r,t)):(tb.info("In copy ",t,"root",i,"data",e.node(t),i),tb.debug("Not Setting parent for node=",r,"cluster!==rootId",t!==i,"node!==clusterId",r!==t));const s=e.edges(r);tb.debug("Copying Edges",s),s.forEach((r=>{tb.info("Edge",r);const a=e.edge(r.v,r.w,r.name);tb.info("Edge data",a,i);try{((t,e)=>(tb.info("Decendants of ",e," is ",qw[e]),tb.info("Edge is ",t),t.v!==e&&t.w!==e&&(qw[e]?qw[e].includes(t.v)||Gw(t.v,e)||Gw(t.w,e)||qw[e].includes(t.w):(tb.debug("Tilt, ",e,",not in decendants"),!1))))(r,i)?(tb.info("Copying as ",r.v,r.w,a,r.name),n.setEdge(r.v,r.w,a,r.name),tb.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):tb.info("Skipping copy of edge ",r.v,"--\x3e",r.w," rootId: ",i," clusterId:",t)}catch(t){tb.error(t)}}))}tb.debug("Removing node",r),e.removeNode(r)}))},Zw=(t,e)=>{const n=e.children(t);let i=[...n];for(const r of n)Vw[r]=t,i=[...i,...Zw(r,e)];return i},Qw=(t,e)=>{tb.trace("Searching",t);const n=e.children(t);if(tb.trace("Searching children of id ",t,n),n.length<1)return tb.trace("This is a valid node",t),t;for(const i of n){const n=Qw(i,e);if(n)return tb.trace("Found replacement for",t," => ",n),n}},Kw=t=>Hw[t]&&Hw[t].externalConnections&&Hw[t]?Hw[t].id:t,Jw=(t,e)=>{if(tb.warn("extractor - ",e,Ym(t),t.children("D")),e>10)return void tb.error("Bailing out");let n=t.nodes(),i=!1;for(const e of n){const n=t.children(e);i=i||n.length>0}if(i){tb.debug("Nodes = ",n,e);for(const i of n)if(tb.debug("Extracting node",i,Hw,Hw[i]&&!Hw[i].externalConnections,!t.parent(i),t.node(i),t.children("D")," Depth ",e),Hw[i])if(!Hw[i].externalConnections&&t.children(i)&&t.children(i).length>0){tb.warn("Cluster without external connections, without a parent and with children",i,e);let n="TB"===t.graph().rankdir?"LR":"TB";Hw[i]&&Hw[i].clusterData&&Hw[i].clusterData.dir&&(n=Hw[i].clusterData.dir,tb.warn("Fixing dir",Hw[i].clusterData.dir,n));const r=new yy({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));tb.warn("Old graph before copy",Ym(t)),Xw(i,t,r,i),t.setNode(i,{clusterNode:!0,id:i,clusterData:Hw[i].clusterData,labelText:Hw[i].labelText,graph:r}),tb.warn("New graph after copy node: (",i,")",Ym(r)),tb.debug("Old graph after copy",Ym(t))}else tb.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!Hw[i].externalConnections," no parent: ",!t.parent(i)," children ",t.children(i)&&t.children(i).length>0,t.children("D"),e),tb.debug(Hw);else tb.debug("Not a cluster",i,e);n=t.nodes(),tb.warn("New list of nodes",n);for(const i of n){const n=t.node(i);tb.warn(" Now next level",i,n),n.clusterNode&&Jw(n.graph,e+1)}}else tb.debug("Done, no node has children",t.nodes())},tT=(t,e)=>{if(0===e.length)return[];let n=Object.assign(e);return e.forEach((e=>{const i=t.children(e),r=tT(t,i);n=[...n,...r]})),n};function eT(t,e,n,i){var r=t.x,a=t.y,s=r-i.x,o=a-i.y,l=Math.sqrt(e*e*o*o+n*n*s*s),c=Math.abs(e*n*s/l);i.x0}const rT=(t,e)=>{var n,i,r=t.x,a=t.y,s=e.x-r,o=e.y-a,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),n=0===o?0:c*s/o,i=c):(s<0&&(l=-l),n=l,i=0===s?0:l*o/s),{x:r+n,y:a+i}},aT={node:function(t,e){return t.intersect(e)},circle:function(t,e,n){return eT(t,e,e,n)},ellipse:eT,polygon:function(t,e,n){var i=t.x,r=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)})):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=i-t.width/2-s,c=r-t.height/2-o,h=0;h1&&a.sort((function(t,e){var i=t.x-n.x,r=t.y-n.y,a=Math.sqrt(i*i+r*r),s=e.x-n.x,o=e.y-n.y,l=Math.sqrt(s*s+o*o);return a{const{shapeSvg:n,bbox:i,halfPadding:r}=zw(t,e,"node "+e.classes,!0);tb.info("Classes = ",e.classes);const a=n.insert("rect",":first-child");return a.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-r).attr("y",-i.height/2-r).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Uw(e,a),e.intersect=function(t){return aT.rect(e,t)},n};function oT(t,e,n,i){const r=[],a=t=>{r.push(t,0)},s=t=>{r.push(0,t)};e.includes("t")?(tb.debug("add top border"),a(n)):s(n),e.includes("r")?(tb.debug("add right border"),a(i)):s(i),e.includes("b")?(tb.debug("add bottom border"),a(n)):s(n),e.includes("l")?(tb.debug("add left border"),a(i)):s(i),t.attr("stroke-dasharray",r.join(" "))}const lT=(t,e,n)=>{const i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let r=70,a=10;"LR"===n&&(r=10,a=70);const s=i.append("rect").attr("x",-1*r/2).attr("y",-1*a/2).attr("width",r).attr("height",a).attr("class","fork-join");return Uw(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return aT.rect(e,t)},i},cT={question:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding+(i.height+e.padding),a=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];tb.info("Question main (Circle)");const s=Ww(n,r,r,a);return s.attr("style",e.style),Uw(e,s),e.intersect=function(t){return tb.warn("Intersect called"),aT.polygon(e,a,t)},n},rect:(t,e)=>{const{shapeSvg:n,bbox:i,halfPadding:r}=zw(t,e,"node "+e.classes,!0);tb.trace("Classes = ",e.classes);const a=n.insert("rect",":first-child"),s=i.width+e.padding,o=i.height+e.padding;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-r).attr("y",-i.height/2-r).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(oT(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{tb.warn(`Unknown node property ${t}`)}))}return Uw(e,a),e.intersect=function(t){return aT.rect(e,t)},n},labelRect:(t,e)=>{const{shapeSvg:n}=zw(t,e,"label",!0);tb.trace("Classes = ",e.classes);const i=n.insert("rect",":first-child");if(i.attr("width",0).attr("height",0),n.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(oT(i,e.props.borders,0,0),t.delete("borders")),t.forEach((t=>{tb.warn(`Unknown node property ${t}`)}))}return Uw(e,i),e.intersect=function(t){return aT.rect(e,t)},n},rectWithTitle:(t,e)=>{let n;n=e.classes?"node "+e.classes:"node default";const i=t.insert("g").attr("class",n).attr("id",e.domId||e.id),r=i.insert("rect",":first-child"),a=i.insert("line"),s=i.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,tb.info("Label text abc79",l,o,"object"==typeof o);const c=s.node().appendChild(jw(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(cb(jx().flowchart.htmlLabels)){const t=c.children[0],e=ie(c);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}tb.info("Text 2",o);const u=o.slice(1,o.length);let d=c.getBBox();const p=s.node().appendChild(jw(u.join?u.join("
"):u,e.labelStyle,!0,!0));if(cb(jx().flowchart.htmlLabels)){const t=p.children[0],e=ie(p);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}const f=e.padding/2;return ie(p).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+f+5)+")"),ie(c).attr("transform","translate( "+(h.width{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return n.insert("polygon",":first-child").attr("points",i.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return aT.circle(e,14,t)},n},circle:(t,e)=>{const{shapeSvg:n,bbox:i,halfPadding:r}=zw(t,e,void 0,!0),a=n.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+r).attr("width",i.width+e.padding).attr("height",i.height+e.padding),tb.info("Circle main"),Uw(e,a),e.intersect=function(t){return tb.info("Circle intersect",e,i.width/2+r,t),aT.circle(e,i.width/2+r,t)},n},doublecircle:(t,e)=>{const{shapeSvg:n,bbox:i,halfPadding:r}=zw(t,e,void 0,!0),a=n.insert("g",":first-child"),s=a.insert("circle"),o=a.insert("circle");return s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+r+5).attr("width",i.width+e.padding+10).attr("height",i.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+r).attr("width",i.width+e.padding).attr("height",i.height+e.padding),tb.info("DoubleCircle main"),Uw(e,s),e.intersect=function(t){return tb.info("DoubleCircle intersect",e,i.width/2+r+5,t),aT.circle(e,i.width/2+r+5,t)},n},stadium:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.height+e.padding,a=i.width+r/4+e.padding,s=n.insert("rect",":first-child").attr("style",e.style).attr("rx",r/2).attr("ry",r/2).attr("x",-a/2).attr("y",-r/2).attr("width",a).attr("height",r);return Uw(e,s),e.intersect=function(t){return aT.rect(e,t)},n},hexagon:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.height+e.padding,a=r/4,s=i.width+2*a+e.padding,o=[{x:a,y:0},{x:s-a,y:0},{x:s,y:-r/2},{x:s-a,y:-r},{x:a,y:-r},{x:0,y:-r/2}],l=Ww(n,s,r,o);return l.attr("style",e.style),Uw(e,l),e.intersect=function(t){return aT.polygon(e,o,t)},n},rect_left_inv_arrow:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding,a=i.height+e.padding,s=[{x:-a/2,y:0},{x:r,y:0},{x:r,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return Ww(n,r,a,s).attr("style",e.style),e.width=r+a,e.height=a,e.intersect=function(t){return aT.polygon(e,s,t)},n},lean_right:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding,a=i.height+e.padding,s=[{x:-2*a/6,y:0},{x:r-a/6,y:0},{x:r+2*a/6,y:-a},{x:a/6,y:-a}],o=Ww(n,r,a,s);return o.attr("style",e.style),Uw(e,o),e.intersect=function(t){return aT.polygon(e,s,t)},n},lean_left:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding,a=i.height+e.padding,s=[{x:2*a/6,y:0},{x:r+a/6,y:0},{x:r-2*a/6,y:-a},{x:-a/6,y:-a}],o=Ww(n,r,a,s);return o.attr("style",e.style),Uw(e,o),e.intersect=function(t){return aT.polygon(e,s,t)},n},trapezoid:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding,a=i.height+e.padding,s=[{x:-2*a/6,y:0},{x:r+2*a/6,y:0},{x:r-a/6,y:-a},{x:a/6,y:-a}],o=Ww(n,r,a,s);return o.attr("style",e.style),Uw(e,o),e.intersect=function(t){return aT.polygon(e,s,t)},n},inv_trapezoid:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding,a=i.height+e.padding,s=[{x:a/6,y:0},{x:r-a/6,y:0},{x:r+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=Ww(n,r,a,s);return o.attr("style",e.style),Uw(e,o),e.intersect=function(t){return aT.polygon(e,s,t)},n},rect_right_inv_arrow:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding,a=i.height+e.padding,s=[{x:0,y:0},{x:r+a/2,y:0},{x:r,y:-a/2},{x:r+a/2,y:-a},{x:0,y:-a}],o=Ww(n,r,a,s);return o.attr("style",e.style),Uw(e,o),e.intersect=function(t){return aT.polygon(e,s,t)},n},cylinder:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding,a=r/2,s=a/(2.5+r/50),o=i.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+r+" 0 a "+a+","+s+" 0,0,0 "+-r+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+r+" 0 l 0,"+-o,c=n.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-r/2+","+-(o/2+s)+")");return Uw(e,c),e.intersect=function(t){const n=aT.rect(e,t),i=n.x-e.x;if(0!=a&&(Math.abs(i)e.height/2-s)){let r=s*s*(1-i*i/(a*a));0!=r&&(r=Math.sqrt(r)),r=s-r,t.y-e.y>0&&(r=-r),n.y+=r}return n},n},start:(t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=n.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Uw(e,i),e.intersect=function(t){return aT.circle(e,7,t)},n},end:(t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=n.insert("circle",":first-child"),r=n.insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Uw(e,r),e.intersect=function(t){return aT.circle(e,7,t)},n},note:sT,subroutine:(t,e)=>{const{shapeSvg:n,bbox:i}=zw(t,e,void 0,!0),r=i.width+e.padding,a=i.height+e.padding,s=[{x:0,y:0},{x:r,y:0},{x:r,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:r+8,y:0},{x:r+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=Ww(n,r,a,s);return o.attr("style",e.style),Uw(e,o),e.intersect=function(t){return aT.polygon(e,s,t)},n},fork:lT,join:lT,class_box:(t,e)=>{const n=e.padding/2;let i;i=e.classes?"node "+e.classes:"node default";const r=t.insert("g").attr("class",i).attr("id",e.domId||e.id),a=r.insert("rect",":first-child"),s=r.insert("line"),o=r.insert("line");let l=0,c=4;const h=r.insert("g").attr("class","label");let u=0;const d=e.classData.annotations&&e.classData.annotations[0],p=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",f=h.node().appendChild(jw(p,e.labelStyle,!0,!0));let g=f.getBBox();if(cb(jx().flowchart.htmlLabels)){const t=f.children[0],e=ie(f);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}e.classData.annotations[0]&&(c+=g.height+4,l+=g.width);let y=e.classData.id;void 0!==e.classData.type&&""!==e.classData.type&&(jx().flowchart.htmlLabels?y+="<"+e.classData.type+">":y+="<"+e.classData.type+">");const m=h.node().appendChild(jw(y,e.labelStyle,!0,!0));ie(m).attr("class","classTitle");let b=m.getBBox();if(cb(jx().flowchart.htmlLabels)){const t=m.children[0],e=ie(m);b=t.getBoundingClientRect(),e.attr("width",b.width),e.attr("height",b.height)}c+=b.height+4,b.width>l&&(l=b.width);const _=[];e.classData.members.forEach((t=>{const n=Sw(t);let i=n.displayText;jx().flowchart.htmlLabels&&(i=i.replace(//g,">"));const r=h.node().appendChild(jw(i,n.cssStyle?n.cssStyle:e.labelStyle,!0,!0));let a=r.getBBox();if(cb(jx().flowchart.htmlLabels)){const t=r.children[0],e=ie(r);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,_.push(r)})),c+=8;const x=[];if(e.classData.methods.forEach((t=>{const n=Sw(t);let i=n.displayText;jx().flowchart.htmlLabels&&(i=i.replace(//g,">"));const r=h.node().appendChild(jw(i,n.cssStyle?n.cssStyle:e.labelStyle,!0,!0));let a=r.getBBox();if(cb(jx().flowchart.htmlLabels)){const t=r.children[0],e=ie(r);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,x.push(r)})),c+=8,d){let t=(l-g.width)/2;ie(f).attr("transform","translate( "+(-1*l/2+t)+", "+-1*c/2+")"),u=g.height+4}let v=(l-b.width)/2;return ie(m).attr("transform","translate( "+(-1*l/2+v)+", "+(-1*c/2+u)+")"),u+=b.height+4,s.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+u).attr("y2",-c/2-n+8+u),u+=8,_.forEach((t=>{ie(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u+4)+")"),u+=b.height+4})),u+=8,o.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+u).attr("y2",-c/2-n+8+u),u+=8,x.forEach((t=>{ie(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u)+")"),u+=b.height+4})),a.attr("class","outer title-state").attr("x",-l/2-n).attr("y",-c/2-n).attr("width",l+e.padding).attr("height",c+e.padding),Uw(e,a),e.intersect=function(t){return aT.rect(e,t)},r}};let hT={};const uT=t=>{const e=hT[t.id];tb.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},dT={rect:(t,e)=>{tb.trace("Creating subgraph rect for ",e.id,e);const n=t.insert("g").attr("class","cluster"+(e.class?" "+e.class:"")).attr("id",e.id),i=n.insert("rect",":first-child"),r=n.insert("g").attr("class","cluster-label"),a=r.node().appendChild(jw(e.labelText,e.labelStyle,void 0,!0));let s=a.getBBox();if(cb(jx().flowchart.htmlLabels)){const t=a.children[0],e=ie(a);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}const o=0*e.padding,l=o/2,c=e.width<=s.width+o?s.width+o:e.width;e.width<=s.width+o?e.diff=(s.width-e.width)/2-e.padding/2:e.diff=-e.padding/2,tb.trace("Data ",e,JSON.stringify(e)),i.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-c/2).attr("y",e.y-e.height/2-l).attr("width",c).attr("height",e.height+o),r.attr("transform","translate("+(e.x-s.width/2)+", "+(e.y-e.height/2)+")");const h=i.node().getBBox();return e.width=h.width,e.height=h.height,e.intersect=function(t){return rT(e,t)},n},roundedWithTitle:(t,e)=>{const n=t.insert("g").attr("class",e.classes).attr("id",e.id),i=n.insert("rect",":first-child"),r=n.insert("g").attr("class","cluster-label"),a=n.append("rect"),s=r.node().appendChild(jw(e.labelText,e.labelStyle,void 0,!0));let o=s.getBBox();if(cb(jx().flowchart.htmlLabels)){const t=s.children[0],e=ie(s);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}o=s.getBBox();const l=0*e.padding,c=l/2,h=e.width<=o.width+e.padding?o.width+e.padding:e.width;e.width<=o.width+e.padding?e.diff=(o.width+0*e.padding-e.width)/2:e.diff=-e.padding/2,i.attr("class","outer").attr("x",e.x-h/2-c).attr("y",e.y-e.height/2-c).attr("width",h+l).attr("height",e.height+l),a.attr("class","inner").attr("x",e.x-h/2-c).attr("y",e.y-e.height/2-c+o.height-1).attr("width",h+l).attr("height",e.height+l-o.height-3),r.attr("transform","translate("+(e.x-o.width/2)+", "+(e.y-e.height/2-e.padding/3+(cb(jx().flowchart.htmlLabels)?5:3))+")");const u=i.node().getBBox();return e.height=u.height,e.intersect=function(t){return rT(e,t)},n},noteGroup:(t,e)=>{const n=t.insert("g").attr("class","note-cluster").attr("id",e.id),i=n.insert("rect",":first-child"),r=0*e.padding,a=r/2;i.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+r).attr("height",e.height+r).attr("fill","none");const s=i.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(t){return rT(e,t)},n},divider:(t,e)=>{const n=t.insert("g").attr("class",e.classes).attr("id",e.id),i=n.insert("rect",":first-child"),r=0*e.padding,a=r/2;i.attr("class","divider").attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2).attr("width",e.width+r).attr("height",e.height+r);const s=i.node().getBBox();return e.width=s.width,e.height=s.height,e.diff=-e.padding/2,e.intersect=function(t){return rT(e,t)},n}};let pT={};let fT={},gT={};function yT(t,e){jx().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}const mT=(t,e)=>{tb.warn("abc88 cutPathAtIntersect",t,e);let n=[],i=t[0],r=!1;return t.forEach((t=>{if(tb.info("abc88 checking point",t,e),((t,e)=>{const n=t.x,i=t.y,r=Math.abs(e.x-n),a=Math.abs(e.y-i),s=t.width/2,o=t.height/2;return r>=s||a>=o})(e,t)||r)tb.warn("abc88 outside",t,i),i=t,r||n.push(t);else{const a=((t,e,n)=>{tb.warn(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const i=t.x,r=t.y,a=Math.abs(i-n.x),s=t.width/2;let o=n.xMath.abs(i-e.x)*l){let t=n.y{s=s||t.x===a.x&&t.y===a.y})),n.some((t=>t.x===a.x&&t.y===a.y))?tb.warn("abc88 no intersect",a,n):n.push(a),r=!0}})),tb.warn("abc88 returning points",n),n},bT=(t,e,n,i)=>{tb.info("Graph in recursive render: XXX",Ym(e),i);const r=e.graph().rankdir;tb.trace("Dir in recursive render - dir:",r);const a=t.insert("g").attr("class","root");e.nodes()?tb.info("Recursive render XXX",e.nodes()):tb.info("No nodes found for",e),e.edges().length>0&&tb.trace("Recursive edges",e.edge(e.edges()[0]));const s=a.insert("g").attr("class","clusters"),o=a.insert("g").attr("class","edgePaths"),l=a.insert("g").attr("class","edgeLabels"),c=a.insert("g").attr("class","nodes");e.nodes().forEach((function(t){const a=e.node(t);if(void 0!==i){const n=JSON.parse(JSON.stringify(i.clusterData));tb.info("Setting data for cluster XXX (",t,") ",n,i),e.setNode(i.id,n),e.parent(t)||(tb.trace("Setting parent",t,i.id),e.setParent(t,i.id,n))}if(tb.info("(Insert) Node XXX"+t+": "+JSON.stringify(e.node(t))),a&&a.clusterNode){tb.info("Cluster identified",t,a.width,e.node(t));const i=bT(c,a.graph,n,e.node(t)),r=i.elem;Uw(a,r),a.diff=i.diff||0,tb.info("Node bounds (abc123)",t,a,a.width,a.x,a.y),((t,e)=>{hT[e.id]=t})(r,a),tb.warn("Recursive render complete ",r,a)}else e.children(t).length>0?(tb.info("Cluster - the non recursive path XXX",t,a.id,a,e),tb.info(Qw(a.id,e)),Hw[a.id]={id:Qw(a.id,e),node:a}):(tb.info("Node - the non recursive path",t,a.id,a),((t,e,n)=>{let i,r;if(e.link){let a;"sandbox"===jx().securityLevel?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),i=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),r=cT[e.shape](i,e,n)}else r=cT[e.shape](t,e,n),i=r;e.tooltip&&r.attr("title",e.tooltip),e.class&&r.attr("class","node default "+e.class),hT[e.id]=i,e.haveCallback&&hT[e.id].attr("class",hT[e.id].attr("class")+" clickable")})(c,e.node(t),r))})),e.edges().forEach((function(t){const n=e.edge(t.v,t.w,t.name);tb.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),tb.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(e.edge(t))),tb.info("Fix",Hw,"ids:",t.v,t.w,"Translateing: ",Hw[t.v],Hw[t.w]),((t,e)=>{const n=jw(e.label,e.labelStyle),i=t.insert("g").attr("class","edgeLabel"),r=i.insert("g").attr("class","label");r.node().appendChild(n);let a,s=n.getBBox();if(cb(jx().flowchart.htmlLabels)){const t=n.children[0],e=ie(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}if(r.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),fT[e.id]=i,e.width=s.width,e.height=s.height,e.startLabelLeft){const n=jw(e.startLabelLeft,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),r=i.insert("g").attr("class","inner");a=r.node().appendChild(n);const s=n.getBBox();r.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),gT[e.id]||(gT[e.id]={}),gT[e.id].startLeft=i,yT(a,e.startLabelLeft)}if(e.startLabelRight){const n=jw(e.startLabelRight,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),r=i.insert("g").attr("class","inner");a=i.node().appendChild(n),r.node().appendChild(n);const s=n.getBBox();r.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),gT[e.id]||(gT[e.id]={}),gT[e.id].startRight=i,yT(a,e.startLabelRight)}if(e.endLabelLeft){const n=jw(e.endLabelLeft,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),r=i.insert("g").attr("class","inner");a=r.node().appendChild(n);const s=n.getBBox();r.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.node().appendChild(n),gT[e.id]||(gT[e.id]={}),gT[e.id].endLeft=i,yT(a,e.endLabelLeft)}if(e.endLabelRight){const n=jw(e.endLabelRight,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),r=i.insert("g").attr("class","inner");a=r.node().appendChild(n);const s=n.getBBox();r.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.node().appendChild(n),gT[e.id]||(gT[e.id]={}),gT[e.id].endRight=i,yT(a,e.endLabelRight)}})(l,n)})),e.edges().forEach((function(t){tb.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t))})),tb.info("#############################################"),tb.info("### Layout ###"),tb.info("#############################################"),tb.info(e),hm(e),tb.info("Graph after layout:",Ym(e));let h=0;return(t=>tT(t,t.children()))(e).forEach((function(t){const n=e.node(t);tb.info("Position "+t+": "+JSON.stringify(e.node(t))),tb.info("Position "+t+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n&&n.clusterNode?uT(n):e.children(t).length>0?(((t,e)=>{tb.trace("Inserting cluster");const n=e.shape||"rect";pT[e.id]=dT[n](t,e)})(s,n),Hw[n.id].node=n):uT(n)})),e.edges().forEach((function(t){const i=e.edge(t);tb.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(i),i);const r=function(t,e,n,i,r,a){let s=n.points,o=!1;const l=a.node(e.v);var c=a.node(e.w);tb.info("abc88 InsertEdge: ",n),c.intersect&&l.intersect&&(s=s.slice(1,n.points.length-1),s.unshift(l.intersect(s[0])),tb.info("Last point",s[s.length-1],c,c.intersect(s[s.length-1])),s.push(c.intersect(s[s.length-1]))),n.toCluster&&(tb.info("to cluster abc88",i[n.toCluster]),s=mT(n.points,i[n.toCluster].node),o=!0),n.fromCluster&&(tb.info("from cluster abc88",i[n.fromCluster]),s=mT(s.reverse(),i[n.fromCluster].node).reverse(),o=!0);const h=s.filter((t=>!Number.isNaN(t.y)));let u;u=("graph"===r||"flowchart"===r)&&n.curve||ao;const d=Js().x((function(t){return t.x})).y((function(t){return t.y})).curve(u);let p;switch(n.thickness){case"normal":p="edge-thickness-normal";break;case"thick":p="edge-thickness-thick";break;default:p=""}switch(n.pattern){case"solid":p+=" edge-pattern-solid";break;case"dotted":p+=" edge-pattern-dotted";break;case"dashed":p+=" edge-pattern-dashed"}const f=t.append("path").attr("d",d(h)).attr("id",n.id).attr("class"," "+p+(n.classes?" "+n.classes:"")).attr("style",n.style);let g="";switch((jx().flowchart.arrowMarkerAbsolute||jx().state.arrowMarkerAbsolute)&&(g=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,g=g.replace(/\(/g,"\\("),g=g.replace(/\)/g,"\\)")),tb.info("arrowTypeStart",n.arrowTypeStart),tb.info("arrowTypeEnd",n.arrowTypeEnd),n.arrowTypeStart){case"arrow_cross":f.attr("marker-start","url("+g+"#"+r+"-crossStart)");break;case"arrow_point":f.attr("marker-start","url("+g+"#"+r+"-pointStart)");break;case"arrow_barb":f.attr("marker-start","url("+g+"#"+r+"-barbStart)");break;case"arrow_circle":f.attr("marker-start","url("+g+"#"+r+"-circleStart)");break;case"aggregation":f.attr("marker-start","url("+g+"#"+r+"-aggregationStart)");break;case"extension":f.attr("marker-start","url("+g+"#"+r+"-extensionStart)");break;case"composition":f.attr("marker-start","url("+g+"#"+r+"-compositionStart)");break;case"dependency":f.attr("marker-start","url("+g+"#"+r+"-dependencyStart)");break;case"lollipop":f.attr("marker-start","url("+g+"#"+r+"-lollipopStart)")}switch(n.arrowTypeEnd){case"arrow_cross":f.attr("marker-end","url("+g+"#"+r+"-crossEnd)");break;case"arrow_point":f.attr("marker-end","url("+g+"#"+r+"-pointEnd)");break;case"arrow_barb":f.attr("marker-end","url("+g+"#"+r+"-barbEnd)");break;case"arrow_circle":f.attr("marker-end","url("+g+"#"+r+"-circleEnd)");break;case"aggregation":f.attr("marker-end","url("+g+"#"+r+"-aggregationEnd)");break;case"extension":f.attr("marker-end","url("+g+"#"+r+"-extensionEnd)");break;case"composition":f.attr("marker-end","url("+g+"#"+r+"-compositionEnd)");break;case"dependency":f.attr("marker-end","url("+g+"#"+r+"-dependencyEnd)");break;case"lollipop":f.attr("marker-end","url("+g+"#"+r+"-lollipopEnd)")}let y={};return o&&(y.updatedPath=s),y.originalPath=n.points,y}(o,t,i,Hw,n,e);((t,e)=>{tb.info("Moving label abc78 ",t.id,t.label,fT[t.id]);let n=e.updatedPath?e.updatedPath:e.originalPath;if(t.label){const i=fT[t.id];let r=t.x,a=t.y;if(n){const i=Dx.calcLabelPosition(n);tb.info("Moving label "+t.label+" from (",r,",",a,") to (",i.x,",",i.y,") abc78"),e.updatedPath&&(r=i.x,a=i.y)}i.attr("transform","translate("+r+", "+a+")")}if(t.startLabelLeft){const e=gT[t.id].startLeft;let i=t.x,r=t.y;if(n){const e=Dx.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=e.x,r=e.y}e.attr("transform","translate("+i+", "+r+")")}if(t.startLabelRight){const e=gT[t.id].startRight;let i=t.x,r=t.y;if(n){const e=Dx.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=e.x,r=e.y}e.attr("transform","translate("+i+", "+r+")")}if(t.endLabelLeft){const e=gT[t.id].endLeft;let i=t.x,r=t.y;if(n){const e=Dx.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=e.x,r=e.y}e.attr("transform","translate("+i+", "+r+")")}if(t.endLabelRight){const e=gT[t.id].endRight;let i=t.x,r=t.y;if(n){const e=Dx.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=e.x,r=e.y}e.attr("transform","translate("+i+", "+r+")")}})(i,r)})),e.nodes().forEach((function(t){const n=e.node(t);tb.info(t,n.type,n.diff),"group"===n.type&&(h=n.diff)})),{elem:a,diff:h}},_T=(t,e,n,i,r)=>{Yw(t,n,i,r),hT={},fT={},gT={},pT={},qw={},Vw={},Hw={},tb.warn("Graph at first:",Ym(e)),((t,e)=>{!t||e>10?tb.debug("Opting out, no graph "):(tb.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(tb.warn("Cluster identified",e," Replacement id in edges: ",Qw(e,t)),qw[e]=Zw(e,t),Hw[e]={id:Qw(e,t),clusterData:t.node(e)})})),t.nodes().forEach((function(e){const n=t.children(e),i=t.edges();n.length>0?(tb.debug("Cluster identified",e,qw),i.forEach((t=>{t.v!==e&&t.w!==e&&Gw(t.v,e)^Gw(t.w,e)&&(tb.warn("Edge: ",t," leaves cluster ",e),tb.warn("Decendants of XXX ",e,": ",qw[e]),Hw[e].externalConnections=!0)}))):tb.debug("Not a cluster ",e,qw)})),t.edges().forEach((function(e){const n=t.edge(e);tb.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),tb.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));let i=e.v,r=e.w;if(tb.warn("Fix XXX",Hw,"ids:",e.v,e.w,"Translating: ",Hw[e.v]," --- ",Hw[e.w]),Hw[e.v]&&Hw[e.w]&&Hw[e.v]===Hw[e.w]){tb.warn("Fixing and trixing link to self - removing XXX",e.v,e.w,e.name),tb.warn("Fixing and trixing - removing XXX",e.v,e.w,e.name),i=Kw(e.v),r=Kw(e.w),t.removeEdge(e.v,e.w,e.name);const a=e.w+"---"+e.v;t.setNode(a,{domId:a,id:a,labelStyle:"",labelText:n.label,padding:0,shape:"labelRect",style:""});const s=JSON.parse(JSON.stringify(n)),o=JSON.parse(JSON.stringify(n));s.label="",s.arrowTypeEnd="none",o.label="",s.fromCluster=e.v,o.toCluster=e.v,t.setEdge(i,a,s,e.name+"-cyclic-special"),t.setEdge(a,r,o,e.name+"-cyclic-special")}else(Hw[e.v]||Hw[e.w])&&(tb.warn("Fixing and trixing - removing XXX",e.v,e.w,e.name),i=Kw(e.v),r=Kw(e.w),t.removeEdge(e.v,e.w,e.name),i!==e.v&&(n.fromCluster=e.v),r!==e.w&&(n.toCluster=e.w),tb.warn("Fix Replacing with XXX",i,r,e.name),t.setEdge(i,r,n,e.name))})),tb.warn("Adjusted Graph",Ym(t)),Jw(t,0),tb.trace(Hw))})(e),tb.warn("Graph after:",Ym(e)),bT(t,e,i)},xT=t=>ub.sanitizeText(t,jx());let vT={dividerMargin:10,padding:5,textHeight:10};function kT(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}const wT={setConf:function(t){Object.keys(t).forEach((function(e){vT[e]=t[e]}))},draw:function(t,e,n,i){tb.info("Drawing class - ",e);const r=jx().flowchart,a=jx().securityLevel;tb.info("config:",r);const s=r.nodeSpacing||50,o=r.rankSpacing||50,l=new yy({multigraph:!0,compound:!0}).setGraph({rankdir:i.db.getDirection(),nodesep:s,ranksep:o,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),c=i.db.getClasses(),h=i.db.getRelations(),u=i.db.getNotes();let d;tb.info(h),function(t,e,n,i){const r=Object.keys(t);tb.info("keys:",r),tb.info(t),r.forEach((function(n){const r=t[n];let a="";r.cssClasses.length>0&&(a=a+" "+r.cssClasses.join(" "));const s={labelStyle:""};let o=void 0!==r.text?r.text:r.id,l="";r.type,l="class_box",e.setNode(r.id,{labelStyle:s.labelStyle,shape:l,labelText:xT(o),classData:r,rx:0,ry:0,class:a,style:s.style,id:r.id,domId:r.domId,tooltip:i.db.getTooltip(r.id)||"",haveCallback:r.haveCallback,link:r.link,width:"group"===r.type?500:void 0,type:r.type,padding:jx().flowchart.padding}),tb.info("setNode",{labelStyle:s.labelStyle,shape:l,labelText:o,rx:0,ry:0,class:a,style:s.style,id:r.id,width:"group"===r.type?500:void 0,type:r.type,padding:jx().flowchart.padding})}))}(c,l,0,i),function(t,e){const n=jx().flowchart;let i=0;t.forEach((function(r){i++;const a={classes:"relation"};a.pattern=1==r.relation.lineType?"dashed":"solid",a.id="id"+i,"arrow_open"===r.type?a.arrowhead="none":a.arrowhead="normal",tb.info(a,r),a.startLabelRight="none"===r.relationTitle1?"":r.relationTitle1,a.endLabelLeft="none"===r.relationTitle2?"":r.relationTitle2,a.arrowTypeStart=kT(r.relation.type1),a.arrowTypeEnd=kT(r.relation.type2);let s="",o="";if(void 0!==r.style){const t=gx(r.style);s=t.style,o=t.labelStyle}else s="fill:none";a.style=s,a.labelStyle=o,void 0!==r.interpolate?a.curve=px(r.interpolate,Zs):void 0!==t.defaultInterpolate?a.curve=px(t.defaultInterpolate,Zs):a.curve=px(n.curve,Zs),r.text=r.title,void 0===r.text?void 0!==r.style&&(a.arrowheadStyle="fill: #333"):(a.arrowheadStyle="fill: #333",a.labelpos="c",jx().flowchart.htmlLabels?(a.labelType="html",a.label=''+r.text+""):(a.labelType="text",a.label=r.text.replace(ub.lineBreakRegex,"\n"),void 0===r.style&&(a.style=a.style||"stroke: #333; stroke-width: 1.5px;fill:none"),a.labelStyle=a.labelStyle.replace("color:","fill:"))),e.setEdge(r.id1,r.id2,a,i)}))}(h,l),function(t,e,n,i){tb.info(t),t.forEach((function(t,r){const a=t,s="",o="";let l=a.text,c="note";if(e.setNode(a.id,{labelStyle:s,shape:c,labelText:xT(l),noteData:a,rx:0,ry:0,class:"",style:o,id:a.id,domId:a.id,tooltip:"",type:"note",padding:jx().flowchart.padding}),tb.info("setNode",{labelStyle:s,shape:c,labelText:l,rx:0,ry:0,style:o,id:a.id,type:"note",padding:jx().flowchart.padding}),!a.class||!(a.class in i))return;const h=n+r,u={classes:"relation",pattern:"dotted"};u.id=`edgeNote${h}`,u.arrowhead="none",tb.info(`Note edge: ${JSON.stringify(u)}, ${JSON.stringify(a)}`),u.startLabelRight="",u.endLabelLeft="",u.arrowTypeStart="none",u.arrowTypeEnd="none",u.style="fill:none",u.labelStyle="",u.curve=px(vT.curve,Zs),e.setEdge(a.id,a.class,u,h)}))}(u,l,h.length+1,c),"sandbox"===a&&(d=ie("#i"+e));const p=ie("sandbox"===a?d.nodes()[0].contentDocument.body:"body"),f=p.select(`[id="${e}"]`),g=p.select("#"+e+" g");if(_T(g,l,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",e),Dx.insertTitle(f,"classTitleText",r.titleTopMargin,i.db.getDiagramTitle()),Xx(l,f,r.diagramPadding,r.useMaxWidth),!r.htmlLabels){const t="sandbox"===a?d.nodes()[0].contentDocument:document,n=t.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const e of n){const n=e.getBBox(),i=t.createElementNS("http://www.w3.org/2000/svg","rect");i.setAttribute("rx",0),i.setAttribute("ry",0),i.setAttribute("width",n.width),i.setAttribute("height",n.height),e.insertBefore(i,e.firstChild)}}}};var TT=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,2],i=[1,5],r=[6,9,11,23,25,27,29,30,31,49],a=[1,17],s=[1,18],o=[1,19],l=[1,20],c=[1,21],h=[1,22],u=[1,25],d=[1,30],p=[1,31],f=[1,32],g=[1,33],y=[6,9,11,15,20,23,25,27,29,30,31,42,43,44,45,49],m=[1,45],b=[30,31,46,47],_=[4,6,9,11,23,25,27,29,30,31,49],x=[42,43,44,45],v=[22,37],k=[1,64],w={trace:function(){},yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,entityName:17,relSpec:18,role:19,BLOCK_START:20,attributes:21,BLOCK_STOP:22,title:23,title_value:24,acc_title:25,acc_title_value:26,acc_descr:27,acc_descr_value:28,acc_descr_multiline_value:29,ALPHANUM:30,ENTITY_NAME:31,attribute:32,attributeType:33,attributeName:34,attributeKeyType:35,attributeComment:36,ATTRIBUTE_WORD:37,ATTRIBUTE_KEY:38,COMMENT:39,cardinality:40,relType:41,ZERO_OR_ONE:42,ZERO_OR_MORE:43,ONE_OR_MORE:44,ONLY_ONE:45,NON_IDENTIFYING:46,IDENTIFYING:47,WORD:48,open_directive:49,type_directive:50,arg_directive:51,close_directive:52,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"title",24:"title_value",25:"acc_title",26:"acc_title_value",27:"acc_descr",28:"acc_descr_value",29:"acc_descr_multiline_value",30:"ALPHANUM",31:"ENTITY_NAME",37:"ATTRIBUTE_WORD",38:"ATTRIBUTE_KEY",39:"COMMENT",42:"ZERO_OR_ONE",43:"ZERO_OR_MORE",44:"ONE_OR_MORE",45:"ONLY_ONE",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[10,2],[10,1],[17,1],[17,1],[21,1],[21,2],[32,2],[32,3],[32,3],[32,4],[33,1],[34,1],[35,1],[36,1],[18,3],[40,1],[40,1],[40,1],[40,1],[41,1],[41,1],[19,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 1:break;case 3:case 7:case 8:this.$=[];break;case 4:a[o-1].push(a[o]),this.$=a[o-1];break;case 5:case 6:case 20:case 41:case 28:case 29:case 30:this.$=a[o];break;case 12:i.addEntity(a[o-4]),i.addEntity(a[o-2]),i.addRelationship(a[o-4],a[o],a[o-2],a[o-3]);break;case 13:i.addEntity(a[o-3]),i.addAttributes(a[o-3],a[o-1]);break;case 14:i.addEntity(a[o-2]);break;case 15:i.addEntity(a[o]);break;case 16:case 17:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 18:case 19:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 21:case 39:case 40:case 31:this.$=a[o].replace(/"/g,"");break;case 22:this.$=[a[o]];break;case 23:a[o].push(a[o-1]),this.$=a[o];break;case 24:this.$={attributeType:a[o-1],attributeName:a[o]};break;case 25:this.$={attributeType:a[o-2],attributeName:a[o-1],attributeKeyType:a[o]};break;case 26:this.$={attributeType:a[o-2],attributeName:a[o-1],attributeComment:a[o]};break;case 27:this.$={attributeType:a[o-3],attributeName:a[o-2],attributeKeyType:a[o-1],attributeComment:a[o]};break;case 32:this.$={cardA:a[o],relType:a[o-1],cardB:a[o-2]};break;case 33:this.$=i.Cardinality.ZERO_OR_ONE;break;case 34:this.$=i.Cardinality.ZERO_OR_MORE;break;case 35:this.$=i.Cardinality.ONE_OR_MORE;break;case 36:this.$=i.Cardinality.ONLY_ONE;break;case 37:this.$=i.Identification.NON_IDENTIFYING;break;case 38:this.$=i.Identification.IDENTIFYING;break;case 42:i.parseDirective("%%{","open_directive");break;case 43:i.parseDirective(a[o],"type_directive");break;case 44:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 45:i.parseDirective("}%%","close_directive","er")}},table:[{3:1,4:n,7:3,12:4,49:i},{1:[3]},e(r,[2,3],{5:6}),{3:7,4:n,7:3,12:4,49:i},{13:8,50:[1,9]},{50:[2,42]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:a,25:s,27:o,29:l,30:c,31:h,49:i},{1:[2,2]},{14:23,15:[1,24],52:u},e([15,52],[2,43]),e(r,[2,8],{1:[2,1]}),e(r,[2,4]),{7:15,10:26,12:4,17:16,23:a,25:s,27:o,29:l,30:c,31:h,49:i},e(r,[2,6]),e(r,[2,7]),e(r,[2,11]),e(r,[2,15],{18:27,40:29,20:[1,28],42:d,43:p,44:f,45:g}),{24:[1,34]},{26:[1,35]},{28:[1,36]},e(r,[2,19]),e(y,[2,20]),e(y,[2,21]),{11:[1,37]},{16:38,51:[1,39]},{11:[2,45]},e(r,[2,5]),{17:40,30:c,31:h},{21:41,22:[1,42],32:43,33:44,37:m},{41:46,46:[1,47],47:[1,48]},e(b,[2,33]),e(b,[2,34]),e(b,[2,35]),e(b,[2,36]),e(r,[2,16]),e(r,[2,17]),e(r,[2,18]),e(_,[2,9]),{14:49,52:u},{52:[2,44]},{15:[1,50]},{22:[1,51]},e(r,[2,14]),{21:52,22:[2,22],32:43,33:44,37:m},{34:53,37:[1,54]},{37:[2,28]},{40:55,42:d,43:p,44:f,45:g},e(x,[2,37]),e(x,[2,38]),{11:[1,56]},{19:57,30:[1,60],31:[1,59],48:[1,58]},e(r,[2,13]),{22:[2,23]},e(v,[2,24],{35:61,36:62,38:[1,63],39:k}),e([22,37,38,39],[2,29]),e([30,31],[2,32]),e(_,[2,10]),e(r,[2,12]),e(r,[2,39]),e(r,[2,40]),e(r,[2,41]),e(v,[2,25],{36:65,39:k}),e(v,[2,26]),e([22,37,39],[2,30]),e(v,[2,31]),e(v,[2,27])],defaultActions:{5:[2,42],7:[2,2],25:[2,45],39:[2,44],45:[2,28],52:[2,23]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},T=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("acc_title"),25;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),27;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.begin("open_directive"),49;case 8:return this.begin("type_directive"),50;case 9:return this.popState(),this.begin("arg_directive"),15;case 10:return this.popState(),this.popState(),52;case 11:return 51;case 12:case 13:case 15:case 21:case 26:break;case 14:return 11;case 16:return 9;case 17:return 31;case 18:return 48;case 19:return 4;case 20:return this.begin("block"),20;case 22:return 38;case 23:case 24:return 37;case 25:return 39;case 27:return this.popState(),22;case 28:case 57:return e.yytext[0];case 29:case 33:case 34:case 47:return 42;case 30:case 31:case 32:case 40:case 42:case 49:return 44;case 35:case 36:case 37:case 38:case 39:case 41:case 48:return 43;case 43:case 44:case 45:case 46:return 45;case 50:case 53:case 54:case 55:return 46;case 51:case 52:return 47;case 56:return 30;case 58:return 6}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK))\b)/i,/^(?:(.*?)[~](.*?)*[~])/i,/^(?:[A-Za-z][A-Za-z0-9\-_\[\]]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},open_directive:{rules:[8],inclusive:!1},type_directive:{rules:[9,10],inclusive:!1},arg_directive:{rules:[10,11],inclusive:!1},block:{rules:[21,22,23,24,25,26,27,28],inclusive:!1},INITIAL:{rules:[0,2,4,7,12,13,14,15,16,17,18,19,20,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58],inclusive:!0}}},t);function C(){this.yy={}}return w.lexer=T,C.prototype=w,w.Parser=C,new C}();TT.parser=TT;const CT=TT,ET=t=>null!==t.match(/^\s*erDiagram/);let ST={},AT=[];const DT=function(t){return void 0===ST[t]&&(ST[t]={attributes:[]},tb.info("Added new entity :",t)),ST[t]},LT={Cardinality:{ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE"},Identification:{NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().er,addEntity:DT,addAttributes:function(t,e){let n,i=DT(t);for(n=e.length-1;n>=0;n--)i.attributes.push(e[n]),tb.debug("Added attribute ",e[n].attributeName)},getEntities:()=>ST,addRelationship:function(t,e,n,i){let r={entityA:t,roleA:e,entityB:n,relSpec:i};AT.push(r),tb.debug("Added new relationship :",r)},getRelationships:()=>AT,clear:function(){ST={},AT=[],Cv()},setAccTitle:Ev,getAccTitle:Sv,setAccDescription:Av,getAccDescription:Dv,setDiagramTitle:Lv,getDiagramTitle:Ov},OT={ONLY_ONE_START:"ONLY_ONE_START",ONLY_ONE_END:"ONLY_ONE_END",ZERO_OR_ONE_START:"ZERO_OR_ONE_START",ZERO_OR_ONE_END:"ZERO_OR_ONE_END",ONE_OR_MORE_START:"ONE_OR_MORE_START",ONE_OR_MORE_END:"ONE_OR_MORE_END",ZERO_OR_MORE_START:"ZERO_OR_MORE_START",ZERO_OR_MORE_END:"ZERO_OR_MORE_END"},NT=OT,MT=function(t,e){let n;t.append("defs").append("marker").attr("id",OT.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",OT.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),n=t.append("defs").append("marker").attr("id",OT.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),n=t.append("defs").append("marker").attr("id",OT.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",OT.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",OT.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),n=t.append("defs").append("marker").attr("id",OT.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),n=t.append("defs").append("marker").attr("id",OT.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},BT=/[^\dA-Za-z](\W)*/g;let IT={},FT=new Map;const RT=function(t,e,n){let i;return Object.keys(e).forEach((function(r){const a=function(t="",e=""){const n=t.replace(BT,"");return`${YT(e)}${YT(n)}${Gm()}`}(r,"entity");FT.set(r,a);const s=t.append("g").attr("id",a);i=void 0===i?a:i;const o="text-"+a,l=s.append("text").classed("er entityLabel",!0).attr("id",o).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",jx().fontFamily).style("font-size",IT.fontSize+"px").text(r),{width:c,height:h}=((t,e,n)=>{const i=IT.entityPadding/3,r=IT.entityPadding/3,a=.85*IT.fontSize,s=e.node().getBBox(),o=[];let l=!1,c=!1,h=0,u=0,d=0,p=0,f=s.height+2*i,g=1;n.forEach((t=>{void 0!==t.attributeKeyType&&(l=!0),void 0!==t.attributeComment&&(c=!0)})),n.forEach((n=>{const r=`${e.node().id}-attr-${g}`;let s=0;const y=hb(n.attributeType),m=t.append("text").classed("er entityLabel",!0).attr("id",`${r}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",jx().fontFamily).style("font-size",a+"px").text(y),b=t.append("text").classed("er entityLabel",!0).attr("id",`${r}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",jx().fontFamily).style("font-size",a+"px").text(n.attributeName),_={};_.tn=m,_.nn=b;const x=m.node().getBBox(),v=b.node().getBBox();if(h=Math.max(h,x.width),u=Math.max(u,v.width),s=Math.max(x.height,v.height),l){const e=t.append("text").classed("er entityLabel",!0).attr("id",`${r}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",jx().fontFamily).style("font-size",a+"px").text(n.attributeKeyType||"");_.kn=e;const i=e.node().getBBox();d=Math.max(d,i.width),s=Math.max(s,i.height)}if(c){const e=t.append("text").classed("er entityLabel",!0).attr("id",`${r}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",jx().fontFamily).style("font-size",a+"px").text(n.attributeComment||"");_.cn=e;const i=e.node().getBBox();p=Math.max(p,i.width),s=Math.max(s,i.height)}_.height=s,o.push(_),f+=s+2*i,g+=1}));let y=4;l&&(y+=2),c&&(y+=2);const m=h+u+d+p,b={width:Math.max(IT.minEntityWidth,Math.max(s.width+2*IT.entityPadding,m+r*y)),height:n.length>0?f:Math.max(IT.minEntityHeight,s.height+2*IT.entityPadding)};if(n.length>0){const n=Math.max(0,(b.width-m-r*y)/(y/2));e.attr("transform","translate("+b.width/2+","+(i+s.height/2)+")");let a=s.height+2*i,f="attributeBoxOdd";o.forEach((e=>{const s=a+i+e.height/2;e.tn.attr("transform","translate("+r+","+s+")");const o=t.insert("rect","#"+e.tn.node().id).classed(`er ${f}`,!0).attr("x",0).attr("y",a).attr("width",h+2*r+n).attr("height",e.height+2*i),g=parseFloat(o.attr("x"))+parseFloat(o.attr("width"));e.nn.attr("transform","translate("+(g+r)+","+s+")");const y=t.insert("rect","#"+e.nn.node().id).classed(`er ${f}`,!0).attr("x",g).attr("y",a).attr("width",u+2*r+n).attr("height",e.height+2*i);let m=parseFloat(y.attr("x"))+parseFloat(y.attr("width"));if(l){e.kn.attr("transform","translate("+(m+r)+","+s+")");const o=t.insert("rect","#"+e.kn.node().id).classed(`er ${f}`,!0).attr("x",m).attr("y",a).attr("width",d+2*r+n).attr("height",e.height+2*i);m=parseFloat(o.attr("x"))+parseFloat(o.attr("width"))}c&&(e.cn.attr("transform","translate("+(m+r)+","+s+")"),t.insert("rect","#"+e.cn.node().id).classed(`er ${f}`,"true").attr("x",m).attr("y",a).attr("width",p+2*r+n).attr("height",e.height+2*i)),a+=e.height+2*i,f="attributeBoxOdd"===f?"attributeBoxEven":"attributeBoxOdd"}))}else b.height=Math.max(IT.minEntityHeight,f),e.attr("transform","translate("+b.width/2+","+b.height/2+")");return b})(s,l,e[r].attributes),u=s.insert("rect","#"+o).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",c).attr("height",h).node().getBBox();n.setNode(a,{width:u.width,height:u.height,shape:"rect",id:a})})),i},$T=function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")};let PT=0;function YT(t=""){return t.length>0?`${t}-`:""}const jT={setConf:function(t){const e=Object.keys(t);for(const n of e)IT[n]=t[n]},draw:function(t,e,n,i){IT=jx().er,tb.info("Drawing ER diagram");const r=jx().securityLevel;let a;"sandbox"===r&&(a=ie("#i"+e));const s=ie("sandbox"===r?a.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);let o;MT(s,IT),o=new yy({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:IT.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));const l=RT(s,i.db.getEntities(),o),c=function(t,e){return t.forEach((function(t){e.setEdge(FT.get(t.entityA),FT.get(t.entityB),{relationship:t},$T(t))})),t}(i.db.getRelationships(),o);hm(o),function(t,e){e.nodes().forEach((function(n){void 0!==n&&void 0!==e.node(n)&&t.select("#"+n).attr("transform","translate("+(e.node(n).x-e.node(n).width/2)+","+(e.node(n).y-e.node(n).height/2)+" )")}))}(s,o),c.forEach((function(t){!function(t,e,n,i,r){PT++;const a=n.edge(FT.get(e.entityA),FT.get(e.entityB),$T(e)),s=Js().x((function(t){return t.x})).y((function(t){return t.y})).curve(ao),o=t.insert("path","#"+i).classed("er relationshipLine",!0).attr("d",s(a.points)).style("stroke",IT.stroke).style("fill","none");e.relSpec.relType===r.db.Identification.NON_IDENTIFYING&&o.attr("stroke-dasharray","8,8");let l="";switch(IT.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),e.relSpec.cardA){case r.db.Cardinality.ZERO_OR_ONE:o.attr("marker-end","url("+l+"#"+NT.ZERO_OR_ONE_END+")");break;case r.db.Cardinality.ZERO_OR_MORE:o.attr("marker-end","url("+l+"#"+NT.ZERO_OR_MORE_END+")");break;case r.db.Cardinality.ONE_OR_MORE:o.attr("marker-end","url("+l+"#"+NT.ONE_OR_MORE_END+")");break;case r.db.Cardinality.ONLY_ONE:o.attr("marker-end","url("+l+"#"+NT.ONLY_ONE_END+")")}switch(e.relSpec.cardB){case r.db.Cardinality.ZERO_OR_ONE:o.attr("marker-start","url("+l+"#"+NT.ZERO_OR_ONE_START+")");break;case r.db.Cardinality.ZERO_OR_MORE:o.attr("marker-start","url("+l+"#"+NT.ZERO_OR_MORE_START+")");break;case r.db.Cardinality.ONE_OR_MORE:o.attr("marker-start","url("+l+"#"+NT.ONE_OR_MORE_START+")");break;case r.db.Cardinality.ONLY_ONE:o.attr("marker-start","url("+l+"#"+NT.ONLY_ONE_START+")")}const c=o.node().getTotalLength(),h=o.node().getPointAtLength(.5*c),u="rel"+PT,d=t.append("text").classed("er relationshipLabel",!0).attr("id",u).attr("x",h.x).attr("y",h.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",jx().fontFamily).style("font-size",IT.fontSize+"px").text(e.roleA).node().getBBox();t.insert("rect","#"+u).classed("er relationshipLabelBox",!0).attr("x",h.x-d.width/2).attr("y",h.y-d.height/2).attr("width",d.width).attr("height",d.height)}(s,t,o,l,i)}));const h=IT.diagramPadding;Dx.insertTitle(s,"entityTitleText",IT.titleTopMargin,i.db.getDiagramTitle());const u=s.node().getBBox(),d=u.width+2*h,p=u.height+2*h;Gx(s,p,d,IT.useMaxWidth),s.attr("viewBox",`${u.x-h} ${u.y-h} ${d} ${p}`)}};var zT=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,9],i=[1,7],r=[1,6],a=[1,8],s=[1,20,21,22,23,38,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],o=[2,10],l=[1,20],c=[1,21],h=[1,22],u=[1,23],d=[1,30],p=[1,32],f=[1,33],g=[1,34],y=[1,62],m=[1,48],b=[1,52],_=[1,36],x=[1,37],v=[1,38],k=[1,39],w=[1,40],T=[1,56],C=[1,63],E=[1,51],S=[1,53],A=[1,55],D=[1,59],L=[1,60],O=[1,41],N=[1,42],M=[1,43],B=[1,44],I=[1,61],F=[1,50],R=[1,54],$=[1,57],P=[1,58],Y=[1,49],j=[1,66],z=[1,71],U=[1,20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],W=[1,75],H=[1,74],q=[1,76],V=[20,21,23,81,82],G=[1,99],X=[1,104],Z=[1,107],Q=[1,108],K=[1,101],J=[1,106],tt=[1,109],et=[1,102],nt=[1,114],it=[1,113],rt=[1,103],at=[1,105],st=[1,110],ot=[1,111],lt=[1,112],ct=[1,115],ht=[20,21,22,23,81,82],ut=[20,21,22,23,53,81,82],dt=[20,21,22,23,40,52,53,55,57,59,61,63,65,66,67,69,71,73,74,76,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],pt=[20,21,23],ft=[20,21,23,52,66,67,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],gt=[1,12,20,21,22,23,24,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],yt=[52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],mt=[1,149],bt=[1,157],_t=[1,158],xt=[1,159],vt=[1,160],kt=[1,144],wt=[1,145],Tt=[1,141],Ct=[1,152],Et=[1,153],St=[1,154],At=[1,155],Dt=[1,156],Lt=[1,161],Ot=[1,162],Nt=[1,147],Mt=[1,150],Bt=[1,146],It=[1,143],Ft=[20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],Rt=[1,165],$t=[20,21,22,23,26,52,66,67,91,105,106,109,111,112,122,123,124,125,126,127],Pt=[20,21,22,23,24,26,38,40,41,42,52,56,58,60,62,64,66,67,68,70,72,73,75,77,81,82,86,87,88,89,90,91,92,95,105,106,109,111,112,113,114,122,123,124,125,126,127],Yt=[12,21,22,24],jt=[22,106],zt=[1,250],Ut=[1,245],Wt=[1,246],Ht=[1,254],qt=[1,251],Vt=[1,248],Gt=[1,247],Xt=[1,249],Zt=[1,252],Qt=[1,253],Kt=[1,255],Jt=[1,273],te=[20,21,23,106],ee=[20,21,22,23,66,67,86,102,105,106,109,110,111,112,113],ne={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,directive:5,openDirective:6,typeDirective:7,closeDirective:8,separator:9,":":10,argDirective:11,open_directive:12,type_directive:13,arg_directive:14,close_directive:15,graphConfig:16,document:17,line:18,statement:19,SEMI:20,NEWLINE:21,SPACE:22,EOF:23,GRAPH:24,NODIR:25,DIR:26,FirstStmtSeperator:27,ending:28,endToken:29,spaceList:30,spaceListNewline:31,verticeStatement:32,styleStatement:33,linkStyleStatement:34,classDefStatement:35,classStatement:36,clickStatement:37,subgraph:38,text:39,SQS:40,SQE:41,end:42,direction:43,acc_title:44,acc_title_value:45,acc_descr:46,acc_descr_value:47,acc_descr_multiline_value:48,link:49,node:50,vertex:51,AMP:52,STYLE_SEPARATOR:53,idString:54,DOUBLECIRCLESTART:55,DOUBLECIRCLEEND:56,PS:57,PE:58,"(-":59,"-)":60,STADIUMSTART:61,STADIUMEND:62,SUBROUTINESTART:63,SUBROUTINEEND:64,VERTEX_WITH_PROPS_START:65,ALPHA:66,COLON:67,PIPE:68,CYLINDERSTART:69,CYLINDEREND:70,DIAMOND_START:71,DIAMOND_STOP:72,TAGEND:73,TRAPSTART:74,TRAPEND:75,INVTRAPSTART:76,INVTRAPEND:77,linkStatement:78,arrowText:79,TESTSTR:80,START_LINK:81,LINK:82,textToken:83,STR:84,keywords:85,STYLE:86,LINKSTYLE:87,CLASSDEF:88,CLASS:89,CLICK:90,DOWN:91,UP:92,textNoTags:93,textNoTagsToken:94,DEFAULT:95,stylesOpt:96,alphaNum:97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,HEX:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,MINUS:109,UNIT:110,BRKT:111,DOT:112,PCT:113,TAGSTART:114,alphaNumToken:115,idStringToken:116,alphaNumStatement:117,direction_tb:118,direction_bt:119,direction_rl:120,direction_lr:121,PUNCTUATION:122,UNICODE_TEXT:123,PLUS:124,EQUALS:125,MULT:126,UNDERSCORE:127,graphCodeTokens:128,ARROW_CROSS:129,ARROW_POINT:130,ARROW_CIRCLE:131,ARROW_OPEN:132,QUOTE:133,$accept:0,$end:1},terminals_:{2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",44:"acc_title",45:"acc_title_value",46:"acc_descr",47:"acc_descr_value",48:"acc_descr_multiline_value",52:"AMP",53:"STYLE_SEPARATOR",55:"DOUBLECIRCLESTART",56:"DOUBLECIRCLEEND",57:"PS",58:"PE",59:"(-",60:"-)",61:"STADIUMSTART",62:"STADIUMEND",63:"SUBROUTINESTART",64:"SUBROUTINEEND",65:"VERTEX_WITH_PROPS_START",66:"ALPHA",67:"COLON",68:"PIPE",69:"CYLINDERSTART",70:"CYLINDEREND",71:"DIAMOND_START",72:"DIAMOND_STOP",73:"TAGEND",74:"TRAPSTART",75:"TRAPEND",76:"INVTRAPSTART",77:"INVTRAPEND",80:"TESTSTR",81:"START_LINK",82:"LINK",84:"STR",86:"STYLE",87:"LINKSTYLE",88:"CLASSDEF",89:"CLASS",90:"CLICK",91:"DOWN",92:"UP",95:"DEFAULT",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"HEX",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"MINUS",110:"UNIT",111:"BRKT",112:"DOT",113:"PCT",114:"TAGSTART",118:"direction_tb",119:"direction_bt",120:"direction_rl",121:"direction_lr",122:"PUNCTUATION",123:"UNICODE_TEXT",124:"PLUS",125:"EQUALS",126:"MULT",127:"UNDERSCORE",129:"ARROW_CROSS",130:"ARROW_POINT",131:"ARROW_CIRCLE",132:"ARROW_OPEN",133:"QUOTE"},productions_:[0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[50,1],[50,5],[50,3],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,8],[51,4],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,4],[51,4],[51,1],[49,2],[49,3],[49,3],[49,1],[49,3],[78,1],[79,3],[39,1],[39,2],[39,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[93,1],[93,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[103,1],[103,3],[96,1],[96,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[94,1],[94,1],[94,1],[94,1],[54,1],[54,2],[97,1],[97,2],[117,1],[117,1],[117,1],[117,1],[43,1],[43,1],[43,1],[43,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 5:i.parseDirective("%%{","open_directive");break;case 6:i.parseDirective(a[o],"type_directive");break;case 7:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 8:i.parseDirective("}%%","close_directive","flowchart");break;case 10:case 36:case 37:case 38:case 39:case 40:this.$=[];break;case 11:(!Array.isArray(a[o])||a[o].length>0)&&a[o-1].push(a[o]),this.$=a[o-1];break;case 12:case 82:case 84:case 96:case 152:case 154:case 155:case 78:case 150:this.$=a[o];break;case 19:i.setDirection("TB"),this.$="TB";break;case 20:i.setDirection(a[o-1]),this.$=a[o-1];break;case 35:this.$=a[o-1].nodes;break;case 41:this.$=i.addSubGraph(a[o-6],a[o-1],a[o-4]);break;case 42:this.$=i.addSubGraph(a[o-3],a[o-1],a[o-3]);break;case 43:this.$=i.addSubGraph(void 0,a[o-1],void 0);break;case 45:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 46:case 47:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 51:i.addLink(a[o-2].stmt,a[o],a[o-1]),this.$={stmt:a[o],nodes:a[o].concat(a[o-2].nodes)};break;case 52:i.addLink(a[o-3].stmt,a[o-1],a[o-2]),this.$={stmt:a[o-1],nodes:a[o-1].concat(a[o-3].nodes)};break;case 53:this.$={stmt:a[o-1],nodes:a[o-1]};break;case 54:this.$={stmt:a[o],nodes:a[o]};break;case 55:case 123:case 125:this.$=[a[o]];break;case 56:this.$=a[o-4].concat(a[o]);break;case 57:this.$=[a[o-2]],i.setClass(a[o-2],a[o]);break;case 58:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"square");break;case 59:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"doublecircle");break;case 60:this.$=a[o-5],i.addVertex(a[o-5],a[o-2],"circle");break;case 61:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"ellipse");break;case 62:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"stadium");break;case 63:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"subroutine");break;case 64:this.$=a[o-7],i.addVertex(a[o-7],a[o-1],"rect",void 0,void 0,void 0,Object.fromEntries([[a[o-5],a[o-3]]]));break;case 65:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"cylinder");break;case 66:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"round");break;case 67:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"diamond");break;case 68:this.$=a[o-5],i.addVertex(a[o-5],a[o-2],"hexagon");break;case 69:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"odd");break;case 70:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"trapezoid");break;case 71:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"inv_trapezoid");break;case 72:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"lean_right");break;case 73:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"lean_left");break;case 74:this.$=a[o],i.addVertex(a[o]);break;case 75:a[o-1].text=a[o],this.$=a[o-1];break;case 76:case 77:a[o-2].text=a[o-1],this.$=a[o-2];break;case 79:var l=i.destructLink(a[o],a[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[o-1]};break;case 80:l=i.destructLink(a[o]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 81:this.$=a[o-1];break;case 83:case 97:case 153:case 151:this.$=a[o-1]+""+a[o];break;case 98:case 99:this.$=a[o-4],i.addClass(a[o-2],a[o]);break;case 100:this.$=a[o-4],i.setClass(a[o-2],a[o]);break;case 101:case 109:this.$=a[o-1],i.setClickEvent(a[o-1],a[o]);break;case 102:case 110:this.$=a[o-3],i.setClickEvent(a[o-3],a[o-2]),i.setTooltip(a[o-3],a[o]);break;case 103:this.$=a[o-2],i.setClickEvent(a[o-2],a[o-1],a[o]);break;case 104:this.$=a[o-4],i.setClickEvent(a[o-4],a[o-3],a[o-2]),i.setTooltip(a[o-4],a[o]);break;case 105:case 111:this.$=a[o-1],i.setLink(a[o-1],a[o]);break;case 106:case 112:this.$=a[o-3],i.setLink(a[o-3],a[o-2]),i.setTooltip(a[o-3],a[o]);break;case 107:case 113:this.$=a[o-3],i.setLink(a[o-3],a[o-2],a[o]);break;case 108:case 114:this.$=a[o-5],i.setLink(a[o-5],a[o-4],a[o]),i.setTooltip(a[o-5],a[o-2]);break;case 115:this.$=a[o-4],i.addVertex(a[o-2],void 0,void 0,a[o]);break;case 116:case 118:this.$=a[o-4],i.updateLink(a[o-2],a[o]);break;case 117:this.$=a[o-4],i.updateLink([a[o-2]],a[o]);break;case 119:this.$=a[o-8],i.updateLinkInterpolate([a[o-6]],a[o-2]),i.updateLink([a[o-6]],a[o]);break;case 120:this.$=a[o-8],i.updateLinkInterpolate(a[o-6],a[o-2]),i.updateLink(a[o-6],a[o]);break;case 121:this.$=a[o-6],i.updateLinkInterpolate([a[o-4]],a[o]);break;case 122:this.$=a[o-6],i.updateLinkInterpolate(a[o-4],a[o]);break;case 124:case 126:a[o-2].push(a[o]),this.$=a[o-2];break;case 128:this.$=a[o-1]+a[o];break;case 156:this.$="v";break;case 157:this.$="-";break;case 158:this.$={stmt:"dir",value:"TB"};break;case 159:this.$={stmt:"dir",value:"BT"};break;case 160:this.$={stmt:"dir",value:"RL"};break;case 161:this.$={stmt:"dir",value:"LR"}}},table:[{3:1,4:2,5:3,6:5,12:n,16:4,21:i,22:r,24:a},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:n,16:4,21:i,22:r,24:a},e(s,o,{17:11}),{7:12,13:[1,13]},{16:14,21:i,22:r,24:a},{16:15,21:i,22:r,24:a},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:l,21:c,22:h,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:d,43:31,44:p,46:f,48:g,50:35,51:45,52:y,54:46,66:m,67:b,86:_,87:x,88:v,89:k,90:w,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,118:O,119:N,120:M,121:B,122:I,123:F,124:R,125:$,126:P,127:Y},{8:64,10:[1,65],15:j},e([10,15],[2,6]),e(s,[2,17]),e(s,[2,18]),e(s,[2,19]),{20:[1,68],21:[1,69],22:z,27:67,30:70},e(U,[2,11]),e(U,[2,12]),e(U,[2,13]),e(U,[2,14]),e(U,[2,15]),e(U,[2,16]),{9:72,20:W,21:H,23:q,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:W,21:H,23:q},{9:81,20:W,21:H,23:q},{9:82,20:W,21:H,23:q},{9:83,20:W,21:H,23:q},{9:84,20:W,21:H,23:q},{9:86,20:W,21:H,22:[1,85],23:q},e(U,[2,44]),{45:[1,87]},{47:[1,88]},e(U,[2,47]),e(V,[2,54],{30:89,22:z}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:G,52:X,66:Z,67:Q,84:[1,97],91:K,97:96,98:[1,94],100:[1,95],105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(U,[2,158]),e(U,[2,159]),e(U,[2,160]),e(U,[2,161]),e(ht,[2,55],{53:[1,116]}),e(ut,[2,74],{116:129,40:[1,117],52:y,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:m,67:b,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],91:T,95:C,105:E,106:S,109:A,111:D,112:L,122:I,123:F,124:R,125:$,126:P,127:Y}),e(dt,[2,150]),e(dt,[2,175]),e(dt,[2,176]),e(dt,[2,177]),e(dt,[2,178]),e(dt,[2,179]),e(dt,[2,180]),e(dt,[2,181]),e(dt,[2,182]),e(dt,[2,183]),e(dt,[2,184]),e(dt,[2,185]),e(dt,[2,186]),e(dt,[2,187]),e(dt,[2,188]),e(dt,[2,189]),e(dt,[2,190]),{9:130,20:W,21:H,23:q},{11:131,14:[1,132]},e(pt,[2,8]),e(s,[2,20]),e(s,[2,26]),e(s,[2,27]),{21:[1,133]},e(ft,[2,34],{30:134,22:z}),e(U,[2,35]),{50:135,51:45,52:y,54:46,66:m,67:b,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,122:I,123:F,124:R,125:$,126:P,127:Y},e(gt,[2,48]),e(gt,[2,49]),e(gt,[2,50]),e(yt,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:mt,24:bt,26:_t,38:xt,39:139,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e([52,66,67,68,80,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,80]),e(U,[2,36]),e(U,[2,37]),e(U,[2,38]),e(U,[2,39]),e(U,[2,40]),{22:mt,24:bt,26:_t,38:xt,39:163,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(Ft,o,{17:164}),e(U,[2,45]),e(U,[2,46]),e(V,[2,53],{52:Rt}),{26:G,52:X,66:Z,67:Q,91:K,97:166,102:[1,167],105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{95:[1,168],103:169,105:[1,170]},{26:G,52:X,66:Z,67:Q,91:K,95:[1,171],97:172,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{26:G,52:X,66:Z,67:Q,91:K,97:173,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(pt,[2,101],{22:[1,174],99:[1,175]}),e(pt,[2,105],{22:[1,176]}),e(pt,[2,109],{115:100,117:178,22:[1,177],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,122:rt,123:at,124:st,125:ot,126:lt,127:ct}),e(pt,[2,111],{22:[1,179]}),e($t,[2,152]),e($t,[2,154]),e($t,[2,155]),e($t,[2,156]),e($t,[2,157]),e(Pt,[2,162]),e(Pt,[2,163]),e(Pt,[2,164]),e(Pt,[2,165]),e(Pt,[2,166]),e(Pt,[2,167]),e(Pt,[2,168]),e(Pt,[2,169]),e(Pt,[2,170]),e(Pt,[2,171]),e(Pt,[2,172]),e(Pt,[2,173]),e(Pt,[2,174]),{52:y,54:180,66:m,67:b,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,122:I,123:F,124:R,125:$,126:P,127:Y},{22:mt,24:bt,26:_t,38:xt,39:181,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:182,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:184,42:vt,52:X,57:[1,183],66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:185,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:186,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:187,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{66:[1,188]},{22:mt,24:bt,26:_t,38:xt,39:189,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:190,42:vt,52:X,66:Z,67:Q,71:[1,191],73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:192,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:193,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:194,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(dt,[2,151]),e(Yt,[2,3]),{8:195,15:j},{15:[2,7]},e(s,[2,28]),e(ft,[2,33]),e(V,[2,51],{30:196,22:z}),e(yt,[2,75],{22:[1,197]}),{22:[1,198]},{22:mt,24:bt,26:_t,38:xt,39:199,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,82:[1,200],83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(Pt,[2,82]),e(Pt,[2,84]),e(Pt,[2,140]),e(Pt,[2,141]),e(Pt,[2,142]),e(Pt,[2,143]),e(Pt,[2,144]),e(Pt,[2,145]),e(Pt,[2,146]),e(Pt,[2,147]),e(Pt,[2,148]),e(Pt,[2,149]),e(Pt,[2,85]),e(Pt,[2,86]),e(Pt,[2,87]),e(Pt,[2,88]),e(Pt,[2,89]),e(Pt,[2,90]),e(Pt,[2,91]),e(Pt,[2,92]),e(Pt,[2,93]),e(Pt,[2,94]),e(Pt,[2,95]),{9:203,20:W,21:H,22:mt,23:q,24:bt,26:_t,38:xt,40:[1,202],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{18:18,19:19,20:l,21:c,22:h,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,204],43:31,44:p,46:f,48:g,50:35,51:45,52:y,54:46,66:m,67:b,86:_,87:x,88:v,89:k,90:w,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,118:O,119:N,120:M,121:B,122:I,123:F,124:R,125:$,126:P,127:Y},{22:z,30:205},{22:[1,206],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,115:100,117:178,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:[1,207]},{22:[1,208]},{22:[1,209],106:[1,210]},e(jt,[2,123]),{22:[1,211]},{22:[1,212],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,115:100,117:178,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:[1,213],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,115:100,117:178,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{84:[1,214]},e(pt,[2,103],{22:[1,215]}),{84:[1,216],101:[1,217]},{84:[1,218]},e($t,[2,153]),{84:[1,219],101:[1,220]},e(ht,[2,57],{116:129,52:y,66:m,67:b,91:T,95:C,105:E,106:S,109:A,111:D,112:L,122:I,123:F,124:R,125:$,126:P,127:Y}),{22:mt,24:bt,26:_t,38:xt,41:[1,221],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,56:[1,222],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:223,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,58:[1,224],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,60:[1,225],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,62:[1,226],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,64:[1,227],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{67:[1,228]},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,70:[1,229],73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,72:[1,230],73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,39:231,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,41:[1,232],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,73:kt,75:[1,233],77:[1,234],81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,73:kt,75:[1,236],77:[1,235],81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{9:237,20:W,21:H,23:q},e(V,[2,52],{52:Rt}),e(yt,[2,77]),e(yt,[2,76]),{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,68:[1,238],73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(yt,[2,79]),e(Pt,[2,83]),{22:mt,24:bt,26:_t,38:xt,39:239,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(Ft,o,{17:240}),e(U,[2,43]),{51:241,52:y,54:46,66:m,67:b,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,122:I,123:F,124:R,125:$,126:P,127:Y},{22:zt,66:Ut,67:Wt,86:Ht,96:242,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:256,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:257,102:qt,104:[1,258],105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:259,102:qt,104:[1,260],105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{105:[1,261]},{22:zt,66:Ut,67:Wt,86:Ht,96:262,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:263,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{26:G,52:X,66:Z,67:Q,91:K,97:264,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(pt,[2,102]),{84:[1,265]},e(pt,[2,106],{22:[1,266]}),e(pt,[2,107]),e(pt,[2,110]),e(pt,[2,112],{22:[1,267]}),e(pt,[2,113]),e(ut,[2,58]),e(ut,[2,59]),{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,58:[1,268],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(ut,[2,66]),e(ut,[2,61]),e(ut,[2,62]),e(ut,[2,63]),{66:[1,269]},e(ut,[2,65]),e(ut,[2,67]),{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,72:[1,270],73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(ut,[2,69]),e(ut,[2,70]),e(ut,[2,72]),e(ut,[2,71]),e(ut,[2,73]),e(Yt,[2,4]),e([22,52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,81]),{22:mt,24:bt,26:_t,38:xt,41:[1,271],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{18:18,19:19,20:l,21:c,22:h,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,272],43:31,44:p,46:f,48:g,50:35,51:45,52:y,54:46,66:m,67:b,86:_,87:x,88:v,89:k,90:w,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,118:O,119:N,120:M,121:B,122:I,123:F,124:R,125:$,126:P,127:Y},e(ht,[2,56]),e(pt,[2,115],{106:Jt}),e(te,[2,125],{108:274,22:zt,66:Ut,67:Wt,86:Ht,102:qt,105:Vt,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt}),e(ee,[2,127]),e(ee,[2,129]),e(ee,[2,130]),e(ee,[2,131]),e(ee,[2,132]),e(ee,[2,133]),e(ee,[2,134]),e(ee,[2,135]),e(ee,[2,136]),e(ee,[2,137]),e(ee,[2,138]),e(ee,[2,139]),e(pt,[2,116],{106:Jt}),e(pt,[2,117],{106:Jt}),{22:[1,275]},e(pt,[2,118],{106:Jt}),{22:[1,276]},e(jt,[2,124]),e(pt,[2,98],{106:Jt}),e(pt,[2,99],{106:Jt}),e(pt,[2,100],{115:100,117:178,26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,122:rt,123:at,124:st,125:ot,126:lt,127:ct}),e(pt,[2,104]),{101:[1,277]},{101:[1,278]},{58:[1,279]},{68:[1,280]},{72:[1,281]},{9:282,20:W,21:H,23:q},e(U,[2,42]),{22:zt,66:Ut,67:Wt,86:Ht,102:qt,105:Vt,107:283,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},e(ee,[2,128]),{26:G,52:X,66:Z,67:Q,91:K,97:284,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{26:G,52:X,66:Z,67:Q,91:K,97:285,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(pt,[2,108]),e(pt,[2,114]),e(ut,[2,60]),{22:mt,24:bt,26:_t,38:xt,39:286,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},e(ut,[2,68]),e(Ft,o,{17:287}),e(te,[2,126],{108:274,22:zt,66:Ut,67:Wt,86:Ht,102:qt,105:Vt,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt}),e(pt,[2,121],{115:100,117:178,22:[1,288],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,122:rt,123:at,124:st,125:ot,126:lt,127:ct}),e(pt,[2,122],{115:100,117:178,22:[1,289],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,122:rt,123:at,124:st,125:ot,126:lt,127:ct}),{22:mt,24:bt,26:_t,38:xt,41:[1,290],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Nt,105:J,106:tt,109:Mt,111:nt,112:it,113:Bt,114:It,115:148,122:rt,123:at,124:st,125:ot,126:lt,127:ct},{18:18,19:19,20:l,21:c,22:h,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,291],43:31,44:p,46:f,48:g,50:35,51:45,52:y,54:46,66:m,67:b,86:_,87:x,88:v,89:k,90:w,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,118:O,119:N,120:M,121:B,122:I,123:F,124:R,125:$,126:P,127:Y},{22:zt,66:Ut,67:Wt,86:Ht,96:292,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:293,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},e(ut,[2,64]),e(U,[2,41]),e(pt,[2,119],{106:Jt}),e(pt,[2,120],{106:Jt})],defaultActions:{2:[2,1],9:[2,5],10:[2,2],132:[2,7]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},ie=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),12;case 1:return this.begin("type_directive"),13;case 2:return this.popState(),this.begin("arg_directive"),10;case 3:return this.popState(),this.popState(),15;case 4:return 14;case 5:case 6:break;case 7:return this.begin("acc_title"),44;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),46;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:case 15:case 24:case 27:case 30:case 33:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:this.begin("string");break;case 16:return"STR";case 17:return 86;case 18:return 95;case 19:return 87;case 20:return 104;case 21:return 88;case 22:return 89;case 23:this.begin("href");break;case 25:return 100;case 26:this.begin("callbackname");break;case 28:this.popState(),this.begin("callbackargs");break;case 29:return 98;case 31:return 99;case 32:this.begin("click");break;case 34:return 90;case 35:case 36:return t.lex.firstGraph()&&this.begin("dir"),24;case 37:return 38;case 38:return 42;case 39:case 40:case 41:case 42:return 101;case 43:return this.popState(),25;case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:return this.popState(),26;case 54:return 118;case 55:return 119;case 56:return 120;case 57:return 121;case 58:return 105;case 59:return 111;case 60:return 53;case 61:return 67;case 62:return 52;case 63:return 20;case 64:return 106;case 65:return 126;case 66:case 67:case 68:return 82;case 69:case 70:case 71:return 81;case 72:return 59;case 73:return 60;case 74:return 61;case 75:return 62;case 76:return 63;case 77:return 64;case 78:return 65;case 79:return 69;case 80:return 70;case 81:return 55;case 82:return 56;case 83:return 109;case 84:return 112;case 85:return 127;case 86:return 124;case 87:return 113;case 88:case 89:return 125;case 90:return 114;case 91:return 73;case 92:return 92;case 93:return"SEP";case 94:return 91;case 95:return 66;case 96:return 75;case 97:return 74;case 98:return 77;case 99:return 76;case 100:return 122;case 101:return 123;case 102:return 68;case 103:return 57;case 104:return 58;case 105:return 40;case 106:return 41;case 107:return 71;case 108:return 72;case 109:return 133;case 110:return 21;case 111:return 22;case 112:return 23}},rules:[/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\])/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[30,31],inclusive:!1},callbackname:{rules:[27,28,29],inclusive:!1},href:{rules:[24,25],inclusive:!1},click:{rules:[33,34],inclusive:!1},vertex:{rules:[],inclusive:!1},dir:{rules:[43,44,45,46,47,48,49,50,51,52,53],inclusive:!1},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},string:{rules:[15,16],inclusive:!1},INITIAL:{rules:[0,5,6,7,9,11,14,17,18,19,20,21,22,23,26,32,35,36,37,38,39,40,41,42,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],inclusive:!0}}},t);function re(){this.yy={}}return ne.lexer=ie,re.prototype=ne,ne.Parser=re,new re}();zT.parser=zT;const UT=zT,WT=(t,e)=>{var n;return"dagre-wrapper"!==(null==(n=null==e?void 0:e.flowchart)?void 0:n.defaultRenderer)&&null!==t.match(/^\s*graph/)},HT=(t,e)=>{var n;return"dagre-wrapper"===(null==(n=null==e?void 0:e.flowchart)?void 0:n.defaultRenderer)&&null!==t.match(/^\s*graph/)||null!==t.match(/^\s*flowchart/)};let qT,VT,GT=0,XT=jx(),ZT={},QT=[],KT={},JT=[],tC={},eC={},nC=0,iC=!0,rC=[];const aC=t=>ub.sanitizeText(t,XT),sC=function(t){const e=Object.keys(ZT);for(const n of e)if(ZT[n].id===t)return ZT[n].domId;return t},oC=function(t,e,n,i){const r={start:t,end:e,type:void 0,text:""};void 0!==(i=n.text)&&(r.text=aC(i.trim()),'"'===r.text[0]&&'"'===r.text[r.text.length-1]&&(r.text=r.text.substring(1,r.text.length-1))),void 0!==n&&(r.type=n.type,r.stroke=n.stroke,r.length=n.length),QT.push(r)},lC=function(t,e){t.split(",").forEach((function(t){let n=t;void 0!==ZT[n]&&ZT[n].classes.push(e),void 0!==tC[n]&&tC[n].classes.push(e)}))},cC=function(t){let e=ie(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=ie("body").append("div").attr("class","mermaidTooltip").style("opacity",0));ie(t).select("svg").selectAll("g.node").on("mouseover",(function(){const t=ie(this);if(null===t.attr("title"))return;const n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(t.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/<br\/>/g,"
")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);ie(this).classed("hover",!1)}))};rC.push(cC);const hC=function(t){for(const[e,n]of JT.entries())if(n.id===t)return e;return-1};let uC=-1;const dC=[],pC=function(t,e){const n=JT[e].nodes;if(uC+=1,uC>2e3)return;if(dC[uC]=e,JT[e].id===t)return{result:!0,count:0};let i=0,r=1;for(;i=0){const n=pC(t,e);if(n.result)return{result:!0,count:r+n.count};r+=n.count}i+=1}return{result:!1,count:r}},fC=(t,e)=>{let n=!1;return t.forEach((t=>{t.nodes.indexOf(e)>=0&&(n=!0)})),n},gC=(t,e)=>{const n=[];return t.nodes.forEach(((i,r)=>{fC(e,i)||n.push(t.nodes[r])})),{nodes:n}},yC={parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},defaultConfig:()=>Ox.flowchart,setAccTitle:Ev,getAccTitle:Sv,getAccDescription:Dv,setAccDescription:Av,addVertex:function(t,e,n,i,r,a,s={}){let o,l=t;void 0!==l&&0!==l.trim().length&&(void 0===ZT[l]&&(ZT[l]={id:l,domId:"flowchart-"+l+"-"+GT,styles:[],classes:[]}),GT++,void 0!==e?(XT=jx(),o=aC(e.trim()),'"'===o[0]&&'"'===o[o.length-1]&&(o=o.substring(1,o.length-1)),ZT[l].text=o):void 0===ZT[l].text&&(ZT[l].text=t),void 0!==n&&(ZT[l].type=n),null!=i&&i.forEach((function(t){ZT[l].styles.push(t)})),null!=r&&r.forEach((function(t){ZT[l].classes.push(t)})),void 0!==a&&(ZT[l].dir=a),void 0===ZT[l].props?ZT[l].props=s:void 0!==s&&Object.assign(ZT[l].props,s))},lookUpDomId:sC,addLink:function(t,e,n,i){let r,a;for(r=0;r/)&&(qT="LR"),qT.match(/.*v/)&&(qT="TB")},setClass:lC,setTooltip:function(t,e){t.split(",").forEach((function(t){void 0!==e&&(eC["gen-1"===VT?sC(t):t]=aC(e))}))},getTooltip:function(t){return eC[t]},setClickEvent:function(t,e,n){t.split(",").forEach((function(t){!function(t,e,n){let i=sC(t);if("loose"!==jx().securityLevel)return;if(void 0===e)return;let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{VT=t||"gen-1"},defaultStyle:function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},addSubGraph:function(t,e,n){let i=t.trim(),r=n;t===n&&n.match(/\s/)&&(i=void 0);let a=[];const{nodeList:s,dir:o}=function(t){const e={boolean:{},number:{},string:{}},n=[];let i;return{nodeList:t.filter((function(t){const r=typeof t;return t.stmt&&"dir"===t.stmt?(i=t.value,!1):""!==t.trim()&&(r in e?!e[r].hasOwnProperty(t)&&(e[r][t]=!0):!n.includes(t)&&n.push(t))})),dir:i}}(a.concat.apply(a,e));if(a=s,"gen-1"===VT)for(let t=0;t0&&pC("none",JT.length-1)},getSubGraphs:function(){return JT},destructLink:(t,e)=>{const n=(t=>{const e=t.trim();let n=e.slice(0,-1),i="arrow_open";switch(e.slice(-1)){case"x":i="arrow_cross","x"===e[0]&&(i="double_"+i,n=n.slice(1));break;case">":i="arrow_point","<"===e[0]&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle","o"===e[0]&&(i="double_"+i,n=n.slice(1))}let r="normal",a=n.length-1;"="===n[0]&&(r="thick");let s=((t,e)=>{const n=e.length;let i=0;for(let r=0;r{let e=t.trim(),n="arrow_open";switch(e[0]){case"<":n="arrow_point",e=e.slice(1);break;case"x":n="arrow_cross",e=e.slice(1);break;case"o":n="arrow_circle",e=e.slice(1)}let i="normal";return e.includes("=")&&(i="thick"),e.includes(".")&&(i="dotted"),{type:n,stroke:i}})(e),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===i.type)i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return"double_arrow"===i.type&&(i.type="double_arrow_point"),i.length=n.length,i}return n},lex:{firstGraph:()=>!!iC&&(iC=!1,!0)},exists:fC,makeUniq:gC,setDiagramTitle:Lv,getDiagramTitle:Ov};const mC={},bC=function(t){const e=Object.keys(t);for(const n of e)mC[n]=t[n]},_C={},xC=function(t,e,n,i,r,a){const s=i.select(`[id="${n}"]`);Object.keys(t).forEach((function(n){const i=t[n];let o="default";i.classes.length>0&&(o=i.classes.join(" "));const l=gx(i.styles);let c,h=void 0!==i.text?i.text:i.id;if(cb(jx().flowchart.htmlLabels)){const t={label:h.replace(/fa[blrs]?:fa-[\w-]+/g,(t=>``))};c=Zm(s,t).node(),c.parentNode.removeChild(c)}else{const t=r.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",l.labelStyle.replace("color:","fill:"));const e=h.split(ub.lineBreakRegex);for(const n of e){const e=r.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","1"),e.textContent=n,t.appendChild(e)}c=t}let u=0,d="";switch(i.type){case"round":u=5,d="rect";break;case"square":case"group":default:d="rect";break;case"diamond":d="question";break;case"hexagon":d="hexagon";break;case"odd":case"odd_right":d="rect_left_inv_arrow";break;case"lean_right":d="lean_right";break;case"lean_left":d="lean_left";break;case"trapezoid":d="trapezoid";break;case"inv_trapezoid":d="inv_trapezoid";break;case"circle":d="circle";break;case"ellipse":d="ellipse";break;case"stadium":d="stadium";break;case"subroutine":d="subroutine";break;case"cylinder":d="cylinder";break;case"doublecircle":d="doublecircle"}e.setNode(i.id,{labelStyle:l.labelStyle,shape:d,labelText:h,rx:u,ry:u,class:o,style:l.style,id:i.id,link:i.link,linkTarget:i.linkTarget,tooltip:a.db.getTooltip(i.id)||"",domId:a.db.lookUpDomId(i.id),haveCallback:i.haveCallback,width:"group"===i.type?500:void 0,dir:i.dir,type:i.type,props:i.props,padding:jx().flowchart.padding}),tb.info("setNode",{labelStyle:l.labelStyle,shape:d,labelText:h,rx:u,ry:u,class:o,style:l.style,id:i.id,domId:a.db.lookUpDomId(i.id),width:"group"===i.type?500:void 0,type:i.type,dir:i.dir,props:i.props,padding:jx().flowchart.padding})}))},vC=function(t,e,n){tb.info("abc78 edges = ",t);let i,r,a=0,s={};if(void 0!==t.defaultStyle){const e=gx(t.defaultStyle);i=e.style,r=e.labelStyle}t.forEach((function(n){a++;var o="L-"+n.start+"-"+n.end;void 0===s[o]?(s[o]=0,tb.info("abc78 new entry",o,s[o])):(s[o]++,tb.info("abc78 new entry",o,s[o]));let l=o+"-"+s[o];tb.info("abc78 new link id to be used is",o,l,s[o]);var c="LS-"+n.start,h="LE-"+n.end;const u={style:"",labelStyle:""};switch(u.minlen=n.length||1,"arrow_open"===n.type?u.arrowhead="none":u.arrowhead="normal",u.arrowTypeStart="arrow_open",u.arrowTypeEnd="arrow_open",n.type){case"double_arrow_cross":u.arrowTypeStart="arrow_cross";case"arrow_cross":u.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":u.arrowTypeStart="arrow_point";case"arrow_point":u.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":u.arrowTypeStart="arrow_circle";case"arrow_circle":u.arrowTypeEnd="arrow_circle"}let d="",p="";switch(n.stroke){case"normal":d="fill:none;",void 0!==i&&(d=i),void 0!==r&&(p=r),u.thickness="normal",u.pattern="solid";break;case"dotted":u.thickness="normal",u.pattern="dotted",u.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":u.thickness="thick",u.pattern="solid",u.style="stroke-width: 3.5px;fill:none;"}if(void 0!==n.style){const t=gx(n.style);d=t.style,p=t.labelStyle}u.style=u.style+=d,u.labelStyle=u.labelStyle+=p,void 0!==n.interpolate?u.curve=px(n.interpolate,Zs):void 0!==t.defaultInterpolate?u.curve=px(t.defaultInterpolate,Zs):u.curve=px(_C.curve,Zs),void 0===n.text?void 0!==n.style&&(u.arrowheadStyle="fill: #333"):(u.arrowheadStyle="fill: #333",u.labelpos="c"),u.labelType="text",u.label=n.text.replace(ub.lineBreakRegex,"\n"),void 0===n.style&&(u.style=u.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),u.labelStyle=u.labelStyle.replace("color:","fill:"),u.id=l,u.classes="flowchart-link "+c+" "+h,e.setEdge(n.start,n.end,u,a)}))},kC={setConf:function(t){const e=Object.keys(t);for(const n of e)_C[n]=t[n]},addVertices:xC,addEdges:vC,getClasses:function(t,e){tb.info("Extracting classes"),e.db.clear();try{return e.parse(t),e.db.getClasses()}catch(t){return}},draw:function(t,e,n,i){tb.info("Drawing flowchart"),i.db.clear(),yC.setGen("gen-2"),i.parser.parse(t);let r=i.db.getDirection();void 0===r&&(r="TD");const{securityLevel:a,flowchart:s}=jx(),o=s.nodeSpacing||50,l=s.rankSpacing||50;let c;"sandbox"===a&&(c=ie("#i"+e));const h=ie("sandbox"===a?c.nodes()[0].contentDocument.body:"body"),u="sandbox"===a?c.nodes()[0].contentDocument:document,d=new yy({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:o,ranksep:l,marginx:0,marginy:0}).setDefaultEdgeLabel((function(){return{}}));let p;const f=i.db.getSubGraphs();tb.info("Subgraphs - ",f);for(let t=f.length-1;t>=0;t--)p=f[t],tb.info("Subgraph - ",p),i.db.addVertex(p.id,p.title,"group",void 0,p.classes,p.dir);const g=i.db.getVertices(),y=i.db.getEdges();tb.info(y);let m=0;for(m=f.length-1;m>=0;m--){p=f[m],re("cluster").append("text");for(let t=0;t2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},w=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),40;case 1:return this.begin("type_directive"),41;case 2:return this.popState(),this.begin("arg_directive"),33;case 3:return this.popState(),this.popState(),43;case 4:return 42;case 5:return this.begin("acc_title"),21;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),23;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:case 20:case 23:case 26:case 29:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:case 13:case 14:case 16:case 17:case 18:break;case 15:return 11;case 19:this.begin("href");break;case 21:return 38;case 22:this.begin("callbackname");break;case 24:this.popState(),this.begin("callbackargs");break;case 25:return 36;case 27:return 37;case 28:this.begin("click");break;case 30:return 35;case 31:return 5;case 32:return 12;case 33:return 13;case 34:return 14;case 35:return 15;case 36:return 16;case 37:return 18;case 38:return 17;case 39:return 19;case 40:return"date";case 41:return 20;case 42:return"accDescription";case 43:return 26;case 44:return 28;case 45:return 29;case 46:return 33;case 47:return 7;case 48:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[26,27],inclusive:!1},callbackname:{rules:[23,24,25],inclusive:!1},href:{rules:[20,21],inclusive:!1},click:{rules:[29,30],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,22,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],inclusive:!0}}},t);function T(){this.yy={}}return k.lexer=w,T.prototype=k,k.Parser=T,new T}();wC.parser=wC;const TC=wC,CC=t=>null!==t.match(/^\s*gantt/);let EC,SC="",AC="",DC="",LC=[],OC=[],NC={},MC=[],BC=[],IC="";const FC=["active","done","crit","milestone"];let RC=[],$C=!1,PC=!1,YC=0;const jC=function(t,e,n,i){return!i.includes(t.format(e.trim()))&&(!!(t.isoWeekday()>=6&&n.includes("weekends"))||(!!n.includes(t.format("dddd").toLowerCase())||n.includes(t.format(e.trim()))))},zC=function(t,n,i,r){if(!i.length||t.manualEndTime)return;let a=e(t.startTime,n,!0);a.add(1,"d");let s=e(t.endTime,n,!0),o=UC(a,s,n,i,r);t.endTime=s.toDate(),t.renderEndTime=o},UC=function(t,e,n,i,r){let a=!1,s=null;for(;t<=e;)a||(s=e.toDate()),a=jC(t,n,i,r),a&&e.add(1,"d"),t.add(1,"d");return s},WC=function(t,n,i){i=i.trim();const r=/^after\s+([\d\w- ]+)/.exec(i.trim());if(null!==r){let t=null;if(r[1].split(" ").forEach((function(e){let n=JC(e);void 0!==n&&(t?n.endTime>t.endTime&&(t=n):t=n)})),t)return t.endTime;{const t=new Date;return t.setHours(0,0,0,0),t}}let a=e(i,n.trim(),!0);if(a.isValid())return a.toDate();{tb.debug("Invalid date:"+i),tb.debug("With date format:"+n.trim());const t=new Date(i);if(void 0===t||isNaN(t.getTime()))throw new Error("Invalid date:"+i);return t}},HC=function(t){const n=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return null!==n?e.duration(Number.parseFloat(n[1]),n[2]):e.duration.invalid()},qC=function(t,n,i,r=!1){i=i.trim();let a=e(i,n.trim(),!0);if(a.isValid())return r&&a.add(1,"d"),a.toDate();const s=e(t),o=HC(i);return o.isValid()&&s.add(o),s.toDate()};let VC=0;const GC=function(t){return void 0===t?(VC+=1,"task"+VC):t};let XC,ZC,QC=[];const KC={},JC=function(t){const e=KC[t];return QC[e]},tE=function(){const t=function(t){const n=QC[t];let i="";switch(QC[t].raw.startTime.type){case"prevTaskEnd":{const t=JC(n.prevTaskId);n.startTime=t.endTime;break}case"getStartDate":i=WC(0,SC,QC[t].raw.startTime.startData),i&&(QC[t].startTime=i)}return QC[t].startTime&&(QC[t].endTime=qC(QC[t].startTime,SC,QC[t].raw.endTime.data,$C),QC[t].endTime&&(QC[t].processed=!0,QC[t].manualEndTime=e(QC[t].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),zC(QC[t],SC,OC,LC))),QC[t].processed};let n=!0;for(const[e,i]of QC.entries())t(e),n=n&&i.processed;return n},eE=function(t,e){t.split(",").forEach((function(t){let n=JC(t);void 0!==n&&n.classes.push(e)}))},nE=function(t,e){RC.push((function(){const n=document.querySelector(`[id="${t}"]`);null!==n&&n.addEventListener("click",(function(){e()}))}),(function(){const n=document.querySelector(`[id="${t}-text"]`);null!==n&&n.addEventListener("click",(function(){e()}))}))},iE={parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().gantt,clear:function(){MC=[],BC=[],IC="",RC=[],VC=0,XC=void 0,ZC=void 0,QC=[],SC="",AC="",EC=void 0,DC="",LC=[],OC=[],$C=!1,PC=!1,YC=0,NC={},Cv()},setDateFormat:function(t){SC=t},getDateFormat:function(){return SC},enableInclusiveEndDates:function(){$C=!0},endDatesAreInclusive:function(){return $C},enableTopAxis:function(){PC=!0},topAxisEnabled:function(){return PC},setAxisFormat:function(t){AC=t},getAxisFormat:function(){return AC},setTickInterval:function(t){EC=t},getTickInterval:function(){return EC},setTodayMarker:function(t){DC=t},getTodayMarker:function(){return DC},setAccTitle:Ev,getAccTitle:Sv,setDiagramTitle:Lv,getDiagramTitle:Ov,setAccDescription:Av,getAccDescription:Dv,addSection:function(t){IC=t,MC.push(t)},getSections:function(){return MC},getTasks:function(){let t=tE();let e=0;for(;!t&&e<10;)t=tE(),e++;return BC=QC,BC},addTask:function(t,e){const n={section:IC,type:IC,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},i=function(t,e){let n;n=":"===e.substr(0,1)?e.substr(1,e.length):e;const i=n.split(","),r={};rE(i,r,FC);for(let t=0;t{Dx.runFunc(e,...i)}))}(t,e,n)})),eE(t,"clickable")},setLink:function(t,e){let n=e;"loose"!==jx().securityLevel&&(n=i(e)),t.split(",").forEach((function(t){void 0!==JC(t)&&(nE(t,(()=>{window.open(n,"_self")})),NC[t]=n)})),eE(t,"clickable")},getLinks:function(){return NC},bindFunctions:function(t){RC.forEach((function(e){e(t)}))},parseDuration:HC,isInvalidDate:jC};function rE(t,e,n){let i=!0;for(;i;)i=!1,n.forEach((function(n){const r=new RegExp("^\\s*"+n+"\\s*$");t[0].match(r)&&(e[n]=!0,t.shift(1),i=!0)}))}let aE;const sE={setConf:function(){tb.debug("Something is calling, setConf, remove the call")},draw:function(t,n,i,r){const a=jx().gantt,s=jx().securityLevel;let o;"sandbox"===s&&(o=ie("#i"+n));const l=ie("sandbox"===s?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===s?o.nodes()[0].contentDocument:document,h=c.getElementById(n);aE=h.parentElement.offsetWidth,void 0===aE&&(aE=1200),void 0!==a.useWidth&&(aE=a.useWidth);const u=r.db.getTasks(),d=u.length*(a.barHeight+a.barGap)+2*a.topPadding;h.setAttribute("viewBox","0 0 "+aE+" "+d);const p=l.select(`[id="${n}"]`),f=Es().domain([S(u,(function(t){return t.startTime})),E(u,(function(t){return t.endTime}))]).rangeRound([0,aE-a.leftPadding-a.rightPadding]);let g=[];for(const t of u)g.push(t.type);const y=g;function m(t,e){return function(t){let e=t.length;const n={};for(;e;)n[t[--e]]=(n[t[e]]||0)+1;return n}(e)[t]||0}g=function(t){const e={},n=[];for(let i=0,r=t.length;ii?r=1:nt?Math.min(t,e):e),0),d=l.reduce(((t,{endTime:e})=>t?Math.max(t,e):e),0),g=r.db.getDateFormat();if(!u||!d)return;const y=[];let m=null,b=e(u);for(;b.valueOf()<=d;)r.db.isInvalidDate(b,g,c,h)?m?m.end=b.clone():m={start:b.clone(),end:b.clone()}:m&&(y.push(m),m=null),b.add(1,"d");p.append("g").selectAll("rect").data(y).enter().append("rect").attr("id",(function(t){return"exclude-"+t.start.format("YYYY-MM-DD")})).attr("x",(function(t){return f(t.start)+i})).attr("y",a.gridLineStartPadding).attr("width",(function(t){const e=t.end.clone().add(1,"day");return f(e)-f(t.start)})).attr("height",o-n-a.gridLineStartPadding).attr("transform-origin",(function(e,n){return(f(e.start)+i+.5*(f(e.end)-f(e.start))).toString()+"px "+(n*t+.5*o).toString()+"px"})).attr("class","exclude-range")})(l,h,u,0,s,t,r.db.getExcludes(),r.db.getIncludes()),function(t,e,n,i){let s=(o=f,P(O,o)).tickSize(-i+e+a.gridLineStartPadding).tickFormat(aa(r.db.getAxisFormat()||a.axisFormat||"%Y-%m-%d"));var o;const l=/^([1-9]\d*)(minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||a.tickInterval);if(null!==l){const t=l[1];switch(l[2]){case"minute":s.ticks(Cr.every(t));break;case"hour":s.ticks(Sr.every(t));break;case"day":s.ticks(Dr.every(t));break;case"week":s.ticks(Mr.every(t));break;case"month":s.ticks(Gr.every(t))}}if(p.append("g").attr("class","grid").attr("transform","translate("+t+", "+(i-50)+")").call(s).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||a.topAxis){let n=function(t){return P(D,t)}(f).tickSize(-i+e+a.gridLineStartPadding).tickFormat(aa(r.db.getAxisFormat()||a.axisFormat||"%Y-%m-%d"));if(null!==l){const t=l[1];switch(l[2]){case"minute":n.ticks(Cr.every(t));break;case"hour":n.ticks(Sr.every(t));break;case"day":n.ticks(Dr.every(t));break;case"week":n.ticks(Mr.every(t));break;case"month":n.ticks(Gr.every(t))}}p.append("g").attr("class","grid").attr("transform","translate("+t+", "+e+")").call(n).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}(u,h,0,s),function(t,e,i,s,o,l,c){p.append("g").selectAll("rect").data(t).enter().append("rect").attr("x",0).attr("y",(function(t,n){return t.order*e+i-2})).attr("width",(function(){return c-a.rightPadding/2})).attr("height",e).attr("class",(function(t){for(const[e,n]of g.entries())if(t.type===n)return"section section"+e%a.numberSectionStyles;return"section section0"}));const h=p.append("g").selectAll("rect").data(t).enter(),u=r.db.getLinks();h.append("rect").attr("id",(function(t){return t.id})).attr("rx",3).attr("ry",3).attr("x",(function(t){return t.milestone?f(t.startTime)+s+.5*(f(t.endTime)-f(t.startTime))-.5*o:f(t.startTime)+s})).attr("y",(function(t,n){return t.order*e+i})).attr("width",(function(t){return t.milestone?o:f(t.renderEndTime||t.endTime)-f(t.startTime)})).attr("height",o).attr("transform-origin",(function(t,n){return n=t.order,(f(t.startTime)+s+.5*(f(t.endTime)-f(t.startTime))).toString()+"px "+(n*e+i+.5*o).toString()+"px"})).attr("class",(function(t){const e="task";let n="";t.classes.length>0&&(n=t.classes.join(" "));let i=0;for(const[e,n]of g.entries())t.type===n&&(i=e%a.numberSectionStyles);let r="";return t.active?t.crit?r+=" activeCrit":r=" active":t.done?r=t.crit?" doneCrit":" done":t.crit&&(r+=" crit"),0===r.length&&(r=" task"),t.milestone&&(r=" milestone "+r),r+=i,r+=" "+n,e+r})),h.append("text").attr("id",(function(t){return t.id+"-text"})).text((function(t){return t.task})).attr("font-size",a.fontSize).attr("x",(function(t){let e=f(t.startTime),n=f(t.renderEndTime||t.endTime);t.milestone&&(e+=.5*(f(t.endTime)-f(t.startTime))-.5*o),t.milestone&&(n=e+o);const i=this.getBBox().width;return i>n-e?n+i+1.5*a.leftPadding>c?e+s-5:n+s+5:(n-e)/2+e+s})).attr("y",(function(t,n){return t.order*e+a.barHeight/2+(a.fontSize/2-2)+i})).attr("text-height",o).attr("class",(function(t){const e=f(t.startTime);let n=f(t.endTime);t.milestone&&(n=e+o);const i=this.getBBox().width;let r="";t.classes.length>0&&(r=t.classes.join(" "));let s=0;for(const[e,n]of g.entries())t.type===n&&(s=e%a.numberSectionStyles);let l="";return t.active&&(l=t.crit?"activeCritText"+s:"activeText"+s),t.done?l=t.crit?l+" doneCritText"+s:l+" doneText"+s:t.crit&&(l=l+" critText"+s),t.milestone&&(l+=" milestoneText"),i>n-e?n+i+1.5*a.leftPadding>c?r+" taskTextOutsideLeft taskTextOutside"+s+" "+l:r+" taskTextOutsideRight taskTextOutside"+s+" "+l+" width-"+i:r+" taskText taskText"+s+" "+l+" width-"+i}));if("sandbox"===jx().securityLevel){let t;t=ie("#i"+n);const e=t.nodes()[0].contentDocument;h.filter((function(t){return void 0!==u[t.id]})).each((function(t){var n=e.querySelector("#"+t.id),i=e.querySelector("#"+t.id+"-text");const r=n.parentNode;var a=e.createElement("a");a.setAttribute("xlink:href",u[t.id]),a.setAttribute("target","_top"),r.appendChild(a),a.appendChild(n),a.appendChild(i)}))}}(t,l,h,u,o,0,i),function(t,e){const n=[];let i=0;for(const[t,e]of g.entries())n[t]=[e,m(e,y)];p.append("g").selectAll("text").data(n).enter().append((function(t){const e=t[0].split(ub.lineBreakRegex),n=-(e.length-1)/2,i=c.createElementNS("http://www.w3.org/2000/svg","text");i.setAttribute("dy",n+"em");for(const[t,n]of e.entries()){const e=c.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttribute("alignment-baseline","central"),e.setAttribute("x","10"),t>0&&e.setAttribute("dy","1em"),e.textContent=n,i.appendChild(e)}return i})).attr("x",10).attr("y",(function(r,a){if(!(a>0))return r[1]*t/2+e;for(let s=0;s2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},r=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return 4;case 1:return 9;case 2:return"space";case 3:return 10;case 4:return 6;case 5:return"TXT"}},rules:[/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5],inclusive:!0}}},t);function a(){this.yy={}}return i.lexer=r,a.prototype=i,i.Parser=a,new a}();oE.parser=oE;const lE=oE;var cE="",hE=!1;const uE={setMessage:t=>{tb.debug("Setting message to: "+t),cE=t},getMessage:()=>cE,setInfo:t=>{hE=t},getInfo:()=>hE,clear:Cv},dE={draw:(t,e,n)=>{try{tb.debug("Rendering info diagram\n"+t);const i=jx().securityLevel;let r;"sandbox"===i&&(r=ie("#i"+e));const a=ie("sandbox"===i?r.nodes()[0].contentDocument.body:"body").select("#"+e);a.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("v "+n),a.attr("height",100),a.attr("width",400)}catch(t){tb.error("Error while rendering info diagram"),tb.error(t.message)}}},pE=t=>null!==t.match(/^\s*info/);var fE=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,4],i=[1,5],r=[1,6],a=[1,7],s=[1,9],o=[1,11,13,15,17,19,20,26,27,28,29],l=[2,5],c=[1,6,11,13,15,17,19,20,26,27,28,29],h=[26,27,28],u=[2,8],d=[1,18],p=[1,19],f=[1,20],g=[1,21],y=[1,22],m=[1,23],b=[1,28],_=[6,26,27,28,29],x={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,PIE:6,document:7,showData:8,line:9,statement:10,txt:11,value:12,title:13,title_value:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,openDirective:21,typeDirective:22,closeDirective:23,":":24,argDirective:25,NEWLINE:26,";":27,EOF:28,open_directive:29,type_directive:30,arg_directive:31,close_directive:32,$accept:0,$end:1},terminals_:{2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",24:":",26:"NEWLINE",27:";",28:"EOF",29:"open_directive",30:"type_directive",31:"arg_directive",32:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[21,1],[22,1],[25,1],[23,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 4:i.setShowData(!0);break;case 7:this.$=a[o-1];break;case 9:i.addSection(a[o-1],i.cleanupValue(a[o]));break;case 10:this.$=a[o].trim(),i.setDiagramTitle(this.$);break;case 11:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 12:case 13:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 14:i.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 21:i.parseDirective("%%{","open_directive");break;case 22:i.parseDirective(a[o],"type_directive");break;case 23:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 24:i.parseDirective("}%%","close_directive","pie")}},table:[{3:1,4:2,5:3,6:n,21:8,26:i,27:r,28:a,29:s},{1:[3]},{3:10,4:2,5:3,6:n,21:8,26:i,27:r,28:a,29:s},{3:11,4:2,5:3,6:n,21:8,26:i,27:r,28:a,29:s},e(o,l,{7:12,8:[1,13]}),e(c,[2,18]),e(c,[2,19]),e(c,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},e(h,u,{21:8,9:16,10:17,5:24,1:[2,3],11:d,13:p,15:f,17:g,19:y,20:m,29:s}),e(o,l,{7:25}),{23:26,24:[1,27],32:b},e([24,32],[2,22]),e(o,[2,6]),{4:29,26:i,27:r,28:a},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},e(h,[2,13]),e(h,[2,14]),e(h,[2,15]),e(h,u,{21:8,9:16,10:17,5:24,1:[2,4],11:d,13:p,15:f,17:g,19:y,20:m,29:s}),e(_,[2,16]),{25:34,31:[1,35]},e(_,[2,24]),e(o,[2,7]),e(h,[2,9]),e(h,[2,10]),e(h,[2,11]),e(h,[2,12]),{23:36,32:b},{32:[2,23]},e(_,[2,17])],defaultActions:{9:[2,21],10:[2,1],11:[2,2],35:[2,23]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},v=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),29;case 1:return this.begin("type_directive"),30;case 2:return this.popState(),this.begin("arg_directive"),24;case 3:return this.popState(),this.popState(),32;case 4:return 31;case 5:case 6:case 8:case 9:break;case 7:return 26;case 10:return this.begin("title"),13;case 11:return this.popState(),"title_value";case 12:return this.begin("acc_title"),15;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),17;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:case 20:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:this.begin("string");break;case 21:return"txt";case 22:return 6;case 23:return 8;case 24:return"value";case 25:return 28}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},title:{rules:[11],inclusive:!1},string:{rules:[20,21],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,12,14,16,19,22,23,24,25],inclusive:!0}}},t);function k(){this.yy={}}return x.lexer=v,k.prototype=x,x.Parser=k,new k}();fE.parser=fE;const gE=fE,yE=t=>null!==t.match(/^\s*pie/)||null!==t.match(/^\s*bar/);let mE={},bE=!1;const _E={parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().pie,addSection:function(t,e){t=ub.sanitizeText(t,jx()),void 0===mE[t]&&(mE[t]=e,tb.debug("Added new section :",t))},getSections:()=>mE,cleanupValue:function(t){return":"===t.substring(0,1)?(t=t.substring(1).trim(),Number(t.trim())):Number(t.trim())},clear:function(){mE={},bE=!1,Cv()},setAccTitle:Ev,getAccTitle:Sv,setDiagramTitle:Lv,getDiagramTitle:Ov,setShowData:function(t){bE=t},getShowData:function(){return bE},getAccDescription:Dv,setAccDescription:Av};let xE,vE=jx();const kE=450,wE={draw:(t,e,n,i)=>{try{vE=jx(),tb.debug("Rendering info diagram\n"+t);const n=jx().securityLevel;let y;"sandbox"===n&&(y=ie("#i"+e));const m=ie("sandbox"===n?y.nodes()[0].contentDocument.body:"body"),b="sandbox"===n?y.nodes()[0].contentDocument:document;i.db.clear(),i.parser.parse(t),tb.debug("Parsed info diagram");const _=b.getElementById(e);xE=_.parentElement.offsetWidth,void 0===xE&&(xE=1200),void 0!==vE.useWidth&&(xE=vE.useWidth),void 0!==vE.pie.useWidth&&(xE=vE.pie.useWidth);const x=m.select("#"+e);Gx(x,kE,xE,vE.pie.useMaxWidth),_.setAttribute("viewBox","0 0 "+xE+" "+kE);var r=18,a=Math.min(xE,kE)/2-40,s=x.append("g").attr("transform","translate("+xE/2+",225)"),o=i.db.getSections(),l=0;Object.keys(o).forEach((function(t){l+=o[t]}));const v=vE.themeVariables;var c=[v.pie1,v.pie2,v.pie3,v.pie4,v.pie5,v.pie6,v.pie7,v.pie8,v.pie9,v.pie10,v.pie11,v.pie12],h=tr().range(c),u=Object.entries(o).map((function(t,e){return{order:e,name:t[0],value:t[1]}})),d=function(){var t=eo,e=to,n=null,i=Ss(0),r=Ss($s),a=Ss(0);function s(s){var o,l,c,h,u,d=(s=Gs(s)).length,p=0,f=new Array(d),g=new Array(d),y=+i.apply(this,arguments),m=Math.min($s,Math.max(-$s,r.apply(this,arguments)-y)),b=Math.min(Math.abs(m)/d,a.apply(this,arguments)),_=b*(m<0?-1:1);for(o=0;o0&&(p+=u);for(null!=e?f.sort((function(t,n){return e(g[t],g[n])})):null!=n&&f.sort((function(t,e){return n(s[t],s[e])})),o=0,c=p?(m-d*_)/p:0;o0?u*c:0)+_,g[l]={data:s[l],index:o,value:u,startAngle:y,endAngle:h,padAngle:b};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ss(+t),s):i},s.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ss(+t),s):r},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ss(+t),s):a},s}().value((function(t){return t.value})).sort((function(t,e){return t.order-e.order})),p=d(u),f=Vs().innerRadius(0).outerRadius(a);s.selectAll("mySlices").data(p).enter().append("path").attr("d",f).attr("fill",(function(t){return h(t.data.name)})).attr("class","pieCircle"),s.selectAll("mySlices").data(p).enter().append("text").text((function(t){return(t.data.value/l*100).toFixed(0)+"%"})).attr("transform",(function(t){return"translate("+f.centroid(t)+")"})).style("text-anchor","middle").attr("class","slice"),s.append("text").text(i.db.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");var g=s.selectAll(".legend").data(h.domain()).enter().append("g").attr("class","legend").attr("transform",(function(t,e){return"translate(216,"+(22*e-22*h.domain().length/2)+")"}));g.append("rect").attr("width",r).attr("height",r).style("fill",h).style("stroke",h),g.data(p).append("text").attr("x",22).attr("y",14).text((function(t){return i.db.getShowData()||vE.showData||vE.pie.showData?t.data.name+" ["+t.data.value+"]":t.data.name}))}catch(t){tb.error("Error while rendering info diagram"),tb.error(t)}}};var TE=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,3],i=[1,5],r=[1,6],a=[1,7],s=[1,8],o=[5,6,8,14,16,18,19,40,41,42,43,44,45,53,71,72],l=[1,22],c=[2,13],h=[1,26],u=[1,27],d=[1,28],p=[1,29],f=[1,30],g=[1,31],y=[1,24],m=[1,32],b=[1,33],_=[1,36],x=[71,72],v=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],k=[1,56],w=[1,57],T=[1,58],C=[1,59],E=[1,60],S=[1,61],A=[1,62],D=[62,63],L=[1,74],O=[1,70],N=[1,71],M=[1,72],B=[1,73],I=[1,75],F=[1,79],R=[1,80],$=[1,77],P=[1,78],Y=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72],j={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,openDirective:9,typeDirective:10,closeDirective:11,":":12,argDirective:13,acc_title:14,acc_title_value:15,acc_descr:16,acc_descr_value:17,acc_descr_multiline_value:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,requirementDef:23,elementDef:24,relationshipDef:25,requirementType:26,requirementName:27,STRUCT_START:28,requirementBody:29,ID:30,COLONSEP:31,id:32,TEXT:33,text:34,RISK:35,riskLevel:36,VERIFYMTHD:37,verifyType:38,STRUCT_STOP:39,REQUIREMENT:40,FUNCTIONAL_REQUIREMENT:41,INTERFACE_REQUIREMENT:42,PERFORMANCE_REQUIREMENT:43,PHYSICAL_REQUIREMENT:44,DESIGN_CONSTRAINT:45,LOW_RISK:46,MED_RISK:47,HIGH_RISK:48,VERIFY_ANALYSIS:49,VERIFY_DEMONSTRATION:50,VERIFY_INSPECTION:51,VERIFY_TEST:52,ELEMENT:53,elementName:54,elementBody:55,TYPE:56,type:57,DOCREF:58,ref:59,END_ARROW_L:60,relationship:61,LINE:62,END_ARROW_R:63,CONTAINS:64,COPIES:65,DERIVES:66,SATISFIES:67,VERIFIES:68,REFINES:69,TRACES:70,unqString:71,qString:72,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",28:"STRUCT_START",30:"ID",31:"COLONSEP",33:"TEXT",35:"RISK",37:"VERIFYMTHD",39:"STRUCT_STOP",40:"REQUIREMENT",41:"FUNCTIONAL_REQUIREMENT",42:"INTERFACE_REQUIREMENT",43:"PERFORMANCE_REQUIREMENT",44:"PHYSICAL_REQUIREMENT",45:"DESIGN_CONSTRAINT",46:"LOW_RISK",47:"MED_RISK",48:"HIGH_RISK",49:"VERIFY_ANALYSIS",50:"VERIFY_DEMONSTRATION",51:"VERIFY_INSPECTION",52:"VERIFY_TEST",53:"ELEMENT",56:"TYPE",58:"DOCREF",60:"END_ARROW_L",62:"LINE",63:"END_ARROW_R",64:"CONTAINS",65:"COPIES",66:"DERIVES",67:"SATISFIES",68:"VERIFIES",69:"REFINES",70:"TRACES",71:"unqString",72:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,2],[4,2],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[23,5],[29,5],[29,5],[29,5],[29,5],[29,2],[29,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[24,5],[55,5],[55,5],[55,2],[55,1],[25,5],[25,5],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[27,1],[27,1],[32,1],[32,1],[34,1],[34,1],[54,1],[54,1],[57,1],[57,1],[59,1],[59,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 6:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 7:case 8:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 9:i.parseDirective("%%{","open_directive");break;case 10:i.parseDirective(a[o],"type_directive");break;case 11:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 12:i.parseDirective("}%%","close_directive","pie");break;case 13:this.$=[];break;case 19:i.addRequirement(a[o-3],a[o-4]);break;case 20:i.setNewReqId(a[o-2]);break;case 21:i.setNewReqText(a[o-2]);break;case 22:i.setNewReqRisk(a[o-2]);break;case 23:i.setNewReqVerifyMethod(a[o-2]);break;case 26:this.$=i.RequirementType.REQUIREMENT;break;case 27:this.$=i.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 28:this.$=i.RequirementType.INTERFACE_REQUIREMENT;break;case 29:this.$=i.RequirementType.PERFORMANCE_REQUIREMENT;break;case 30:this.$=i.RequirementType.PHYSICAL_REQUIREMENT;break;case 31:this.$=i.RequirementType.DESIGN_CONSTRAINT;break;case 32:this.$=i.RiskLevel.LOW_RISK;break;case 33:this.$=i.RiskLevel.MED_RISK;break;case 34:this.$=i.RiskLevel.HIGH_RISK;break;case 35:this.$=i.VerifyType.VERIFY_ANALYSIS;break;case 36:this.$=i.VerifyType.VERIFY_DEMONSTRATION;break;case 37:this.$=i.VerifyType.VERIFY_INSPECTION;break;case 38:this.$=i.VerifyType.VERIFY_TEST;break;case 39:i.addElement(a[o-3]);break;case 40:i.setNewElementType(a[o-2]);break;case 41:i.setNewElementDocRef(a[o-2]);break;case 44:i.addRelationship(a[o-2],a[o],a[o-4]);break;case 45:i.addRelationship(a[o-2],a[o-4],a[o]);break;case 46:this.$=i.Relationships.CONTAINS;break;case 47:this.$=i.Relationships.COPIES;break;case 48:this.$=i.Relationships.DERIVES;break;case 49:this.$=i.Relationships.SATISFIES;break;case 50:this.$=i.Relationships.VERIFIES;break;case 51:this.$=i.Relationships.REFINES;break;case 52:this.$=i.Relationships.TRACES}},table:[{3:1,4:2,6:n,9:4,14:i,16:r,18:a,19:s},{1:[3]},{3:10,4:2,5:[1,9],6:n,9:4,14:i,16:r,18:a,19:s},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},e(o,[2,8]),{20:[2,9]},{3:16,4:2,6:n,9:4,14:i,16:r,18:a,19:s},{1:[2,2]},{4:21,5:l,7:17,8:c,9:4,14:i,16:r,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:p,44:f,45:g,53:y,71:m,72:b},{11:34,12:[1,35],22:_},e([12,22],[2,10]),e(o,[2,6]),e(o,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:l,7:38,8:c,9:4,14:i,16:r,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:p,44:f,45:g,53:y,71:m,72:b},{4:21,5:l,7:39,8:c,9:4,14:i,16:r,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:p,44:f,45:g,53:y,71:m,72:b},{4:21,5:l,7:40,8:c,9:4,14:i,16:r,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:p,44:f,45:g,53:y,71:m,72:b},{4:21,5:l,7:41,8:c,9:4,14:i,16:r,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:p,44:f,45:g,53:y,71:m,72:b},{4:21,5:l,7:42,8:c,9:4,14:i,16:r,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:p,44:f,45:g,53:y,71:m,72:b},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},e(x,[2,26]),e(x,[2,27]),e(x,[2,28]),e(x,[2,29]),e(x,[2,30]),e(x,[2,31]),e(v,[2,55]),e(v,[2,56]),e(o,[2,4]),{13:51,21:[1,52]},e(o,[2,12]),{1:[2,3]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{8:[2,18]},{28:[1,53]},{28:[2,53]},{28:[2,54]},{28:[1,54]},{28:[2,59]},{28:[2,60]},{61:55,64:k,65:w,66:T,67:C,68:E,69:S,70:A},{61:63,64:k,65:w,66:T,67:C,68:E,69:S,70:A},{11:64,22:_},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),{63:[1,68]},e(o,[2,5]),{5:L,29:69,30:O,33:N,35:M,37:B,39:I},{5:F,39:R,55:76,56:$,58:P},{32:81,71:m,72:b},{32:82,71:m,72:b},e(Y,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:L,29:87,30:O,33:N,35:M,37:B,39:I},e(Y,[2,25]),e(Y,[2,39]),{31:[1,88]},{31:[1,89]},{5:F,39:R,55:90,56:$,58:P},e(Y,[2,43]),e(Y,[2,44]),e(Y,[2,45]),{32:91,71:m,72:b},{34:92,71:[1,93],72:[1,94]},{36:95,46:[1,96],47:[1,97],48:[1,98]},{38:99,49:[1,100],50:[1,101],51:[1,102],52:[1,103]},e(Y,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},e(Y,[2,42]),{5:[1,110]},{5:[1,111]},{5:[2,57]},{5:[2,58]},{5:[1,112]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[1,113]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[2,38]},{5:[1,114]},{5:[2,61]},{5:[2,62]},{5:[1,115]},{5:[2,63]},{5:[2,64]},{5:L,29:116,30:O,33:N,35:M,37:B,39:I},{5:L,29:117,30:O,33:N,35:M,37:B,39:I},{5:L,29:118,30:O,33:N,35:M,37:B,39:I},{5:L,29:119,30:O,33:N,35:M,37:B,39:I},{5:F,39:R,55:120,56:$,58:P},{5:F,39:R,55:121,56:$,58:P},e(Y,[2,20]),e(Y,[2,21]),e(Y,[2,22]),e(Y,[2,23]),e(Y,[2,40]),e(Y,[2,41])],defaultActions:{8:[2,9],10:[2,2],16:[2,1],37:[2,3],38:[2,14],39:[2,15],40:[2,16],41:[2,17],42:[2,18],44:[2,53],45:[2,54],47:[2,59],48:[2,60],52:[2,11],93:[2,57],94:[2,58],96:[2,32],97:[2,33],98:[2,34],100:[2,35],101:[2,36],102:[2,37],103:[2,38],105:[2,61],106:[2,62],108:[2,63],109:[2,64]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},z=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),19;case 1:return this.begin("type_directive"),20;case 2:return this.popState(),this.begin("arg_directive"),12;case 3:return this.popState(),this.popState(),22;case 4:return 21;case 5:return"title";case 6:return this.begin("acc_title"),14;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),16;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 53:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 5;case 14:case 15:case 16:break;case 17:return 8;case 18:return 6;case 19:return 28;case 20:return 39;case 21:return 31;case 22:return 30;case 23:return 33;case 24:return 35;case 25:return 37;case 26:return 40;case 27:return 41;case 28:return 42;case 29:return 43;case 30:return 44;case 31:return 45;case 32:return 46;case 33:return 47;case 34:return 48;case 35:return 49;case 36:return 50;case 37:return 51;case 38:return 52;case 39:return 53;case 40:return 64;case 41:return 65;case 42:return 66;case 43:return 67;case 44:return 68;case 45:return 69;case 46:return 70;case 47:return 56;case 48:return 58;case 49:return 60;case 50:return 63;case 51:return 62;case 52:this.begin("string");break;case 54:return"qString";case 55:return e.yytext=e.yytext.trim(),71}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[53,54],inclusive:!1},INITIAL:{rules:[0,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55],inclusive:!0}}},t);function U(){this.yy={}}return j.lexer=z,U.prototype=j,j.Parser=U,new U}();TE.parser=TE;const CE=TE,EE=t=>null!==t.match(/^\s*requirement(Diagram)?/);let SE=[],AE={},DE={},LE={},OE={};const NE={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().req,addRequirement:(t,e)=>(void 0===DE[t]&&(DE[t]={name:t,type:e,id:AE.id,text:AE.text,risk:AE.risk,verifyMethod:AE.verifyMethod}),AE={},DE[t]),getRequirements:()=>DE,setNewReqId:t=>{void 0!==AE&&(AE.id=t)},setNewReqText:t=>{void 0!==AE&&(AE.text=t)},setNewReqRisk:t=>{void 0!==AE&&(AE.risk=t)},setNewReqVerifyMethod:t=>{void 0!==AE&&(AE.verifyMethod=t)},setAccTitle:Ev,getAccTitle:Sv,setAccDescription:Av,getAccDescription:Dv,addElement:t=>(void 0===OE[t]&&(OE[t]={name:t,type:LE.type,docRef:LE.docRef},tb.info("Added new requirement: ",t)),LE={},OE[t]),getElements:()=>OE,setNewElementType:t=>{void 0!==LE&&(LE.type=t)},setNewElementDocRef:t=>{void 0!==LE&&(LE.docRef=t)},addRelationship:(t,e,n)=>{SE.push({type:t,src:e,dst:n})},getRelationships:()=>SE,clear:()=>{SE=[],AE={},DE={},LE={},OE={},Cv()}},ME={CONTAINS:"contains",ARROW:"arrow"},BE=ME,IE=(t,e)=>{let n=t.append("defs").append("marker").attr("id",ME.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");n.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),n.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),n.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",ME.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)};let FE={},RE=0;const $E=(t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",FE.rect_min_width+"px").attr("height",FE.rect_min_height+"px"),PE=(t,e,n)=>{let i=FE.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",i).attr("y",FE.rect_padding).attr("dominant-baseline","hanging"),a=0;n.forEach((t=>{0==a?r.append("tspan").attr("text-anchor","middle").attr("x",FE.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",FE.rect_min_width/2).attr("dy",.75*FE.line_height).text(t),a++}));let s=1.5*FE.rect_padding+a*FE.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",FE.rect_min_width).attr("y1",s).attr("y2",s),{titleNode:r,y:s}},YE=(t,e,n,i)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",FE.rect_padding).attr("y",i).attr("dominant-baseline","hanging"),a=0;let s=[];return n.forEach((t=>{let e=t.length;for(;e>30&&a<3;){let n=t.substring(0,30);e=(t=t.substring(30,t.length)).length,s[s.length]=n,a++}if(3==a){let t=s[s.length-1];s[s.length-1]=t.substring(0,t.length-4)+"..."}else s[s.length]=t;a=0})),s.forEach((t=>{r.append("tspan").attr("x",FE.rect_padding).attr("dy",FE.line_height).text(t)})),r},jE=function(t,e,n,i,r){const a=n.edge(zE(e.src),zE(e.dst)),s=Js().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+i).attr("class","er relationshipLine").attr("d",s(a.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+ub.getUrl(FE.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+ub.getUrl(FE.arrowMarkerAbsolute)+"#"+BE.ARROW+"_line_ending)")),((t,e,n,i)=>{const r=e.node().getTotalLength(),a=e.node().getPointAtLength(.5*r),s="rel"+RE;RE++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",s).attr("x",a.x).attr("y",a.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(i).node().getBBox();t.insert("rect","#"+s).attr("class","req reqLabelBox").attr("x",a.x-o.width/2).attr("y",a.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")})(t,o,0,`<<${e.type}>>`)},zE=t=>t.replace(/\s/g,"").replace(/\./g,"_"),UE={draw:(t,e,n,i)=>{FE=jx().requirement,i.db.clear(),i.parser.parse(t);const r=FE.securityLevel;let a;"sandbox"===r&&(a=ie("#i"+e));const s=ie("sandbox"===r?a.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);IE(s,FE);const o=new yy({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:FE.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let l=i.db.getRequirements(),c=i.db.getElements(),h=i.db.getRelationships();((t,e,n)=>{Object.keys(t).forEach((i=>{let r=t[i];i=zE(i),tb.info("Added new requirement: ",i);const a=n.append("g").attr("id",i),s=$E(a,"req-"+i);let o=PE(a,i+"_title",[`<<${r.type}>>`,`${r.name}`]);YE(a,i+"_body",[`Id: ${r.id}`,`Text: ${r.text}`,`Risk: ${r.risk}`,`Verification: ${r.verifyMethod}`],o.y);const l=s.node().getBBox();e.setNode(i,{width:l.width,height:l.height,shape:"rect",id:i})}))})(l,o,s),((t,e,n)=>{Object.keys(t).forEach((i=>{let r=t[i];const a=zE(i),s=n.append("g").attr("id",a),o="element-"+a,l=$E(s,o);let c=PE(s,o+"_title",["<>",`${i}`]);YE(s,o+"_body",[`Type: ${r.type||"Not Specified"}`,`Doc Ref: ${r.docRef||"None"}`],c.y);const h=l.node().getBBox();e.setNode(a,{width:h.width,height:h.height,shape:"rect",id:a})}))})(c,o,s),((t,e)=>{t.forEach((function(t){let n=zE(t.src),i=zE(t.dst);e.setEdge(n,i,{relationship:t})}))})(h,o),hm(o),function(t,e){e.nodes().forEach((function(n){void 0!==n&&void 0!==e.node(n)&&(t.select("#"+n),t.select("#"+n).attr("transform","translate("+(e.node(n).x-e.node(n).width/2)+","+(e.node(n).y-e.node(n).height/2)+" )"))}))}(s,o),h.forEach((function(t){jE(s,t,o,e,i)}));const u=FE.rect_padding,d=s.node().getBBox(),p=d.width+2*u,f=d.height+2*u;Gx(s,f,p,FE.useMaxWidth),s.attr("viewBox",`${d.x-u} ${d.y-u} ${p} ${f}`)}};var WE=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,2],i=[1,3],r=[1,5],a=[1,7],s=[2,5],o=[1,15],l=[1,17],c=[1,18],h=[1,19],u=[1,21],d=[1,22],p=[1,23],f=[1,29],g=[1,30],y=[1,31],m=[1,32],b=[1,33],_=[1,34],x=[1,35],v=[1,36],k=[1,37],w=[1,38],T=[1,39],C=[1,40],E=[1,43],S=[1,44],A=[1,45],D=[1,46],L=[1,47],O=[1,48],N=[1,51],M=[1,4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],B=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,53,58,59,60,61,69,79],I=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,52,53,58,59,60,61,69,79],F=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,51,53,58,59,60,61,69,79],R=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,53,58,59,60,61,69,79],$=[67,68,69],P=[1,121],Y=[1,4,5,7,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],j={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,directive:6,SD:7,document:8,line:9,statement:10,openDirective:11,typeDirective:12,closeDirective:13,":":14,argDirective:15,participant:16,actor:17,AS:18,restOfLine:19,participant_actor:20,signal:21,autonumber:22,NUM:23,off:24,activate:25,deactivate:26,note_statement:27,links_statement:28,link_statement:29,properties_statement:30,details_statement:31,title:32,legacy_title:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,loop:39,end:40,rect:41,opt:42,alt:43,else_sections:44,par:45,par_sections:46,critical:47,option_sections:48,break:49,option:50,and:51,else:52,note:53,placement:54,text2:55,over:56,actor_pair:57,links:58,link:59,properties:60,details:61,spaceList:62,",":63,left_of:64,right_of:65,signaltype:66,"+":67,"-":68,ACTOR:69,SOLID_OPEN_ARROW:70,DOTTED_OPEN_ARROW:71,SOLID_ARROW:72,DOTTED_ARROW:73,SOLID_CROSS:74,DOTTED_CROSS:75,SOLID_POINT:76,DOTTED_POINT:77,TXT:78,open_directive:79,type_directive:80,arg_directive:81,close_directive:82,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",20:"participant_actor",22:"autonumber",23:"NUM",24:"off",25:"activate",26:"deactivate",32:"title",33:"legacy_title",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",39:"loop",40:"end",41:"rect",42:"opt",43:"alt",45:"par",47:"critical",49:"break",50:"option",51:"and",52:"else",53:"note",56:"over",58:"links",59:"link",60:"properties",61:"details",63:",",64:"left_of",65:"right_of",67:"+",68:"-",69:"ACTOR",70:"SOLID_OPEN_ARROW",71:"DOTTED_OPEN_ARROW",72:"SOLID_ARROW",73:"DOTTED_ARROW",74:"SOLID_CROSS",75:"DOTTED_CROSS",76:"SOLID_POINT",77:"DOTTED_POINT",78:"TXT",79:"open_directive",80:"type_directive",81:"arg_directive",82:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,5],[10,3],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[48,1],[48,4],[46,1],[46,4],[44,1],[44,4],[27,4],[27,4],[28,3],[29,3],[30,3],[31,3],[62,2],[62,1],[57,3],[57,1],[54,1],[54,1],[21,5],[21,5],[21,4],[17,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[55,1],[11,1],[12,1],[15,1],[13,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 4:return i.apply(a[o]),a[o];case 5:case 9:this.$=[];break;case 6:a[o-1].push(a[o]),this.$=a[o-1];break;case 7:case 8:case 56:this.$=a[o];break;case 12:a[o-3].type="addParticipant",a[o-3].description=i.parseMessage(a[o-1]),this.$=a[o-3];break;case 13:a[o-1].type="addParticipant",this.$=a[o-1];break;case 14:a[o-3].type="addActor",a[o-3].description=i.parseMessage(a[o-1]),this.$=a[o-3];break;case 15:a[o-1].type="addActor",this.$=a[o-1];break;case 17:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-2]),sequenceIndexStep:Number(a[o-1]),sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:i.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:a[o-1]};break;case 22:this.$={type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:a[o-1]};break;case 28:i.setDiagramTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 29:i.setDiagramTitle(a[o].substring(7)),this.$=a[o].substring(7);break;case 30:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 31:case 32:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 33:a[o-1].unshift({type:"loopStart",loopText:i.parseMessage(a[o-2]),signalType:i.LINETYPE.LOOP_START}),a[o-1].push({type:"loopEnd",loopText:a[o-2],signalType:i.LINETYPE.LOOP_END}),this.$=a[o-1];break;case 34:a[o-1].unshift({type:"rectStart",color:i.parseMessage(a[o-2]),signalType:i.LINETYPE.RECT_START}),a[o-1].push({type:"rectEnd",color:i.parseMessage(a[o-2]),signalType:i.LINETYPE.RECT_END}),this.$=a[o-1];break;case 35:a[o-1].unshift({type:"optStart",optText:i.parseMessage(a[o-2]),signalType:i.LINETYPE.OPT_START}),a[o-1].push({type:"optEnd",optText:i.parseMessage(a[o-2]),signalType:i.LINETYPE.OPT_END}),this.$=a[o-1];break;case 36:a[o-1].unshift({type:"altStart",altText:i.parseMessage(a[o-2]),signalType:i.LINETYPE.ALT_START}),a[o-1].push({type:"altEnd",signalType:i.LINETYPE.ALT_END}),this.$=a[o-1];break;case 37:a[o-1].unshift({type:"parStart",parText:i.parseMessage(a[o-2]),signalType:i.LINETYPE.PAR_START}),a[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=a[o-1];break;case 38:a[o-1].unshift({type:"criticalStart",criticalText:i.parseMessage(a[o-2]),signalType:i.LINETYPE.CRITICAL_START}),a[o-1].push({type:"criticalEnd",signalType:i.LINETYPE.CRITICAL_END}),this.$=a[o-1];break;case 39:a[o-1].unshift({type:"breakStart",breakText:i.parseMessage(a[o-2]),signalType:i.LINETYPE.BREAK_START}),a[o-1].push({type:"breakEnd",optText:i.parseMessage(a[o-2]),signalType:i.LINETYPE.BREAK_END}),this.$=a[o-1];break;case 42:this.$=a[o-3].concat([{type:"option",optionText:i.parseMessage(a[o-1]),signalType:i.LINETYPE.CRITICAL_OPTION},a[o]]);break;case 44:this.$=a[o-3].concat([{type:"and",parText:i.parseMessage(a[o-1]),signalType:i.LINETYPE.PAR_AND},a[o]]);break;case 46:this.$=a[o-3].concat([{type:"else",altText:i.parseMessage(a[o-1]),signalType:i.LINETYPE.ALT_ELSE},a[o]]);break;case 47:this.$=[a[o-1],{type:"addNote",placement:a[o-2],actor:a[o-1].actor,text:a[o]}];break;case 48:a[o-2]=[].concat(a[o-1],a[o-1]).slice(0,2),a[o-2][0]=a[o-2][0].actor,a[o-2][1]=a[o-2][1].actor,this.$=[a[o-1],{type:"addNote",placement:i.PLACEMENT.OVER,actor:a[o-2].slice(0,2),text:a[o]}];break;case 49:this.$=[a[o-1],{type:"addLinks",actor:a[o-1].actor,text:a[o]}];break;case 50:this.$=[a[o-1],{type:"addALink",actor:a[o-1].actor,text:a[o]}];break;case 51:this.$=[a[o-1],{type:"addProperties",actor:a[o-1].actor,text:a[o]}];break;case 52:this.$=[a[o-1],{type:"addDetails",actor:a[o-1].actor,text:a[o]}];break;case 55:this.$=[a[o-2],a[o]];break;case 57:this.$=i.PLACEMENT.LEFTOF;break;case 58:this.$=i.PLACEMENT.RIGHTOF;break;case 59:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o]},{type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:a[o-1]}];break;case 60:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o]},{type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:a[o-4]}];break;case 61:this.$=[a[o-3],a[o-1],{type:"addMessage",from:a[o-3].actor,to:a[o-1].actor,signalType:a[o-2],msg:a[o]}];break;case 62:this.$={type:"addParticipant",actor:a[o]};break;case 63:this.$=i.LINETYPE.SOLID_OPEN;break;case 64:this.$=i.LINETYPE.DOTTED_OPEN;break;case 65:this.$=i.LINETYPE.SOLID;break;case 66:this.$=i.LINETYPE.DOTTED;break;case 67:this.$=i.LINETYPE.SOLID_CROSS;break;case 68:this.$=i.LINETYPE.DOTTED_CROSS;break;case 69:this.$=i.LINETYPE.SOLID_POINT;break;case 70:this.$=i.LINETYPE.DOTTED_POINT;break;case 71:this.$=i.parseMessage(a[o].trim().substring(1));break;case 72:i.parseDirective("%%{","open_directive");break;case 73:i.parseDirective(a[o],"type_directive");break;case 74:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 75:i.parseDirective("}%%","close_directive","sequence")}},table:[{3:1,4:n,5:i,6:4,7:r,11:6,79:a},{1:[3]},{3:8,4:n,5:i,6:4,7:r,11:6,79:a},{3:9,4:n,5:i,6:4,7:r,11:6,79:a},{3:10,4:n,5:i,6:4,7:r,11:6,79:a},e([1,4,5,16,20,22,25,26,32,33,34,36,38,39,41,42,43,45,47,49,53,58,59,60,61,69,79],s,{8:11}),{12:12,80:[1,13]},{80:[2,72]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:o,5:l,6:41,9:14,10:16,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:a},{13:49,14:[1,50],82:N},e([14,82],[2,73]),e(M,[2,6]),{6:41,10:52,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:a},e(M,[2,8]),e(M,[2,9]),{17:53,69:O},{17:54,69:O},{5:[1,55]},{5:[1,58],23:[1,56],24:[1,57]},{17:59,69:O},{17:60,69:O},{5:[1,61]},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},e(M,[2,28]),e(M,[2,29]),{35:[1,66]},{37:[1,67]},e(M,[2,32]),{19:[1,68]},{19:[1,69]},{19:[1,70]},{19:[1,71]},{19:[1,72]},{19:[1,73]},{19:[1,74]},e(M,[2,40]),{66:75,70:[1,76],71:[1,77],72:[1,78],73:[1,79],74:[1,80],75:[1,81],76:[1,82],77:[1,83]},{54:84,56:[1,85],64:[1,86],65:[1,87]},{17:88,69:O},{17:89,69:O},{17:90,69:O},{17:91,69:O},e([5,18,63,70,71,72,73,74,75,76,77,78],[2,62]),{5:[1,92]},{15:93,81:[1,94]},{5:[2,75]},e(M,[2,7]),{5:[1,96],18:[1,95]},{5:[1,98],18:[1,97]},e(M,[2,16]),{5:[1,100],23:[1,99]},{5:[1,101]},e(M,[2,20]),{5:[1,102]},{5:[1,103]},e(M,[2,23]),e(M,[2,24]),e(M,[2,25]),e(M,[2,26]),e(M,[2,27]),e(M,[2,30]),e(M,[2,31]),e(B,s,{8:104}),e(B,s,{8:105}),e(B,s,{8:106}),e(I,s,{44:107,8:108}),e(F,s,{46:109,8:110}),e(R,s,{48:111,8:112}),e(B,s,{8:113}),{17:116,67:[1,114],68:[1,115],69:O},e($,[2,63]),e($,[2,64]),e($,[2,65]),e($,[2,66]),e($,[2,67]),e($,[2,68]),e($,[2,69]),e($,[2,70]),{17:117,69:O},{17:119,57:118,69:O},{69:[2,57]},{69:[2,58]},{55:120,78:P},{55:122,78:P},{55:123,78:P},{55:124,78:P},e(Y,[2,10]),{13:125,82:N},{82:[2,74]},{19:[1,126]},e(M,[2,13]),{19:[1,127]},e(M,[2,15]),{5:[1,128]},e(M,[2,18]),e(M,[2,19]),e(M,[2,21]),e(M,[2,22]),{4:o,5:l,6:41,9:14,10:16,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,40:[1,129],41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:a},{4:o,5:l,6:41,9:14,10:16,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,40:[1,130],41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:a},{4:o,5:l,6:41,9:14,10:16,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,40:[1,131],41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:a},{40:[1,132]},{4:o,5:l,6:41,9:14,10:16,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,40:[2,45],41:x,42:v,43:k,45:w,47:T,49:C,52:[1,133],53:E,58:S,59:A,60:D,61:L,69:O,79:a},{40:[1,134]},{4:o,5:l,6:41,9:14,10:16,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,40:[2,43],41:x,42:v,43:k,45:w,47:T,49:C,51:[1,135],53:E,58:S,59:A,60:D,61:L,69:O,79:a},{40:[1,136]},{4:o,5:l,6:41,9:14,10:16,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,40:[2,41],41:x,42:v,43:k,45:w,47:T,49:C,50:[1,137],53:E,58:S,59:A,60:D,61:L,69:O,79:a},{4:o,5:l,6:41,9:14,10:16,11:6,16:c,17:42,20:h,21:20,22:u,25:d,26:p,27:24,28:25,29:26,30:27,31:28,32:f,33:g,34:y,36:m,38:b,39:_,40:[1,138],41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:a},{17:139,69:O},{17:140,69:O},{55:141,78:P},{55:142,78:P},{55:143,78:P},{63:[1,144],78:[2,56]},{5:[2,49]},{5:[2,71]},{5:[2,50]},{5:[2,51]},{5:[2,52]},{5:[1,145]},{5:[1,146]},{5:[1,147]},e(M,[2,17]),e(M,[2,33]),e(M,[2,34]),e(M,[2,35]),e(M,[2,36]),{19:[1,148]},e(M,[2,37]),{19:[1,149]},e(M,[2,38]),{19:[1,150]},e(M,[2,39]),{55:151,78:P},{55:152,78:P},{5:[2,61]},{5:[2,47]},{5:[2,48]},{17:153,69:O},e(Y,[2,11]),e(M,[2,12]),e(M,[2,14]),e(I,s,{8:108,44:154}),e(F,s,{8:110,46:155}),e(R,s,{8:112,48:156}),{5:[2,59]},{5:[2,60]},{78:[2,55]},{40:[2,46]},{40:[2,44]},{40:[2,42]}],defaultActions:{7:[2,72],8:[2,1],9:[2,2],10:[2,3],51:[2,75],86:[2,57],87:[2,58],94:[2,74],120:[2,49],121:[2,71],122:[2,50],123:[2,51],124:[2,52],141:[2,61],142:[2,47],143:[2,48],151:[2,59],152:[2,60],153:[2,55],154:[2,46],155:[2,44],156:[2,42]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},z=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),79;case 1:return this.begin("type_directive"),80;case 2:return this.popState(),this.begin("arg_directive"),14;case 3:return this.popState(),this.popState(),82;case 4:return 81;case 5:case 52:case 65:return 5;case 6:case 7:case 8:case 9:case 10:break;case 11:return 23;case 12:return this.begin("ID"),16;case 13:return this.begin("ID"),20;case 14:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),69;case 15:return this.popState(),this.popState(),this.begin("LINE"),18;case 16:return this.popState(),this.popState(),5;case 17:return this.begin("LINE"),39;case 18:return this.begin("LINE"),41;case 19:return this.begin("LINE"),42;case 20:return this.begin("LINE"),43;case 21:return this.begin("LINE"),52;case 22:return this.begin("LINE"),45;case 23:return this.begin("LINE"),51;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),50;case 26:return this.begin("LINE"),49;case 27:return this.popState(),19;case 28:return 40;case 29:return 64;case 30:return 65;case 31:return 58;case 32:return 59;case 33:return 60;case 34:return 61;case 35:return 56;case 36:return 53;case 37:return this.begin("ID"),25;case 38:return this.begin("ID"),26;case 39:return 32;case 40:return 33;case 41:return this.begin("acc_title"),34;case 42:return this.popState(),"acc_title_value";case 43:return this.begin("acc_descr"),36;case 44:return this.popState(),"acc_descr_value";case 45:this.begin("acc_descr_multiline");break;case 46:this.popState();break;case 47:return"acc_descr_multiline_value";case 48:return 7;case 49:return 22;case 50:return 24;case 51:return 63;case 53:return e.yytext=e.yytext.trim(),69;case 54:return 72;case 55:return 73;case 56:return 70;case 57:return 71;case 58:return 74;case 59:return 75;case 60:return 76;case 61:return 77;case 62:return 78;case 63:return 67;case 64:return 68;case 66:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[46,47],inclusive:!1},acc_descr:{rules:[44],inclusive:!1},acc_title:{rules:[42],inclusive:!1},open_directive:{rules:[1,8],inclusive:!1},type_directive:{rules:[2,3,8],inclusive:!1},arg_directive:{rules:[3,4,8],inclusive:!1},ID:{rules:[7,8,14],inclusive:!1},ALIAS:{rules:[7,8,15,16],inclusive:!1},LINE:{rules:[7,8,27],inclusive:!1},INITIAL:{rules:[0,5,6,8,9,10,11,12,13,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66],inclusive:!0}}},t);function U(){this.yy={}}return j.lexer=z,U.prototype=j,j.Parser=U,new U}();WE.parser=WE;const HE=WE,qE=t=>null!==t.match(/^\s*sequenceDiagram/);let VE,GE,XE={},ZE=[],QE=!1;const KE=function(t,e,n,i){const r=XE[t];r&&e===r.name&&null==n||(null!=n&&null!=n.text||(n={text:e,wrap:null,type:i}),null!=i&&null!=n.text||(n={text:e,wrap:null,type:i}),XE[t]={name:e,description:n.text,wrap:void 0===n.wrap&&eS()||!!n.wrap,prevActor:VE,links:{},properties:{},actorCnt:null,rectData:null,type:i||"participant"},VE&&XE[VE]&&(XE[VE].nextActor=t),VE=t)},JE=function(t,e,n={text:void 0,wrap:void 0},i){if(i===nS.ACTIVE_END){const e=(t=>{let e,n=0;for(e=0;e>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return ZE.push({from:t,to:e,message:n.text,wrap:void 0===n.wrap&&eS()||!!n.wrap,type:i}),!0},tS=function(t){return XE[t]},eS=()=>void 0!==GE?GE:jx().sequence.wrap,nS={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31},iS=function(t,e,n){n.text,void 0===n.wrap&&eS()||n.wrap;const i=[].concat(t,t);ZE.push({from:i[0],to:i[1],message:n.text,wrap:void 0===n.wrap&&eS()||!!n.wrap,type:nS.NOTE,placement:e})},rS=function(t,e){const n=tS(t);try{let t=ab(e.text,jx());t=t.replace(/&/g,"&"),t=t.replace(/=/g,"=");aS(n,JSON.parse(t))}catch(t){tb.error("error while parsing actor link text",t)}};function aS(t,e){if(null==t.links)t.links=e;else for(let n in e)t.links[n]=e[n]}const sS=function(t,e){const n=tS(t);try{let t=ab(e.text,jx());oS(n,JSON.parse(t))}catch(t){tb.error("error while parsing actor properties text",t)}};function oS(t,e){if(null==t.properties)t.properties=e;else for(let n in e)t.properties[n]=e[n]}const lS=function(t,e){const n=tS(t),i=document.getElementById(e.text);try{const t=i.innerHTML,e=JSON.parse(t);e.properties&&oS(n,e.properties),e.links&&aS(n,e.links)}catch(t){tb.error("error while parsing actor details text",t)}},cS=function(t){if(Array.isArray(t))t.forEach((function(t){cS(t)}));else switch(t.type){case"sequenceIndex":ZE.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":KE(t.actor,t.actor,t.description,"participant");break;case"addActor":KE(t.actor,t.actor,t.description,"actor");break;case"activeStart":case"activeEnd":JE(t.actor,void 0,void 0,t.signalType);break;case"addNote":iS(t.actor,t.placement,t.text);break;case"addLinks":rS(t.actor,t.text);break;case"addALink":!function(t,e){const n=tS(t);try{const t={};let s=ab(e.text,jx());var i=s.indexOf("@");s=s.replace(/&/g,"&"),s=s.replace(/=/g,"=");var r=s.slice(0,i-1).trim(),a=s.slice(i+1).trim();t[r]=a,aS(n,t)}catch(t){tb.error("error while parsing actor link text",t)}}(t.actor,t.text);break;case"addProperties":sS(t.actor,t.text);break;case"addDetails":lS(t.actor,t.text);break;case"addMessage":JE(t.from,t.to,t.msg,t.signalType);break;case"loopStart":JE(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":JE(void 0,void 0,void 0,t.signalType);break;case"rectStart":JE(void 0,void 0,t.color,t.signalType);break;case"optStart":JE(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":JE(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":Ev(t.text);break;case"parStart":case"and":JE(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":JE(void 0,void 0,t.criticalText,t.signalType);break;case"option":JE(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":JE(void 0,void 0,t.breakText,t.signalType)}},hS={addActor:KE,addMessage:function(t,e,n,i){ZE.push({from:t,to:e,message:n.text,wrap:void 0===n.wrap&&eS()||!!n.wrap,answer:i})},addSignal:JE,addLinks:rS,addDetails:lS,addProperties:sS,autoWrap:eS,setWrap:function(t){GE=t},enableSequenceNumbers:function(){QE=!0},disableSequenceNumbers:function(){QE=!1},showSequenceNumbers:()=>QE,getMessages:function(){return ZE},getActors:function(){return XE},getActor:tS,getActorKeys:function(){return Object.keys(XE)},getActorProperty:function(t,e){if(void 0!==t&&void 0!==t.properties)return t.properties[e]},getAccTitle:Sv,getDiagramTitle:Ov,setDiagramTitle:Lv,parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().sequence,clear:function(){XE={},ZE=[],QE=!1,Cv()},parseMessage:function(t){const e=t.trim(),n={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:null!==e.match(/^:?wrap:/)||null===e.match(/^:?nowrap:/)&&void 0};return tb.debug("parseMessage:",n),n},LINETYPE:nS,ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},addNote:iS,setAccTitle:Ev,apply:cS,setAccDescription:Av,getAccDescription:Dv};let uS=[];const dS=()=>{uS.forEach((t=>{t()})),uS=[]},pS=function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},fS=(t,e)=>{(t=>{uS.push(t)})((()=>{const n=document.querySelectorAll(t);0!==n.length&&(n[0].addEventListener("mouseover",(function(){mS("actor"+e+"_popup")})),n[0].addEventListener("mouseout",(function(){bS("actor"+e+"_popup")})))}))},gS=function(t,e,n,r){const a=t.append("image");a.attr("x",e),a.attr("y",n);var s=i(r);a.attr("xlink:href",s)},yS=function(t,e,n,r){const a=t.append("use");a.attr("x",e),a.attr("y",n);var s=i(r);a.attr("xlink:href","#"+s)},mS=function(t){var e=document.getElementById(t);null!=e&&(e.style.display="block")},bS=function(t){var e=document.getElementById(t);null!=e&&(e.style.display="none")},_S=function(t,e){let n=0,i=0;const r=e.text.split(ub.lineBreakRegex);let a=[],s=0,o=()=>e.y;if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":o=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":o=()=>Math.round(e.y+(n+i+e.textMargin)/2);break;case"bottom":case"end":o=()=>Math.round(e.y+(n+i+2*e.textMargin)-e.textMargin)}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[l,c]of r.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==e.fontSize&&(s=l*e.fontSize);const r=t.append("text");if(r.attr("x",e.x),r.attr("y",o()),void 0!==e.anchor&&r.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&r.style("font-family",e.fontFamily),void 0!==e.fontSize&&r.style("font-size",e.fontSize),void 0!==e.fontWeight&&r.style("font-weight",e.fontWeight),void 0!==e.fill&&r.attr("fill",e.fill),void 0!==e.class&&r.attr("class",e.class),void 0!==e.dy?r.attr("dy",e.dy):0!==s&&r.attr("dy",s),e.tspan){const t=r.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(c)}else r.text(c);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(i+=(r._groups||r)[0][0].getBBox().height,n=i),a.push(r)}return a},xS=function(t,e){const n=t.append("polygon");return n.attr("points",function(t,e,n,i,r){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-r)+" "+(t+n-1.2*r)+","+(e+i)+" "+t+","+(e+i)}(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,_S(t,e),n};let vS=-1;const kS=(t,e)=>{t.selectAll&&t.selectAll(".actor-line").attr("class","200").attr("y2",e-55)},wS=function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},TS=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},CS=function(){function t(t,e,n,r,a,s,o){i(e.append("text").attr("x",n+a/2).attr("y",r+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,n,r,a,s,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:u}=l;let d=c&&c.replace?c.replace("px",""):c;const p=t.split(ub.lineBreakRegex);for(let t=0;tn?l.width:n;const p=h.append("rect");if(p.attr("class","actorPopupMenuPanel"+u),p.attr("x",l.x),p.attr("y",l.height),p.attr("fill",l.fill),p.attr("stroke",l.stroke),p.attr("width",d),p.attr("height",l.height),p.attr("rx",l.rx),p.attr("ry",l.ry),null!=s){var f=20;for(let t in s){var g=h.append("a"),y=i(s[t]);g.attr("xlink:href",y),g.attr("target","_blank"),ES(r)(t,g,l.x+10,l.height+f,d,20,{class:"actor"},r),f+=30}}return p.attr("height",f),{height:l.height+f,width:d}},drawImage:gS,drawEmbeddedImage:yS,anchorElement:function(t){return t.append("g")},drawActivation:function(t,e,n,i,r){const a=TS(),s=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+r%3,a.width=e.stopx-e.startx,a.height=n-e.starty,pS(s,a)},drawLoop:function(t,e,n,i){const{boxMargin:r,boxTextMargin:a,labelBoxHeight:s,labelBoxWidth:o,messageFontFamily:l,messageFontSize:c,messageFontWeight:h}=i,u=t.append("g"),d=function(t,e,n,i){return u.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",i).attr("class","loopLine")};d(e.startx,e.starty,e.stopx,e.starty),d(e.stopx,e.starty,e.stopx,e.stopy),d(e.startx,e.stopy,e.stopx,e.stopy),d(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach((function(t){d(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}));let p=wS();p.text=n,p.x=e.startx,p.y=e.starty,p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=o||50,p.height=s||20,p.textMargin=a,p.class="labelText",xS(u,p),p=wS(),p.text=e.title,p.x=e.startx+o/2+(e.stopx-e.startx)/2,p.y=e.starty+r+a,p.anchor="middle",p.valign="middle",p.textMargin=a,p.class="loopText",p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=!0;let f=_S(u,p);return void 0!==e.sectionTitles&&e.sectionTitles.forEach((function(t,n){if(t.message){p.text=t.message,p.x=e.startx+(e.stopx-e.startx)/2,p.y=e.sections[n].y+r+a,p.class="loopText",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=e.wrap,f=_S(u,p);let i=Math.round(f.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[n].height+=i-(r+a)}})),e.height=Math.round(e.stopy-e.starty),u},drawBackgroundRect:function(t,e){pS(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},insertArrowHead:function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},insertArrowFilledHead:function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},insertSequenceNumber:function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},insertArrowCrossHead:function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},insertDatabaseIcon:function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},insertComputerIcon:function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},insertClockIcon:function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},getTextObj:wS,getNoteRect:TS,popupMenu:function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'block'; }"},popdownMenu:function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'none'; }"},fixLifeLineHeights:kS,sanitizeUrl:i};let AS={};const DS={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))},clear:function(){this.actors=[],this.loops=[],this.messages=[],this.notes=[]},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],loops:[],messages:[],notes:[]},init:function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,IS(jx())},updateVal:function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},updateBounds:function(t,e,n,i){const r=this;let a=0;function s(s){return function(o){a++;const l=r.sequenceItems.length-a+1;r.updateVal(o,"starty",e-l*AS.boxMargin,Math.min),r.updateVal(o,"stopy",i+l*AS.boxMargin,Math.max),r.updateVal(DS.data,"startx",t-l*AS.boxMargin,Math.min),r.updateVal(DS.data,"stopx",n+l*AS.boxMargin,Math.max),"activation"!==s&&(r.updateVal(o,"startx",t-l*AS.boxMargin,Math.min),r.updateVal(o,"stopx",n+l*AS.boxMargin,Math.max),r.updateVal(DS.data,"starty",e-l*AS.boxMargin,Math.min),r.updateVal(DS.data,"stopy",i+l*AS.boxMargin,Math.max))}}this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},insert:function(t,e,n,i){const r=Math.min(t,n),a=Math.max(t,n),s=Math.min(e,i),o=Math.max(e,i);this.updateVal(DS.data,"startx",r,Math.min),this.updateVal(DS.data,"starty",s,Math.min),this.updateVal(DS.data,"stopx",a,Math.max),this.updateVal(DS.data,"stopy",o,Math.max),this.updateBounds(r,s,a,o)},newActivation:function(t,e,n){const i=n[t.from.actor],r=FS(t.from.actor).length||0,a=i.x+i.width/2+(r-1)*AS.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+AS.activationWidth,stopy:void 0,actor:t.from.actor,anchored:SS.anchorElement(e)})},endActivation:function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop:function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},newLoop:function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},addSectionToLoop:function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:DS.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},LS=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),OS=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),NS=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});const MS=function(t,e,n,i,r,a){if(!0===r.hideUnusedParticipants){const t=new Set;a.forEach((e=>{t.add(e.from),t.add(e.to)})),n=n.filter((e=>t.has(e)))}let s=0,o=0,l=0;for(const r of n){const n=e[r];n.width=n.width||AS.width,n.height=Math.max(n.height||AS.height,AS.height),n.margin=n.margin||AS.actorMargin,n.x=s+o,n.y=i;const a=SS.drawActor(t,n,AS);l=Math.max(l,a),DS.insert(n.x,i,n.x+n.width,n.height),s+=n.width,o+=n.margin,DS.models.addActor(n)}DS.bumpVerticalPos(l)},BS=function(t,e,n,i){let r=0,a=0;for(const s of n){const n=e[s],o=PS(n),l=SS.drawPopup(t,n,o,AS,AS.forceMenus,i);l.height>r&&(r=l.height),l.width+n.x>a&&(a=l.width+n.x)}return{maxHeight:r,maxWidth:a}},IS=function(t){lx(AS,t),t.fontFamily&&(AS.actorFontFamily=AS.noteFontFamily=AS.messageFontFamily=t.fontFamily),t.fontSize&&(AS.actorFontSize=AS.noteFontSize=AS.messageFontSize=t.fontSize),t.fontWeight&&(AS.actorFontWeight=AS.noteFontWeight=AS.messageFontWeight=t.fontWeight)},FS=function(t){return DS.activations.filter((function(e){return e.actor===t}))},RS=function(t,e){const n=e[t],i=FS(t);return[i.reduce((function(t,e){return Math.min(t,e.startx)}),n.x+n.width/2),i.reduce((function(t,e){return Math.max(t,e.stopx)}),n.x+n.width/2)]};function $S(t,e,n,i,r){DS.bumpVerticalPos(n);let a=i;if(e.id&&e.message&&t[e.id]){const n=t[e.id].width,r=LS(AS);e.message=Dx.wrapLabel(`[${e.message}]`,n-2*AS.wrapPadding,r),e.width=n,e.wrap=!0;const s=Dx.calculateTextDimensions(e.message,r),o=Math.max(s.height,AS.labelBoxHeight);a=i+o,tb.debug(`${o} - ${e.message}`)}r(e),DS.bumpVerticalPos(a)}const PS=function(t){let e=0;const n=NS(AS);for(const i in t.links){const t=Dx.calculateTextDimensions(i,n).width+2*AS.wrapPadding+2*AS.boxMargin;et.actor)).lastIndexOf(t.from.actor);delete DS.activations.splice(e,1)[0]}}void 0!==t.placement?(o=function(t,e,n){const i=e[t.from].x,r=e[t.to].x,a=t.wrap&&t.message;let s=Dx.calculateTextDimensions(a?Dx.wrapLabel(t.message,AS.width,OS(AS)):t.message,OS(AS));const o={width:a?AS.width:Math.max(AS.width,s.width+2*AS.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===n.db.PLACEMENT.RIGHTOF?(o.width=a?Math.max(AS.width,s.width):Math.max(e[t.from].width/2+e[t.to].width/2,s.width+2*AS.noteMargin),o.startx=i+(e[t.from].width+AS.actorMargin)/2):t.placement===n.db.PLACEMENT.LEFTOF?(o.width=a?Math.max(AS.width,s.width+2*AS.noteMargin):Math.max(e[t.from].width/2+e[t.to].width/2,s.width+2*AS.noteMargin),o.startx=i-o.width+(e[t.from].width-AS.actorMargin)/2):t.to===t.from?(s=Dx.calculateTextDimensions(a?Dx.wrapLabel(t.message,Math.max(AS.width,e[t.from].width),OS(AS)):t.message,OS(AS)),o.width=a?Math.max(AS.width,e[t.from].width):Math.max(e[t.from].width,AS.width,s.width+2*AS.noteMargin),o.startx=i+(e[t.from].width-o.width)/2):(o.width=Math.abs(i+e[t.from].width/2-(r+e[t.to].width/2))+AS.actorMargin,o.startx=i{s=t,s.from=Math.min(s.from,o.startx),s.to=Math.max(s.to,o.startx+o.width),s.width=Math.max(s.width,Math.abs(s.from-s.to))-AS.labelBoxWidth}))):(l=function(t,e,n){let i=!1;if([n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(i=!0),!i)return{};const r=RS(t.from,e),a=RS(t.to,e),s=r[0]<=a[0]?1:0,o=r[0]0&&a.forEach((n=>{if(s=n,l.startx===l.stopx){const n=e[t.from],i=e[t.to];s.from=Math.min(n.x-l.width/2,n.x-n.width/2,s.from),s.to=Math.max(i.x+l.width/2,i.x+n.width/2,s.to),s.width=Math.max(s.width,Math.abs(s.to-s.from))-AS.labelBoxWidth}else s.from=Math.min(l.startx,s.from),s.to=Math.max(l.stopx,s.to),s.width=Math.max(s.width,l.width)-AS.labelBoxWidth})))})),DS.activations=[],tb.debug("Loop type widths:",r),r},jS={bounds:DS,drawActors:MS,drawActorsPopup:BS,setConf:IS,draw:function(t,e,n,i){const{securityLevel:r,sequence:a}=jx();let s;AS=a,"sandbox"===r&&(s=ie("#i"+e));const o=ie("sandbox"===r?s.nodes()[0].contentDocument.body:"body"),l="sandbox"===r?s.nodes()[0].contentDocument:document;DS.init(),tb.debug(i.db);const c="sandbox"===r?o.select(`[id="${e}"]`):ie(`[id="${e}"]`),h=i.db.getActors(),u=i.db.getActorKeys(),d=i.db.getMessages(),p=i.db.getDiagramTitle(),f=function(t,e,n){const i={};return e.forEach((function(e){if(t[e.to]&&t[e.from]){const r=t[e.to];if(e.placement===n.db.PLACEMENT.LEFTOF&&!r.prevActor)return;if(e.placement===n.db.PLACEMENT.RIGHTOF&&!r.nextActor)return;const a=void 0!==e.placement,s=!a,o=a?OS(AS):LS(AS),l=e.wrap?Dx.wrapLabel(e.message,AS.width-2*AS.wrapPadding,o):e.message,c=Dx.calculateTextDimensions(l,o).width+2*AS.wrapPadding;s&&e.from===r.nextActor?i[e.to]=Math.max(i[e.to]||0,c):s&&e.from===r.prevActor?i[e.from]=Math.max(i[e.from]||0,c):s&&e.from===e.to?(i[e.from]=Math.max(i[e.from]||0,c/2),i[e.to]=Math.max(i[e.to]||0,c/2)):e.placement===n.db.PLACEMENT.RIGHTOF?i[e.from]=Math.max(i[e.from]||0,c):e.placement===n.db.PLACEMENT.LEFTOF?i[r.prevActor]=Math.max(i[r.prevActor]||0,c):e.placement===n.db.PLACEMENT.OVER&&(r.prevActor&&(i[r.prevActor]=Math.max(i[r.prevActor]||0,c/2)),r.nextActor&&(i[e.from]=Math.max(i[e.from]||0,c/2)))}})),tb.debug("maxMessageWidthPerActor:",i),i}(h,d,i);AS.height=function(t,e){let n=0;Object.keys(t).forEach((e=>{const i=t[e];i.wrap&&(i.description=Dx.wrapLabel(i.description,AS.width-2*AS.wrapPadding,NS(AS)));const r=Dx.calculateTextDimensions(i.description,NS(AS));i.width=i.wrap?AS.width:Math.max(AS.width,r.width+2*AS.wrapPadding),i.height=i.wrap?Math.max(r.height,AS.height):AS.height,n=Math.max(n,i.height)}));for(const n in e){const i=t[n];if(!i)continue;const r=t[i.nextActor];if(!r)continue;const a=e[n]+AS.actorMargin-i.width/2-r.width/2;i.margin=Math.max(a,AS.actorMargin)}return Math.max(n,AS.height)}(h,f),SS.insertComputerIcon(c),SS.insertDatabaseIcon(c),SS.insertClockIcon(c),MS(c,h,u,0,AS,d);const g=YS(d,h,f,i);SS.insertArrowHead(c),SS.insertArrowCrossHead(c),SS.insertArrowFilledHead(c),SS.insertSequenceNumber(c);let y=1,m=1;const b=[];d.forEach((function(t){let e,n,r;switch(t.type){case i.db.LINETYPE.NOTE:n=t.noteModel,function(t,e){DS.bumpVerticalPos(AS.boxMargin),e.height=AS.boxMargin,e.starty=DS.getVerticalPos();const n=SS.getNoteRect();n.x=e.startx,n.y=e.starty,n.width=e.width||AS.width,n.class="note";const i=t.append("g"),r=SS.drawRect(i,n),a=SS.getTextObj();a.x=e.startx,a.y=e.starty,a.width=n.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=AS.noteFontFamily,a.fontSize=AS.noteFontSize,a.fontWeight=AS.noteFontWeight,a.anchor=AS.noteAlign,a.textMargin=AS.noteMargin,a.valign="center";const s=_S(i,a),o=Math.round(s.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));r.attr("height",o+2*AS.noteMargin),e.height+=o+2*AS.noteMargin,DS.bumpVerticalPos(o+2*AS.noteMargin),e.stopy=e.starty+o+2*AS.noteMargin,e.stopx=e.startx+n.width,DS.insert(e.startx,e.starty,e.stopx,e.stopy),DS.models.addNote(e)}(c,n);break;case i.db.LINETYPE.ACTIVE_START:DS.newActivation(t,c,h);break;case i.db.LINETYPE.ACTIVE_END:!function(t,e){const n=DS.endActivation(t);n.starty+18>e&&(n.starty=e-6,e+=12),SS.drawActivation(c,n,e,AS,FS(t.from.actor).length),DS.insert(n.startx,e-10,n.stopx,e)}(t,DS.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:$S(g,t,AS.boxMargin,AS.boxMargin+AS.boxTextMargin,(t=>DS.newLoop(t)));break;case i.db.LINETYPE.LOOP_END:e=DS.endLoop(),SS.drawLoop(c,e,"loop",AS),DS.bumpVerticalPos(e.stopy-DS.getVerticalPos()),DS.models.addLoop(e);break;case i.db.LINETYPE.RECT_START:$S(g,t,AS.boxMargin,AS.boxMargin,(t=>DS.newLoop(void 0,t.message)));break;case i.db.LINETYPE.RECT_END:e=DS.endLoop(),SS.drawBackgroundRect(c,e),DS.models.addLoop(e),DS.bumpVerticalPos(e.stopy-DS.getVerticalPos());break;case i.db.LINETYPE.OPT_START:$S(g,t,AS.boxMargin,AS.boxMargin+AS.boxTextMargin,(t=>DS.newLoop(t)));break;case i.db.LINETYPE.OPT_END:e=DS.endLoop(),SS.drawLoop(c,e,"opt",AS),DS.bumpVerticalPos(e.stopy-DS.getVerticalPos()),DS.models.addLoop(e);break;case i.db.LINETYPE.ALT_START:$S(g,t,AS.boxMargin,AS.boxMargin+AS.boxTextMargin,(t=>DS.newLoop(t)));break;case i.db.LINETYPE.ALT_ELSE:$S(g,t,AS.boxMargin+AS.boxTextMargin,AS.boxMargin,(t=>DS.addSectionToLoop(t)));break;case i.db.LINETYPE.ALT_END:e=DS.endLoop(),SS.drawLoop(c,e,"alt",AS),DS.bumpVerticalPos(e.stopy-DS.getVerticalPos()),DS.models.addLoop(e);break;case i.db.LINETYPE.PAR_START:$S(g,t,AS.boxMargin,AS.boxMargin+AS.boxTextMargin,(t=>DS.newLoop(t)));break;case i.db.LINETYPE.PAR_AND:$S(g,t,AS.boxMargin+AS.boxTextMargin,AS.boxMargin,(t=>DS.addSectionToLoop(t)));break;case i.db.LINETYPE.PAR_END:e=DS.endLoop(),SS.drawLoop(c,e,"par",AS),DS.bumpVerticalPos(e.stopy-DS.getVerticalPos()),DS.models.addLoop(e);break;case i.db.LINETYPE.AUTONUMBER:y=t.message.start||y,m=t.message.step||m,t.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:$S(g,t,AS.boxMargin,AS.boxMargin+AS.boxTextMargin,(t=>DS.newLoop(t)));break;case i.db.LINETYPE.CRITICAL_OPTION:$S(g,t,AS.boxMargin+AS.boxTextMargin,AS.boxMargin,(t=>DS.addSectionToLoop(t)));break;case i.db.LINETYPE.CRITICAL_END:e=DS.endLoop(),SS.drawLoop(c,e,"critical",AS),DS.bumpVerticalPos(e.stopy-DS.getVerticalPos()),DS.models.addLoop(e);break;case i.db.LINETYPE.BREAK_START:$S(g,t,AS.boxMargin,AS.boxMargin+AS.boxTextMargin,(t=>DS.newLoop(t)));break;case i.db.LINETYPE.BREAK_END:e=DS.endLoop(),SS.drawLoop(c,e,"break",AS),DS.bumpVerticalPos(e.stopy-DS.getVerticalPos()),DS.models.addLoop(e);break;default:try{r=t.msgModel,r.starty=DS.getVerticalPos(),r.sequenceIndex=y,r.sequenceVisible=i.db.showSequenceNumbers();const e=function(t,e){DS.bumpVerticalPos(10);const{startx:n,stopx:i,message:r}=e,a=ub.splitBreaks(r).length,s=Dx.calculateTextDimensions(r,LS(AS)),o=s.height/a;let l;e.height+=o,DS.bumpVerticalPos(o);let c=s.height-10;const h=s.width;if(n===i){l=DS.getVerticalPos()+c,AS.rightAngles||(c+=AS.boxMargin,l=DS.getVerticalPos()+c),c+=30;const t=Math.max(h/2,AS.width/2);DS.insert(n-t,DS.getVerticalPos()-10+c,i+t,DS.getVerticalPos()+30+c)}else c+=AS.boxMargin,l=DS.getVerticalPos()+c,DS.insert(n,l-10,i,l);return DS.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,DS.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}(0,r);b.push({messageModel:r,lineStartY:e}),DS.models.addMessage(r)}catch(t){tb.error("error while drawing message",t)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(y+=m)})),b.forEach((t=>function(t,e,n,i){const{startx:r,stopx:a,starty:s,message:o,type:l,sequenceIndex:c,sequenceVisible:h}=e,u=Dx.calculateTextDimensions(o,LS(AS)),d=SS.getTextObj();d.x=r,d.y=s+10,d.width=a-r,d.class="messageText",d.dy="1em",d.text=o,d.fontFamily=AS.messageFontFamily,d.fontSize=AS.messageFontSize,d.fontWeight=AS.messageFontWeight,d.anchor=AS.messageAlign,d.valign="center",d.textMargin=AS.wrapPadding,d.tspan=!1,_S(t,d);const p=u.width;let f;r===a?f=AS.rightAngles?t.append("path").attr("d",`M ${r},${n} H ${r+Math.max(AS.width/2,p/2)} V ${n+25} H ${r}`):t.append("path").attr("d","M "+r+","+n+" C "+(r+60)+","+(n-10)+" "+(r+60)+","+(n+30)+" "+r+","+(n+20)):(f=t.append("line"),f.attr("x1",r),f.attr("y1",n),f.attr("x2",a),f.attr("y2",n)),l===i.db.LINETYPE.DOTTED||l===i.db.LINETYPE.DOTTED_CROSS||l===i.db.LINETYPE.DOTTED_POINT||l===i.db.LINETYPE.DOTTED_OPEN?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0");let g="";AS.arrowMarkerAbsolute&&(g=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,g=g.replace(/\(/g,"\\("),g=g.replace(/\)/g,"\\)")),f.attr("stroke-width",2),f.attr("stroke","none"),f.style("fill","none"),l!==i.db.LINETYPE.SOLID&&l!==i.db.LINETYPE.DOTTED||f.attr("marker-end","url("+g+"#arrowhead)"),l!==i.db.LINETYPE.SOLID_POINT&&l!==i.db.LINETYPE.DOTTED_POINT||f.attr("marker-end","url("+g+"#filled-head)"),l!==i.db.LINETYPE.SOLID_CROSS&&l!==i.db.LINETYPE.DOTTED_CROSS||f.attr("marker-end","url("+g+"#crosshead)"),(h||AS.showSequenceNumbers)&&(f.attr("marker-start","url("+g+"#sequencenumber)"),t.append("text").attr("x",r).attr("y",n+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))}(c,t.messageModel,t.lineStartY,i))),AS.mirrorActors&&(DS.bumpVerticalPos(2*AS.boxMargin),MS(c,h,u,DS.getVerticalPos(),AS,d),DS.bumpVerticalPos(AS.boxMargin),kS(c,DS.getVerticalPos()));const _=BS(c,h,u,l),{bounds:x}=DS.getBounds();tb.debug("For line height fix Querying: #"+e+" .actor-line");re("#"+e+" .actor-line").attr("y2",x.stopy);let v=x.stopy-x.starty;v<_.maxHeight&&(v=_.maxHeight);let k=v+2*AS.diagramMarginY;AS.mirrorActors&&(k=k-AS.boxMargin+AS.bottomMarginAdj);let w=x.stopx-x.startx;w<_.maxWidth&&(w=_.maxWidth);const T=w+2*AS.diagramMarginX;p&&c.append("text").text(p).attr("x",(x.stopx-x.startx)/2-2*AS.diagramMarginX).attr("y",-25),Gx(c,k,T,AS.useMaxWidth);const C=p?40:0;c.attr("viewBox",x.startx-AS.diagramMarginX+" -"+(AS.diagramMarginY+C)+" "+T+" "+(k+C)),tb.debug("models:",DS.models)}};var zS=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,2],i=[1,3],r=[1,5],a=[1,7],s=[2,5],o=[1,15],l=[1,17],c=[1,21],h=[1,22],u=[1,23],d=[1,24],p=[1,37],f=[1,25],g=[1,26],y=[1,27],m=[1,28],b=[1,29],_=[1,32],x=[1,33],v=[1,34],k=[1,35],w=[1,36],T=[1,39],C=[1,40],E=[1,41],S=[1,42],A=[1,38],D=[1,45],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],O=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],N=[1,4,5,7,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],B={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,directive:6,SD:7,document:8,line:9,statement:10,classDefStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,class:42,CLASSENTITY_IDS:43,STYLECLASS:44,openDirective:45,typeDirective:46,closeDirective:47,":":48,argDirective:49,direction_tb:50,direction_bt:51,direction_rl:52,direction_lr:53,eol:54,";":55,EDGE_STATE:56,STYLE_SEPARATOR:57,left_of:58,right_of:59,open_directive:60,type_directive:61,arg_directive:62,close_directive:63,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",7:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"class",43:"CLASSENTITY_IDS",44:"STYLECLASS",48:":",50:"direction_tb",51:"direction_bt",52:"direction_rl",53:"direction_lr",55:";",56:"EDGE_STATE",57:"STYLE_SEPARATOR",58:"left_of",59:"right_of",60:"open_directive",61:"type_directive",62:"arg_directive",63:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[10,2],[10,2],[10,1],[11,3],[11,3],[12,3],[6,3],[6,5],[32,1],[32,1],[32,1],[32,1],[54,1],[54,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1],[45,1],[46,1],[49,1],[47,1]],performAction:function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 4:return i.setRootDoc(a[o]),a[o];case 5:this.$=[];break;case 6:"nl"!=a[o]&&(a[o-1].push(a[o]),this.$=a[o-1]);break;case 7:case 8:case 12:this.$=a[o];break;case 9:this.$="nl";break;case 13:const t=a[o-1];t.description=i.trimColon(a[o]),this.$=t;break;case 14:this.$={stmt:"relation",state1:a[o-2],state2:a[o]};break;case 15:const e=i.trimColon(a[o]);this.$={stmt:"relation",state1:a[o-3],state2:a[o-1],description:e};break;case 19:this.$={stmt:"state",id:a[o-3],type:"default",description:"",doc:a[o-1]};break;case 20:var l=a[o],c=a[o-2].trim();if(a[o].match(":")){var h=a[o].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:a[o-3],type:"default",description:a[o-5],doc:a[o-1]};break;case 22:this.$={stmt:"state",id:a[o],type:"fork"};break;case 23:this.$={stmt:"state",id:a[o],type:"join"};break;case 24:this.$={stmt:"state",id:a[o],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[o-1].trim(),note:{position:a[o-2].trim(),text:a[o].trim()}};break;case 30:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 31:case 32:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 33:case 34:this.$={stmt:"classDef",id:a[o-1].trim(),classes:a[o].trim()};break;case 35:this.$={stmt:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:a[o].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:a[o-2].trim(),classes:[a[o].trim()],type:"default",description:""};break;case 50:i.parseDirective("%%{","open_directive");break;case 51:i.parseDirective(a[o],"type_directive");break;case 52:a[o]=a[o].trim().replace(/'/g,'"'),i.parseDirective(a[o],"arg_directive");break;case 53:i.parseDirective("}%%","close_directive","state")}},table:[{3:1,4:n,5:i,6:4,7:r,45:6,60:a},{1:[3]},{3:8,4:n,5:i,6:4,7:r,45:6,60:a},{3:9,4:n,5:i,6:4,7:r,45:6,60:a},{3:10,4:n,5:i,6:4,7:r,45:6,60:a},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],s,{8:11}),{46:12,61:[1,13]},{61:[2,50]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:o,5:l,6:30,9:14,10:16,11:18,12:19,13:20,16:c,17:h,19:u,22:d,24:p,25:f,26:g,27:y,28:m,29:b,32:31,33:_,35:x,37:v,38:k,42:w,45:6,50:T,51:C,52:E,53:S,56:A,60:a},{47:43,48:[1,44],63:D},e([48,63],[2,51]),e(L,[2,6]),{6:30,10:46,11:18,12:19,13:20,16:c,17:h,19:u,22:d,24:p,25:f,26:g,27:y,28:m,29:b,32:31,33:_,35:x,37:v,38:k,42:w,45:6,50:T,51:C,52:E,53:S,56:A,60:a},e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(L,[2,11]),e(L,[2,12],{14:[1,47],15:[1,48]}),e(L,[2,16]),{18:[1,49]},e(L,[2,18],{20:[1,50]}),{23:[1,51]},e(L,[2,22]),e(L,[2,23]),e(L,[2,24]),e(L,[2,25]),{30:52,31:[1,53],58:[1,54],59:[1,55]},e(L,[2,28]),e(L,[2,29]),{34:[1,56]},{36:[1,57]},e(L,[2,32]),{39:[1,58],41:[1,59]},{43:[1,60]},e(O,[2,44],{57:[1,61]}),e(O,[2,45],{57:[1,62]}),e(L,[2,38]),e(L,[2,39]),e(L,[2,40]),e(L,[2,41]),e(N,[2,36]),{49:63,62:[1,64]},e(N,[2,53]),e(L,[2,7]),e(L,[2,13]),{13:65,24:p,56:A},e(L,[2,17]),e(M,s,{8:66}),{24:[1,67]},{24:[1,68]},{23:[1,69]},{24:[2,48]},{24:[2,49]},e(L,[2,30]),e(L,[2,31]),{40:[1,70]},{40:[1,71]},{44:[1,72]},{24:[1,73]},{24:[1,74]},{47:75,63:D},{63:[2,52]},e(L,[2,14],{14:[1,76]}),{4:o,5:l,6:30,9:14,10:16,11:18,12:19,13:20,16:c,17:h,19:u,21:[1,77],22:d,24:p,25:f,26:g,27:y,28:m,29:b,32:31,33:_,35:x,37:v,38:k,42:w,45:6,50:T,51:C,52:E,53:S,56:A,60:a},e(L,[2,20],{20:[1,78]}),{31:[1,79]},{24:[1,80]},e(L,[2,33]),e(L,[2,34]),e(L,[2,35]),e(O,[2,46]),e(O,[2,47]),e(N,[2,37]),e(L,[2,15]),e(L,[2,19]),e(M,s,{8:81}),e(L,[2,26]),e(L,[2,27]),{4:o,5:l,6:30,9:14,10:16,11:18,12:19,13:20,16:c,17:h,19:u,21:[1,82],22:d,24:p,25:f,26:g,27:y,28:m,29:b,32:31,33:_,35:x,37:v,38:k,42:w,45:6,50:T,51:C,52:E,53:S,56:A,60:a},e(L,[2,21])],defaultActions:{7:[2,50],8:[2,1],9:[2,2],10:[2,3],54:[2,48],55:[2,49],64:[2,52]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],a=[],s=this.table,o="",l=0,c=0,h=1,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var y=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||d.lex()||h)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,_,x,v,k,w,T,C,E={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==b&&(b=m()),x=s[_]&&s[_][b]),void 0===x||!x.length||!x[0]){var S="";for(k in C=[],s[_])this.terminals_[k]&&k>2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},I=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return 41;case 1:case 44:return 50;case 2:case 45:return 51;case 3:case 46:return 52;case 4:case 47:return 53;case 5:return this.begin("open_directive"),60;case 6:return this.begin("type_directive"),61;case 7:return this.popState(),this.begin("arg_directive"),48;case 8:return this.popState(),this.popState(),63;case 9:return 62;case 10:case 11:case 13:case 14:case 15:case 16:case 56:case 58:case 64:break;case 12:case 79:return 5;case 17:case 34:return this.pushState("SCALE"),17;case 18:case 35:return 18;case 19:case 25:case 36:case 51:case 54:this.popState();break;case 20:return this.begin("acc_title"),33;case 21:return this.popState(),"acc_title_value";case 22:return this.begin("acc_descr"),35;case 23:return this.popState(),"acc_descr_value";case 24:this.begin("acc_descr_multiline");break;case 26:return"acc_descr_multiline_value";case 27:return this.pushState("CLASSDEF"),38;case 28:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 29:return this.popState(),this.pushState("CLASSDEFID"),39;case 30:return this.popState(),40;case 31:return this.pushState("CLASS"),42;case 32:return this.popState(),this.pushState("CLASS_STYLE"),43;case 33:return this.popState(),44;case 37:this.pushState("STATE");break;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 40:case 43:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 48:this.begin("STATE_STRING");break;case 49:return this.popState(),this.pushState("STATE_ID"),"AS";case 50:case 66:return this.popState(),"ID";case 52:return"STATE_DESCR";case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 57:return this.popState(),21;case 59:return this.begin("NOTE"),29;case 60:return this.popState(),this.pushState("NOTE_ID"),58;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:this.popState(),this.pushState("FLOATING_NOTE");break;case 63:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:return"NOTE_TEXT";case 67:return this.popState(),this.pushState("NOTE_TEXT"),24;case 68:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 69:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 70:case 71:return 7;case 72:return 16;case 73:return 56;case 74:return 24;case 75:return e.yytext=e.yytext.trim(),14;case 76:return 15;case 77:return 28;case 78:return 57;case 80:return"INVALID"}},rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[14,15],inclusive:!1},close_directive:{rules:[14,15],inclusive:!1},arg_directive:{rules:[8,9,14,15],inclusive:!1},type_directive:{rules:[7,8,14,15],inclusive:!1},open_directive:{rules:[6,14,15],inclusive:!1},struct:{rules:[14,15,27,31,37,44,45,46,47,56,57,58,59,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[66],inclusive:!1},FLOATING_NOTE:{rules:[63,64,65],inclusive:!1},NOTE_TEXT:{rules:[68,69],inclusive:!1},NOTE_ID:{rules:[67],inclusive:!1},NOTE:{rules:[60,61,62],inclusive:!1},CLASS_STYLE:{rules:[33],inclusive:!1},CLASS:{rules:[32],inclusive:!1},CLASSDEFID:{rules:[30],inclusive:!1},CLASSDEF:{rules:[28,29],inclusive:!1},acc_descr_multiline:{rules:[25,26],inclusive:!1},acc_descr:{rules:[23],inclusive:!1},acc_title:{rules:[21],inclusive:!1},SCALE:{rules:[18,19,35,36],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[50],inclusive:!1},STATE_STRING:{rules:[51,52],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[14,15,38,39,40,41,42,43,48,49,53,54,55],inclusive:!1},ID:{rules:[14,15],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,10,11,12,13,15,16,17,20,22,24,27,31,34,37,55,59,70,71,72,73,74,75,76,78,79,80],inclusive:!0}}},t);function F(){this.yy={}}return B.lexer=I,F.prototype=B,B.Parser=F,new F}();zS.parser=zS;const US=zS,WS=(t,e)=>{var n;return"dagre-wrapper"!==(null==(n=null==e?void 0:e.state)?void 0:n.defaultRenderer)&&null!==t.match(/^\s*stateDiagram/)},HS=(t,e)=>{var n;return null!==t.match(/^\s*stateDiagram-v2/)||!(!t.match(/^\s*stateDiagram/)||"dagre-wrapper"!==(null==(n=null==e?void 0:e.state)?void 0:n.defaultRenderer))},qS="state",VS="relation",GS="default",XS="divider",ZS="[*]",QS="start",KS=ZS,JS="end",tA="color",eA="fill";let nA="LR",iA=[],rA={};let aA={root:{relations:[],states:{},documents:{}}},sA=aA.root,oA=0,lA=0;const cA=t=>JSON.parse(JSON.stringify(t)),hA=(t,e,n)=>{if(e.stmt===VS)hA(t,e.state1,!0),hA(t,e.state2,!1);else if(e.stmt===qS&&"[*]"===e.id&&(e.id=n?t.id+"_start":t.id+"_end",e.start=n),e.doc){const t=[];let n,i=[];for(n=0;n0&&i.length>0){const n={stmt:qS,id:mx(),type:"divider",doc:cA(i)};t.push(cA(n)),e.doc=t}e.doc.forEach((t=>hA(e,t,!0)))}},uA=function(t,e=GS,n=null,i=null,r=null,a=null,s=null,o=null){if(void 0===sA.states[t]?(tb.info("Adding state ",t,i),sA.states[t]={id:t,descriptions:[],type:e,doc:n,note:r,classes:[],styles:[],textStyles:[]}):(sA.states[t].doc||(sA.states[t].doc=n),sA.states[t].type||(sA.states[t].type=e)),i&&(tb.info("Setting state description",t,i),"string"==typeof i&&mA(t,i.trim()),"object"==typeof i&&i.forEach((e=>mA(t,e.trim())))),r&&(sA.states[t].note=r,sA.states[t].note.text=ub.sanitizeText(sA.states[t].note.text,jx())),a){tb.info("Setting state classes",t,a);("string"==typeof a?[a]:a).forEach((e=>_A(t,e.trim())))}if(s){tb.info("Setting state styles",t,s);("string"==typeof s?[s]:s).forEach((e=>xA(t,e.trim())))}if(o){tb.info("Setting state styles",t,s);("string"==typeof o?[o]:o).forEach((e=>vA(t,e.trim())))}},dA=function(t){aA={root:{relations:[],states:{},documents:{}}},sA=aA.root,oA=0,rA={},t||Cv()},pA=function(t){return sA.states[t]};function fA(t=""){let e=t;return t===ZS&&(oA++,e=`${QS}${oA}`),e}function gA(t="",e=GS){return t===ZS?QS:e}const yA=function(t,e,n){if("object"==typeof t)!function(t,e,n){let i=fA(t.id),r=gA(t.id,t.type),a=fA(e.id),s=gA(e.id,e.type);uA(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),uA(a,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),sA.relations.push({id1:i,id2:a,relationTitle:ub.sanitizeText(n,jx())})}(t,e,n);else{const i=fA(t),r=gA(t),a=function(t=""){let e=t;return t===KS&&(oA++,e=`${JS}${oA}`),e}(e),s=function(t="",e=GS){return t===KS?JS:e}(e);uA(i,r),uA(a,s),sA.relations.push({id1:i,id2:a,title:ub.sanitizeText(n,jx())})}},mA=function(t,e){const n=sA.states[t],i=e.startsWith(":")?e.replace(":","").trim():e;n.descriptions.push(ub.sanitizeText(i,jx()))},bA=function(t,e=""){void 0===rA[t]&&(rA[t]={id:t,styles:[],textStyles:[]});const n=rA[t];null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(t.match(tA)){const t=e.replace(eA,"bgFill").replace(tA,eA);n.textStyles.push(t)}n.styles.push(e)}))},_A=function(t,e){t.split(",").forEach((function(t){let n=pA(t);if(void 0===n){const e=t.trim();uA(e),n=pA(e)}n.classes.push(e)}))},xA=function(t,e){const n=pA(t);void 0!==n&&n.textStyles.push(e)},vA=function(t,e){const n=pA(t);void 0!==n&&n.textStyles.push(e)},kA={parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().state,addState:uA,clear:dA,getState:pA,getStates:function(){return sA.states},getRelations:function(){return sA.relations},getClasses:function(){return rA},getDirection:()=>nA,addRelation:yA,getDividerId:()=>(lA++,"divider-id-"+lA),setDirection:t=>{nA=t},cleanupLabel:function(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()},lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},logDocuments:function(){tb.info("Documents = ",aA)},getRootDoc:()=>iA,setRootDoc:t=>{tb.info("Setting root doc",t),iA=t},getRootDocV2:()=>(hA({id:"root"},{id:"root",doc:iA},!0),{id:"root",doc:iA}),extract:t=>{let e;e=t.doc?t.doc:t,tb.info(e),dA(!0),tb.info("Extract",e),e.forEach((t=>{switch(t.stmt){case qS:uA(t.id,t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case VS:yA(t.state1,t.state2,t.description);break;case"classDef":bA(t.id,t.classes);break;case"applyClass":_A(t.id,t.styleClass)}}))},trimColon:t=>t&&":"===t[0]?t.substr(1).trim():t.trim(),getAccTitle:Sv,setAccTitle:Ev,getAccDescription:Dv,setAccDescription:Av,addStyleClass:bA,setCssClass:_A,addDescription:mA,setDiagramTitle:Lv,getDiagramTitle:Ov},wA=(t,e)=>{const n=t.append("text").attr("x",2*jx().state.padding).attr("y",jx().state.textHeight+1.3*jx().state.padding).attr("font-size",jx().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),i=n.height,r=t.append("text").attr("x",jx().state.padding).attr("y",i+.4*jx().state.padding+jx().state.dividerMargin+jx().state.textHeight).attr("class","state-description");let a=!0,s=!0;e.descriptions.forEach((function(t){a||(!function(t,e,n){const i=t.append("tspan").attr("x",2*jx().state.padding).text(e);n||i.attr("dy",jx().state.textHeight)}(r,t,s),s=!1),a=!1}));const o=t.append("line").attr("x1",jx().state.padding).attr("y1",jx().state.padding+i+jx().state.dividerMargin/2).attr("y2",jx().state.padding+i+jx().state.dividerMargin/2).attr("class","descr-divider"),l=r.node().getBBox(),c=Math.max(l.width,n.width);return o.attr("x2",c+3*jx().state.padding),t.insert("rect",":first-child").attr("x",jx().state.padding).attr("y",jx().state.padding).attr("width",c+2*jx().state.padding).attr("height",l.height+i+2*jx().state.padding).attr("rx",jx().state.radius),t},TA=(t,e,n)=>{const i=jx().state.padding,r=2*jx().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",jx().state.titleShift).attr("font-size",jx().state.fontSize).attr("class","state-title").text(e.id),c=l.node().getBBox().width+r;let h,u=Math.max(c,s);u===s&&(u+=r);const d=t.node().getBBox();e.doc,h=o-i,c>s&&(h=(s-u)/2+i),Math.abs(o-d.x)s&&(h=o-(c-s)/2);const p=1-jx().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",p).attr("class",n?"alt-composit":"composit").attr("width",u).attr("height",d.height+jx().state.textHeight+jx().state.titleShift+1).attr("rx","0"),l.attr("x",h+i),c<=s&&l.attr("x",o+(u-r)/2-c/2+i),t.insert("rect",":first-child").attr("x",h).attr("y",jx().state.titleShift-jx().state.textHeight-jx().state.padding).attr("width",u).attr("height",3*jx().state.textHeight).attr("rx",jx().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",jx().state.titleShift-jx().state.textHeight-jx().state.padding).attr("width",u).attr("height",d.height+3+2*jx().state.textHeight).attr("rx",jx().state.radius),t},CA=(t,e)=>{e.attr("class","state-note");const n=e.append("rect").attr("x",0).attr("y",jx().state.padding),i=e.append("g"),{textWidth:r,textHeight:a}=((t,e,n,i)=>{let r=0;const a=i.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
");s=s.replace(/\n/g,"
");const o=s.split(ub.lineBreakRegex);let l=1.25*jx().state.noteMargin;for(const t of o){const i=t.trim();if(i.length>0){const t=a.append("tspan");t.text(i),0===l&&(l+=t.node().getBBox().height),r+=l,t.attr("x",e+jx().state.noteMargin),t.attr("y",n+r+1.25*jx().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:r}})(t,0,0,i);return n.attr("height",a+2*jx().state.noteMargin),n.attr("width",r+2*jx().state.noteMargin),n},EA=function(t,e){const n=e.id,i={id:n,label:e.id,width:0,height:0},r=t.append("g").attr("id",n).attr("class","stateGroup");"start"===e.type&&(t=>{t.append("circle").attr("class","start-state").attr("r",jx().state.sizeUnit).attr("cx",jx().state.padding+jx().state.sizeUnit).attr("cy",jx().state.padding+jx().state.sizeUnit)})(r),"end"===e.type&&(t=>{t.append("circle").attr("class","end-state-outer").attr("r",jx().state.sizeUnit+jx().state.miniPadding).attr("cx",jx().state.padding+jx().state.sizeUnit+jx().state.miniPadding).attr("cy",jx().state.padding+jx().state.sizeUnit+jx().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",jx().state.sizeUnit).attr("cx",jx().state.padding+jx().state.sizeUnit+2).attr("cy",jx().state.padding+jx().state.sizeUnit+2)})(r),"fork"!==e.type&&"join"!==e.type||((t,e)=>{let n=jx().state.forkWidth,i=jx().state.forkHeight;if(e.parentId){let t=n;n=i,i=t}t.append("rect").style("stroke","black").style("fill","black").attr("width",n).attr("height",i).attr("x",jx().state.padding).attr("y",jx().state.padding)})(r,e),"note"===e.type&&CA(e.note.text,r),"divider"===e.type&&(t=>{t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",jx().state.textHeight).attr("class","divider").attr("x2",2*jx().state.textHeight).attr("y1",0).attr("y2",0)})(r),"default"===e.type&&0===e.descriptions.length&&((t,e)=>{const n=t.append("text").attr("x",2*jx().state.padding).attr("y",jx().state.textHeight+2*jx().state.padding).attr("font-size",jx().state.fontSize).attr("class","state-title").text(e.id),i=n.node().getBBox();t.insert("rect",":first-child").attr("x",jx().state.padding).attr("y",jx().state.padding).attr("width",i.width+2*jx().state.padding).attr("height",i.height+2*jx().state.padding).attr("rx",jx().state.radius)})(r,e),"default"===e.type&&e.descriptions.length>0&&wA(r,e);const a=r.node().getBBox();return i.width=a.width+2*jx().state.padding,i.height=a.height+2*jx().state.padding,i};let SA=0;let AA;const DA={},LA=t=>t?t.length*AA.fontSizeFactor:1,OA=(t,e,n,i,r,a,s)=>{const o=new yy({compound:!0,multigraph:!0});let l,c=!0;for(l=0;l{const e=t.parentElement;let n=0,i=0;e&&(e.parentElement&&(n=e.parentElement.getBBox().width),i=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(i)&&(i=0)),t.setAttribute("x1",0-i+8),t.setAttribute("x2",n-i-8)}))}else tb.debug("No Node "+t+": "+JSON.stringify(o.node(t)))}));let g=f.getBBox();o.edges().forEach((function(t){void 0!==t&&void 0!==o.edge(t)&&(tb.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(o.edge(t))),function(t,e,n){e.points=e.points.filter((t=>!Number.isNaN(t.y)));const i=e.points,r=Js().x((function(t){return t.x})).y((function(t){return t.y})).curve(ao),a=t.append("path").attr("d",r(i)).attr("id","edge"+SA).attr("class","transition");let s="";if(jx().state.arrowMarkerAbsolute&&(s=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,s=s.replace(/\(/g,"\\("),s=s.replace(/\)/g,"\\)")),a.attr("marker-end","url("+s+"#"+function(t){switch(t){case kA.relationType.AGGREGATION:return"aggregation";case kA.relationType.EXTENSION:return"extension";case kA.relationType.COMPOSITION:return"composition";case kA.relationType.DEPENDENCY:return"dependency"}}(kA.relationType.DEPENDENCY)+"End)"),void 0!==n.title){const i=t.append("g").attr("class","stateLabel"),{x:r,y:a}=Dx.calcLabelPosition(e.points),s=ub.getRows(n.title);let o=0;const l=[];let c=0,h=0;for(let t=0;t<=s.length;t++){const e=i.append("text").attr("text-anchor","middle").text(s[t]).attr("x",r).attr("y",a+o),n=e.node().getBBox();if(c=Math.max(c,n.width),h=Math.min(h,n.x),tb.info(n.x,r,a+o),0===o){const t=e.node().getBBox();o=t.height,tb.info("Title height",o,a)}l.push(e)}let u=o*s.length;if(s.length>1){const t=(s.length-1)*o*.5;l.forEach(((e,n)=>e.attr("y",a+n*o-t))),u=o*s.length}const d=i.node().getBBox();i.insert("rect",":first-child").attr("class","box").attr("x",r-c/2-jx().state.padding/2).attr("y",a-u/2-jx().state.padding/2-3.5).attr("width",c+jx().state.padding).attr("height",u+jx().state.padding),tb.info(d)}SA++}(e,o.edge(t),o.edge(t).relation))})),g=f.getBBox();const y={id:n||"root",label:n||"root",width:0,height:0};return y.width=g.width+2*AA.padding,y.height=g.height+2*AA.padding,tb.debug("Doc rendered",y,o),y},NA={setConf:function(){},draw:function(t,e,n,i){AA=jx().state;const r=jx().securityLevel;let a;"sandbox"===r&&(a=ie("#i"+e));const s=ie("sandbox"===r?a.nodes()[0].contentDocument.body:"body"),o="sandbox"===r?a.nodes()[0].contentDocument:document;tb.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);l.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z");new yy({multigraph:!0,compound:!0,rankdir:"RL"}).setDefaultEdgeLabel((function(){return{}}));const c=i.db.getRootDoc();OA(c,l,void 0,!1,s,o,i);const h=AA.padding,u=l.node().getBBox(),d=u.width+2*h,p=u.height+2*h;Gx(l,p,1.75*d,AA.useMaxWidth),l.attr("viewBox",`${u.x-AA.padding} ${u.y-AA.padding} `+d+" "+p)}},MA="rect",BA="rectWithTitle",IA="statediagram",FA=`${IA}-state`,RA="transition",$A=`${RA} note-edge`,PA=`${IA}-note`,YA=`${IA}-cluster`,jA=`${IA}-cluster-alt`,zA="parent",UA="note",WA="state",HA="----",qA=`${HA}${UA}`,VA=`${HA}${zA}`,GA="fill:none",XA="fill: #333",ZA="text",QA="normal";let KA={},JA=0;function tD(t="",e=0,n="",i=HA){const r=null!==n&&n.length>0?`${i}${n}`:"";return`${WA}-${t}${r}-${e}`}const eD=(t,e,n,i,r,a)=>{const s=n.id,o=null==(l=i[s])?"":l.classes?l.classes.join(" "):"";var l;if("root"!==s){let e=MA;!0===n.start&&(e="start"),!1===n.start&&(e="end"),n.type!==GS&&(e=n.type),KA[s]||(KA[s]={id:s,shape:e,description:ub.sanitizeText(s,jx()),classes:`${o} ${FA}`});const i=KA[s];n.description&&(Array.isArray(i.description)?(i.shape=BA,i.description.push(n.description)):i.description.length>0?(i.shape=BA,i.description===s?i.description=[n.description]:i.description=[i.description,n.description]):(i.shape=MA,i.description=n.description),i.description=ub.sanitizeTextOrArray(i.description,jx())),1===i.description.length&&i.shape===BA&&(i.shape=MA),!i.type&&n.doc&&(tb.info("Setting cluster for ",s,iD(n)),i.type="group",i.dir=iD(n),i.shape=n.type===XS?"divider":"roundedWithTitle",i.classes=i.classes+" "+YA+" "+(a?jA:""));const r={labelStyle:"",shape:i.shape,labelText:i.description,classes:i.classes,style:"",id:s,dir:i.dir,domId:tD(s,JA),type:i.type,padding:15};if(n.note){const e={labelStyle:"",shape:"note",labelText:n.note.text,classes:PA,style:"",id:s+qA+"-"+JA,domId:tD(s,JA,UA),type:i.type,padding:15},a={labelStyle:"",shape:"noteGroup",labelText:n.note.text,classes:i.classes,style:"",id:s+VA,domId:tD(s,JA,zA),type:"group",padding:0};JA++;const o=s+VA;t.setNode(o,a),t.setNode(e.id,e),t.setNode(s,r),t.setParent(s,o),t.setParent(e.id,o);let l=s,c=e.id;"left of"===n.note.position&&(l=e.id,c=s),t.setEdge(l,c,{arrowhead:"none",arrowType:"",style:GA,labelStyle:"",classes:$A,arrowheadStyle:XA,labelpos:"c",labelType:ZA,thickness:QA})}else t.setNode(s,r)}e&&"root"!==e.id&&(tb.trace("Setting node ",s," to be child of its parent ",e.id),t.setParent(s,e.id)),n.doc&&(tb.trace("Adding nodes children "),nD(t,n,n.doc,i,r,!a))},nD=(t,e,n,i,r,a)=>{tb.trace("items",n),n.forEach((n=>{switch(n.stmt){case qS:case GS:eD(t,e,n,i,r,a);break;case VS:{eD(t,e,n.state1,i,r,a),eD(t,e,n.state2,i,r,a);const s={id:"edge"+JA,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:GA,labelStyle:"",label:ub.sanitizeText(n.description,jx()),arrowheadStyle:XA,labelpos:"c",labelType:ZA,thickness:QA,classes:RA};t.setEdge(n.state1.id,n.state2.id,s,JA),JA++}}}))},iD=(t,e="TB")=>{let n=e;if(t.doc)for(let e=0;e2&&C.push("'"+this.terminals_[k]+"'");S=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(x[0]){case 1:n.push(b),r.push(d.yytext),a.push(d.yylloc),n.push(x[1]),b=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(w=this.productions_[x[1]][1],E.$=r[r.length-w],E._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},y&&(E._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,x[1],r,a].concat(u))))return v;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[x[1]][0]),r.push(E.$),a.push(E._$),T=s[n[n.length-2]][n[n.length-1]],n.push(T);break;case 3:return!0}}return!0}},f=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;ae[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),26;case 1:return this.begin("type_directive"),27;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),29;case 4:return 28;case 5:case 6:case 8:case 9:break;case 7:return 11;case 10:return 4;case 11:return 17;case 12:return this.begin("acc_title"),18;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),20;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:return 23;case 20:return 24;case 21:return 25;case 22:return 15;case 23:return 6;case 24:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23,24],inclusive:!0}}},t);function g(){this.yy={}}return p.lexer=f,g.prototype=p,p.Parser=g,new g}();aD.parser=aD;const sD=aD,oD=t=>null!==t.match(/^\s*journey/);let lD="";const cD=[],hD=[],uD=[],dD=function(){let t=!0;for(const[e,n]of uD.entries())uD[e].processed,t=t&&n.processed;return t},pD={parseDirective:function(t,e,n){nL.parseDirective(this,t,e,n)},getConfig:()=>jx().journey,clear:function(){cD.length=0,hD.length=0,lD="",uD.length=0,Cv()},setDiagramTitle:Lv,getDiagramTitle:Ov,setAccTitle:Ev,getAccTitle:Sv,setAccDescription:Av,getAccDescription:Dv,addSection:function(t){lD=t,cD.push(t)},getSections:function(){return cD},getTasks:function(){let t=dD();let e=0;for(;!t&&e<100;)t=dD(),e++;return hD.push(...uD),hD},addTask:function(t,e){const n=e.substr(1).split(":");let i=0,r=[];1===n.length?(i=Number(n[0]),r=[]):(i=Number(n[0]),r=n[1].split(","));const a=r.map((t=>t.trim())),s={section:lD,type:lD,people:a,task:t,score:i};uD.push(s)},addTaskOrg:function(t){const e={section:lD,type:lD,description:t,task:t,classes:[]};hD.push(e)},getActors:function(){return function(){const t=[];return hD.forEach((e=>{e.people&&t.push(...e.people)})),[...new Set(t)].sort()}()}},fD=function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},gD=function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},yD=function(t,e){const n=e.text.replace(/
/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),i};let mD=-1;const bD=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},_D=function(){function t(t,e,n,r,a,s,o,l){i(e.append("text").attr("x",n+a/2).attr("y",r+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,r,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(/
/gi);for(let t=0;t3?function(t){const i=Vs().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(n/2).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}(r):e.score<3?function(t){const i=Vs().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(n/2).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}(r):r.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}(r,{cx:i,cy:300+30*(5-e.score),score:e.score});const a=bD();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,fD(r,a);let s=e.x+14;e.people.forEach((t=>{const n=e.actors[t].color,i={cx:s,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};gD(r,i),s+=10})),_D(n)(e.task,r,a.x,a.y,a.width,a.height,{class:"task"},n,e.colour)},drawBackgroundRect:function(t,e){fD(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},getTextObj:function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},getNoteRect:bD,initGraphics:function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")}},vD={};const kD=jx().journey,wD=kD.leftMargin,TD={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},updateBounds:function(t,e,n,i){const r=jx().journey,a=this;let s=0;var o;this.sequenceItems.forEach((function(l){s++;const c=a.sequenceItems.length-s+1;a.updateVal(l,"starty",e-c*r.boxMargin,Math.min),a.updateVal(l,"stopy",i+c*r.boxMargin,Math.max),a.updateVal(TD.data,"startx",t-c*r.boxMargin,Math.min),a.updateVal(TD.data,"stopx",n+c*r.boxMargin,Math.max),"activation"!==o&&(a.updateVal(l,"startx",t-c*r.boxMargin,Math.min),a.updateVal(l,"stopx",n+c*r.boxMargin,Math.max),a.updateVal(TD.data,"starty",e-c*r.boxMargin,Math.min),a.updateVal(TD.data,"stopy",i+c*r.boxMargin,Math.max))}))},insert:function(t,e,n,i){const r=Math.min(t,n),a=Math.max(t,n),s=Math.min(e,i),o=Math.max(e,i);this.updateVal(TD.data,"startx",r,Math.min),this.updateVal(TD.data,"starty",s,Math.min),this.updateVal(TD.data,"stopx",a,Math.max),this.updateVal(TD.data,"stopy",o,Math.max),this.updateBounds(r,s,a,o)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},CD=kD.sectionFills,ED=kD.sectionColours,SD=function(t,e,n){const i=jx().journey;let r="";const a=n+(2*i.height+i.diagramMarginY);let s=0,o="#CCC",l="black",c=0;for(const[n,h]of e.entries()){if(r!==h.section){o=CD[s%CD.length],c=s%CD.length,l=ED[s%ED.length];const e={x:n*i.taskMargin+n*i.width+wD,y:50,text:h.section,fill:o,num:c,colour:l};xD.drawSection(t,e,i),r=h.section,s++}const e=h.people.reduce(((t,e)=>(vD[e]&&(t[e]=vD[e]),t)),{});h.x=n*i.taskMargin+n*i.width+wD,h.y=a,h.width=i.diagramMarginX,h.height=i.diagramMarginY,h.colour=l,h.fill=o,h.num=c,h.actors=e,xD.drawTask(t,h,i),TD.insert(h.x,h.y,h.x+h.width+i.taskMargin,450)}},AD={setConf:function(t){Object.keys(t).forEach((function(e){kD[e]=t[e]}))},draw:function(t,e,n,i){const r=jx().journey;i.db.clear(),i.parser.parse(t+"\n");const a=jx().securityLevel;let s;"sandbox"===a&&(s=ie("#i"+e));const o=ie("sandbox"===a?s.nodes()[0].contentDocument.body:"body");TD.init();const l=o.select("#"+e);xD.initGraphics(l);const c=i.db.getTasks(),h=i.db.getDiagramTitle(),u=i.db.getActors();for(const t in vD)delete vD[t];let d=0;u.forEach((t=>{vD[t]={color:r.actorColours[d%r.actorColours.length],position:d},d++})),function(t){const e=jx().journey;let n=60;Object.keys(vD).forEach((i=>{const r=vD[i].color,a={cx:20,cy:n,r:7,fill:r,stroke:"#000",pos:vD[i].position};xD.drawCircle(t,a);const s={x:40,y:n+7,fill:"#666",text:i,textMargin:5|e.boxTextMargin};xD.drawText(t,s),n+=20}))}(l),TD.insert(0,0,wD,50*Object.keys(vD).length),SD(l,c,0);const p=TD.getBounds();h&&l.append("text").text(h).attr("x",wD).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const f=p.stopy-p.starty+2*r.diagramMarginY,g=wD+p.stopx+2*r.diagramMarginX;Gx(l,f,g,r.useMaxWidth),l.append("line").attr("x1",wD).attr("y1",4*r.height).attr("x2",g-wD-4).attr("y2",4*r.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const y=h?70:0;l.attr("viewBox",`${p.startx} -25 ${g} ${f+y}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",f+y+25)}};let DD={};const LD={setConf:function(t){DD={...DD,...t}},draw:(t,e,n)=>{try{tb.debug("Renering svg for syntax error\n");const t=ie("#"+e),i=t.append("g");i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in graph"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text("mermaid version "+n),t.attr("height",100),t.attr("width",500),t.attr("viewBox","768 0 912 512")}catch(t){tb.error("Error while rendering info diagram"),tb.error((i=t)instanceof Error?i.message:String(i))}var i}};let OD=!1;const ND=()=>{OD||(OD=!0,yv("error",{db:{clear:()=>{}},styles:Kx,renderer:LD,parser:{parser:{yy:{}},parse:()=>{}},init:()=>{}},(t=>"error"===t.toLowerCase().trim())),yv("c4",{parser:dk,db:Sk,renderer:aw,styles:ov,init:t=>{aw.setConf(t.c4)}},pk),yv("class",{parser:ow,db:Cw,renderer:$w,styles:Zx,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Cw.clear()}},lw),yv("classDiagram",{parser:ow,db:Cw,renderer:wT,styles:Zx,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Cw.clear()}},cw),yv("er",{parser:CT,db:LT,renderer:jT,styles:Qx},ET),yv("gantt",{parser:TC,db:iE,renderer:sE,styles:tv},CC),yv("info",{parser:lE,db:uE,renderer:dE,styles:ev},pE),yv("pie",{parser:gE,db:_E,renderer:wE,styles:nv},yE),yv("requirement",{parser:CE,db:NE,renderer:UE,styles:iv},EE),yv("sequence",{parser:HE,db:hS,renderer:jS,styles:rv,init:t=>{if(t.sequence||(t.sequence={}),t.sequence.arrowMarkerAbsolute=t.arrowMarkerAbsolute,"sequenceDiagram"in t)throw new Error("`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.");hS.setWrap(t.wrap),jS.setConf(t.sequence)}},qE),yv("state",{parser:US,db:kA,renderer:NA,styles:av,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,kA.clear()}},WS),yv("stateDiagram",{parser:US,db:kA,renderer:rD,styles:av,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,kA.clear()}},HS),yv("journey",{parser:sD,db:pD,renderer:AD,styles:sv,init:t=>{AD.setConf(t.journey),pD.clear()}},oD),yv("flowchart",{parser:UT,db:yC,renderer:kC,styles:Jx,init:t=>{t.flowchart||(t.flowchart={}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,bC(t.flowchart),yC.clear(),yC.setGen("gen-1")}},WT),yv("flowchart-v2",{parser:UT,db:yC,renderer:kC,styles:Jx,init:t=>{t.flowchart||(t.flowchart={}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Yx({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}}),kC.setConf(t.flowchart),yC.clear(),yC.setGen("gen-2")}},HT),yv("gitGraph",{parser:_v,db:Gv,renderer:ck,styles:hk},xv))};class MD{constructor(t,e){var n,i;Km(this,"type","graph"),Km(this,"parser"),Km(this,"renderer"),Km(this,"db"),Km(this,"detectTypeFailed",!1),this.txt=t;const r=jx();this.txt=t;try{this.type=ax(t,r)}catch(t){this.handleError(t,e),this.type="error",this.detectTypeFailed=!0}const a=mv(this.type);tb.debug("Type "+this.type),this.db=a.db,null==(i=(n=this.db).clear)||i.call(n),this.renderer=a.renderer,this.parser=a.parser;const s=this.parser.parse.bind(this.parser);this.parser.parse=t=>s(function(t,e){var n;const i=t.match(ex);if(i){const r=tx(i[1],{schema:J_});return(null==r?void 0:r.title)&&(null==(n=e.setDiagramTitle)||n.call(e,r.title)),t.slice(i[0].length)}return t}(t,this.db)),this.parser.parser.yy=this.db,a.init&&(a.init(r),tb.debug("Initialized diagram "+this.type,r)),this.txt+="\n",this.parse(this.txt,e)}parse(t,e){var n,i;if(this.detectTypeFailed)return!1;try{return t+="\n",null==(i=(n=this.db).clear)||i.call(n),this.parser.parse(t),!0}catch(t){this.handleError(t,e)}return!1}handleError(t,e){if(void 0===e)throw t;Ax(t)?e(t.str,t.hash):e(t)}getParser(){return this.parser}getType(){return this.type}}const BD=(t,e)=>{const n=ax(t,jx());try{mv(n)}catch(i){const r=rx[n].loader;if(!r)throw new Error(`Diagram ${n} not found.`);return r().then((({diagram:i})=>(yv(n,i,void 0),new MD(t,e))))}return new MD(t,e)},ID=MD;const FD=["graph","flowchart","flowchart-v2","stateDiagram","stateDiagram-v2"],RD="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",$D="sandbox",PD="loose",YD="http://www.w3.org/1999/xlink",jD="http://www.w3.org/1999/xhtml",zD=["foreignobject"],UD=["dominant-baseline"];const WD=function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/classDef.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/#\w+;/g,(function(t){const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})),e},HD=function(t){let e=t;return e=e.replace(/fl°°/g,""),e=e.replace(/fl°/g,"&"),e=e.replace(/¶ß/g,";"),e},qD=(t,e,n=[])=>`\n.${t} ${e} { ${n.join(" !important; ")} !important; }`,VD=(t,e,n,i)=>{const r=((t,e,n={})=>{var i;let r="";if(void 0!==t.themeCSS&&(r+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(r+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(r+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),!Ig(n)&&FD.includes(e)){const e=t.htmlLabels||(null==(i=t.flowchart)?void 0:i.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];for(const t in n){const i=n[t];Ig(i.styles)||e.forEach((t=>{r+=qD(i.id,t,i.styles)})),Ig(i.textStyles)||(r+=qD(i.id,"tspan",i.textStyles))}}return r})(t,e,n);return Dh(Th(`${i}{${cv(e,r,t.themeVariables)}}`),Lh)},GD=(t="",e,n)=>{let i=t;return n||e||(i=i.replace(/marker-end="url\(.*?#/g,'marker-end="url(#')),i=HD(i),i=i.replace(/
/g,"
"),i},XD=(t="",e)=>`
+
+
+
+
+
+
+
+
+
+
+ ")}" sandbox="allow-top-navigation-by-user-activation allow-popups">\n The "iframe" tag is not supported by your browser.\n`,ZD=(t,e,n,i,r)=>{const a=t.append("div");a.attr("id",n),i&&a.attr("style",i);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return r&&s.attr("xmlns:xlink",r),s.append("g"),t};function QD(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}const KD=(t,e,n,i)=>{var r,a,s;null==(r=t.getElementById(e))||r.remove(),null==(a=t.getElementById(n))||a.remove(),null==(s=t.getElementById(i))||s.remove()};let JD={};const tL=function(t,e,n){switch(tb.debug(`Directive type=${e.type} with args:`,e.args),e.type){case"init":case"initialize":["config"].forEach((t=>{void 0!==e.args[t]&&("flowchart-v2"===n&&(n="flowchart"),e.args[n]=e.args[t],delete e.args[t])})),tb.debug("sanitize in handleDirective",e.args),Ex(e.args),tb.debug("sanitize in handleDirective (done)",e.args),Ux(e.args);break;case"wrap":case"nowrap":t&&t.setWrap&&t.setWrap("wrap"===e.type);break;case"themeCss":tb.warn("themeCss encountered");break;default:tb.warn(`Unhandled directive: source: '%%{${e.type}: ${JSON.stringify(e.args?e.args:{})}}%%`,e)}};function eL(t,e,n,i){!function(t,e){Ig(e)||t.attr("aria-roledescription",e)}(e,t),function(t,e,n,i){if(void 0!==t.insert&&(e||n)){if(n){const e="chart-desc-"+i;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(n)}if(e){const n="chart-title-"+i;t.attr("aria-labelledby",n),t.insert("title",":first-child").attr("id",n).text(e)}}}(e,n,i,e.attr("id"))}const nL=Object.freeze({render:function(t,e,n,i){var r,a,s,o,l;ND(),Wx();const c=Dx.detectInit(e);c&&(Ex(c),Ux(c));const h=jx();tb.debug(h),e.length>(null!=(r=null==h?void 0:h.maxTextSize)?r:5e4)&&(e=RD),e=e.replace(/\r\n?/g,"\n");const u="#"+t,d="i"+t,p="#"+d,f="d"+t,g="#"+f;let y=ie("body");const m=h.securityLevel===$D,b=h.securityLevel===PD,_=h.fontFamily;if(void 0!==i){if(i&&(i.innerHTML=""),m){const t=QD(ie(i),d);y=ie(t.nodes()[0].contentDocument.body),y.node().style.margin=0}else y=ie(i);ZD(y,t,f,`font-family: ${_}`,YD)}else{if(KD(document,t,f,d),m){const t=QD(ie("body"),d);y=ie(t.nodes()[0].contentDocument.body),y.node().style.margin=0}else y=ie("body");ZD(y,t,f)}let x,v;e=WD(e);try{if(x=BD(e),"then"in x)throw new Error("Diagram is a promise. Use renderAsync.")}catch(t){x=new ID("error"),v=t}const k=y.select(g).node(),w=x.type,T=k.firstChild,C=T.firstChild,E=FD.includes(w)?x.renderer.getClasses(e,x):{},S=VD(h,w,E,u),A=document.createElement("style");A.innerHTML=S,T.insertBefore(A,C);try{x.renderer.draw(e,t,Lx,x)}catch(n){throw LD.draw(e,t,Lx),n}eL(w,y.select(`${g} svg`),null==(s=(a=x.db).getAccTitle)?void 0:s.call(a),null==(l=(o=x.db).getAccDescription)?void 0:l.call(o)),y.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",jD);let D=y.select(g).node().innerHTML;if(tb.debug("config.arrowMarkerAbsolute",h.arrowMarkerAbsolute),D=GD(D,m,cb(h.arrowMarkerAbsolute)),m){const t=y.select(g+" svg").node();D=XD(D,t)}else b||(D=vl.sanitize(D,{ADD_TAGS:zD,ADD_ATTR:UD}));if(void 0!==n)switch(w){case"flowchart":case"flowchart-v2":n(D,yC.bindFunctions);break;case"gantt":n(D,iE.bindFunctions);break;case"class":case"classDiagram":n(D,Cw.bindFunctions);break;default:n(D)}else tb.debug("CB = undefined!");dS();const L=ie(m?p:g).node();if(L&&"remove"in L&&L.remove(),v)throw v;return D},renderAsync:async function(t,e,n,i){var r,a,s,o,l;ND(),Wx();const c=Dx.detectInit(e);c&&(Ex(c),Ux(c));const h=jx();tb.debug(h),e.length>(null!=(r=null==h?void 0:h.maxTextSize)?r:5e4)&&(e=RD),e=e.replace(/\r\n?/g,"\n");const u="#"+t,d="i"+t,p="#"+d,f="d"+t,g="#"+f;let y=ie("body");const m=h.securityLevel===$D,b=h.securityLevel===PD,_=h.fontFamily;if(void 0!==i){if(i&&(i.innerHTML=""),m){const t=QD(ie(i),d);y=ie(t.nodes()[0].contentDocument.body),y.node().style.margin=0}else y=ie(i);ZD(y,t,f,`font-family: ${_}`,YD)}else{if(KD(document,t,f,d),m){const t=QD(ie("body"),d);y=ie(t.nodes()[0].contentDocument.body),y.node().style.margin=0}else y=ie("body");ZD(y,t,f)}let x,v;e=WD(e);try{x=await BD(e)}catch(t){x=new ID("error"),v=t}const k=y.select(g).node(),w=x.type,T=k.firstChild,C=T.firstChild,E=FD.includes(w)?x.renderer.getClasses(e,x):{},S=VD(h,w,E,u),A=document.createElement("style");A.innerHTML=S,T.insertBefore(A,C);try{await x.renderer.draw(e,t,Lx,x)}catch(n){throw LD.draw(e,t,Lx),n}eL(w,y.select(`${g} svg`),null==(s=(a=x.db).getAccTitle)?void 0:s.call(a),null==(l=(o=x.db).getAccDescription)?void 0:l.call(o)),y.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",jD);let D=y.select(g).node().innerHTML;if(tb.debug("config.arrowMarkerAbsolute",h.arrowMarkerAbsolute),D=GD(D,m,cb(h.arrowMarkerAbsolute)),m){const t=y.select(g+" svg").node();D=XD(D,t)}else b||(D=vl.sanitize(D,{ADD_TAGS:zD,ADD_ATTR:UD}));if(void 0!==n)switch(w){case"flowchart":case"flowchart-v2":n(D,yC.bindFunctions);break;case"gantt":n(D,iE.bindFunctions);break;case"class":case"classDiagram":n(D,Cw.bindFunctions);break;default:n(D)}else tb.debug("CB = undefined!");dS();const L=ie(m?p:g).node();if(L&&"remove"in L&&L.remove(),v)throw v;return D},parse:function(t,e){return ND(),new ID(t,e).parse(t,e)},parseAsync:async function(t,e){return ND(),(await BD(t,e)).parse(t,e)},parseDirective:function(t,e,n,i){try{if(void 0!==e)switch(e=e.trim(),n){case"open_directive":JD={};break;case"type_directive":if(!JD)throw new Error("currentDirective is undefined");JD.type=e.toLowerCase();break;case"arg_directive":if(!JD)throw new Error("currentDirective is undefined");JD.args=JSON.parse(e);break;case"close_directive":tL(t,JD,i),JD=void 0}}catch(t){tb.error(`Error while rendering sequenceDiagram directive: ${e} jison context: ${n}`),tb.error(t.message)}},initialize:function(t={}){var e;(null==t?void 0:t.fontFamily)&&!(null==(e=t.themeVariables)?void 0:e.fontFamily)&&(t.themeVariables={fontFamily:t.fontFamily}),$x(t),(null==t?void 0:t.theme)&&t.theme in xb?t.themeVariables=xb[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=xb.default.getThemeVariables(t.themeVariables));const n="object"==typeof t?Rx(t):Px();eb(n.logLevel),ND()},getConfig:jx,setConfig:Yx,getSiteConfig:Px,updateSiteConfig:t=>(Mx=lx(Mx,t),Fx(Mx,Bx),Mx),reset:()=>{Wx()},globalReset:()=>{Wx(Ox)},defaultConfig:Ox});eb(jx().logLevel),Wx(jx());let iL=!1;const rL=(t,e,n)=>{tb.warn(t),Ax(t)?(n&&n(t.str,t.hash),e.push({...t,message:t.str,error:t})):(n&&n(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},aL=function(t,e,n){const i=nL.getConfig();let r;if(t&&(uL.sequenceConfig=t),tb.debug((n?"":"No ")+"Callback function found"),void 0===e)r=document.querySelectorAll(".mermaid");else if("string"==typeof e)r=document.querySelectorAll(e);else if(e instanceof HTMLElement)r=[e];else{if(!(e instanceof NodeList))throw new Error("Invalid argument nodes for mermaid.init");r=e}tb.debug(`Found ${r.length} diagrams`),void 0!==(null==t?void 0:t.startOnLoad)&&(tb.debug("Start On Load: "+(null==t?void 0:t.startOnLoad)),nL.updateSiteConfig({startOnLoad:null==t?void 0:t.startOnLoad}));const a=new Dx.initIdGenerator(i.deterministicIds,i.deterministicIDSeed);let s;const o=[];for(const t of Array.from(r)){
+/*! Check if previously processed */
+if(tb.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");const e=`mermaid-${a.next()}`;s=t.innerHTML,s=Dx.entityDecode(s).trim().replace(/
/gi,"
");const i=Dx.detectInit(s);i&&tb.debug("Detected early reinit: ",i);try{nL.render(e,s,((i,r)=>{t.innerHTML=i,void 0!==n&&n(e),r&&r(t)}),t)}catch(t){rL(t,o,uL.parseError)}}if(o.length>0)throw o[0]},sL=async function(t,e,n){const i=nL.getConfig();let r;if(t&&(uL.sequenceConfig=t),tb.debug((n?"":"No ")+"Callback function found"),void 0===e)r=document.querySelectorAll(".mermaid");else if("string"==typeof e)r=document.querySelectorAll(e);else if(e instanceof HTMLElement)r=[e];else{if(!(e instanceof NodeList))throw new Error("Invalid argument nodes for mermaid.init");r=e}tb.debug(`Found ${r.length} diagrams`),void 0!==(null==t?void 0:t.startOnLoad)&&(tb.debug("Start On Load: "+(null==t?void 0:t.startOnLoad)),nL.updateSiteConfig({startOnLoad:null==t?void 0:t.startOnLoad}));const a=new Dx.initIdGenerator(i.deterministicIds,i.deterministicIDSeed);let s;const o=[];for(const t of Array.from(r)){
+/*! Check if previously processed */
+if(tb.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");const e=`mermaid-${a.next()}`;s=t.innerHTML,s=Dx.entityDecode(s).trim().replace(/
/gi,"
");const i=Dx.detectInit(s);i&&tb.debug("Detected early reinit: ",i);try{await nL.renderAsync(e,s,((i,r)=>{t.innerHTML=i,void 0!==n&&n(e),r&&r(t)}),t)}catch(t){rL(t,o,uL.parseError)}}if(o.length>0)throw o[0]},oL=function(){if(uL.startOnLoad){const{startOnLoad:t}=nL.getConfig();t&&uL.init()}};"undefined"!=typeof document&&
+/*!
+ * Wait for document loaded before starting the execution
+ */
+window.addEventListener("load",oL,!1);const lL=[];let cL=!1;const hL=async()=>{if(!cL){for(cL=!0;lL.length>0;){const t=lL.shift();if(t)try{await t()}catch(t){tb.error("Error executing queue",t)}}cL=!1}},uL={startOnLoad:!0,diagrams:{},mermaidAPI:nL,parse:t=>nL.parse(t,uL.parseError),parseAsync:t=>new Promise(((e,n)=>{lL.push((()=>new Promise(((i,r)=>{nL.parseAsync(t,uL.parseError).then((t=>{i(t),e(t)}),(t=>{tb.error("Error parsing",t),r(t),n(t)}))})))),hL()})),render:nL.render,renderAsync:(t,e,n,i)=>new Promise(((r,a)=>{lL.push((()=>new Promise(((s,o)=>{nL.renderAsync(t,e,n,i).then((t=>{s(t),r(t)}),(t=>{tb.error("Error parsing",t),o(t),a(t)}))})))),hL()})),init:async function(t,e,n){try{iL?await sL(t,e,n):aL(t,e,n)}catch(t){tb.warn("Syntax Error rendering"),Ax(t)&&tb.warn(t.str),uL.parseError&&uL.parseError(t)}},initThrowsErrors:aL,initThrowsErrorsAsync:sL,registerExternalDiagrams:async(t,{lazyLoad:e=!0}={})=>{e?(t=>{for(const{id:e,detector:n,loader:i}of t)sx(e,n,i)})(t):await(async t=>{tb.debug(`Loading ${t.length} external diagrams`);const e=await Promise.allSettled(t.map((async({id:t,detector:e,loader:n})=>{const{diagram:i}=await n();yv(t,i,e)}))),n=e.filter((t=>"rejected"===t.status));if(n.length>0){tb.error(`Failed to load ${n.length} external diagrams`);for(const t of n)tb.error(t);throw new Error(`Failed to load ${n.length} external diagrams`)}})(t),iL=!0},initialize:function(t){nL.initialize(t)},parseError:void 0,contentLoaded:oL,setParseErrorHandler:function(t){uL.parseError=t}},dL={id:"mermaid",init:function(t){let{...e}=t.getConfig().mermaid||{};uL.mermaidAPI.initialize({startOnLoad:!1,...e});const n=t.getRevealElement().querySelectorAll(".mermaid");Array.from(n).forEach((function(t){var e=t.textContent.trim();try{uL.mermaidAPI.render(`mermaid-${Math.random().toString(36).substring(2)}`,e,(function(e,n){t.innerHTML=e}))}catch(n){let i="";n?.str&&(i=n.str),n?.message&&(i=n.message),console.error(i,{error:n,graphDefinition:e,el:t}),t.innerHTML=i}}))}};return()=>dL}));
diff --git a/custom_plugins/pdfexport/pdfexport.js b/custom_plugins/pdfexport/pdfexport.js
new file mode 100644
index 0000000..a0c57ca
--- /dev/null
+++ b/custom_plugins/pdfexport/pdfexport.js
@@ -0,0 +1,108 @@
+var PdfExport = ( function( _Reveal ){
+
+ var Reveal = _Reveal;
+ var setStylesheet = null;
+ var installAltKeyBindings = null;
+
+ function getRevealJsPath(){
+ var regex = /\b[^/]+\/reveal.css$/i;
+ var script = Array.from( document.querySelectorAll( 'link' ) ).find( function( e ){
+ return e.attributes.href && e.attributes.href.value.search( regex ) >= 0;
+ });
+ if( !script ){
+ console.error( 'reveal.css could not be found in included elements. Did you rename this file?' );
+ return '';
+ }
+ return script.attributes.href.value.replace( regex, '' );
+ }
+
+ function setStylesheet3( pdfExport ){
+ var link = document.querySelector( '#print' );
+ if( !link ){
+ link = document.createElement( 'link' );
+ link.rel = 'stylesheet';
+ link.id = 'print';
+ document.querySelector( 'head' ).appendChild( link );
+ }
+ var style = 'paper';
+ if( pdfExport ){
+ style = 'pdf';
+ }
+ link.href = getRevealJsPath() + 'css/print/' + style + '.css';
+ }
+
+ function setStylesheet4( pdfExport ){
+ }
+
+ function installAltKeyBindings3(){
+ }
+
+ function installAltKeyBindings4(){
+ if( isPrintingPDF() ){
+ var config = Reveal.getConfig();
+ var shortcut = config.pdfExportShortcut || 'E';
+ window.addEventListener( 'keydown', function( e ){
+ if( e.target.nodeName.toUpperCase() == 'BODY'
+ && ( e.key.toUpperCase() == shortcut.toUpperCase() || e.keyCode == shortcut.toUpperCase().charCodeAt( 0 ) ) ){
+ e.preventDefault();
+ togglePdfExport();
+ return false;
+ }
+ }, true );
+ }
+ }
+
+ function isPrintingPDF(){
+ return ( /print-pdf/gi ).test( window.location.search );
+ }
+
+ function togglePdfExport(){
+ var url_doc = new URL( document.URL );
+ var query_doc = new URLSearchParams( url_doc.searchParams );
+ if( isPrintingPDF() ){
+ query_doc.delete( 'print-pdf' );
+ }else{
+ query_doc.set( 'print-pdf', '' );
+ }
+ url_doc.search = ( query_doc.toString() ? '?' + query_doc.toString() : '' );
+ window.location.href = url_doc.toString();
+ }
+
+ function installKeyBindings(){
+ var config = Reveal.getConfig();
+ var shortcut = config.pdfExportShortcut || 'E';
+ Reveal.addKeyBinding({
+ keyCode: shortcut.toUpperCase().charCodeAt( 0 ),
+ key: shortcut.toUpperCase(),
+ description: 'PDF export mode'
+ }, togglePdfExport );
+ installAltKeyBindings();
+ }
+
+ function install(){
+ installKeyBindings();
+ setStylesheet( isPrintingPDF() );
+ }
+
+ var Plugin = {
+ }
+
+ if( Reveal && Reveal.VERSION && Reveal.VERSION.length && Reveal.VERSION[ 0 ] == '3' ){
+ // reveal 3.x
+ setStylesheet = setStylesheet3;
+ installAltKeyBindings = installAltKeyBindings3;
+ install();
+ }else{
+ // must be reveal 4.x
+ setStylesheet = setStylesheet4;
+ installAltKeyBindings = installAltKeyBindings4;
+ Plugin.id = 'pdf-export';
+ Plugin.init = function( _Reveal ){
+ Reveal = _Reveal;
+ install();
+ };
+ }
+
+ return Plugin;
+
+})( Reveal );
diff --git a/images/make_foundation_logo.png b/images/make_foundation_logo.png
new file mode 100644
index 0000000..22981e4
Binary files /dev/null and b/images/make_foundation_logo.png differ
diff --git a/images/make_logo.png b/images/make_logo.png
new file mode 100644
index 0000000..9cee4a0
Binary files /dev/null and b/images/make_logo.png differ
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..4e32aac
--- /dev/null
+++ b/index.html
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
Sécurité informatique
+
+
+
+
+
+
+
+
+
+