Files
mermaid-live-editor/_app/immutable/chunks/state-81e9bfc5.js
T
2023-02-16 15:33:38 +00:00

1300 lines
1021 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{C as writable,J as derived,K as get_store_value}from"./index-02874a89.js";import{g as getDefaultExportFromCjs,c as commonjsGlobal}from"./_commonjsHelpers-35101cd5.js";import{_ as __vitePreload}from"./preload-helper-41c905a7.js";import{S as Selection,r as root$2,a as array$1,d as define,e as extend$1,R as Rgb,C as Color,b as rgbConvert,c as constant$2,i as interpolateNumber,f as color,g as interpolateRgb,h as interpolateString,n as nogamma,j as hue,k as Color$1,_,l as ChannelsReusable,s as select,m as lighten,o as darken}from"./darken-e9b93bc2.js";const defaultLoading={loading:!1},loadingStateStore=writable(defaultLoading),initLoading=async(t,e)=>{loadingStateStore.set({loading:!0,message:t});const r=await e;return loadingStateStore.set({loading:!1}),r};var bundle={};(function(exports){(()=>{var __webpack_modules__={607:(module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0});var serializer_1=__webpack_require__(810),deserializer_1=__webpack_require__(496),Module;typeof process<"u"&&process.release&&process.release.name==="node"&&(Module=eval("require")("module"));var ESSerializer=function(){function t(){}return t.throwErrorIfInNonNodeEnvironment=function(){if(!Module)throw new Error("Cannot intercept require in non-Node environment.")},t.interceptRequire=function(){this.isRequireIntercepted||(this.isRequireIntercepted=!0,this.throwErrorIfInNonNodeEnvironment(),t.originRequire=Module.prototype.require,Module.prototype.require=function(){var e=t.originRequire.apply(this,arguments),r=e.name;return t.requiredClasses[r]||(t.requiredClasses[r]=e),e})},t.stopInterceptRequire=function(){this.throwErrorIfInNonNodeEnvironment(),Module.prototype.require=t.originRequire,this.isRequireIntercepted=!1},t.isInterceptingRequire=function(){return this.isRequireIntercepted},t.getRequiredClasses=function(){return this.requiredClasses},t.clearRequiredClasses=function(){this.requiredClasses={}},t.registerClass=function(e){this.registeredClasses.push(e)},t.registerClasses=function(e){this.registeredClasses=this.registeredClasses.concat(e)},t.clearRegisteredClasses=function(){this.registeredClasses=[]},t.serialize=function(e,r){return r===void 0&&(r={}),JSON.stringify(serializer_1.getSerializeValueWithClassName(e,r))},t.deserialize=function(e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),deserializer_1.deserializeFromParsedObj(JSON.parse(e),Object.values(this.requiredClasses).concat(this.registeredClasses).concat(r),n)},t.originRequire=null,t.isRequireIntercepted=!1,t.requiredClasses={},t.registeredClasses=[],t}();module.exports=ESSerializer},917:function(t,e){var r=this&&this.__spreadArrays||function(){for(var ft=0,Lt=0,Tt=arguments.length;Lt<Tt;Lt++)ft+=arguments[Lt].length;var Q=Array(ft),ut=0;for(Lt=0;Lt<Tt;Lt++)for(var st=arguments[Lt],ot=0,dt=st.length;ot<dt;ot++,ut++)Q[ut]=st[ot];return Q};Object.defineProperty(e,"__esModule",{value:!0}),e.TO_STRING_FIELD=e.TIMESTAMP_FIELD=e.OPTIONS_FIELD=e.CLASS_NAME_FIELD=e.BOOLEAN_FIELD=e.ARRAY_FIELD=e.BUILTIN_TYPE_UNDEFINED=e.BUILTIN_TYPE_NOT_FINITE=e.BUILTIN_TYPE_BIG_INT=e.BUILTIN_CLASS_AGGREGATE_ERROR=e.BUILTIN_CLASS_URI_ERROR=e.BUILTIN_CLASS_TYPE_ERROR=e.BUILTIN_CLASS_SYNTAX_ERROR=e.BUILTIN_CLASS_REFERENCE_ERROR=e.BUILTIN_CLASS_RANGE_ERROR=e.BUILTIN_CLASS_EVAL_ERROR=e.BUILTIN_CLASS_ERROR=e.BUILTIN_CLASS_STRING=e.BUILTIN_CLASS_SET=e.BUILTIN_CLASS_REGEXP=e.BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT=e.BUILTIN_CLASS_INTL_PLURALRULES=e.BUILTIN_CLASS_INTL_NUMBERFORMAT=e.BUILTIN_CLASS_INTL_LOCALE=e.BUILTIN_CLASS_INTL_LISTFORMAT=e.BUILTIN_CLASS_INTL_DATETIMEFORMAT=e.BUILTIN_CLASS_INTL_COLLATOR=e.BUILTIN_CLASS_DATE=e.BUILTIN_CLASS_DATAVIEW=e.BUILTIN_CLASS_BOOLEAN=e.BUILTIN_CLASS_SHAREDARRAYBUFFER=e.BUILTIN_CLASS_ARRAYBUFFER=e.BUILTIN_CLASS_BIGUINT64ARRAY=e.BUILTIN_CLASS_BIGINT64ARRAY=e.BUILTIN_CLASS_FLOAT64ARRAY=e.BUILTIN_CLASS_FLOAT32ARRAY=e.BUILTIN_CLASS_UINT32ARRAY=e.BUILTIN_CLASS_INT32ARRAY=e.BUILTIN_CLASS_UINT16ARRAY=e.BUILTIN_CLASS_INT16ARRAY=e.BUILTIN_CLASS_UINT8CLAMPEDARRAY=e.BUILTIN_CLASS_UINT8ARRAY=e.BUILTIN_CLASS_INT8ARRAY=e.CLASSNAMES_WHOSE_ENUMERABLE_PROPERTIES_SHOULD_BE_IGNORED=e.ALL_BUILTIN_INTLS=e.ALL_BUILTIN_ERRORS=e.ALL_BUILTIN_ARRAYS=e.ESSERIALIZER_NULL=void 0,e.ESSERIALIZER_NULL="__ESSERIALIZER_NULL__",e.ARRAY_FIELD="ess_arr",e.BOOLEAN_FIELD="ess_bool",e.CLASS_NAME_FIELD="ess_cn",e.OPTIONS_FIELD="ess_opt",e.TIMESTAMP_FIELD="ess_ts",e.TO_STRING_FIELD="ess_str";var n="Int8Array";e.BUILTIN_CLASS_INT8ARRAY=n;var a="Uint8Array";e.BUILTIN_CLASS_UINT8ARRAY=a;var s="Uint8ClampedArray";e.BUILTIN_CLASS_UINT8CLAMPEDARRAY=s;var o="Int16Array";e.BUILTIN_CLASS_INT16ARRAY=o;var l="Uint16Array";e.BUILTIN_CLASS_UINT16ARRAY=l;var u="Int32Array";e.BUILTIN_CLASS_INT32ARRAY=u;var h="Uint32Array";e.BUILTIN_CLASS_UINT32ARRAY=h;var d="Float32Array";e.BUILTIN_CLASS_FLOAT32ARRAY=d;var p="Float64Array";e.BUILTIN_CLASS_FLOAT64ARRAY=p;var g="BigInt64Array";e.BUILTIN_CLASS_BIGINT64ARRAY=g;var m="BigUint64Array";e.BUILTIN_CLASS_BIGUINT64ARRAY=m,e.BUILTIN_CLASS_ARRAYBUFFER="ArrayBuffer",e.BUILTIN_CLASS_SHAREDARRAYBUFFER="SharedArrayBuffer",e.BUILTIN_CLASS_BOOLEAN="Boolean",e.BUILTIN_CLASS_DATAVIEW="DataView",e.BUILTIN_CLASS_DATE="Date";var T="Collator";e.BUILTIN_CLASS_INTL_COLLATOR=T;var I="DateTimeFormat";e.BUILTIN_CLASS_INTL_DATETIMEFORMAT=I;var A="ListFormat";e.BUILTIN_CLASS_INTL_LISTFORMAT=A,e.BUILTIN_CLASS_INTL_LOCALE="Locale";var C="NumberFormat";e.BUILTIN_CLASS_INTL_NUMBERFORMAT=C;var L="PluralRules";e.BUILTIN_CLASS_INTL_PLURALRULES=L;var M="RelativeTimeFormat";e.BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT=M,e.BUILTIN_CLASS_REGEXP="RegExp",e.BUILTIN_CLASS_SET="Set";var F="String";e.BUILTIN_CLASS_STRING=F;var H="Error";e.BUILTIN_CLASS_ERROR=H;var q="EvalError";e.BUILTIN_CLASS_EVAL_ERROR=q;var U="RangeError";e.BUILTIN_CLASS_RANGE_ERROR=U;var z="ReferenceError";e.BUILTIN_CLASS_REFERENCE_ERROR=z;var R="SyntaxError";e.BUILTIN_CLASS_SYNTAX_ERROR=R;var $="TypeError";e.BUILTIN_CLASS_TYPE_ERROR=$;var D="URIError";e.BUILTIN_CLASS_URI_ERROR=D;var k="AggregateError";e.BUILTIN_CLASS_AGGREGATE_ERROR=k,e.BUILTIN_TYPE_BIG_INT="BI",e.BUILTIN_TYPE_NOT_FINITE="NF",e.BUILTIN_TYPE_UNDEFINED="UD";var B=[n,a,s,o,l,u,h,d,p,g,m];e.ALL_BUILTIN_ARRAYS=B;var v=[H,q,U,z,R,$,D,k];e.ALL_BUILTIN_ERRORS=v;var J=[T,I,A,C,L,M];e.ALL_BUILTIN_INTLS=J;var E=r([F],B);e.CLASSNAMES_WHOSE_ENUMERABLE_PROPERTIES_SHOULD_BE_IGNORED=E},496:function(t,e,r){var n=this&&this.__spreadArrays||function(){for(var C=0,L=0,M=arguments.length;L<M;L++)C+=arguments[L].length;var F=Array(C),H=0;for(L=0;L<M;L++)for(var q=arguments[L],U=0,z=q.length;U<z;U++,H++)F[H]=q[U];return F};Object.defineProperty(e,"__esModule",{value:!0}),e.getParentClassName=e.getClassMappingFromClassArray=e.deserializeFromParsedObjWithClassMapping=e.deserializeFromParsedObj=void 0;var a=r(821),s=r(917),o=/^\s*class\s+/;function l(C,L,M){if(M===void 0&&(M={}),a.notObject(C))return C;if(Array.isArray(C))return u(C,L);var F=C[s.CLASS_NAME_FIELD],H=function(z,R,$){switch(z){case s.BUILTIN_CLASS_INT8ARRAY:return h(R[s.ARRAY_FIELD],Int8Array);case s.BUILTIN_CLASS_UINT8ARRAY:return h(R[s.ARRAY_FIELD],Uint8Array);case s.BUILTIN_CLASS_UINT8CLAMPEDARRAY:return h(R[s.ARRAY_FIELD],Uint8ClampedArray);case s.BUILTIN_CLASS_INT16ARRAY:return h(R[s.ARRAY_FIELD],Int16Array);case s.BUILTIN_CLASS_UINT16ARRAY:return h(R[s.ARRAY_FIELD],Uint16Array);case s.BUILTIN_CLASS_INT32ARRAY:return h(R[s.ARRAY_FIELD],Int32Array);case s.BUILTIN_CLASS_UINT32ARRAY:return h(R[s.ARRAY_FIELD],Uint32Array);case s.BUILTIN_CLASS_FLOAT32ARRAY:return h(R[s.ARRAY_FIELD],Float32Array);case s.BUILTIN_CLASS_FLOAT64ARRAY:return h(R[s.ARRAY_FIELD],Float64Array);case s.BUILTIN_CLASS_BIGINT64ARRAY:return d(R[s.ARRAY_FIELD],BigInt64Array);case s.BUILTIN_CLASS_BIGUINT64ARRAY:return d(R[s.ARRAY_FIELD],BigUint64Array);case s.BUILTIN_TYPE_BIG_INT:return p(R[s.TO_STRING_FIELD]);case s.BUILTIN_TYPE_UNDEFINED:return;case s.BUILTIN_TYPE_NOT_FINITE:return a.getValueFromToStringResult(R[s.TO_STRING_FIELD]);case s.BUILTIN_CLASS_ARRAYBUFFER:return D=R[s.ARRAY_FIELD],new Uint8Array(D).buffer;case s.BUILTIN_CLASS_SHAREDARRAYBUFFER:return function(k){var B=new SharedArrayBuffer(k.length),v=new Uint8Array(B);return k.forEach(function(J,E){v[E]=J}),B}(R[s.ARRAY_FIELD]);case s.BUILTIN_CLASS_BOOLEAN:return function(k){return new Boolean(k[s.BOOLEAN_FIELD])}(R);case s.BUILTIN_CLASS_DATAVIEW:return function(k){return new DataView(new Uint8Array(k).buffer)}(R[s.ARRAY_FIELD]);case s.BUILTIN_CLASS_DATE:return function(k){return typeof k[s.TIMESTAMP_FIELD]=="number"?new Date(k[s.TIMESTAMP_FIELD]):null}(R);case s.BUILTIN_CLASS_INTL_COLLATOR:return g(R,Intl.Collator);case s.BUILTIN_CLASS_INTL_DATETIMEFORMAT:return g(R,Intl.DateTimeFormat);case s.BUILTIN_CLASS_INTL_LISTFORMAT:return g(R,Intl.ListFormat);case s.BUILTIN_CLASS_INTL_LOCALE:return new Intl.Locale(R[s.TO_STRING_FIELD]);case s.BUILTIN_CLASS_INTL_NUMBERFORMAT:return g(R,Intl.NumberFormat);case s.BUILTIN_CLASS_INTL_PLURALRULES:return g(R,Intl.PluralRules);case s.BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT:return g(R,Intl.RelativeTimeFormat);case s.BUILTIN_CLASS_REGEXP:return function(k){var B=k[s.TO_STRING_FIELD],v=B.lastIndexOf("/");return new RegExp(B.substring(1,v),B.substring(v+1))}(R);case s.BUILTIN_CLASS_SET:return function(k,B){return new Set(u(k[s.ARRAY_FIELD],B))}(R,$);case s.BUILTIN_CLASS_STRING:return function(k){return new String(k[s.TO_STRING_FIELD])}(R);case s.BUILTIN_CLASS_ERROR:return m(R,Error);case s.BUILTIN_CLASS_EVAL_ERROR:return m(R,EvalError);case s.BUILTIN_CLASS_RANGE_ERROR:return m(R,RangeError);case s.BUILTIN_CLASS_REFERENCE_ERROR:return m(R,ReferenceError);case s.BUILTIN_CLASS_SYNTAX_ERROR:return m(R,SyntaxError);case s.BUILTIN_CLASS_TYPE_ERROR:return m(R,TypeError);case s.BUILTIN_CLASS_URI_ERROR:return m(R,URIError);case s.BUILTIN_CLASS_AGGREGATE_ERROR:return m(R,AggregateError);default:return s.ESSERIALIZER_NULL}var D}(F,C,L);if(H!==s.ESSERIALIZER_NULL)return H;if(F&&!L[F])throw new Error("Class "+F+" not found");var q=[];M.fieldsForConstructorParameters&&(q=M.fieldsForConstructorParameters.map(function(z){return z in C?C[z]:{}}));var U=function(z,R){if(!z)return{};for(var $,D=Math.max(z.length-R.length,0),k=[{},0,"",null],B=k.shift();!$&&B!==void 0;)$=T(z,R.concat(Array.from(Array(D),function(){return B}))),B=D===0?void 0:k.shift();return $||($={},Object.setPrototypeOf($,z?z.prototype:Object.prototype)),$}(L[F],q);return function(z,R,$,D){for(var k in R){var B=R[k];if(!D.ignoreProperties||!D.ignoreProperties.includes(k))if(D.rawProperties&&D.rawProperties.includes(k))z[k]=JSON.stringify(B);else{var v=Object.getOwnPropertyDescriptor(z,k);J=B,E=v,k===s.CLASS_NAME_FIELD||E&&(typeof E.set=="function"||E.writable===!1&&typeof J!="object")||(v&&v.writable===!1&&typeof B=="object"?I(z[k],B,$):z[k]=l(B,$))}}var J,E;return z}(U,C,L,M)}function u(C,L){return C.map(function(M){return l(M,L)})}function h(C,L){return new L(C)}function d(C,L){return new L(C.map(function(M){return p(M[s.TO_STRING_FIELD])}))}function p(C){return BigInt(C)}function g(C,L){var M=C[s.OPTIONS_FIELD],F=M.locale;return delete M.locale,new L(F,M)}function m(C,L){var M;return delete(M=C.message?new L(C.message):new L).stack,C.name&&(M.name=C.name),C.stack&&(M.stack=C.stack),L===AggregateError&&(M.errors=l(C.errors,{})),M}function T(C,L){var M;try{if(o.test(C.toString()))M=new(C.bind.apply(C,n([void 0],L)));else{var F=C.prototype.constructor;F.name==="Object"&&(F=C),M=Object.create(F.prototype),F.call(M,L)}}catch{M=null}return M}function I(C,L,M){for(var F in L){var H=Object.getOwnPropertyDescriptor(C,F);H&&H.writable!==!0&&typeof H.set!="function"||(C[F]=l(L[F],M))}}function A(C){C===void 0&&(C=[]);var L={};return C.forEach(function(M){if(a.isClass(M)){var F=M.name,H=L[F];H&&H!==M&&console.warn("WARNING: Found class definition with the same name: "+F),L[F]=M}}),L}e.deserializeFromParsedObj=function(C,L,M){return l(C,A(L),M)},e.deserializeFromParsedObjWithClassMapping=l,e.getClassMappingFromClassArray=A,e.getParentClassName=function(C){return C.prototype.__proto__.constructor.name}},821:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isClass=e.notObject=e.getValueFromToStringResult=void 0,e.notObject=function(r){return r===null||typeof r!="object"},e.getValueFromToStringResult=function(r){switch(r){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN;default:return null}},e.isClass=function(r){if(function(n){return[Date].indexOf(n)>=0}(r))return!0;try{Reflect.construct(String,[],r)}catch{return!1}return!0}},810:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSerializeValueWithClassName=void 0;var n=r(917),a=r(821);function s(l,u){u===void 0&&(u={});var h=function(g){var m,T,I;return g===void 0?((m={})[n.CLASS_NAME_FIELD]=n.BUILTIN_TYPE_UNDEFINED,m):typeof g!="number"||isFinite(g)?typeof g=="bigint"?((I={})[n.CLASS_NAME_FIELD]=n.BUILTIN_TYPE_BIG_INT,I[n.TO_STRING_FIELD]=g.toString(),I):a.notObject(g)?g:n.ESSERIALIZER_NULL:((T={})[n.CLASS_NAME_FIELD]=n.BUILTIN_TYPE_NOT_FINITE,T[n.TO_STRING_FIELD]=g.toString(),T)}(l);if(h!==n.ESSERIALIZER_NULL)return h;if(Array.isArray(l))return o(l);var d={};if(!function(g){var m=g.__proto__.constructor.name;return n.CLASSNAMES_WHOSE_ENUMERABLE_PROPERTIES_SHOULD_BE_IGNORED.includes(m)}(l)){if(u.ignoreProperties&&u.ignoreProperties.forEach(function(g){delete l[g]}),u.interceptProperties)for(var p in u.interceptProperties)l[p]=u.interceptProperties[p].call(l,l[p]);(function(g,m){for(var T in g)typeof g[T]!="function"&&(m[T]=s(g[T]))})(l,d)}return function(g,m){var T=g.__proto__.constructor.name;return T==="Object"&&(T=g.constructor.name),T!=="Object"&&(m[n.CLASS_NAME_FIELD]=T,T===n.BUILTIN_CLASS_ARRAYBUFFER||T===n.BUILTIN_CLASS_SHAREDARRAYBUFFER?m[n.ARRAY_FIELD]=o(Array.from(new Uint8Array(g))):T===n.BUILTIN_CLASS_BOOLEAN?m[n.BOOLEAN_FIELD]=g.valueOf():T===n.BUILTIN_CLASS_DATAVIEW?m[n.ARRAY_FIELD]=o(Array.from(new Uint8Array(g.buffer))):T===n.BUILTIN_CLASS_DATE?m[n.TIMESTAMP_FIELD]=g.getTime():T===n.BUILTIN_CLASS_INTL_LOCALE||T===n.BUILTIN_CLASS_REGEXP?m[n.TO_STRING_FIELD]=g.toString():T===n.BUILTIN_CLASS_SET?m[n.ARRAY_FIELD]=o(Array.from(g)):T===n.BUILTIN_CLASS_STRING?m[n.TO_STRING_FIELD]=g.toString():n.ALL_BUILTIN_ARRAYS.includes(T)?m[n.ARRAY_FIELD]=o(Array.from(g)):n.ALL_BUILTIN_ERRORS.includes(T)?function(I,A,C){I.name!=="Error"&&(A.name=I.name),I.message&&(A.message=I.message),I.stack&&(A.stack=I.stack),C===n.BUILTIN_CLASS_AGGREGATE_ERROR&&(A.errors=s(I.errors))}(g,m,T):n.ALL_BUILTIN_INTLS.includes(T)&&(m[n.OPTIONS_FIELD]=g.resolvedOptions())),m}(l,d)}function o(l){return l.map(function(u){return s(u)})}e.getSerializeValueWithClassName=s}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(e!==void 0)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__webpack_require__),r.exports}var __webpack_exports__=__webpack_require__(607),__webpack_export_target__=exports;for(var i in __webpack_exports__)__webpack_export_target__[i]=__webpack_exports__[i];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})()})(bundle);const ESSerializer=getDefaultExportFromCjs(bundle),alreadyWarnFor=[],warnStorageNotFound=t=>{const e=typeof process<"u"&&!0;if(!alreadyWarnFor.includes(t)&&!e){let r=`Unable to find the ${t}. No data will be persisted.`;typeof window>"u"&&(r+=`
Are you running on a server? Most of storages are not available while running on a server.`),console.warn(r),alreadyWarnFor.push(t)}},serialize$1=t=>ESSerializer.serialize(t),deserialize=t=>{if(t!=="undefined"){if(t!=null){try{return ESSerializer.deserialize(t)}catch{}try{return JSON.parse(t)}catch{}}return t}};function persist(t,e,r){const n=e.getValue(r);return n!==null&&t.set(n),"addListener"in e&&e.addListener(r,a=>{t.set(a)}),t.subscribe(a=>{e.setValue(r,a)}),{...t,delete(){e.deleteValue(r)}}}function getBrowserStorage(t,e=!1){const r=[],n=o=>{const l=o.key;if(o.storageArea===t)for(const{listener:u}of r.filter(({key:h})=>h===l))u(deserialize(o.newValue))},a=()=>{e&&typeof window<"u"&&window.addEventListener&&window.addEventListener("storage",n)},s=()=>{e&&typeof window<"u"&&window.removeEventListener&&window.removeEventListener("storage",n)};return{addListener(o,l){r.push({key:o,listener:l}),r.length===1&&a()},removeListener(o,l){const u=r.indexOf({key:o,listener:l});u!==-1&&r.splice(u,1),r.length===0&&s()},getValue(o){const l=t.getItem(o);return deserialize(l)},deleteValue(o){t.removeItem(o)},setValue(o,l){t.setItem(o,serialize$1(l))}}}function localStorage(t=!1){return typeof window<"u"&&window.localStorage?getBrowserStorage(window.localStorage,t):(warnStorageNotFound("window.localStorage"),noopStorage())}function noopStorage(){return{getValue(){return null},deleteValue(){},setValue(){}}}let analytics;const initAnalytics=async()=>{if(!analytics)try{const[{Analytics:t},{default:e}]=await Promise.all([__vitePreload(()=>import("./analytics.browser.es-34f06abc.js"),[],import.meta.url),__vitePreload(()=>import("./plausible-c08e2f58.js").then(r=>r.p),["./plausible-c08e2f58.js","./_commonjsHelpers-35101cd5.js"],import.meta.url)]);analytics=t({app:"mermaid-live-editor",plugins:[e({domain:"mermaid.live",hashMode:!1,trackLocalhost:!1,apiHost:"https://plausible.io"})]})}catch(t){console.log(t),console.info("Analytics blocked ;)")}},detectType$1=t=>{const e=["classDiagram","erDiagram","flowChart","gantt","gitGraph","graph","journey","pie","stateDiagram"],r=t.replace(/^\s*%%.*\n/g,`
`).trimStart().split(" ")[0].toLowerCase();return e.find(a=>r.includes(a.toLowerCase()))},countLines=t=>{var e;return(((e=t.match(/\n/g))==null?void 0:e.length)??0)+1},saveStatistics=t=>{const e=detectType$1(t);if(!e)return;const r=countLines(t);logEvent("render",{graphType:e,length:r})},minutesToMilliSeconds=t=>t*6e4,defaultDelay=minutesToMilliSeconds(1),delaysPerEvent={render:minutesToMilliSeconds(5),panZoom:minutesToMilliSeconds(10),copyClipboard:defaultDelay,download:defaultDelay,copyMarkdown:defaultDelay,loadGist:defaultDelay,loadSampleDiagram:defaultDelay,renderDiagram:defaultDelay,history:defaultDelay,migration:defaultDelay,themeChange:defaultDelay},timeouts=new Map,logEvent=(t,e)=>{if(!analytics)return;const r=e?JSON.stringify({name:t,data:e}):t;timeouts.has(r)?clearTimeout(timeouts.get(r)):analytics.track(t,e),timeouts.set(r,window.setTimeout(()=>timeouts.delete(r),delaysPerEvent[t]))};const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(t){let e=t.length;for(;--e>=0;)t[e]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(t,e,r,n,a){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=t&&t.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const d_code=t=>t<256?_dist_code[t]:_dist_code[256+(t>>>7)],put_short=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},send_bits=(t,e,r)=>{t.bi_valid>Buf_size-r?(t.bi_buf|=e<<t.bi_valid&65535,put_short(t,t.bi_buf),t.bi_buf=e>>Buf_size-t.bi_valid,t.bi_valid+=r-Buf_size):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},send_code=(t,e,r)=>{send_bits(t,r[e*2],r[e*2+1])},bi_reverse=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},bi_flush=t=>{t.bi_valid===16?(put_short(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},gen_bitlen=(t,e)=>{const r=e.dyn_tree,n=e.max_code,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,u=e.stat_desc.max_length;let h,d,p,g,m,T,I=0;for(g=0;g<=MAX_BITS$1;g++)t.bl_count[g]=0;for(r[t.heap[t.heap_max]*2+1]=0,h=t.heap_max+1;h<HEAP_SIZE$1;h++)d=t.heap[h],g=r[r[d*2+1]*2+1]+1,g>u&&(g=u,I++),r[d*2+1]=g,!(d>n)&&(t.bl_count[g]++,m=0,d>=l&&(m=o[d-l]),T=r[d*2],t.opt_len+=T*(g+m),s&&(t.static_len+=T*(a[d*2+1]+m)));if(I!==0){do{for(g=u-1;t.bl_count[g]===0;)g--;t.bl_count[g]--,t.bl_count[g+1]+=2,t.bl_count[u]--,I-=2}while(I>0);for(g=u;g!==0;g--)for(d=t.bl_count[g];d!==0;)p=t.heap[--h],!(p>n)&&(r[p*2+1]!==g&&(t.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),d--)}},gen_codes=(t,e,r)=>{const n=new Array(MAX_BITS$1+1);let a=0,s,o;for(s=1;s<=MAX_BITS$1;s++)a=a+r[s-1]<<1,n[s]=a;for(o=0;o<=e;o++){let l=t[o*2+1];l!==0&&(t[o*2]=bi_reverse(n[l]++,l))}},tr_static_init=()=>{let t,e,r,n,a;const s=new Array(MAX_BITS$1+1);for(r=0,n=0;n<LENGTH_CODES$1-1;n++)for(base_length[n]=r,t=0;t<1<<extra_lbits[n];t++)_length_code[r++]=n;for(_length_code[r-1]=n,a=0,n=0;n<16;n++)for(base_dist[n]=a,t=0;t<1<<extra_dbits[n];t++)_dist_code[a++]=n;for(a>>=7;n<D_CODES$1;n++)for(base_dist[n]=a<<7,t=0;t<1<<extra_dbits[n]-7;t++)_dist_code[256+a++]=n;for(e=0;e<=MAX_BITS$1;e++)s[e]=0;for(t=0;t<=143;)static_ltree[t*2+1]=8,t++,s[8]++;for(;t<=255;)static_ltree[t*2+1]=9,t++,s[9]++;for(;t<=279;)static_ltree[t*2+1]=7,t++,s[7]++;for(;t<=287;)static_ltree[t*2+1]=8,t++,s[8]++;for(gen_codes(static_ltree,L_CODES$1+1,s),t=0;t<D_CODES$1;t++)static_dtree[t*2+1]=5,static_dtree[t*2]=bi_reverse(t,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=t=>{let e;for(e=0;e<L_CODES$1;e++)t.dyn_ltree[e*2]=0;for(e=0;e<D_CODES$1;e++)t.dyn_dtree[e*2]=0;for(e=0;e<BL_CODES$1;e++)t.bl_tree[e*2]=0;t.dyn_ltree[END_BLOCK*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},bi_windup=t=>{t.bi_valid>8?put_short(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},smaller=(t,e,r,n)=>{const a=e*2,s=r*2;return t[a]<t[s]||t[a]===t[s]&&n[e]<=n[r]},pqdownheap=(t,e,r)=>{const n=t.heap[r];let a=r<<1;for(;a<=t.heap_len&&(a<t.heap_len&&smaller(e,t.heap[a+1],t.heap[a],t.depth)&&a++,!smaller(e,n,t.heap[a],t.depth));)t.heap[r]=t.heap[a],r=a,a<<=1;t.heap[r]=n},compress_block=(t,e,r)=>{let n,a,s=0,o,l;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+s++]&255,n+=(t.pending_buf[t.sym_buf+s++]&255)<<8,a=t.pending_buf[t.sym_buf+s++],n===0?send_code(t,a,e):(o=_length_code[a],send_code(t,o+LITERALS$1+1,e),l=extra_lbits[o],l!==0&&(a-=base_length[o],send_bits(t,a,l)),n--,o=d_code(n),send_code(t,o,r),l=extra_dbits[o],l!==0&&(n-=base_dist[o],send_bits(t,n,l)));while(s<t.sym_next);send_code(t,END_BLOCK,e)},build_tree=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,l,u=-1,h;for(t.heap_len=0,t.heap_max=HEAP_SIZE$1,o=0;o<s;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)h=t.heap[++t.heap_len]=u<2?++u:0,r[h*2]=1,t.depth[h]=0,t.opt_len--,a&&(t.static_len-=n[h*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)pqdownheap(t,r,o);h=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],pqdownheap(t,r,1),l=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=l,r[h*2]=r[o*2]+r[l*2],t.depth[h]=(t.depth[o]>=t.depth[l]?t.depth[o]:t.depth[l])+1,r[o*2+1]=r[l*2+1]=h,t.heap[1]=h++,pqdownheap(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],gen_bitlen(t,e),gen_codes(r,u,t.bl_count)},scan_tree=(t,e,r)=>{let n,a=-1,s,o=e[0*2+1],l=0,u=7,h=4;for(o===0&&(u=138,h=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=o,o=e[(n+1)*2+1],!(++l<u&&s===o)&&(l<h?t.bl_tree[s*2]+=l:s!==0?(s!==a&&t.bl_tree[s*2]++,t.bl_tree[REP_3_6*2]++):l<=10?t.bl_tree[REPZ_3_10*2]++:t.bl_tree[REPZ_11_138*2]++,l=0,a=s,o===0?(u=138,h=3):s===o?(u=6,h=3):(u=7,h=4))},send_tree=(t,e,r)=>{let n,a=-1,s,o=e[0*2+1],l=0,u=7,h=4;for(o===0&&(u=138,h=3),n=0;n<=r;n++)if(s=o,o=e[(n+1)*2+1],!(++l<u&&s===o)){if(l<h)do send_code(t,s,t.bl_tree);while(--l!==0);else s!==0?(s!==a&&(send_code(t,s,t.bl_tree),l--),send_code(t,REP_3_6,t.bl_tree),send_bits(t,l-3,2)):l<=10?(send_code(t,REPZ_3_10,t.bl_tree),send_bits(t,l-3,3)):(send_code(t,REPZ_11_138,t.bl_tree),send_bits(t,l-11,7));l=0,a=s,o===0?(u=138,h=3):s===o?(u=6,h=3):(u=7,h=4)}},build_bl_tree=t=>{let e;for(scan_tree(t,t.dyn_ltree,t.l_desc.max_code),scan_tree(t,t.dyn_dtree,t.d_desc.max_code),build_tree(t,t.bl_desc),e=BL_CODES$1-1;e>=3&&t.bl_tree[bl_order[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},send_all_trees=(t,e,r,n)=>{let a;for(send_bits(t,e-257,5),send_bits(t,r-1,5),send_bits(t,n-4,4),a=0;a<n;a++)send_bits(t,t.bl_tree[bl_order[a]*2+1],3);send_tree(t,t.dyn_ltree,e-1),send_tree(t,t.dyn_dtree,r-1)},detect_data_type=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Z_BINARY;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Z_TEXT;for(r=32;r<LITERALS$1;r++)if(t.dyn_ltree[r*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=t=>{static_init_done||(tr_static_init(),static_init_done=!0),t.l_desc=new TreeDesc(t.dyn_ltree,static_l_desc),t.d_desc=new TreeDesc(t.dyn_dtree,static_d_desc),t.bl_desc=new TreeDesc(t.bl_tree,static_bl_desc),t.bi_buf=0,t.bi_valid=0,init_block(t)},_tr_stored_block$1=(t,e,r,n)=>{send_bits(t,(STORED_BLOCK<<1)+(n?1:0),3),bi_windup(t),put_short(t,r),put_short(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},_tr_align$1=t=>{send_bits(t,STATIC_TREES<<1,3),send_code(t,END_BLOCK,static_ltree),bi_flush(t)},_tr_flush_block$1=(t,e,r,n)=>{let a,s,o=0;t.level>0?(t.strm.data_type===Z_UNKNOWN$1&&(t.strm.data_type=detect_data_type(t)),build_tree(t,t.l_desc),build_tree(t,t.d_desc),o=build_bl_tree(t),a=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=a&&(a=s)):a=s=r+5,r+4<=a&&e!==-1?_tr_stored_block$1(t,e,r,n):t.strategy===Z_FIXED$1||s===a?(send_bits(t,(STATIC_TREES<<1)+(n?1:0),3),compress_block(t,static_ltree,static_dtree)):(send_bits(t,(DYN_TREES<<1)+(n?1:0),3),send_all_trees(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),compress_block(t,t.dyn_ltree,t.dyn_dtree)),init_block(t),n&&bi_windup(t)},_tr_tally$1=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(_length_code[r]+LITERALS$1+1)*2]++,t.dyn_dtree[d_code(e)*2]++),t.sym_next===t.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(t,e,r,n)=>{let a=t&65535|0,s=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do a=a+e[n++]|0,s=s+a|0;while(--o);a%=65521,s%=65521}return a|s<<16|0};var adler32_1=adler32;const makeTable=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},crcTable=new Uint32Array(makeTable()),crc32=(t,e,r,n)=>{const a=crcTable,s=n+r;t^=-1;for(let o=n;o<s;o++)t=t>>>8^a[(t^e[o])&255];return t^-1};var crc32_1=crc32,messages$1={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(t,e)=>(t.msg=messages$1[e],e),rank$1=t=>t*2-(t>4?9:0),zero=t=>{let e=t.length;for(;--e>=0;)t[e]=0},slide_hash=t=>{let e,r,n,a=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=a?r-a:0;while(--e);e=a,n=e;do r=t.prev[--n],t.prev[n]=r>=a?r-a:0;while(--e)};let HASH_ZLIB=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,HASH=HASH_ZLIB;const flush_pending=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},flush_block_only=(t,e)=>{_tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,flush_pending(t.strm)},put_byte=(t,e)=>{t.pending_buf[t.pending++]=e},putShortMSB=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},read_buf=(t,e,r,n)=>{let a=t.avail_in;return a>n&&(a=n),a===0?0:(t.avail_in-=a,e.set(t.input.subarray(t.next_in,t.next_in+a),r),t.state.wrap===1?t.adler=adler32_1(t.adler,e,a,r):t.state.wrap===2&&(t.adler=crc32_1(t.adler,e,a,r)),t.next_in+=a,t.total_in+=a,a)},longest_match=(t,e)=>{let r=t.max_chain_length,n=t.strstart,a,s,o=t.prev_length,l=t.nice_match;const u=t.strstart>t.w_size-MIN_LOOKAHEAD?t.strstart-(t.w_size-MIN_LOOKAHEAD):0,h=t.window,d=t.w_mask,p=t.prev,g=t.strstart+MAX_MATCH;let m=h[n+o-1],T=h[n+o];t.prev_length>=t.good_match&&(r>>=2),l>t.lookahead&&(l=t.lookahead);do if(a=e,!(h[a+o]!==T||h[a+o-1]!==m||h[a]!==h[n]||h[++a]!==h[n+1])){n+=2,a++;do;while(h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&n<g);if(s=MAX_MATCH-(g-n),n=g-MAX_MATCH,s>o){if(t.match_start=e,o=s,s>=l)break;m=h[n+o-1],T=h[n+o]}}while((e=p[e&d])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},fill_window=t=>{const e=t.w_size;let r,n,a;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-MIN_LOOKAHEAD)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),slide_hash(t),n+=e),t.strm.avail_in===0)break;if(r=read_buf(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=MIN_MATCH)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=HASH(t,t.ins_h,t.window[a+1]);t.insert&&(t.ins_h=HASH(t,t.ins_h,t.window[a+MIN_MATCH-1]),t.prev[a&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=a,a++,t.insert--,!(t.lookahead+t.insert<MIN_MATCH)););}while(t.lookahead<MIN_LOOKAHEAD&&t.strm.avail_in!==0)},deflate_stored=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,a,s,o=0,l=t.strm.avail_in;do{if(n=65535,s=t.bi_valid+42>>3,t.strm.avail_out<s||(s=t.strm.avail_out-s,a=t.strstart-t.block_start,n>a+t.strm.avail_in&&(n=a+t.strm.avail_in),n>s&&(n=s),n<r&&(n===0&&e!==Z_FINISH$3||e===Z_NO_FLUSH$2||n!==a+t.strm.avail_in)))break;o=e===Z_FINISH$3&&n===a+t.strm.avail_in?1:0,_tr_stored_block(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,flush_pending(t.strm),a&&(a>n&&(a=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+a),t.strm.next_out),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a,t.block_start+=a,n-=a),n&&(read_buf(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return l-=t.strm.avail_in,l&&(l>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=l&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-l,t.strm.next_in),t.strstart),t.strstart+=l,t.insert+=l>t.w_size-t.insert?t.w_size-t.insert:l),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?BS_FINISH_DONE:e!==Z_NO_FLUSH$2&&e!==Z_FINISH$3&&t.strm.avail_in===0&&t.strstart===t.block_start?BS_BLOCK_DONE:(s=t.window_size-t.strstart,t.strm.avail_in>s&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(read_buf(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water<t.strstart&&(t.high_water=t.strstart),s=t.bi_valid+42>>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,r=s>t.w_size?t.w_size:s,a=t.strstart-t.block_start,(a>=r||(a||e===Z_FINISH$3)&&e!==Z_NO_FLUSH$2&&t.strm.avail_in===0&&a<=s)&&(n=a>s?s:a,o=e===Z_FINISH$3&&t.strm.avail_in===0&&n===a?1:0,_tr_stored_block(t,t.block_start,n,o),t.block_start+=n,flush_pending(t.strm)),o?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(t,e)=>{let r,n;for(;;){if(t.lookahead<MIN_LOOKAHEAD){if(fill_window(t),t.lookahead<MIN_LOOKAHEAD&&e===Z_NO_FLUSH$2)return BS_NEED_MORE;if(t.lookahead===0)break}if(r=0,t.lookahead>=MIN_MATCH&&(t.ins_h=HASH(t,t.ins_h,t.window[t.strstart+MIN_MATCH-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-MIN_LOOKAHEAD&&(t.match_length=longest_match(t,r)),t.match_length>=MIN_MATCH)if(n=_tr_tally(t,t.strstart-t.match_start,t.match_length-MIN_MATCH),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=MIN_MATCH){t.match_length--;do t.strstart++,t.ins_h=HASH(t,t.ins_h,t.window[t.strstart+MIN_MATCH-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=HASH(t,t.ins_h,t.window[t.strstart+1]);else n=_tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(flush_block_only(t,!1),t.strm.avail_out===0))return BS_NEED_MORE}return t.insert=t.strstart<MIN_MATCH-1?t.strstart:MIN_MATCH-1,e===Z_FINISH$3?(flush_block_only(t,!0),t.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):t.sym_next&&(flush_block_only(t,!1),t.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(t,e)=>{let r,n,a;for(;;){if(t.lookahead<MIN_LOOKAHEAD){if(fill_window(t),t.lookahead<MIN_LOOKAHEAD&&e===Z_NO_FLUSH$2)return BS_NEED_MORE;if(t.lookahead===0)break}if(r=0,t.lookahead>=MIN_MATCH&&(t.ins_h=HASH(t,t.ins_h,t.window[t.strstart+MIN_MATCH-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=MIN_MATCH-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-MIN_LOOKAHEAD&&(t.match_length=longest_match(t,r),t.match_length<=5&&(t.strategy===Z_FILTERED||t.match_length===MIN_MATCH&&t.strstart-t.match_start>4096)&&(t.match_length=MIN_MATCH-1)),t.prev_length>=MIN_MATCH&&t.match_length<=t.prev_length){a=t.strstart+t.lookahead-MIN_MATCH,n=_tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-MIN_MATCH),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=a&&(t.ins_h=HASH(t,t.ins_h,t.window[t.strstart+MIN_MATCH-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=MIN_MATCH-1,t.strstart++,n&&(flush_block_only(t,!1),t.strm.avail_out===0))return BS_NEED_MORE}else if(t.match_available){if(n=_tr_tally(t,0,t.window[t.strstart-1]),n&&flush_block_only(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return BS_NEED_MORE}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=_tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<MIN_MATCH-1?t.strstart:MIN_MATCH-1,e===Z_FINISH$3?(flush_block_only(t,!0),t.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):t.sym_next&&(flush_block_only(t,!1),t.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(t,e)=>{let r,n,a,s;const o=t.window;for(;;){if(t.lookahead<=MAX_MATCH){if(fill_window(t),t.lookahead<=MAX_MATCH&&e===Z_NO_FLUSH$2)return BS_NEED_MORE;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=MIN_MATCH&&t.strstart>0&&(a=t.strstart-1,n=o[a],n===o[++a]&&n===o[++a]&&n===o[++a])){s=t.strstart+MAX_MATCH;do;while(n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&a<s);t.match_length=MAX_MATCH-(s-a),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=MIN_MATCH?(r=_tr_tally(t,1,t.match_length-MIN_MATCH),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=_tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(flush_block_only(t,!1),t.strm.avail_out===0))return BS_NEED_MORE}return t.insert=0,e===Z_FINISH$3?(flush_block_only(t,!0),t.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):t.sym_next&&(flush_block_only(t,!1),t.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(fill_window(t),t.lookahead===0)){if(e===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(t.match_length=0,r=_tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(flush_block_only(t,!1),t.strm.avail_out===0))return BS_NEED_MORE}return t.insert=0,e===Z_FINISH$3?(flush_block_only(t,!0),t.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):t.sym_next&&(flush_block_only(t,!1),t.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(t,e,r,n,a){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=a}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=t=>{t.window_size=2*t.w_size,zero(t.head),t.max_lazy_match=configuration_table[t.level].max_lazy,t.good_match=configuration_table[t.level].good_length,t.nice_match=configuration_table[t.level].nice_length,t.max_chain_length=configuration_table[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=MIN_MATCH-1,t.match_available=0,t.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateStateCheck=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==INIT_STATE&&e.status!==GZIP_STATE&&e.status!==EXTRA_STATE&&e.status!==NAME_STATE&&e.status!==COMMENT_STATE&&e.status!==HCRC_STATE&&e.status!==BUSY_STATE&&e.status!==FINISH_STATE?1:0},deflateResetKeep=t=>{if(deflateStateCheck(t))return err(t,Z_STREAM_ERROR$2);t.total_in=t.total_out=0,t.data_type=Z_UNKNOWN;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?GZIP_STATE:e.wrap?INIT_STATE:BUSY_STATE,t.adler=e.wrap===2?0:1,e.last_flush=-2,_tr_init(e),Z_OK$3},deflateReset=t=>{const e=deflateResetKeep(t);return e===Z_OK$3&&lm_init(t.state),e},deflateSetHeader=(t,e)=>deflateStateCheck(t)||t.state.wrap!==2?Z_STREAM_ERROR$2:(t.state.gzhead=e,Z_OK$3),deflateInit2=(t,e,r,n,a,s)=>{if(!t)return Z_STREAM_ERROR$2;let o=1;if(e===Z_DEFAULT_COMPRESSION$1&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),a<1||a>MAX_MEM_LEVEL||r!==Z_DEFLATED$2||n<8||n>15||e<0||e>9||s<0||s>Z_FIXED||n===8&&o!==1)return err(t,Z_STREAM_ERROR$2);n===8&&(n=9);const l=new DeflateState;return t.state=l,l.strm=t,l.status=INIT_STATE,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+MIN_MATCH-1)/MIN_MATCH),l.window=new Uint8Array(l.w_size*2),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=(l.lit_bufsize-1)*3,l.level=e,l.strategy=s,l.method=r,deflateReset(t)},deflateInit=(t,e)=>deflateInit2(t,e,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(t,e)=>{if(deflateStateCheck(t)||e>Z_BLOCK$1||e<0)return t?err(t,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===FINISH_STATE&&e!==Z_FINISH$3)return err(t,t.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(flush_pending(t),t.avail_out===0)return r.last_flush=-1,Z_OK$3}else if(t.avail_in===0&&rank$1(e)<=rank$1(n)&&e!==Z_FINISH$3)return err(t,Z_BUF_ERROR$1);if(r.status===FINISH_STATE&&t.avail_in!==0)return err(t,Z_BUF_ERROR$1);if(r.status===INIT_STATE&&r.wrap===0&&(r.status=BUSY_STATE),r.status===INIT_STATE){let a=Z_DEFLATED$2+(r.w_bits-8<<4)<<8,s=-1;if(r.strategy>=Z_HUFFMAN_ONLY||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,a|=s<<6,r.strstart!==0&&(a|=PRESET_DICT),a+=31-a%31,putShortMSB(r,a),r.strstart!==0&&(putShortMSB(r,t.adler>>>16),putShortMSB(r,t.adler&65535)),t.adler=1,r.status=BUSY_STATE,flush_pending(t),r.pending!==0)return r.last_flush=-1,Z_OK$3}if(r.status===GZIP_STATE){if(t.adler=0,put_byte(r,31),put_byte(r,139),put_byte(r,8),r.gzhead)put_byte(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),put_byte(r,r.gzhead.time&255),put_byte(r,r.gzhead.time>>8&255),put_byte(r,r.gzhead.time>>16&255),put_byte(r,r.gzhead.time>>24&255),put_byte(r,r.level===9?2:r.strategy>=Z_HUFFMAN_ONLY||r.level<2?4:0),put_byte(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(put_byte(r,r.gzhead.extra.length&255),put_byte(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=crc32_1(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=EXTRA_STATE;else if(put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,0),put_byte(r,r.level===9?2:r.strategy>=Z_HUFFMAN_ONLY||r.level<2?4:0),put_byte(r,OS_CODE),r.status=BUSY_STATE,flush_pending(t),r.pending!==0)return r.last_flush=-1,Z_OK$3}if(r.status===EXTRA_STATE){if(r.gzhead.extra){let a=r.pending,s=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+s>r.pending_buf_size;){let l=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+l),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>a&&(t.adler=crc32_1(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex+=l,flush_pending(t),r.pending!==0)return r.last_flush=-1,Z_OK$3;a=0,s-=l}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending+=s,r.gzhead.hcrc&&r.pending>a&&(t.adler=crc32_1(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=NAME_STATE}if(r.status===NAME_STATE){if(r.gzhead.name){let a=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(t.adler=crc32_1(t.adler,r.pending_buf,r.pending-a,a)),flush_pending(t),r.pending!==0)return r.last_flush=-1,Z_OK$3;a=0}r.gzindex<r.gzhead.name.length?s=r.gzhead.name.charCodeAt(r.gzindex++)&255:s=0,put_byte(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>a&&(t.adler=crc32_1(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=COMMENT_STATE}if(r.status===COMMENT_STATE){if(r.gzhead.comment){let a=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(t.adler=crc32_1(t.adler,r.pending_buf,r.pending-a,a)),flush_pending(t),r.pending!==0)return r.last_flush=-1,Z_OK$3;a=0}r.gzindex<r.gzhead.comment.length?s=r.gzhead.comment.charCodeAt(r.gzindex++)&255:s=0,put_byte(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>a&&(t.adler=crc32_1(t.adler,r.pending_buf,r.pending-a,a))}r.status=HCRC_STATE}if(r.status===HCRC_STATE){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(flush_pending(t),r.pending!==0))return r.last_flush=-1,Z_OK$3;put_byte(r,t.adler&255),put_byte(r,t.adler>>8&255),t.adler=0}if(r.status=BUSY_STATE,flush_pending(t),r.pending!==0)return r.last_flush=-1,Z_OK$3}if(t.avail_in!==0||r.lookahead!==0||e!==Z_NO_FLUSH$2&&r.status!==FINISH_STATE){let a=r.level===0?deflate_stored(r,e):r.strategy===Z_HUFFMAN_ONLY?deflate_huff(r,e):r.strategy===Z_RLE?deflate_rle(r,e):configuration_table[r.level].func(r,e);if((a===BS_FINISH_STARTED||a===BS_FINISH_DONE)&&(r.status=FINISH_STATE),a===BS_NEED_MORE||a===BS_FINISH_STARTED)return t.avail_out===0&&(r.last_flush=-1),Z_OK$3;if(a===BS_BLOCK_DONE&&(e===Z_PARTIAL_FLUSH?_tr_align(r):e!==Z_BLOCK$1&&(_tr_stored_block(r,0,0,!1),e===Z_FULL_FLUSH$1&&(zero(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),flush_pending(t),t.avail_out===0))return r.last_flush=-1,Z_OK$3}return e!==Z_FINISH$3?Z_OK$3:r.wrap<=0?Z_STREAM_END$3:(r.wrap===2?(put_byte(r,t.adler&255),put_byte(r,t.adler>>8&255),put_byte(r,t.adler>>16&255),put_byte(r,t.adler>>24&255),put_byte(r,t.total_in&255),put_byte(r,t.total_in>>8&255),put_byte(r,t.total_in>>16&255),put_byte(r,t.total_in>>24&255)):(putShortMSB(r,t.adler>>>16),putShortMSB(r,t.adler&65535)),flush_pending(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=t=>{if(deflateStateCheck(t))return Z_STREAM_ERROR$2;const e=t.state.status;return t.state=null,e===BUSY_STATE?err(t,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(t,e)=>{let r=e.length;if(deflateStateCheck(t))return Z_STREAM_ERROR$2;const n=t.state,a=n.wrap;if(a===2||a===1&&n.status!==INIT_STATE||n.lookahead)return Z_STREAM_ERROR$2;if(a===1&&(t.adler=adler32_1(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){a===0&&(zero(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}const s=t.avail_in,o=t.next_in,l=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,fill_window(n);n.lookahead>=MIN_MATCH;){let u=n.strstart,h=n.lookahead-(MIN_MATCH-1);do n.ins_h=HASH(n,n.ins_h,n.window[u+MIN_MATCH-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--h);n.strstart=u,n.lookahead=MIN_MATCH-1,fill_window(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=MIN_MATCH-1,n.match_available=0,t.next_in=o,t.input=l,t.avail_in=s,n.wrap=a,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var assign=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)_has(r,n)&&(t[n]=r[n])}}return t},flattenChunks=t=>{let e=0;for(let n=0,a=t.length;n<a;n++)e+=t[n].length;const r=new Uint8Array(e);for(let n=0,a=0,s=t.length;n<s;n++){let o=t[n];r.set(o,a),a+=o.length}return r},common$2={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let t=0;t<256;t++)_utf8len[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,a,s,o=t.length,l=0;for(a=0;a<o;a++)r=t.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=t.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(l),s=0,a=0;s<l;a++)r=t.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=t.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};const buf2binstring=(t,e)=>{if(e<65534&&t.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r};var buf2string=(t,e)=>{const r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,a;const s=new Array(r*2);for(a=0,n=0;n<r;){let o=t[n++];if(o<128){s[a++]=o;continue}let l=_utf8len[o];if(l>4){s[a++]=65533,n+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&n<r;)o=o<<6|t[n++]&63,l--;if(l>1){s[a++]=65533;continue}o<65536?s[a++]=o:(o-=65536,s[a++]=55296|o>>10&1023,s[a++]=56320|o&1023)}return buf2binstring(s,a)},utf8border=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+_utf8len[t[r]]>e?r:e},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(t){this.options=common$2.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let r=deflate_1$2.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Z_OK$2)throw new Error(messages$1[r]);if(e.header&&deflate_1$2.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=strings.string2buf(e.dictionary):toString$1.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=deflate_1$2.deflateSetDictionary(this.strm,n),r!==Z_OK$2)throw new Error(messages$1[r]);this._dict_set=!0}}Deflate$1.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let a,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof t=="string"?r.input=strings.string2buf(t):toString$1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===Z_SYNC_FLUSH||s===Z_FULL_FLUSH)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(a=deflate_1$2.deflate(r,s),a===Z_STREAM_END$2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=deflate_1$2.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Z_OK$2;if(r.avail_out===0){this.onData(r.output);continue}if(s>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Deflate$1.prototype.onData=function(t){this.chunks.push(t)};Deflate$1.prototype.onEnd=function(t){t===Z_OK$2&&(this.result=common$2.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function deflate$1(t,e){const r=new Deflate$1(e);if(r.push(t,!0),r.err)throw r.msg||messages$1[r.err];return r.result}function deflateRaw$1(t,e){return e=e||{},e.raw=!0,deflate$1(t,e)}function gzip$1(t,e){return e=e||{},e.gzip=!0,deflate$1(t,e)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,constants$1=constants$2,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1,constants:constants$1};const BAD$1=16209,TYPE$1=16191;var inffast=function t(e,r){let n,a,s,o,l,u,h,d,p,g,m,T,I,A,C,L,M,F,H,q,U,z,R,$;const D=e.state;n=e.next_in,R=e.input,a=n+(e.avail_in-5),s=e.next_out,$=e.output,o=s-(r-e.avail_out),l=s+(e.avail_out-257),u=D.dmax,h=D.wsize,d=D.whave,p=D.wnext,g=D.window,m=D.hold,T=D.bits,I=D.lencode,A=D.distcode,C=(1<<D.lenbits)-1,L=(1<<D.distbits)-1;t:do{T<15&&(m+=R[n++]<<T,T+=8,m+=R[n++]<<T,T+=8),M=I[m&C];e:for(;;){if(F=M>>>24,m>>>=F,T-=F,F=M>>>16&255,F===0)$[s++]=M&65535;else if(F&16){H=M&65535,F&=15,F&&(T<F&&(m+=R[n++]<<T,T+=8),H+=m&(1<<F)-1,m>>>=F,T-=F),T<15&&(m+=R[n++]<<T,T+=8,m+=R[n++]<<T,T+=8),M=A[m&L];r:for(;;){if(F=M>>>24,m>>>=F,T-=F,F=M>>>16&255,F&16){if(q=M&65535,F&=15,T<F&&(m+=R[n++]<<T,T+=8,T<F&&(m+=R[n++]<<T,T+=8)),q+=m&(1<<F)-1,q>u){e.msg="invalid distance too far back",D.mode=BAD$1;break t}if(m>>>=F,T-=F,F=s-o,q>F){if(F=q-F,F>d&&D.sane){e.msg="invalid distance too far back",D.mode=BAD$1;break t}if(U=0,z=g,p===0){if(U+=h-F,F<H){H-=F;do $[s++]=g[U++];while(--F);U=s-q,z=$}}else if(p<F){if(U+=h+p-F,F-=p,F<H){H-=F;do $[s++]=g[U++];while(--F);if(U=0,p<H){F=p,H-=F;do $[s++]=g[U++];while(--F);U=s-q,z=$}}}else if(U+=p-F,F<H){H-=F;do $[s++]=g[U++];while(--F);U=s-q,z=$}for(;H>2;)$[s++]=z[U++],$[s++]=z[U++],$[s++]=z[U++],H-=3;H&&($[s++]=z[U++],H>1&&($[s++]=z[U++]))}else{U=s-q;do $[s++]=$[U++],$[s++]=$[U++],$[s++]=$[U++],H-=3;while(H>2);H&&($[s++]=$[U++],H>1&&($[s++]=$[U++]))}}else if(F&64){e.msg="invalid distance code",D.mode=BAD$1;break t}else{M=A[(M&65535)+(m&(1<<F)-1)];continue r}break}}else if(F&64)if(F&32){D.mode=TYPE$1;break t}else{e.msg="invalid literal/length code",D.mode=BAD$1;break t}else{M=I[(M&65535)+(m&(1<<F)-1)];continue e}break}}while(n<a&&s<l);H=T>>3,n-=H,T-=H<<3,m&=(1<<T)-1,e.next_in=n,e.next_out=s,e.avail_in=n<a?5+(a-n):5-(n-a),e.avail_out=s<l?257+(l-s):257-(s-l),D.hold=m,D.bits=T};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(t,e,r,n,a,s,o,l)=>{const u=l.bits;let h=0,d=0,p=0,g=0,m=0,T=0,I=0,A=0,C=0,L=0,M,F,H,q,U,z=null,R;const $=new Uint16Array(MAXBITS+1),D=new Uint16Array(MAXBITS+1);let k=null,B,v,J;for(h=0;h<=MAXBITS;h++)$[h]=0;for(d=0;d<n;d++)$[e[r+d]]++;for(m=u,g=MAXBITS;g>=1&&$[g]===0;g--);if(m>g&&(m=g),g===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,l.bits=1,0;for(p=1;p<g&&$[p]===0;p++);for(m<p&&(m=p),A=1,h=1;h<=MAXBITS;h++)if(A<<=1,A-=$[h],A<0)return-1;if(A>0&&(t===CODES$1||g!==1))return-1;for(D[1]=0,h=1;h<MAXBITS;h++)D[h+1]=D[h]+$[h];for(d=0;d<n;d++)e[r+d]!==0&&(o[D[e[r+d]]++]=d);if(t===CODES$1?(z=k=o,R=20):t===LENS$1?(z=lbase,k=lext,R=257):(z=dbase,k=dext,R=0),L=0,d=0,h=p,U=s,T=m,I=0,H=-1,C=1<<m,q=C-1,t===LENS$1&&C>ENOUGH_LENS$1||t===DISTS$1&&C>ENOUGH_DISTS$1)return 1;for(;;){B=h-I,o[d]+1<R?(v=0,J=o[d]):o[d]>=R?(v=k[o[d]-R],J=z[o[d]-R]):(v=32+64,J=0),M=1<<h-I,F=1<<T,p=F;do F-=M,a[U+(L>>I)+F]=B<<24|v<<16|J|0;while(F!==0);for(M=1<<h-1;L&M;)M>>=1;if(M!==0?(L&=M-1,L+=M):L=0,d++,--$[h]===0){if(h===g)break;h=e[r+o[d]]}if(h>m&&(L&q)!==H){for(I===0&&(I=m),U+=p,T=h-I,A=1<<T;T+I<g&&(A-=$[T+I],!(A<=0));)T++,A<<=1;if(C+=1<<T,t===LENS$1&&C>ENOUGH_LENS$1||t===DISTS$1&&C>ENOUGH_DISTS$1)return 1;H=L&q,a[H]=m<<24|T<<16|U-s|0}}return L!==0&&(a[U+L]=h-I<<24|64<<16|0),l.bits=m,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT$1=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<HEAD||e.mode>SYNC?1:0},inflateResetKeep=t=>{if(inflateStateCheck(t))return Z_STREAM_ERROR$1;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=HEAD,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(ENOUGH_LENS),e.distcode=e.distdyn=new Int32Array(ENOUGH_DISTS),e.sane=1,e.back=-1,Z_OK$1},inflateReset=t=>{if(inflateStateCheck(t))return Z_STREAM_ERROR$1;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,inflateResetKeep(t)},inflateReset2=(t,e)=>{let r;if(inflateStateCheck(t))return Z_STREAM_ERROR$1;const n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Z_STREAM_ERROR$1:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,inflateReset(t))},inflateInit2=(t,e)=>{if(!t)return Z_STREAM_ERROR$1;const r=new InflateState;t.state=r,r.strm=t,r.window=null,r.mode=HEAD;const n=inflateReset2(t,e);return n!==Z_OK$1&&(t.state=null),n},inflateInit=t=>inflateInit2(t,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=t=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(inftrees(LENS,t.lens,0,288,lenfix,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;inftrees(DISTS,t.lens,0,32,distfix,0,t.work,{bits:5}),virgin=!1}t.lencode=lenfix,t.lenbits=9,t.distcode=distfix,t.distbits=5},updatewindow=(t,e,r,n)=>{let a;const s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(e.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(a=s.wsize-s.wnext,a>n&&(a=n),s.window.set(e.subarray(r-n,r-n+a),s.wnext),n-=a,n?(s.window.set(e.subarray(r-n,r),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0},inflate$2=(t,e)=>{let r,n,a,s,o,l,u,h,d,p,g,m,T,I,A=0,C,L,M,F,H,q,U,z;const R=new Uint8Array(4);let $,D;const k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(t)||!t.output||!t.input&&t.avail_in!==0)return Z_STREAM_ERROR$1;r=t.state,r.mode===TYPE&&(r.mode=TYPEDO),o=t.next_out,a=t.output,u=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,h=r.hold,d=r.bits,p=l,g=u,z=Z_OK$1;t:for(;;)switch(r.mode){case HEAD:if(r.wrap===0){r.mode=TYPEDO;break}for(;d<16;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(r.wrap&2&&h===35615){r.wbits===0&&(r.wbits=15),r.check=0,R[0]=h&255,R[1]=h>>>8&255,r.check=crc32_1(r.check,R,2,0),h=0,d=0,r.mode=FLAGS;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",r.mode=BAD;break}if((h&15)!==Z_DEFLATED){t.msg="unknown compression method",r.mode=BAD;break}if(h>>>=4,d-=4,U=(h&15)+8,r.wbits===0&&(r.wbits=U),U>15||U>r.wbits){t.msg="invalid window size",r.mode=BAD;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=h&512?DICTID:TYPE,h=0,d=0;break;case FLAGS:for(;d<16;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(r.flags=h,(r.flags&255)!==Z_DEFLATED){t.msg="unknown compression method",r.mode=BAD;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=BAD;break}r.head&&(r.head.text=h>>8&1),r.flags&512&&r.wrap&4&&(R[0]=h&255,R[1]=h>>>8&255,r.check=crc32_1(r.check,R,2,0)),h=0,d=0,r.mode=TIME;case TIME:for(;d<32;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}r.head&&(r.head.time=h),r.flags&512&&r.wrap&4&&(R[0]=h&255,R[1]=h>>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,r.check=crc32_1(r.check,R,4,0)),h=0,d=0,r.mode=OS;case OS:for(;d<16;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}r.head&&(r.head.xflags=h&255,r.head.os=h>>8),r.flags&512&&r.wrap&4&&(R[0]=h&255,R[1]=h>>>8&255,r.check=crc32_1(r.check,R,2,0)),h=0,d=0,r.mode=EXLEN;case EXLEN:if(r.flags&1024){for(;d<16;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}r.length=h,r.head&&(r.head.extra_len=h),r.flags&512&&r.wrap&4&&(R[0]=h&255,R[1]=h>>>8&255,r.check=crc32_1(r.check,R,2,0)),h=0,d=0}else r.head&&(r.head.extra=null);r.mode=EXTRA;case EXTRA:if(r.flags&1024&&(m=r.length,m>l&&(m=l),m&&(r.head&&(U=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(s,s+m),U)),r.flags&512&&r.wrap&4&&(r.check=crc32_1(r.check,n,m,s)),l-=m,s+=m,r.length-=m),r.length))break t;r.length=0,r.mode=NAME;case NAME:if(r.flags&2048){if(l===0)break t;m=0;do U=n[s+m++],r.head&&U&&r.length<65536&&(r.head.name+=String.fromCharCode(U));while(U&&m<l);if(r.flags&512&&r.wrap&4&&(r.check=crc32_1(r.check,n,m,s)),l-=m,s+=m,U)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=COMMENT$1;case COMMENT$1:if(r.flags&4096){if(l===0)break t;m=0;do U=n[s+m++],r.head&&U&&r.length<65536&&(r.head.comment+=String.fromCharCode(U));while(U&&m<l);if(r.flags&512&&r.wrap&4&&(r.check=crc32_1(r.check,n,m,s)),l-=m,s+=m,U)break t}else r.head&&(r.head.comment=null);r.mode=HCRC;case HCRC:if(r.flags&512){for(;d<16;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(r.wrap&4&&h!==(r.check&65535)){t.msg="header crc mismatch",r.mode=BAD;break}h=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=TYPE;break;case DICTID:for(;d<32;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}t.adler=r.check=zswap32(h),h=0,d=0,r.mode=DICT;case DICT:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=l,r.hold=h,r.bits=d,Z_NEED_DICT$1;t.adler=r.check=1,r.mode=TYPE;case TYPE:if(e===Z_BLOCK||e===Z_TREES)break t;case TYPEDO:if(r.last){h>>>=d&7,d-=d&7,r.mode=CHECK;break}for(;d<3;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}switch(r.last=h&1,h>>>=1,d-=1,h&3){case 0:r.mode=STORED;break;case 1:if(fixedtables(r),r.mode=LEN_,e===Z_TREES){h>>>=2,d-=2;break t}break;case 2:r.mode=TABLE;break;case 3:t.msg="invalid block type",r.mode=BAD}h>>>=2,d-=2;break;case STORED:for(h>>>=d&7,d-=d&7;d<32;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",r.mode=BAD;break}if(r.length=h&65535,h=0,d=0,r.mode=COPY_,e===Z_TREES)break t;case COPY_:r.mode=COPY;case COPY:if(m=r.length,m){if(m>l&&(m=l),m>u&&(m=u),m===0)break t;a.set(n.subarray(s,s+m),o),l-=m,s+=m,u-=m,o+=m,r.length-=m;break}r.mode=TYPE;break;case TABLE:for(;d<14;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(r.nlen=(h&31)+257,h>>>=5,d-=5,r.ndist=(h&31)+1,h>>>=5,d-=5,r.ncode=(h&15)+4,h>>>=4,d-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=BAD;break}r.have=0,r.mode=LENLENS;case LENLENS:for(;r.have<r.ncode;){for(;d<3;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}r.lens[k[r.have++]]=h&7,h>>>=3,d-=3}for(;r.have<19;)r.lens[k[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,$={bits:r.lenbits},z=inftrees(CODES,r.lens,0,19,r.lencode,0,r.work,$),r.lenbits=$.bits,z){t.msg="invalid code lengths set",r.mode=BAD;break}r.have=0,r.mode=CODELENS;case CODELENS:for(;r.have<r.nlen+r.ndist;){for(;A=r.lencode[h&(1<<r.lenbits)-1],C=A>>>24,L=A>>>16&255,M=A&65535,!(C<=d);){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(M<16)h>>>=C,d-=C,r.lens[r.have++]=M;else{if(M===16){for(D=C+2;d<D;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(h>>>=C,d-=C,r.have===0){t.msg="invalid bit length repeat",r.mode=BAD;break}U=r.lens[r.have-1],m=3+(h&3),h>>>=2,d-=2}else if(M===17){for(D=C+3;d<D;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}h>>>=C,d-=C,U=0,m=3+(h&7),h>>>=3,d-=3}else{for(D=C+7;d<D;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}h>>>=C,d-=C,U=0,m=11+(h&127),h>>>=7,d-=7}if(r.have+m>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=BAD;break}for(;m--;)r.lens[r.have++]=U}}if(r.mode===BAD)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=BAD;break}if(r.lenbits=9,$={bits:r.lenbits},z=inftrees(LENS,r.lens,0,r.nlen,r.lencode,0,r.work,$),r.lenbits=$.bits,z){t.msg="invalid literal/lengths set",r.mode=BAD;break}if(r.distbits=6,r.distcode=r.distdyn,$={bits:r.distbits},z=inftrees(DISTS,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,$),r.distbits=$.bits,z){t.msg="invalid distances set",r.mode=BAD;break}if(r.mode=LEN_,e===Z_TREES)break t;case LEN_:r.mode=LEN;case LEN:if(l>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=l,r.hold=h,r.bits=d,inffast(t,g),o=t.next_out,a=t.output,u=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,h=r.hold,d=r.bits,r.mode===TYPE&&(r.back=-1);break}for(r.back=0;A=r.lencode[h&(1<<r.lenbits)-1],C=A>>>24,L=A>>>16&255,M=A&65535,!(C<=d);){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(L&&!(L&240)){for(F=C,H=L,q=M;A=r.lencode[q+((h&(1<<F+H)-1)>>F)],C=A>>>24,L=A>>>16&255,M=A&65535,!(F+C<=d);){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}h>>>=F,d-=F,r.back+=F}if(h>>>=C,d-=C,r.back+=C,r.length=M,L===0){r.mode=LIT;break}if(L&32){r.back=-1,r.mode=TYPE;break}if(L&64){t.msg="invalid literal/length code",r.mode=BAD;break}r.extra=L&15,r.mode=LENEXT;case LENEXT:if(r.extra){for(D=r.extra;d<D;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=DIST;case DIST:for(;A=r.distcode[h&(1<<r.distbits)-1],C=A>>>24,L=A>>>16&255,M=A&65535,!(C<=d);){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(!(L&240)){for(F=C,H=L,q=M;A=r.distcode[q+((h&(1<<F+H)-1)>>F)],C=A>>>24,L=A>>>16&255,M=A&65535,!(F+C<=d);){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}h>>>=F,d-=F,r.back+=F}if(h>>>=C,d-=C,r.back+=C,L&64){t.msg="invalid distance code",r.mode=BAD;break}r.offset=M,r.extra=L&15,r.mode=DISTEXT;case DISTEXT:if(r.extra){for(D=r.extra;d<D;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=BAD;break}r.mode=MATCH;case MATCH:if(u===0)break t;if(m=g-u,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=BAD;break}m>r.wnext?(m-=r.wnext,T=r.wsize-m):T=r.wnext-m,m>r.length&&(m=r.length),I=r.window}else I=a,T=o-r.offset,m=r.length;m>u&&(m=u),u-=m,r.length-=m;do a[o++]=I[T++];while(--m);r.length===0&&(r.mode=LEN);break;case LIT:if(u===0)break t;a[o++]=r.length,u--,r.mode=LEN;break;case CHECK:if(r.wrap){for(;d<32;){if(l===0)break t;l--,h|=n[s++]<<d,d+=8}if(g-=u,t.total_out+=g,r.total+=g,r.wrap&4&&g&&(t.adler=r.check=r.flags?crc32_1(r.check,a,g,o-g):adler32_1(r.check,a,g,o-g)),g=u,r.wrap&4&&(r.flags?h:zswap32(h))!==r.check){t.msg="incorrect data check",r.mode=BAD;break}h=0,d=0}r.mode=LENGTH;case LENGTH:if(r.wrap&&r.flags){for(;d<32;){if(l===0)break t;l--,h+=n[s++]<<d,d+=8}if(r.wrap&4&&h!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=BAD;break}h=0,d=0}r.mode=DONE;case DONE:z=Z_STREAM_END$1;break t;case BAD:z=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=l,r.hold=h,r.bits=d,(r.wsize||g!==t.avail_out&&r.mode<BAD&&(r.mode<CHECK||e!==Z_FINISH$1))&&updatewindow(t,t.output,t.next_out,g-t.avail_out),p-=t.avail_in,g-=t.avail_out,t.total_in+=p,t.total_out+=g,r.total+=g,r.wrap&4&&g&&(t.adler=r.check=r.flags?crc32_1(r.check,a,g,t.next_out-g):adler32_1(r.check,a,g,t.next_out-g)),t.data_type=r.bits+(r.last?64:0)+(r.mode===TYPE?128:0)+(r.mode===LEN_||r.mode===COPY_?256:0),(p===0&&g===0||e===Z_FINISH$1)&&z===Z_OK$1&&(z=Z_BUF_ERROR),z},inflateEnd=t=>{if(inflateStateCheck(t))return Z_STREAM_ERROR$1;let e=t.state;return e.window&&(e.window=null),t.state=null,Z_OK$1},inflateGetHeader=(t,e)=>{if(inflateStateCheck(t))return Z_STREAM_ERROR$1;const r=t.state;return r.wrap&2?(r.head=e,e.done=!1,Z_OK$1):Z_STREAM_ERROR$1},inflateSetDictionary=(t,e)=>{const r=e.length;let n,a,s;return inflateStateCheck(t)||(n=t.state,n.wrap!==0&&n.mode!==DICT)?Z_STREAM_ERROR$1:n.mode===DICT&&(a=1,a=adler32_1(a,e,r,0),a!==n.check)?Z_DATA_ERROR$1:(s=updatewindow(t,e,r,r),s?(n.mode=MEM,Z_MEM_ERROR$1):(n.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString$2=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(t){this.options=common$2.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let r=inflate_1$2.inflateInit2(this.strm,e.windowBits);if(r!==Z_OK)throw new Error(messages$1[r]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=strings.string2buf(e.dictionary):toString$2.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=inflate_1$2.inflateSetDictionary(this.strm,e.dictionary),r!==Z_OK)))throw new Error(messages$1[r])}Inflate$1.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let s,o,l;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?Z_FINISH:Z_NO_FLUSH,toString$2.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),s=inflate_1$2.inflate(r,o),s===Z_NEED_DICT&&a&&(s=inflate_1$2.inflateSetDictionary(r,a),s===Z_OK?s=inflate_1$2.inflate(r,o):s===Z_DATA_ERROR&&(s=Z_NEED_DICT));r.avail_in>0&&s===Z_STREAM_END&&r.state.wrap>0&&t[r.next_in]!==0;)inflate_1$2.inflateReset(r),s=inflate_1$2.inflate(r,o);switch(s){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(s),this.ended=!0,!1}if(l=r.avail_out,r.next_out&&(r.avail_out===0||s===Z_STREAM_END))if(this.options.to==="string"){let u=strings.utf8border(r.output,r.next_out),h=r.next_out-u,d=strings.buf2string(r.output,u);r.next_out=h,r.avail_out=n-h,h&&r.output.set(r.output.subarray(u,u+h),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(s===Z_OK&&l===0)){if(s===Z_STREAM_END)return s=inflate_1$2.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Inflate$1.prototype.onData=function(t){this.chunks.push(t)};Inflate$1.prototype.onEnd=function(t){t===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common$2.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function inflate$1(t,e){const r=new Inflate$1(e);if(r.push(t),r.err)throw r.msg||messages$1[r.err];return r.result}function inflateRaw$1(t,e){return e=e||{},e.raw=!0,inflate$1(t,e)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,constants$3=constants$2,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1,constants:constants$3};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var deflate_1=deflate,inflate_1=inflate;const _hasatob=typeof atob=="function",_hasbtoa=typeof btoa=="function",_hasBuffer=typeof Buffer=="function",_TD=typeof TextDecoder=="function"?new TextDecoder:void 0,_TE=typeof TextEncoder=="function"?new TextEncoder:void 0,b64ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b64chs=Array.prototype.slice.call(b64ch),b64tab=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(b64chs),b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_fromCC=String.fromCharCode.bind(String),_U8Afrom=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):(t,e=r=>r)=>new Uint8Array(Array.prototype.slice.call(t,0).map(e)),_mkUriSafe=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),_tidyB64=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),btoaPolyfill=t=>{let e,r,n,a,s="";const o=t.length%3;for(let l=0;l<t.length;){if((r=t.charCodeAt(l++))>255||(n=t.charCodeAt(l++))>255||(a=t.charCodeAt(l++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|a,s+=b64chs[e>>18&63]+b64chs[e>>12&63]+b64chs[e>>6&63]+b64chs[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},_btoa=_hasbtoa?t=>btoa(t):_hasBuffer?t=>Buffer.from(t,"binary").toString("base64"):btoaPolyfill,_fromUint8Array=_hasBuffer?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,a=t.length;n<a;n+=4096)r.push(_fromCC.apply(null,t.subarray(n,n+4096)));return _btoa(r.join(""))},fromUint8Array=(t,e=!1)=>e?_mkUriSafe(_fromUint8Array(t)):_fromUint8Array(t),cb_utob=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?_fromCC(192|e>>>6)+_fromCC(128|e&63):_fromCC(224|e>>>12&15)+_fromCC(128|e>>>6&63)+_fromCC(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return _fromCC(240|e>>>18&7)+_fromCC(128|e>>>12&63)+_fromCC(128|e>>>6&63)+_fromCC(128|e&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=t=>t.replace(re_utob,cb_utob),_encode=_hasBuffer?t=>Buffer.from(t,"utf8").toString("base64"):_TE?t=>_fromUint8Array(_TE.encode(t)):t=>_btoa(utob(t)),encode=(t,e=!1)=>e?_mkUriSafe(_encode(t)):_encode(t),re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return _fromCC((r>>>10)+55296)+_fromCC((r&1023)+56320);case 3:return _fromCC((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return _fromCC((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},btou=t=>t.replace(re_btou,cb_btou),atobPolyfill=t=>{if(t=t.replace(/\s+/g,""),!b64re.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,a;for(let s=0;s<t.length;)e=b64tab[t.charAt(s++)]<<18|b64tab[t.charAt(s++)]<<12|(n=b64tab[t.charAt(s++)])<<6|(a=b64tab[t.charAt(s++)]),r+=n===64?_fromCC(e>>16&255):a===64?_fromCC(e>>16&255,e>>8&255):_fromCC(e>>16&255,e>>8&255,e&255);return r},_atob=_hasatob?t=>atob(_tidyB64(t)):_hasBuffer?t=>Buffer.from(t,"base64").toString("binary"):atobPolyfill,_toUint8Array=_hasBuffer?t=>_U8Afrom(Buffer.from(t,"base64")):t=>_U8Afrom(_atob(t),e=>e.charCodeAt(0)),toUint8Array=t=>_toUint8Array(_unURI(t)),_decode=_hasBuffer?t=>Buffer.from(t,"base64").toString("utf8"):_TD?t=>_TD.decode(_toUint8Array(t)):t=>btou(_atob(t)),_unURI=t=>_tidyB64(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),decode=t=>_decode(_unURI(t)),base64Serde={serialize:t=>encode(t,!0),deserialize:t=>decode(t)},pakoSerde={serialize:t=>{const e=new TextEncoder().encode(t),r=deflate_1(e,{level:9});return fromUint8Array(r,!0)},deserialize:t=>{const e=toUint8Array(t);return inflate_1(e,{to:"string"})}},serdes={base64:base64Serde,pako:pakoSerde},serializeState=(t,e="pako")=>{if(!(e in serdes))throw new Error(`Unknown serde type: ${e}`);const r=JSON.stringify(t),n=serdes[e].serialize(r);return`${e}:${n}`},deserializeState=t=>{let e,r;if(t.includes(":")){let a;if([a,r]=t.split(":"),a in serdes)e=a;else throw new Error(`Unknown serde type: ${a}`)}else e="base64",r=t;const n=serdes[e].deserialize(r);return JSON.parse(n)};var dist$1={},words={};(function(t){var e=commonjsGlobal&&commonjsGlobal.__values||function(n){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&n[a],o=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.getWordsByCategory=t.wordList=void 0,t.wordList={noun:[{word:"accountant",categories:["profession"]},{word:"ability",categories:["thing"]},{word:"accident",categories:["thing"]},{word:"account",categories:["thing"]},{word:"action",categories:["thing"]},{word:"activity",categories:["thing"]},{word:"actor",categories:["profession"]},{word:"ad",categories:["media"]},{word:"addition",categories:["thing"]},{word:"address",categories:["thing"]},{word:"adult",categories:["people"]},{word:"advantage",categories:["thing"]},{word:"advertisement",categories:["media"]},{word:"afternoon",categories:["time"]},{word:"agency",categories:["thing"]},{word:"agent",categories:["people"]},{word:"air",categories:["thing"]},{word:"airline",categories:["transportation"]},{word:"airplane",categories:["transportation"]},{word:"airport",categories:["transportation","place"]},{word:"alarm",categories:["thing"]},{word:"alligator",categories:["animals"]},{word:"ambulance",categories:["health"]},{word:"analyst",categories:["profession"]},{word:"angle",categories:["thing"]},{word:"animal",categories:["animals"]},{word:"answer",categories:["thing"]},{word:"apartment",categories:["place"]},{word:"apple",categories:["food"]},{word:"application",categories:["thing"]},{word:"appointment",categories:["thing"]},{word:"architect",categories:["profession"]},{word:"argument",categories:["thing"]},{word:"area",categories:["thing"]},{word:"arm",categories:["thing"]},{word:"army",categories:["thing"]},{word:"art",categories:["thing"]},{word:"article",categories:["thing"]},{word:"artist",categories:["profession"]},{word:"australia",categories:["place"]},{word:"author",categories:["profession"]},{word:"autumn",categories:["time"]},{word:"baby",categories:["people","family"]},{word:"baker",categories:["profession"]},{word:"balloon",categories:["thing"]},{word:"banana",categories:["food"]},{word:"barista",categories:["profession"]},{word:"battery",categories:["thing"]},{word:"beach",categories:["place"]},{word:"bear",categories:["animals"]},{word:"beard",categories:["thing"]},{word:"bed",categories:["thing"]},{word:"belgium",categories:["place"]},{word:"bird",categories:["animals"]},{word:"bit",categories:["thing","technology"]},{word:"book",categories:["thing","education"]},{word:"boots",categories:["thing"]},{word:"boy",categories:["people"]},{word:"branch",categories:["thing"]},{word:"breakfast",categories:["thing"]},{word:"brother",categories:["family"]},{word:"businessperson",categories:["people","business"]},{word:"butcher",categories:["profession"]},{word:"byte",categories:["thing","technology"]},{word:"camera",categories:["thing"]},{word:"candle",categories:["thing"]},{word:"car",categories:["transportation"]},{word:"caravan",categories:["transportation"]},{word:"carpenter",categories:["profession"]},{word:"carpet",categories:["thing"]},{word:"cartoon",categories:["media"]},{word:"cat",categories:["animals"]},{word:"chef",categories:["profession"]},{word:"child",categories:["people","family"]},{word:"china",categories:["place"]},{word:"church",categories:["religion"]},{word:"city",categories:["place"]},{word:"coat",categories:["thing"]},{word:"coffeeshop",categories:["place"]},{word:"computer",categories:["thing","technology"]},{word:"continent",categories:["place"]},{word:"controller",categories:["thing","technology"]},{word:"country",categories:["place"]},{word:"cpu",categories:["thing","technology"]},{word:"crayon",categories:["thing"]},{word:"cricket",categories:["animals"]},{word:"crowd",categories:["people"]},{word:"daughter",categories:["family"]},{word:"dawn",categories:["time"]},{word:"daybreak",categories:["time"]},{word:"death",categories:["thing"]},{word:"denmark",categories:["place"]},{word:"dentist",categories:["profession"]},{word:"diamond",categories:["thing"]},{word:"dinner",categories:["food"]},{word:"disease",categories:["thing"]},{word:"doctor",categories:["profession"]},{word:"dog",categories:["animals"]},{word:"dream",categories:["thing"]},{word:"dress",categories:["thing"]},{word:"dusk",categories:["time"]},{word:"easter",categories:["religion"]},{word:"egg",categories:["food"]},{word:"eggplant",categories:["food"]},{word:"egypt",categories:["place"]},{word:"electrician",categories:["profession"]},{word:"elephant",categories:["animals"]},{word:"energy",categories:["thing"]},{word:"engine",categories:["transportation"]},{word:"engineer",categories:["profession"]},{word:"england",categories:["place"]},{word:"eve",categories:["time"]},{word:"evening",categories:["time"]},{word:"eventide",categories:["time"]},{word:"exabyte",categories:["thing","technology"]},{word:"eye",categories:["thing"]},{word:"fall",categories:["time"]},{word:"family",categories:["family"]},{word:"farmer",categories:["profession"]},{word:"father",categories:["people","family"]},{word:"finland",categories:["place"]},{word:"fireman",categories:["profession"]},{word:"fish",categories:["animals"]},{word:"flag",categories:["thing"]},{word:"florist",categories:["profession"]},{word:"flower",categories:["thing"]},{word:"football",categories:["sports"]},{word:"forest",categories:["place"]},{word:"fountain",categories:["thing"]},{word:"france",categories:["place"]},{word:"furniture",categories:["thing"]},{word:"garage",categories:["place"]},{word:"garden",categories:["food"]},{word:"gas",categories:["transportation"]},{word:"ghost",categories:["thing"]},{word:"gigabyte",categories:["thing","technology"]},{word:"girl",categories:["people"]},{word:"glass",categories:["thing"]},{word:"gold",categories:["thing"]},{word:"gpu",categories:["thing","technology"]},{word:"grandmother",categories:["people","family"]},{word:"grass",categories:["thing"]},{word:"greece",categories:["place"]},{word:"guitar",categories:["thing"]},{word:"hair",categories:["thing"]},{word:"hairdresser",categories:["profession"]},{word:"hamburger",categories:["food"]},{word:"helicopter",categories:["transportation"]},{word:"helmet",categories:["thing"]},{word:"holiday",categories:["thing"]},{word:"honey",categories:["food"]},{word:"horse",categories:["animals"]},{word:"hospital",categories:["place"]},{word:"house",categories:["place"]},{word:"hydrogen",categories:["science"]},{word:"ice",categories:["science"]},{word:"insect",categories:["animals"]},{word:"insurance",categories:["thing"]},{word:"intern",categories:["profession"]},{word:"iron",categories:["science"]},{word:"island",categories:["place"]},{word:"jackal",categories:["animals"]},{word:"jelly",categories:["food"]},{word:"jewellery",categories:["thing"]},{word:"jordan",categories:["place"]},{word:"journalist",categories:["profession"]},{word:"joystick",categories:["thing","technology"]},{word:"judge",categories:["profession"]},{word:"juice",categories:["food"]},{word:"kangaroo",categories:["animals"]},{word:"keyboard",categories:["thing","technology"]},{word:"kilobyte",categories:["thing","technology"]},{word:"king",categories:["people"]},{word:"kitchen",categories:["place"]},{word:"kite",categories:["thing"]},{word:"knife",categories:["thing"]},{word:"lamp",categories:["thing"]},{word:"laptop",categories:["thing","technology"]},{word:"lawyer",categories:["profession"]},{word:"leather",categories:["thing"]},{word:"librarian",categories:["profession"]},{word:"library",categories:["place"]},{word:"lifeguard",categories:["profession"]},{word:"lighter",categories:["thing"]},{word:"lion",categories:["animals"]},{word:"lizard",categories:["animals"]},{word:"lock",categories:["thing"]},{word:"london",categories:["place"]},{word:"lunch",categories:["food"]},{word:"machine",categories:["science"]},{word:"magazine",categories:["media"]},{word:"magician",categories:["people"]},{word:"man",categories:["people"]},{word:"manchester",categories:["place"]},{word:"market",categories:["place"]},{word:"match",categories:["thing"]},{word:"mechanic",categories:["profession"]},{word:"megabyte",categories:["thing","technology"]},{word:"memory",categories:["thing","technology"]},{word:"microphone",categories:["thing"]},{word:"midnight",categories:["time"]},{word:"minister",categories:["people","religion"]},{word:"monitor",categories:["thing","technology"]},{word:"monkey",categories:["animals"]},{word:"morn",categories:["time"]},{word:"morning",categories:["time"]},{word:"mother",categories:["people","family"]},{word:"motherboard",categories:["thing","technology"]},{word:"motorcycle",categories:["transportation"]},{word:"mouse",categories:["thing","technology","animals"]},{word:"musician",categories:["profession"]},{word:"nail",categories:["thing"]},{word:"napkin",categories:["thing"]},{word:"needle",categories:["thing"]},{word:"nest",categories:["thing"]},{word:"nigeria",categories:["place"]},{word:"night",categories:["time"]},{word:"nightfall",categories:["time"]},{word:"noon",categories:["time"]},{word:"notebook",categories:["thing"]},{word:"nurse",categories:["profession"]},{word:"ocean",categories:["place"]},{word:"oil",categories:["thing"]},{word:"optician",categories:["profession"]},{word:"orange",categories:["food"]},{word:"oxygen",categories:["science"]},{word:"oyster",categories:["animals"]},{word:"pager",categories:["thing","technology"]},{word:"painter",categories:["profession"]},{word:"painting",categories:["media"]},{word:"park",categories:["place"]},{word:"parrot",categories:["animals"]},{word:"pencil",categories:["thing","education"]},{word:"petabyte",categories:["thing","technology"]},{word:"pharmacist",categories:["profession"]},{word:"photographer",categories:["profession"]},{word:"piano",categories:["thing"]},{word:"pillow",categories:["thing"]},{word:"pilot",categories:["profession"]},{word:"pizza",categories:["food"]},{word:"planet",categories:["science"]},{word:"plastic",categories:["thing"]},{word:"plumber",categories:["profession"]},{word:"policeman",categories:["profession"]},{word:"portugal",categories:["place"]},{word:"postman",categories:["profession"]},{word:"potato",categories:["food"]},{word:"printer",categories:["thing","technology"]},{word:"processor",categories:["thing","technology"]},{word:"psychiatrist",categories:["profession"]},{word:"queen",categories:["people"]},{word:"quill",categories:["thing"]},{word:"rain",categories:["thing"]},{word:"rainbow",categories:["science"]},{word:"raincoat",categories:["thing"]},{word:"ram",categories:["thing","technology"]},{word:"receptionist",categories:["profession"]},{word:"refrigerator",categories:["food"]},{word:"restaurant",categories:["place"]},{word:"river",categories:["thing"]},{word:"rocket",categories:["science"]},{word:"room",categories:["place"]},{word:"rose",categories:["thing"]},{word:"russia",categories:["place"]},{word:"salesclerk",categories:["people","business"]},{word:"salesmen",categories:["profession"]},{word:"sandwich",categories:["food"]},{word:"school",categories:["education"]},{word:"scientist",categories:["profession"]},{word:"scooter",categories:["transportation"]},{word:"secretary",categories:["profession"]},{word:"shampoo",categories:["thing"]},{word:"shoe",categories:["thing"]},{word:"smartphone",categories:["thing","technology"]},{word:"soccer",categories:["sports"]},{word:"solstice",categories:["time"]},{word:"spoon",categories:["thing"]},{word:"spring",categories:["time"]},{word:"state",categories:["place"]},{word:"stone",categories:["thing"]},{word:"student",categories:["people","education"]},{word:"sugar",categories:["food"]},{word:"summer",categories:["time"]},{word:"sundown",categories:["time"]},{word:"sunset",categories:["time"]},{word:"sweden",categories:["place"]},{word:"table",categories:["thing"]},{word:"tailor",categories:["profession"]},{word:"teacher",categories:["people","education","profession"]},{word:"teenager",categories:["people","family"]},{word:"telephone",categories:["thing"]},{word:"television",categories:["media"]},{word:"tent",categories:["thing"]},{word:"terabyte",categories:["thing","technology"]},{word:"thailand",categories:["place"]},{word:"tiger",categories:["animals"]},{word:"toddler",categories:["people","family"]},{word:"tomato",categories:["food"]},{word:"toothbrush",categories:["thing"]},{word:"traffic",categories:["thing"]},{word:"train",categories:["transportation"]},{word:"translator",categories:["profession"]},{word:"truck",categories:["thing","transportation"]},{word:"twilight",categories:["time"]},{word:"uganda",categories:["place"]},{word:"umbrella",categories:["thing"]},{word:"van",categories:["transportation"]},{word:"vase",categories:["thing"]},{word:"vegetable",categories:["food"]},{word:"vr",categories:["thing","technology"]},{word:"vulture",categories:["animals"]},{word:"waiter",categories:["profession"]},{word:"waitress",categories:["profession"]},{word:"wall",categories:["thing"]},{word:"whale",categories:["animals"]},{word:"window",categories:["thing"]},{word:"winter",categories:["time"]},{word:"wire",categories:["thing"]},{word:"wolf",categories:["animals"]},{word:"woman",categories:["people"]},{word:"xylophone",categories:["thing"]},{word:"yacht",categories:["transportation"]},{word:"yak",categories:["animals"]},{word:"yottabyte",categories:["thing","technology"]},{word:"zebra",categories:["animals"]},{word:"zettabyte",categories:["thing","technology"]},{word:"zoo",categories:["animals"]}],adjective:[{word:"abandoned",categories:["condition"]},{word:"abiding",categories:["personality"]},{word:"able",categories:["condition"]},{word:"abrasive",categories:["condition","personality"]},{word:"abnormal",categories:["condition"]},{word:"absurd",categories:["condition"]},{word:"abundant",categories:["quantity"]},{word:"acceptable",categories:["condition"]},{word:"acidic",categories:["taste"]},{word:"acoustic",categories:["sounds"]},{word:"acrid",categories:["condition"]},{word:"adamant",categories:["personality"]},{word:"adorable",categories:["personality"]},{word:"adventurous",categories:["personality"]},{word:"aggressive",categories:["personality"]},{word:"agitated",categories:["personality"]},{word:"agreeable",categories:["personality"]},{word:"alert",categories:["condition"]},{word:"alive",categories:["condition"]},{word:"aloof",categories:["personality"]},{word:"ambitious",categories:["personality"]},{word:"ancient",categories:["time"]},{word:"angry",categories:["personality"]},{word:"annoyed",categories:["personality"]},{word:"antsy",categories:["personality"]},{word:"anxious",categories:["personality"]},{word:"appalling",categories:["personality"]},{word:"appetizing",categories:["taste"]},{word:"apprehensive",categories:["personality"]},{word:"arrogant",categories:["personality"]},{word:"ashamed",categories:["personality"]},{word:"astonishing",categories:["personality"]},{word:"attractive",categories:["appearance"]},{word:"average",categories:["appearance"]},{word:"bad",categories:["condition"]},{word:"bald",categories:["appearance"]},{word:"bashful",categories:["personality"]},{word:"beautiful",categories:["appearance"]},{word:"beefy",categories:["appearance"]},{word:"belligerent",categories:["personality"]},{word:"bent",categories:["condition"]},{word:"better",categories:["condition"]},{word:"best",categories:["condition"]},{word:"better",categories:["condition"]},{word:"bewildered",categories:["personality"]},{word:"big",categories:["size"]},{word:"billions",categories:["quantity"]},{word:"billowy",categories:["appearance"]},{word:"bitter",categories:["taste"]},{word:"black",categories:["color"]},{word:"bland",categories:["taste"]},{word:"blue",categories:["color"]},{word:"blushing",categories:["appearance"]},{word:"bored",categories:["personality"]},{word:"boring",categories:["personality"]},{word:"boundless",categories:["personality"]},{word:"brainy",categories:["personality"]},{word:"brash",categories:["personality"]},{word:"brave",categories:["personality"]},{word:"breezy",categories:["touch"]},{word:"brief",categories:["time"]},{word:"bright",categories:["appearance"]},{word:"broad",categories:["shapes"]},{word:"broken",categories:["condition"]},{word:"brown",categories:["color"]},{word:"bulky",categories:["appearance"]},{word:"bumpy",categories:["touch"]},{word:"burly",categories:["appearance"]},{word:"busy",categories:["personality"]},{word:"cagey",categories:["personality"]},{word:"calm",categories:["personality"]},{word:"callous",categories:["personality"]},{word:"careful",categories:["condition"]},{word:"chilly",categories:["touch"]},{word:"chubby",categories:["appearance"]},{word:"clean",categories:["appearance"]},{word:"clever",categories:["condition"]},{word:"clumsy",categories:["personality"]},{word:"cold",categories:["touch"]},{word:"colossal",categories:["size"]},{word:"cool",categories:["touch"]},{word:"crashing",categories:["sounds"]},{word:"creamy",categories:["taste"]},{word:"crooked",categories:["shapes"]},{word:"cuddly",categories:["touch"]},{word:"curved",categories:["shapes"]},{word:"damaged",categories:["touch"]},{word:"damp",categories:["touch"]},{word:"dazzling",categories:["appearance"]},{word:"dead",categories:["condition"]},{word:"deafening",categories:["sounds"]},{word:"deep",categories:["shapes"]},{word:"defeated",categories:["personality"]},{word:"delicious",categories:["taste"]},{word:"delightful",categories:["personality"]},{word:"dirty",categories:["touch"]},{word:"disgusting",categories:["taste"]},{word:"drab",categories:["appearance"]},{word:"dry",categories:["touch"]},{word:"eager",categories:["personality"]},{word:"early",categories:["time"]},{word:"easy",categories:["condition"]},{word:"echoing",categories:["sounds"]},{word:"elegant",categories:["appearance"]},{word:"embarrassed",categories:["personality"]},{word:"enough",categories:["quantity"]},{word:"faint",categories:["sounds"]},{word:"faithful",categories:["personality"]},{word:"famous",categories:["condition"]},{word:"fancy",categories:["appearance"]},{word:"fast",categories:["time"]},{word:"fat",categories:["size"]},{word:"few",categories:["quantity"]},{word:"fierce",categories:["personality"]},{word:"fit",categories:["appearance"]},{word:"flabby",categories:["appearance"]},{word:"flaky",categories:["touch"]},{word:"flat",categories:["shapes"]},{word:"fluffy",categories:["touch"]},{word:"freezing",categories:["touch"]},{word:"fresh",categories:["taste"]},{word:"full",categories:["quantity"]},{word:"future",categories:["time"]},{word:"gentle",categories:["personality"]},{word:"gifted",categories:["condition"]},{word:"gigantic",categories:["size"]},{word:"glamorous",categories:["appearance"]},{word:"gorgeous",categories:["appearance"]},{word:"gray",categories:["color"]},{word:"greasy",categories:["touch","taste"]},{word:"great",categories:["size"]},{word:"green",categories:["color"]},{word:"grumpy",categories:["personality"]},{word:"hallowed",categories:["condition"]},{word:"handsome",categories:["appearance"]},{word:"happy",categories:["personality"]},{word:"harsh",categories:["sounds"]},{word:"helpful",categories:["condition"]},{word:"helpless",categories:["personality"]},{word:"high",categories:["shapes"]},{word:"hissing",categories:["sounds"]},{word:"hollow",categories:["shapes"]},{word:"hot",categories:["touch","taste"]},{word:"howling",categories:["sounds"]},{word:"huge",categories:["size"]},{word:"hundreds",categories:["quantity"]},{word:"icy",categories:["touch"]},{word:"immense",categories:["size"]},{word:"important",categories:["condition"]},{word:"incalculable",categories:["quantity"]},{word:"inexpensive",categories:["condition"]},{word:"itchy",categories:["personality"]},{word:"jealous",categories:["personality"]},{word:"jolly",categories:["personality"]},{word:"juicy",categories:["taste"]},{word:"kind",categories:["personality"]},{word:"large",categories:["size"]},{word:"late",categories:["time"]},{word:"lazy",categories:["personality"]},{word:"lemon",categories:["color"]},{word:"limited",categories:["quantity"]},{word:"little",categories:["size","quantity"]},{word:"lively",categories:["personality"]},{word:"long",categories:["time","appearance"]},{word:"loose",categories:["touch"]},{word:"loud",categories:["sounds"]},{word:"low",categories:["shapes"]},{word:"magnificent",categories:["appearance"]},{word:"mammoth",categories:["size"]},{word:"mango",categories:["color"]},{word:"many",categories:["quantity"]},{word:"massive",categories:["size"]},{word:"mealy",categories:["condition"]},{word:"melodic",categories:["sounds"]},{word:"melted",categories:["touch"]},{word:"microscopic",categories:["size"]},{word:"millions",categories:["quantity"]},{word:"miniature",categories:["size"]},{word:"modern",categories:["time"]},{word:"moldy",categories:["taste"]},{word:"most",categories:["quantity"]},{word:"muscular",categories:["appearance"]},{word:"mushy",categories:["condition"]},{word:"mysterious",categories:["personality"]},{word:"narrow",categories:["shapes"]},{word:"nervous",categories:["personality"]},{word:"nice",categories:["personality"]},{word:"noisy",categories:["sounds"]},{word:"numerous",categories:["quantity"]},{word:"nutritious",categories:["taste"]},{word:"nutty",categories:["taste"]},{word:"obedient",categories:["personality"]},{word:"obnoxious",categories:["personality"]},{word:"odd",categories:["condition"]},{word:"old",categories:["time"]},{word:"orange",categories:["color"]},{word:"panicky",categories:["personality"]},{word:"petite",categories:["size"]},{word:"pitiful",categories:["personality"]},{word:"plain",categories:["appearance"]},{word:"plump",categories:["appearance"]},{word:"polite",categories:["personality"]},{word:"poor",categories:["condition"]},{word:"powerful",categories:["condition"]},{word:"prehistoric",categories:["time"]},{word:"prickly",categories:["touch"]},{word:"proud",categories:["personality"]},{word:"puny",categories:["size"]},{word:"purple",categories:["color"]},{word:"purring",categories:["sounds"]},{word:"putrid",categories:["taste"]},{word:"quaint",categories:["appearance"]},{word:"quick",categories:["time"]},{word:"quiet",categories:["sounds"]},{word:"rancid",categories:["taste"]},{word:"rapid",categories:["time"]},{word:"rapping",categories:["sounds"]},{word:"raspy",categories:["sounds"]},{word:"red",categories:["color"]},{word:"refined",categories:["shapes"]},{word:"repulsive",categories:["personality"]},{word:"rhythmic",categories:["sounds"]},{word:"rich",categories:["condition"]},{word:"ripe",categories:["taste"]},{word:"rotten",categories:["taste"]},{word:"rough",categories:["touch"]},{word:"round",categories:["shapes"]},{word:"salmon",categories:["color"]},{word:"salty",categories:["taste"]},{word:"savory",categories:["taste"]},{word:"scarce",categories:["quantity"]},{word:"scary",categories:["personality"]},{word:"scrawny",categories:["size"]},{word:"screeching",categories:["sounds"]},{word:"scruffy",categories:["appearance"]},{word:"shaggy",categories:["touch"]},{word:"shallow",categories:["shapes"]},{word:"shapely",categories:["appearance"]},{word:"sharp",categories:["touch"]},{word:"short",categories:["size","appearance","time"]},{word:"shrilling",categories:["sounds"]},{word:"shy",categories:["condition"]},{word:"silly",categories:["personality"]},{word:"skinny",categories:["appearance","shapes"]},{word:"slimy",categories:["touch"]},{word:"slow",categories:["time"]},{word:"small",categories:["size"]},{word:"some",categories:["quantity"]},{word:"sour",categories:["taste"]},{word:"sparse",categories:["quantity"]},{word:"spicy",categories:["taste"]},{word:"spoiled",categories:["taste"]},{word:"square",categories:["shapes"]},{word:"squeaking",categories:["sounds"]},{word:"stale",categories:["taste"]},{word:"steep",categories:["shapes"]},{word:"sticky",categories:["touch"]},{word:"stocky",categories:["appearance"]},{word:"straight",categories:["shapes"]},{word:"strong",categories:["touch"]},{word:"substantial",categories:["quantity"]},{word:"sweet",categories:["taste"]},{word:"swift",categories:["time"]},{word:"tall",categories:["size"]},{word:"tangy",categories:["taste"]},{word:"tart",categories:["taste"]},{word:"tasteless",categories:["taste"]},{word:"tasty",categories:["taste"]},{word:"teeny",categories:["size"]},{word:"tender",categories:["condition"]},{word:"thankful",categories:["personality"]},{word:"thoughtless",categories:["personality"]},{word:"thousands",categories:["quantity"]},{word:"thundering",categories:["sounds"]},{word:"tight",categories:["touch"]},{word:"tinkling",categories:["sounds"]},{word:"tiny",categories:["size"]},{word:"ugly",categories:["appearance"]},{word:"uneven",categories:["touch"]},{word:"unimportant",categories:["condition"]},{word:"uninterested",categories:["condition"]},{word:"unkempt",categories:["appearance"]},{word:"unsightly",categories:["appearance"]},{word:"uptight",categories:["personality"]},{word:"vast",categories:["condition"]},{word:"victorious",categories:["personality"]},{word:"wailing",categories:["sounds"]},{word:"warm",categories:["touch"]},{word:"weak",categories:["touch"]},{word:"wet",categories:["touch"]},{word:"whining",categories:["sounds"]},{word:"whispering",categories:["sounds"]},{word:"white",categories:["color"]},{word:"wide",categories:["shapes"]},{word:"witty",categories:["personality"]},{word:"wonderful",categories:["personality"]},{word:"wooden",categories:["touch"]},{word:"worried",categories:["personality"]},{word:"wrong",categories:["condition"]},{word:"yellow",categories:["color"]},{word:"young",categories:["time"]},{word:"yummy",categories:["taste"]},{word:"zealous",categories:["personality"]}]};function r(n,a){var s,o;a===void 0&&(a=[]);var l=new Set(a),u=[];try{for(var h=e(t.wordList[n]),d=h.next();!d.done;d=h.next()){var p=d.value;(a.length===0||p.categories.some(function(g){return l.has(g)}))&&u.push(p.word)}}catch(g){s={error:g}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(s)throw s.error}}return u}t.getWordsByCategory=r})(words);var __assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},__assign.apply(this,arguments)};Object.defineProperty(dist$1,"__esModule",{value:!0});dist$1.totalUniqueSlugs=generateSlug_1=dist$1.generateSlug=void 0;var words_1=words,DEFAULT_NUMBER_OF_WORDS=3;function generateSlug(t,e){for(var r=t||DEFAULT_NUMBER_OF_WORDS,n={partsOfSpeech:getDefaultPartsOfSpeech(r),categories:{},format:"kebab"},a=__assign(__assign({},n),e),s=[],o=0;o<r;o++){var l=a.partsOfSpeech[o],u=words_1.getWordsByCategory(a.partsOfSpeech[o],a.categories[l]),h=u[Math.floor(Math.random()*u.length)];s.push(h)}return formatter(s,a.format)}var generateSlug_1=dist$1.generateSlug=generateSlug;function getDefaultPartsOfSpeech(t){for(var e=[],r=0;r<t-1;r++)e.push("adjective");return e.push("noun"),e}function formatter(t,e){return e==="kebab"?t.join("-").toLowerCase():e==="camel"?t.map(function(r,n){return n===0?r.toLowerCase():r[0].toUpperCase()+r.slice(1).toLowerCase()}).join(""):e==="lower"?t.join(" ").toLowerCase():e==="sentence"?t.map(function(r,n){return n===0?r[0].toUpperCase()+r.slice(1).toLowerCase():r}).join(" "):t.map(function(r){return r[0].toUpperCase()+r.slice(1).toLowerCase()}).join(" ")}function totalUniqueSlugs(t,e){for(var r,n,a=words_1.getWordsByCategory("adjective",(r=e==null?void 0:e.categories)===null||r===void 0?void 0:r.adjective).length,s=words_1.getWordsByCategory("noun",(n=e==null?void 0:e.categories)===null||n===void 0?void 0:n.noun).length,o={adjective:a,noun:s},l=t||DEFAULT_NUMBER_OF_WORDS,u=(e==null?void 0:e.partsOfSpeech)||getDefaultPartsOfSpeech(l),h=1,d=0;d<l;d++)h*=o[u[d]];return h}dist$1.totalUniqueSlugs=totalUniqueSlugs;let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const byteToHex=[];for(let t=0;t<256;++t)byteToHex.push((t+256).toString(16).slice(1));function unsafeStringify(t,e=0){return(byteToHex[t[e+0]]+byteToHex[t[e+1]]+byteToHex[t[e+2]]+byteToHex[t[e+3]]+"-"+byteToHex[t[e+4]]+byteToHex[t[e+5]]+"-"+byteToHex[t[e+6]]+byteToHex[t[e+7]]+"-"+byteToHex[t[e+8]]+byteToHex[t[e+9]]+"-"+byteToHex[t[e+10]]+byteToHex[t[e+11]]+byteToHex[t[e+12]]+byteToHex[t[e+13]]+byteToHex[t[e+14]]+byteToHex[t[e+15]]).toLowerCase()}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4(t,e,r){if(native.randomUUID&&!e&&!t)return native.randomUUID();t=t||{};const n=t.random||(t.rng||rng)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let a=0;a<16;++a)e[r+a]=n[a];return e}return unsafeStringify(n)}const MAX_AUTO_HISTORY_LENGTH=30,historyModeStore=persist(writable("manual"),localStorage(),"autoHistoryMode"),autoHistoryStore=persist(writable([]),localStorage(),"autoHistoryStore"),manualHistoryStore=persist(writable([]),localStorage(),"manualHistoryStore"),loaderHistoryStore=writable([]),historyStore=derived([historyModeStore,autoHistoryStore,manualHistoryStore,loaderHistoryStore],([t,e,r,n],a)=>{switch(t){case"auto":{a(e);break}case"manual":{a(r);break}case"loader":{a(n);break}default:a(e)}}),addHistoryEntry=t=>{const e={...t,id:v4()};if(e.type==="loader"){loaderHistoryStore.update(r=>[e,...r]);return}e.name||(e.name=generateSlug_1(2)),e.type==="auto"?autoHistoryStore.update(r=>(r.length>=MAX_AUTO_HISTORY_LENGTH&&(r=r.slice(0,MAX_AUTO_HISTORY_LENGTH-1)),[e,...r])):e.type==="manual"&&(manualHistoryStore.update(r=>[e,...r]),logEvent("history",{action:"save"}))},clearHistoryData=t=>{(get_store_value(historyModeStore)==="auto"?autoHistoryStore:manualHistoryStore).update(e=>(get_store_value(historyModeStore)!=="loader"&&(e=e.filter(({id:r})=>t&&r!=t),logEvent("history",{action:"clear",type:t?"single":"all"})),e))},getPreviousState=t=>{const e=get_store_value(t?autoHistoryStore:manualHistoryStore);return e.length>0?JSON.stringify(e[0].state):""},restoreHistory=t=>{const e=t.filter(n=>validateEntry(n)),r=t.length-e.length;if(r>0&&(console.error(`${r} invalid history entries were removed.`),console.error(t)),e.length>0){let n=0;(e[0].type==="auto"?autoHistoryStore:manualHistoryStore).update(a=>{const s=new Set(a.map(({id:u})=>u)),o=e.filter(({id:u})=>!s.has(u));n=o.length;const l=[...a,...o];return l.sort((u,h)=>h.time-u.time),l}),alert(`${n} entries restored. ${r} invalid, ${e.length-n} duplicates.`),logEvent("history",{action:"restore",success:n,invalid:r,duplicates:e.length-n})}else alert("No valid entries found.")},setIDs=t=>{for(const e of t)e.id||(e.id=v4());return t},injectHistoryIDs=()=>{autoHistoryStore.update(setIDs),manualHistoryStore.update(setIDs)},validateEntry=t=>t.type&&t.state&&t.time&&!0,codeFileName="code.mmd",configFileName="config.json",isValidGist=t=>codeFileName in t,getFileContent=async t=>t.truncated?await fetchText(t.raw_url):t.content,getGistData=async t=>{const e=t.split("github.com").pop();if(!e)throw new Error("Invalid GitHub URL"+t);const[r,n,a,s]=e.split("/"),{html_url:o,files:l,history:u}=await fetchJSON(`https://api.github.com/gists/${a}${s?"/"+s:""}`);if(isValidGist(l)){const h=await getFileContent(l[codeFileName]);let d="{}";configFileName in l&&(d=await getFileContent(l[configFileName]));const p=u[0];return{url:`${o}/${p.version}`,code:h,config:d,author:p.user.login,time:new Date(p.committed_at).getTime(),version:p.version.slice(-7)}}else throw new Error("Invalid gist provided")},getStateFromGist=(t,e=t.url)=>{const r={...defaultState,code:t.code,loader:{type:"gist",config:{url:e}}};return t.config&&(r.mermaid=t.config),r},loadGistData=async t=>{const e=t.split("github.com").pop();if(!e)throw new Error("Invalid GitHub URL"+t);const[r,n,a,s]=e.split("/"),{history:o}=await fetchJSON(`https://api.github.com/gists/${a}${s?"/"+s:""}`),l=[];for(const d of o){const p=await getGistData(d.url).catch();p&&l.push(p)}if(l.length===0)throw new Error("Invalid gist provided");l.reverse();const u=l.slice(-1).pop();if(!u)throw new Error("Invalid gist provided");const h=getStateFromGist(u,t);for(const d of l)addHistoryEntry({state:getStateFromGist(d),time:d.time,type:"loader",url:d.url,name:`${d.author} v${d.version}`});return h},loaders={gist:loadGistData},loadDataFromUrl=async()=>{const t=new URLSearchParams(window.location.search);let e=defaultState,r=!1;const n=t.get("code")??void 0,a=t.get("config")??void 0;let s;const o=a?await fetchText(a):defaultState.mermaid;if(n&&(s=await fetchText(n),r=!0),s){if(!n)throw new Error("Code URL is not defined");e={code:s,mermaid:o,loader:{type:"files",config:{codeURL:n,configURL:a}}}}else for(const[l,u]of t.entries())if(l in loaders)try{e=await loaders[l](u),r=!0;break}catch(h){console.error(h)}r&&updateCodeStore({...e,autoSync:!0,updateDiagram:!0})},migrations={injectHistoryIDs},migrationStore=persist(writable({version:-1}),localStorage(),"migrations"),applyMigrations=()=>{const{version:t}=get_store_value(migrationStore),e=Object.entries(migrations);if(t!==e.length-1){console.log(`Current migration version: v${t}. Migrating to v${e.length-1}.`);for(let r=t+1;r<e.length;r++){const[n,a]=e[r];console.log(`Applying migration ${r}: ${n}.`),a(),logEvent("migration",{key:n}),migrationStore.set({version:r})}logEvent("migration",{status:"complete",from:t,to:e.length-1})}};function commonjsRequire(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.')}var moment_min={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(commonjsGlobal,function(){var r;function n(){return r.apply(null,arguments)}function a(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function s(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function o(f,b){return Object.prototype.hasOwnProperty.call(f,b)}function l(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;for(var b in f)if(o(f,b))return;return 1}function u(f){return f===void 0}function h(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function d(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function p(f,b){for(var S=[],O=f.length,V=0;V<O;++V)S.push(b(f[V],V));return S}function g(f,b){for(var S in b)o(b,S)&&(f[S]=b[S]);return o(b,"toString")&&(f.toString=b.toString),o(b,"valueOf")&&(f.valueOf=b.valueOf),f}function m(f,b,S,O){return $e(f,b,S,O,!0).utc()}function T(f){return f._pf==null&&(f._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),f._pf}function I(f){if(f._isValid==null){var b=T(f),S=C.call(b.parsedDateParts,function(O){return O!=null}),S=!isNaN(f._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidEra&&!b.invalidMonth&&!b.invalidWeekday&&!b.weekdayMismatch&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&S);if(f._strict&&(S=S&&b.charsLeftOver===0&&b.unusedTokens.length===0&&b.bigHour===void 0),Object.isFrozen!=null&&Object.isFrozen(f))return S;f._isValid=S}return f._isValid}function A(f){var b=m(NaN);return f!=null?g(T(b),f):T(b).userInvalidated=!0,b}var C=Array.prototype.some||function(f){for(var b=Object(this),S=b.length>>>0,O=0;O<S;O++)if(O in b&&f.call(this,b[O],O,b))return!0;return!1},L=n.momentProperties=[],M=!1;function F(f,b){var S,O,V,lt=L.length;if(u(b._isAMomentObject)||(f._isAMomentObject=b._isAMomentObject),u(b._i)||(f._i=b._i),u(b._f)||(f._f=b._f),u(b._l)||(f._l=b._l),u(b._strict)||(f._strict=b._strict),u(b._tzm)||(f._tzm=b._tzm),u(b._isUTC)||(f._isUTC=b._isUTC),u(b._offset)||(f._offset=b._offset),u(b._pf)||(f._pf=T(b)),u(b._locale)||(f._locale=b._locale),0<lt)for(S=0;S<lt;S++)u(V=b[O=L[S]])||(f[O]=V);return f}function H(f){F(this,f),this._d=new Date(f._d!=null?f._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),M===!1&&(M=!0,n.updateOffset(this),M=!1)}function q(f){return f instanceof H||f!=null&&f._isAMomentObject!=null}function U(f){n.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+f)}function z(f,b){var S=!0;return g(function(){if(n.deprecationHandler!=null&&n.deprecationHandler(null,f),S){for(var O,V,lt=[],bt=arguments.length,Ct=0;Ct<bt;Ct++){if(O="",typeof arguments[Ct]=="object"){for(V in O+=`
[`+Ct+"] ",arguments[0])o(arguments[0],V)&&(O+=V+": "+arguments[0][V]+", ");O=O.slice(0,-2)}else O=arguments[Ct];lt.push(O)}U(f+`
Arguments: `+Array.prototype.slice.call(lt).join("")+`
`+new Error().stack),S=!1}return b.apply(this,arguments)},b)}var R={};function $(f,b){n.deprecationHandler!=null&&n.deprecationHandler(f,b),R[f]||(U(b),R[f]=!0)}function D(f){return typeof Function<"u"&&f instanceof Function||Object.prototype.toString.call(f)==="[object Function]"}function k(f,b){var S,O=g({},f);for(S in b)o(b,S)&&(s(f[S])&&s(b[S])?(O[S]={},g(O[S],f[S]),g(O[S],b[S])):b[S]!=null?O[S]=b[S]:delete O[S]);for(S in f)o(f,S)&&!o(b,S)&&s(f[S])&&(O[S]=g({},O[S]));return O}function B(f){f!=null&&this.set(f)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;var v=Object.keys||function(f){var b,S=[];for(b in f)o(f,b)&&S.push(b);return S};function J(f,b,S){var O=""+Math.abs(f);return(0<=f?S?"+":"":"-")+Math.pow(10,Math.max(0,b-O.length)).toString().substr(1)+O}var E=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ft=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Lt={},Tt={};function Q(f,b,S,O){var V=typeof O=="string"?function(){return this[O]()}:O;f&&(Tt[f]=V),b&&(Tt[b[0]]=function(){return J(V.apply(this,arguments),b[1],b[2])}),S&&(Tt[S]=function(){return this.localeData().ordinal(V.apply(this,arguments),f)})}function ut(f,b){return f.isValid()?(b=st(b,f.localeData()),Lt[b]=Lt[b]||function(S){for(var O,V=S.match(E),lt=0,bt=V.length;lt<bt;lt++)Tt[V[lt]]?V[lt]=Tt[V[lt]]:V[lt]=(O=V[lt]).match(/\[[\s\S]/)?O.replace(/^\[|\]$/g,""):O.replace(/\\/g,"");return function(Ct){for(var Bt="",$t=0;$t<bt;$t++)Bt+=D(V[$t])?V[$t].call(Ct,S):V[$t];return Bt}}(b),Lt[b](f)):f.localeData().invalidDate()}function st(f,b){var S=5;function O(V){return b.longDateFormat(V)||V}for(ft.lastIndex=0;0<=S&&ft.test(f);)f=f.replace(ft,O),ft.lastIndex=0,--S;return f}var ot={};function dt(f,b){var S=f.toLowerCase();ot[S]=ot[S+"s"]=ot[b]=f}function xt(f){return typeof f=="string"?ot[f]||ot[f.toLowerCase()]:void 0}function et(f){var b,S,O={};for(S in f)o(f,S)&&(b=xt(S))&&(O[b]=f[S]);return O}var Nt={};function G(f,b){Nt[f]=b}function Z(f){return f%4==0&&f%100!=0||f%400==0}function tt(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function W(b){var b=+b,S=0;return S=b!=0&&isFinite(b)?tt(b):S}function Y(f,b){return function(S){return S!=null?(it(this,f,S),n.updateOffset(this,b),this):P(this,f)}}function P(f,b){return f.isValid()?f._d["get"+(f._isUTC?"UTC":"")+b]():NaN}function it(f,b,S){f.isValid()&&!isNaN(S)&&(b==="FullYear"&&Z(f.year())&&f.month()===1&&f.date()===29?(S=W(S),f._d["set"+(f._isUTC?"UTC":"")+b](S,f.month(),pt(S,f.month()))):f._d["set"+(f._isUTC?"UTC":"")+b](S))}var N=/\d/,ae=/\d\d/,gt=/\d{3}/,or=/\d{4}/,er=/[+-]?\d{6}/,j=/\d\d?/,Ft=/\d\d\d\d?/,at=/\d\d\d\d\d\d?/,Dt=/\d{1,3}/,rr=/\d{1,4}/,tr=/[+-]?\d{1,6}/,kt=/\d+/,_t=/[+-]?\d+/,St=/Z|[+-]\d\d:?\d\d/gi,Et=/Z|[+-]\d\d(?::?\d\d)?/gi,yt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function ct(f,b,S){Wt[f]=D(b)?b:function(O,V){return O&&S?S:b}}function ne(f,b){return o(Wt,f)?Wt[f](b._strict,b._locale):new RegExp(jt(f.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(S,O,V,lt,bt){return O||V||lt||bt})))}function jt(f){return f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Wt={},qt={};function Ht(f,b){var S,O,V=b;for(typeof f=="string"&&(f=[f]),h(b)&&(V=function(lt,bt){bt[b]=W(lt)}),O=f.length,S=0;S<O;S++)qt[f[S]]=V}function ge(f,b){Ht(f,function(S,O,V,lt){V._w=V._w||{},b(S,V._w,V,lt)})}var zt,Pt=0,Mt=1,wt=2,mt=3,It=4,vt=5,Ut=6,ht=7,Jt=8;function pt(f,b){if(isNaN(f)||isNaN(b))return NaN;var S=(b%(S=12)+S)%S;return f+=(b-S)/12,S==1?Z(f)?29:28:31-S%7%2}zt=Array.prototype.indexOf||function(f){for(var b=0;b<this.length;++b)if(this[b]===f)return b;return-1},Q("M",["MM",2],"Mo",function(){return this.month()+1}),Q("MMM",0,0,function(f){return this.localeData().monthsShort(this,f)}),Q("MMMM",0,0,function(f){return this.localeData().months(this,f)}),dt("month","M"),G("month",8),ct("M",j),ct("MM",j,ae),ct("MMM",function(f,b){return b.monthsShortRegex(f)}),ct("MMMM",function(f,b){return b.monthsRegex(f)}),Ht(["M","MM"],function(f,b){b[Mt]=W(f)-1}),Ht(["MMM","MMMM"],function(f,b,S,O){O=S._locale.monthsParse(f,O,S._strict),O!=null?b[Mt]=O:T(S).invalidMonth=f});var Kt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),oe="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ue=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,he=yt,fe=yt;function Gt(f,b){var S;if(f.isValid()){if(typeof b=="string"){if(/^\d+$/.test(b))b=W(b);else if(!h(b=f.localeData().monthsParse(b)))return}S=Math.min(f.date(),pt(f.year(),b)),f._d["set"+(f._isUTC?"UTC":"")+"Month"](b,S)}}function te(f){return f!=null?(Gt(this,f),n.updateOffset(this,!0),this):P(this,"Month")}function ce(){function f(bt,Ct){return Ct.length-bt.length}for(var b,S=[],O=[],V=[],lt=0;lt<12;lt++)b=m([2e3,lt]),S.push(this.monthsShort(b,"")),O.push(this.months(b,"")),V.push(this.months(b,"")),V.push(this.monthsShort(b,""));for(S.sort(f),O.sort(f),V.sort(f),lt=0;lt<12;lt++)S[lt]=jt(S[lt]),O[lt]=jt(O[lt]);for(lt=0;lt<24;lt++)V[lt]=jt(V[lt]);this._monthsRegex=new RegExp("^("+V.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+O.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+S.join("|")+")","i")}function Zt(f){return Z(f)?366:365}Q("Y",0,0,function(){var f=this.year();return f<=9999?J(f,4):"+"+f}),Q(0,["YY",2],0,function(){return this.year()%100}),Q(0,["YYYY",4],0,"year"),Q(0,["YYYYY",5],0,"year"),Q(0,["YYYYYY",6,!0],0,"year"),dt("year","y"),G("year",1),ct("Y",_t),ct("YY",j,ae),ct("YYYY",rr,or),ct("YYYYY",tr,er),ct("YYYYYY",tr,er),Ht(["YYYYY","YYYYYY"],Pt),Ht("YYYY",function(f,b){b[Pt]=f.length===2?n.parseTwoDigitYear(f):W(f)}),Ht("YY",function(f,b){b[Pt]=n.parseTwoDigitYear(f)}),Ht("Y",function(f,b){b[Pt]=parseInt(f,10)}),n.parseTwoDigitYear=function(f){return W(f)+(68<W(f)?1900:2e3)};var xr=Y("FullYear",!0);function Ue(f,b,S,O,V,lt,bt){var Ct;return f<100&&0<=f?(Ct=new Date(f+400,b,S,O,V,lt,bt),isFinite(Ct.getFullYear())&&Ct.setFullYear(f)):Ct=new Date(f,b,S,O,V,lt,bt),Ct}function Be(f){var b;return f<100&&0<=f?((b=Array.prototype.slice.call(arguments))[0]=f+400,b=new Date(Date.UTC.apply(null,b)),isFinite(b.getUTCFullYear())&&b.setUTCFullYear(f)):b=new Date(Date.UTC.apply(null,arguments)),b}function _e(f,b,S){return S=7+b-S,S-(7+Be(f,0,S).getUTCDay()-b)%7-1}function ee(f,bt,Ct,O,V){var lt,bt=1+7*(bt-1)+(7+Ct-O)%7+_e(f,O,V),Ct=bt<=0?Zt(lt=f-1)+bt:bt>Zt(f)?(lt=f+1,bt-Zt(f)):(lt=f,bt);return{year:lt,dayOfYear:Ct}}function Te(f,b,S){var O,V,lt=_e(f.year(),b,S),lt=Math.floor((f.dayOfYear()-lt-1)/7)+1;return lt<1?O=lt+we(V=f.year()-1,b,S):lt>we(f.year(),b,S)?(O=lt-we(f.year(),b,S),V=f.year()+1):(V=f.year(),O=lt),{week:O,year:V}}function we(f,V,S){var O=_e(f,V,S),V=_e(f+1,V,S);return(Zt(f)-O+V)/7}Q("w",["ww",2],"wo","week"),Q("W",["WW",2],"Wo","isoWeek"),dt("week","w"),dt("isoWeek","W"),G("week",5),G("isoWeek",5),ct("w",j),ct("ww",j,ae),ct("W",j),ct("WW",j,ae),ge(["w","ww","W","WW"],function(f,b,S,O){b[O.substr(0,1)]=W(f)});function Ee(f,b){return f.slice(b,7).concat(f.slice(0,b))}Q("d",0,"do","day"),Q("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),Q("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),Q("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),Q("e",0,0,"weekday"),Q("E",0,0,"isoWeekday"),dt("day","d"),dt("weekday","e"),dt("isoWeekday","E"),G("day",11),G("weekday",11),G("isoWeekday",11),ct("d",j),ct("e",j),ct("E",j),ct("dd",function(f,b){return b.weekdaysMinRegex(f)}),ct("ddd",function(f,b){return b.weekdaysShortRegex(f)}),ct("dddd",function(f,b){return b.weekdaysRegex(f)}),ge(["dd","ddd","dddd"],function(f,b,S,O){O=S._locale.weekdaysParse(f,O,S._strict),O!=null?b.d=O:T(S).invalidWeekday=f}),ge(["d","e","E"],function(f,b,S,O){b[O]=W(f)});var ke="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),xe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Le="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ie=yt,Yt=yt,rt=yt;function At(){function f($t,se){return se.length-$t.length}for(var b,S,O,V=[],lt=[],bt=[],Ct=[],Bt=0;Bt<7;Bt++)O=m([2e3,1]).day(Bt),b=jt(this.weekdaysMin(O,"")),S=jt(this.weekdaysShort(O,"")),O=jt(this.weekdays(O,"")),V.push(b),lt.push(S),bt.push(O),Ct.push(b),Ct.push(S),Ct.push(O);V.sort(f),lt.sort(f),bt.sort(f),Ct.sort(f),this._weekdaysRegex=new RegExp("^("+Ct.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+bt.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+lt.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+V.join("|")+")","i")}function Rt(){return this.hours()%12||12}function le(f,b){Q(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function be(f,b){return b._meridiemParse}Q("H",["HH",2],0,"hour"),Q("h",["hh",2],0,Rt),Q("k",["kk",2],0,function(){return this.hours()||24}),Q("hmm",0,0,function(){return""+Rt.apply(this)+J(this.minutes(),2)}),Q("hmmss",0,0,function(){return""+Rt.apply(this)+J(this.minutes(),2)+J(this.seconds(),2)}),Q("Hmm",0,0,function(){return""+this.hours()+J(this.minutes(),2)}),Q("Hmmss",0,0,function(){return""+this.hours()+J(this.minutes(),2)+J(this.seconds(),2)}),le("a",!0),le("A",!1),dt("hour","h"),G("hour",13),ct("a",be),ct("A",be),ct("H",j),ct("h",j),ct("k",j),ct("HH",j,ae),ct("hh",j,ae),ct("kk",j,ae),ct("hmm",Ft),ct("hmmss",at),ct("Hmm",Ft),ct("Hmmss",at),Ht(["H","HH"],mt),Ht(["k","kk"],function(f,b,S){f=W(f),b[mt]=f===24?0:f}),Ht(["a","A"],function(f,b,S){S._isPm=S._locale.isPM(f),S._meridiem=f}),Ht(["h","hh"],function(f,b,S){b[mt]=W(f),T(S).bigHour=!0}),Ht("hmm",function(f,b,S){var O=f.length-2;b[mt]=W(f.substr(0,O)),b[It]=W(f.substr(O)),T(S).bigHour=!0}),Ht("hmmss",function(f,b,S){var O=f.length-4,V=f.length-2;b[mt]=W(f.substr(0,O)),b[It]=W(f.substr(O,2)),b[vt]=W(f.substr(V)),T(S).bigHour=!0}),Ht("Hmm",function(f,b,S){var O=f.length-2;b[mt]=W(f.substr(0,O)),b[It]=W(f.substr(O))}),Ht("Hmmss",function(f,b,S){var O=f.length-4,V=f.length-2;b[mt]=W(f.substr(0,O)),b[It]=W(f.substr(O,2)),b[vt]=W(f.substr(V))}),yt=Y("Hours",!0);var ye,Ce={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:Kt,monthsShort:oe,week:{dow:0,doy:6},weekdays:ke,weekdaysMin:Le,weekdaysShort:xe,meridiemParse:/[ap]\.?m?\.?/i},de={},ve={};function Ke(f){return f&&f.toLowerCase().replace("_","-")}function Qe(f){for(var b,S,O,V,lt=0;lt<f.length;){for(b=(V=Ke(f[lt]).split("-")).length,S=(S=Ke(f[lt+1]))?S.split("-"):null;0<b;){if(O=Me(V.slice(0,b).join("-")))return O;if(S&&S.length>=b&&function(bt,Ct){for(var Bt=Math.min(bt.length,Ct.length),$t=0;$t<Bt;$t+=1)if(bt[$t]!==Ct[$t])return $t;return Bt}(V,S)>=b-1)break;b--}lt++}return ye}function Me(f){var b;if(de[f]===void 0&&t&&t.exports&&f.match("^[^/\\\\]*$")!=null)try{b=ye._abbr,commonjsRequire("./locale/"+f),Vt(b)}catch{de[f]=null}return de[f]}function Vt(f,b){return f&&((b=u(b)?ie(f):Xt(f,b))?ye=b:typeof console<"u"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),ye._abbr}function Xt(f,b){if(b===null)return delete de[f],null;var S,O=Ce;if(b.abbr=f,de[f]!=null)$("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."),O=de[f]._config;else if(b.parentLocale!=null)if(de[b.parentLocale]!=null)O=de[b.parentLocale]._config;else{if((S=Me(b.parentLocale))==null)return ve[b.parentLocale]||(ve[b.parentLocale]=[]),ve[b.parentLocale].push({name:f,config:b}),null;O=S._config}return de[f]=new B(k(O,b)),ve[f]&&ve[f].forEach(function(V){Xt(V.name,V.config)}),Vt(f),de[f]}function ie(f){var b;if(!(f=f&&f._locale&&f._locale._abbr?f._locale._abbr:f))return ye;if(!a(f)){if(b=Me(f))return b;f=[f]}return Qe(f)}function Ot(f){var b=f._a;return b&&T(f).overflow===-2&&(b=b[Mt]<0||11<b[Mt]?Mt:b[wt]<1||b[wt]>pt(b[Pt],b[Mt])?wt:b[mt]<0||24<b[mt]||b[mt]===24&&(b[It]!==0||b[vt]!==0||b[Ut]!==0)?mt:b[It]<0||59<b[It]?It:b[vt]<0||59<b[vt]?vt:b[Ut]<0||999<b[Ut]?Ut:-1,T(f)._overflowDayOfYear&&(b<Pt||wt<b)&&(b=wt),T(f)._overflowWeeks&&b===-1&&(b=ht),T(f)._overflowWeekday&&b===-1&&(b=Jt),T(f).overflow=b),f}var Se=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,X=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ir=/Z|[+-]\d\d(?::?\d\d)?/,nt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Ne=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pr=/^\/?Date\((-?\d+)/i,Er=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,mr={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function yr(f){var b,S,O,V,lt,bt,Bt=f._i,Ct=Se.exec(Bt)||X.exec(Bt),Bt=nt.length,$t=Ne.length;if(Ct){for(T(f).iso=!0,b=0,S=Bt;b<S;b++)if(nt[b][1].exec(Ct[1])){V=nt[b][0],O=nt[b][2]!==!1;break}if(V==null)f._isValid=!1;else{if(Ct[3]){for(b=0,S=$t;b<S;b++)if(Ne[b][1].exec(Ct[3])){lt=(Ct[2]||" ")+Ne[b][0];break}if(lt==null)return void(f._isValid=!1)}if(O||lt==null){if(Ct[4]){if(!ir.exec(Ct[4]))return void(f._isValid=!1);bt="Z"}f._f=V+(lt||"")+(bt||""),fr(f)}else f._isValid=!1}}else f._isValid=!1}function De(f,b,S,O,V,lt){return f=[function(bt){bt=parseInt(bt,10);{if(bt<=49)return 2e3+bt;if(bt<=999)return 1900+bt}return bt}(f),oe.indexOf(b),parseInt(S,10),parseInt(O,10),parseInt(V,10)],lt&&f.push(parseInt(lt,10)),f}function Ve(f){var b,S,O,V,lt=Er.exec(f._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));lt?(b=De(lt[4],lt[3],lt[2],lt[5],lt[6],lt[7]),S=lt[1],O=b,V=f,S&&xe.indexOf(S)!==new Date(O[0],O[1],O[2]).getDay()?(T(V).weekdayMismatch=!0,V._isValid=!1):(f._a=b,f._tzm=(S=lt[8],O=lt[9],V=lt[10],S?mr[S]:O?0:60*(((S=parseInt(V,10))-(O=S%100))/100)+O),f._d=Be.apply(null,f._a),f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),T(f).rfc2822=!0)):f._isValid=!1}function We(f,b,S){return f??b??S}function nr(f){var b,S,O,V,lt,bt,Ct,Bt,$t,se,Qt,Ae=[];if(!f._d){for(O=f,V=new Date(n.now()),S=O._useUTC?[V.getUTCFullYear(),V.getUTCMonth(),V.getUTCDate()]:[V.getFullYear(),V.getMonth(),V.getDate()],f._w&&f._a[wt]==null&&f._a[Mt]==null&&((V=(O=f)._w).GG!=null||V.W!=null||V.E!=null?(Bt=1,$t=4,lt=We(V.GG,O._a[Pt],Te(me(),1,4).year),bt=We(V.W,1),((Ct=We(V.E,1))<1||7<Ct)&&(se=!0)):(Bt=O._locale._week.dow,$t=O._locale._week.doy,Qt=Te(me(),Bt,$t),lt=We(V.gg,O._a[Pt],Qt.year),bt=We(V.w,Qt.week),V.d!=null?((Ct=V.d)<0||6<Ct)&&(se=!0):V.e!=null?(Ct=V.e+Bt,(V.e<0||6<V.e)&&(se=!0)):Ct=Bt),bt<1||bt>we(lt,Bt,$t)?T(O)._overflowWeeks=!0:se!=null?T(O)._overflowWeekday=!0:(Qt=ee(lt,bt,Ct,Bt,$t),O._a[Pt]=Qt.year,O._dayOfYear=Qt.dayOfYear)),f._dayOfYear!=null&&(V=We(f._a[Pt],S[Pt]),(f._dayOfYear>Zt(V)||f._dayOfYear===0)&&(T(f)._overflowDayOfYear=!0),se=Be(V,0,f._dayOfYear),f._a[Mt]=se.getUTCMonth(),f._a[wt]=se.getUTCDate()),b=0;b<3&&f._a[b]==null;++b)f._a[b]=Ae[b]=S[b];for(;b<7;b++)f._a[b]=Ae[b]=f._a[b]==null?b===2?1:0:f._a[b];f._a[mt]===24&&f._a[It]===0&&f._a[vt]===0&&f._a[Ut]===0&&(f._nextDay=!0,f._a[mt]=0),f._d=(f._useUTC?Be:Ue).apply(null,Ae),lt=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[mt]=24),f._w&&f._w.d!==void 0&&f._w.d!==lt&&(T(f).weekdayMismatch=!0)}}function fr(f){if(f._f===n.ISO_8601)yr(f);else if(f._f===n.RFC_2822)Ve(f);else{f._a=[],T(f).empty=!0;for(var b,S,O,V,lt,bt=""+f._i,Ct=bt.length,Bt=0,$t=st(f._f,f._locale).match(E)||[],se=$t.length,Qt=0;Qt<se;Qt++)S=$t[Qt],(b=(bt.match(ne(S,f))||[])[0])&&(0<(O=bt.substr(0,bt.indexOf(b))).length&&T(f).unusedInput.push(O),bt=bt.slice(bt.indexOf(b)+b.length),Bt+=b.length),Tt[S]?(b?T(f).empty=!1:T(f).unusedTokens.push(S),O=S,lt=f,(V=b)!=null&&o(qt,O)&&qt[O](V,lt._a,lt,O)):f._strict&&!b&&T(f).unusedTokens.push(S);T(f).charsLeftOver=Ct-Bt,0<bt.length&&T(f).unusedInput.push(bt),f._a[mt]<=12&&T(f).bigHour===!0&&0<f._a[mt]&&(T(f).bigHour=void 0),T(f).parsedDateParts=f._a.slice(0),T(f).meridiem=f._meridiem,f._a[mt]=function(Ae,Re,He){return He==null?Re:Ae.meridiemHour!=null?Ae.meridiemHour(Re,He):Ae.isPM!=null?((Ae=Ae.isPM(He))&&Re<12&&(Re+=12),Re=Ae||Re!==12?Re:0):Re}(f._locale,f._a[mt],f._meridiem),(Ct=T(f).era)!==null&&(f._a[Pt]=f._locale.erasConvertYear(Ct,f._a[Pt])),nr(f),Ot(f)}}function _r(f){var b,S,O,V=f._i,lt=f._f;return f._locale=f._locale||ie(f._l),V===null||lt===void 0&&V===""?A({nullInput:!0}):(typeof V=="string"&&(f._i=V=f._locale.preparse(V)),q(V)?new H(Ot(V)):(d(V)?f._d=V:a(lt)?function(bt){var Ct,Bt,$t,se,Qt,Ae,Re=!1,He=bt._f.length;if(He===0)return T(bt).invalidFormat=!0,bt._d=new Date(NaN);for(se=0;se<He;se++)Qt=0,Ae=!1,Ct=F({},bt),bt._useUTC!=null&&(Ct._useUTC=bt._useUTC),Ct._f=bt._f[se],fr(Ct),I(Ct)&&(Ae=!0),Qt=(Qt+=T(Ct).charsLeftOver)+10*T(Ct).unusedTokens.length,T(Ct).score=Qt,Re?Qt<$t&&($t=Qt,Bt=Ct):($t==null||Qt<$t||Ae)&&($t=Qt,Bt=Ct,Ae&&(Re=!0));g(bt,Bt||Ct)}(f):lt?fr(f):u(lt=(V=f)._i)?V._d=new Date(n.now()):d(lt)?V._d=new Date(lt.valueOf()):typeof lt=="string"?(S=V,(b=pr.exec(S._i))!==null?S._d=new Date(+b[1]):(yr(S),S._isValid===!1&&(delete S._isValid,Ve(S),S._isValid===!1&&(delete S._isValid,S._strict?S._isValid=!1:n.createFromInputFallback(S))))):a(lt)?(V._a=p(lt.slice(0),function(bt){return parseInt(bt,10)}),nr(V)):s(lt)?(b=V)._d||(O=(S=et(b._i)).day===void 0?S.date:S.day,b._a=p([S.year,S.month,O,S.hour,S.minute,S.second,S.millisecond],function(bt){return bt&&parseInt(bt,10)}),nr(b)):h(lt)?V._d=new Date(lt):n.createFromInputFallback(V),I(f)||(f._d=null),f))}function $e(f,b,S,O,V){var lt={};return b!==!0&&b!==!1||(O=b,b=void 0),S!==!0&&S!==!1||(O=S,S=void 0),(s(f)&&l(f)||a(f)&&f.length===0)&&(f=void 0),lt._isAMomentObject=!0,lt._useUTC=lt._isUTC=V,lt._l=S,lt._i=f,lt._f=b,lt._strict=O,(V=new H(Ot(_r(V=lt))))._nextDay&&(V.add(1,"d"),V._nextDay=void 0),V}function me(f,b,S,O){return $e(f,b,S,O,!1)}n.createFromInputFallback=z("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(f){f._d=new Date(f._i+(f._useUTC?" UTC":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){},Ft=z("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=me.apply(null,arguments);return this.isValid()&&f.isValid()?f<this?this:f:A()}),at=z("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=me.apply(null,arguments);return this.isValid()&&f.isValid()?this<f?this:f:A()});function Oe(f,b){var S,O;if(!(b=b.length===1&&a(b[0])?b[0]:b).length)return me();for(S=b[0],O=1;O<b.length;++O)b[O].isValid()&&!b[O][f](S)||(S=b[O]);return S}var Ge=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ye(b){var b=et(b),S=b.year||0,O=b.quarter||0,V=b.month||0,lt=b.week||b.isoWeek||0,bt=b.day||0,Ct=b.hour||0,Bt=b.minute||0,$t=b.second||0,se=b.millisecond||0;this._isValid=function(Qt){var Ae,Re,He=!1,Dr=Ge.length;for(Ae in Qt)if(o(Qt,Ae)&&(zt.call(Ge,Ae)===-1||Qt[Ae]!=null&&isNaN(Qt[Ae])))return!1;for(Re=0;Re<Dr;++Re)if(Qt[Ge[Re]]){if(He)return!1;parseFloat(Qt[Ge[Re]])!==W(Qt[Ge[Re]])&&(He=!0)}return!0}(b),this._milliseconds=+se+1e3*$t+6e4*Bt+1e3*Ct*60*60,this._days=+bt+7*lt,this._months=+V+3*O+12*S,this._data={},this._locale=ie(),this._bubble()}function je(f){return f instanceof Ye}function Fe(f){return f<0?-1*Math.round(-1*f):Math.round(f)}function gr(f,b){Q(f,0,0,function(){var S=this.utcOffset(),O="+";return S<0&&(S=-S,O="-"),O+J(~~(S/60),2)+b+J(~~S%60,2)})}gr("Z",":"),gr("ZZ",""),ct("Z",Et),ct("ZZ",Et),Ht(["Z","ZZ"],function(f,b,S){S._useUTC=!0,S._tzm=ar(Et,f)});var cr=/([\+\-]|\d\d)/gi;function ar(f,S){var S=(S||"").match(f);return S===null?null:(S=60*(f=((S[S.length-1]||[])+"").match(cr)||["-",0,0])[1]+W(f[2]))===0?0:f[0]==="+"?S:-S}function Pe(f,b){var S;return b._isUTC?(b=b.clone(),S=(q(f)||d(f)?f:me(f)).valueOf()-b.valueOf(),b._d.setTime(b._d.valueOf()+S),n.updateOffset(b,!1),b):me(f).local()}function kr(f){return-Math.round(f._d.getTimezoneOffset())}function Rr(){return!!this.isValid()&&this._isUTC&&this._offset===0}n.updateOffset=function(){};var qr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Zr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ze(f,b){var S,O=f,V=null;return je(f)?O={ms:f._milliseconds,d:f._days,M:f._months}:h(f)||!isNaN(+f)?(O={},b?O[b]=+f:O.milliseconds=+f):(V=qr.exec(f))?(S=V[1]==="-"?-1:1,O={y:0,d:W(V[wt])*S,h:W(V[mt])*S,m:W(V[It])*S,s:W(V[vt])*S,ms:W(Fe(1e3*V[Ut]))*S}):(V=Zr.exec(f))?(S=V[1]==="-"?-1:1,O={y:sr(V[2],S),M:sr(V[3],S),w:sr(V[4],S),d:sr(V[5],S),h:sr(V[6],S),m:sr(V[7],S),s:sr(V[8],S)}):O==null?O={}:typeof O=="object"&&("from"in O||"to"in O)&&(b=function(lt,bt){var Ct;return!lt.isValid()||!bt.isValid()?{milliseconds:0,months:0}:(bt=Pe(bt,lt),lt.isBefore(bt)?Ct=$r(lt,bt):((Ct=$r(bt,lt)).milliseconds=-Ct.milliseconds,Ct.months=-Ct.months),Ct)}(me(O.from),me(O.to)),(O={}).ms=b.milliseconds,O.M=b.months),V=new Ye(O),je(f)&&o(f,"_locale")&&(V._locale=f._locale),je(f)&&o(f,"_isValid")&&(V._isValid=f._isValid),V}function sr(f,b){return f=f&&parseFloat(f.replace(",",".")),(isNaN(f)?0:f)*b}function $r(f,b){var S={};return S.months=b.month()-f.month()+12*(b.year()-f.year()),f.clone().add(S.months,"M").isAfter(b)&&--S.months,S.milliseconds=+b-+f.clone().add(S.months,"M"),S}function Nr(f,b){return function(S,O){var V;return O===null||isNaN(+O)||($(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),V=S,S=O,O=V),Or(this,ze(S,O),f),this}}function Or(f,bt,S,O){var V=bt._milliseconds,lt=Fe(bt._days),bt=Fe(bt._months);f.isValid()&&(O=O==null||O,bt&&Gt(f,P(f,"Month")+bt*S),lt&&it(f,"Date",P(f,"Date")+lt*S),V&&f._d.setTime(f._d.valueOf()+V*S),O&&n.updateOffset(f,lt||bt))}ze.fn=Ye.prototype,ze.invalid=function(){return ze(NaN)},Kt=Nr(1,"add"),ke=Nr(-1,"subtract");function Mr(f){return typeof f=="string"||f instanceof String}function Xr(f){return q(f)||d(f)||Mr(f)||h(f)||function(b){var S=a(b),O=!1;return S&&(O=b.filter(function(V){return!h(V)&&Mr(b)}).length===0),S&&O}(f)||function(b){var S,O,V=s(b)&&!l(b),lt=!1,bt=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],Ct=bt.length;for(S=0;S<Ct;S+=1)O=bt[S],lt=lt||o(b,O);return V&&lt}(f)||f==null}function br(f,V){if(f.date()<V.date())return-br(V,f);var S=12*(V.year()-f.year())+(V.month()-f.month()),O=f.clone().add(S,"months"),V=V-O<0?(V-O)/(O-f.clone().add(S-1,"months")):(V-O)/(f.clone().add(1+S,"months")-O);return-(S+V)||0}function Br(f){return f===void 0?this._locale._abbr:((f=ie(f))!=null&&(this._locale=f),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",Le=z("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function Fr(){return this._locale}var Pr=126227808e5;function ur(f,b){return(f%b+b)%b}function Ur(f,b,S){return f<100&&0<=f?new Date(f+400,b,S)-Pr:new Date(f,b,S).valueOf()}function Yr(f,b,S){return f<100&&0<=f?Date.UTC(f+400,b,S)-Pr:Date.UTC(f,b,S)}function Sr(f,b){return b.erasAbbrRegex(f)}function Cr(){for(var f=[],b=[],S=[],O=[],V=this.eras(),lt=0,bt=V.length;lt<bt;++lt)b.push(jt(V[lt].name)),f.push(jt(V[lt].abbr)),S.push(jt(V[lt].narrow)),O.push(jt(V[lt].name)),O.push(jt(V[lt].abbr)),O.push(jt(V[lt].narrow));this._erasRegex=new RegExp("^("+O.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+b.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+f.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+S.join("|")+")","i")}function vr(f,b){Q(0,[f,f.length],0,b)}function zr(f,b,S,O,V){var lt;return f==null?Te(this,O,V).year:(lt=we(f,O,V),function(bt,Ct,Bt,$t,se){return bt=ee(bt,Ct,Bt,$t,se),Ct=Be(bt.year,0,bt.dayOfYear),this.year(Ct.getUTCFullYear()),this.month(Ct.getUTCMonth()),this.date(Ct.getUTCDate()),this}.call(this,f,b=lt<b?lt:b,S,O,V))}Q("N",0,0,"eraAbbr"),Q("NN",0,0,"eraAbbr"),Q("NNN",0,0,"eraAbbr"),Q("NNNN",0,0,"eraName"),Q("NNNNN",0,0,"eraNarrow"),Q("y",["y",1],"yo","eraYear"),Q("y",["yy",2],0,"eraYear"),Q("y",["yyy",3],0,"eraYear"),Q("y",["yyyy",4],0,"eraYear"),ct("N",Sr),ct("NN",Sr),ct("NNN",Sr),ct("NNNN",function(f,b){return b.erasNameRegex(f)}),ct("NNNNN",function(f,b){return b.erasNarrowRegex(f)}),Ht(["N","NN","NNN","NNNN","NNNNN"],function(f,b,S,O){O=S._locale.erasParse(f,O,S._strict),O?T(S).era=O:T(S).invalidEra=f}),ct("y",kt),ct("yy",kt),ct("yyy",kt),ct("yyyy",kt),ct("yo",function(f,b){return b._eraYearOrdinalRegex||kt}),Ht(["y","yy","yyy","yyyy"],Pt),Ht(["yo"],function(f,b,S,O){var V;S._locale._eraYearOrdinalRegex&&(V=f.match(S._locale._eraYearOrdinalRegex)),S._locale.eraYearOrdinalParse?b[Pt]=S._locale.eraYearOrdinalParse(f,V):b[Pt]=parseInt(f,10)}),Q(0,["gg",2],0,function(){return this.weekYear()%100}),Q(0,["GG",2],0,function(){return this.isoWeekYear()%100}),vr("gggg","weekYear"),vr("ggggg","weekYear"),vr("GGGG","isoWeekYear"),vr("GGGGG","isoWeekYear"),dt("weekYear","gg"),dt("isoWeekYear","GG"),G("weekYear",1),G("isoWeekYear",1),ct("G",_t),ct("g",_t),ct("GG",j,ae),ct("gg",j,ae),ct("GGGG",rr,or),ct("gggg",rr,or),ct("GGGGG",tr,er),ct("ggggg",tr,er),ge(["gggg","ggggg","GGGG","GGGGG"],function(f,b,S,O){b[O.substr(0,2)]=W(f)}),ge(["gg","GG"],function(f,b,S,O){b[O]=n.parseTwoDigitYear(f)}),Q("Q",0,"Qo","quarter"),dt("quarter","Q"),G("quarter",7),ct("Q",N),Ht("Q",function(f,b){b[Mt]=3*(W(f)-1)}),Q("D",["DD",2],"Do","date"),dt("date","D"),G("date",9),ct("D",j),ct("DD",j,ae),ct("Do",function(f,b){return f?b._dayOfMonthOrdinalParse||b._ordinalParse:b._dayOfMonthOrdinalParseLenient}),Ht(["D","DD"],wt),Ht("Do",function(f,b){b[wt]=W(f.match(j)[0])}),rr=Y("Date",!0),Q("DDD",["DDDD",3],"DDDo","dayOfYear"),dt("dayOfYear","DDD"),G("dayOfYear",4),ct("DDD",Dt),ct("DDDD",gt),Ht(["DDD","DDDD"],function(f,b,S){S._dayOfYear=W(f)}),Q("m",["mm",2],0,"minute"),dt("minute","m"),G("minute",14),ct("m",j),ct("mm",j,ae),Ht(["m","mm"],It);var Je,or=Y("Minutes",!1),tr=(Q("s",["ss",2],0,"second"),dt("second","s"),G("second",15),ct("s",j),ct("ss",j,ae),Ht(["s","ss"],vt),Y("Seconds",!1));for(Q("S",0,0,function(){return~~(this.millisecond()/100)}),Q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Q(0,["SSS",3],0,"millisecond"),Q(0,["SSSS",4],0,function(){return 10*this.millisecond()}),Q(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),Q(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),Q(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),Q(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),Q(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),dt("millisecond","ms"),G("millisecond",16),ct("S",Dt,N),ct("SS",Dt,ae),ct("SSS",Dt,gt),Je="SSSS";Je.length<=9;Je+="S")ct(Je,kt);function Kr(f,b){b[Ut]=W(1e3*("0."+f))}for(Je="S";Je.length<=9;Je+="S")Ht(Je,Kr);er=Y("Milliseconds",!1),Q("z",0,0,"zoneAbbr"),Q("zz",0,0,"zoneName"),N=H.prototype;function Hr(f){return f}N.add=Kt,N.calendar=function(S,V){arguments.length===1&&(arguments[0]?Xr(arguments[0])?(S=arguments[0],V=void 0):function(lt){for(var bt=s(lt)&&!l(lt),Ct=!1,Bt=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],$t=0;$t<Bt.length;$t+=1)Ct=Ct||o(lt,Bt[$t]);return bt&&Ct}(arguments[0])&&(V=arguments[0],S=void 0):V=S=void 0);var S=S||me(),O=Pe(S,this).startOf("day"),O=n.calendarFormat(this,O)||"sameElse",V=V&&(D(V[O])?V[O].call(this,S):V[O]);return this.format(V||this.localeData().calendar(O,this,me(S)))},N.clone=function(){return new H(this)},N.diff=function(f,b,S){var O,V,lt;if(!this.isValid())return NaN;if(!(O=Pe(f,this)).isValid())return NaN;switch(V=6e4*(O.utcOffset()-this.utcOffset()),b=xt(b)){case"year":lt=br(this,O)/12;break;case"month":lt=br(this,O);break;case"quarter":lt=br(this,O)/3;break;case"second":lt=(this-O)/1e3;break;case"minute":lt=(this-O)/6e4;break;case"hour":lt=(this-O)/36e5;break;case"day":lt=(this-O-V)/864e5;break;case"week":lt=(this-O-V)/6048e5;break;default:lt=this-O}return S?lt:tt(lt)},N.endOf=function(f){var b,S;if((f=xt(f))===void 0||f==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Yr:Ur,f){case"year":b=S(this.year()+1,0,1)-1;break;case"quarter":b=S(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":b=S(this.year(),this.month()+1,1)-1;break;case"week":b=S(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":b=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":b=S(this.year(),this.month(),this.date()+1)-1;break;case"hour":b=this._d.valueOf(),b+=36e5-ur(b+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":b=this._d.valueOf(),b+=6e4-ur(b,6e4)-1;break;case"second":b=this._d.valueOf(),b+=1e3-ur(b,1e3)-1;break}return this._d.setTime(b),n.updateOffset(this,!0),this},N.format=function(f){return f=f||(this.isUtc()?n.defaultFormatUtc:n.defaultFormat),f=ut(this,f),this.localeData().postformat(f)},N.from=function(f,b){return this.isValid()&&(q(f)&&f.isValid()||me(f).isValid())?ze({to:this,from:f}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()},N.fromNow=function(f){return this.from(me(),f)},N.to=function(f,b){return this.isValid()&&(q(f)&&f.isValid()||me(f).isValid())?ze({from:this,to:f}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()},N.toNow=function(f){return this.to(me(),f)},N.get=function(f){return D(this[f=xt(f)])?this[f]():this},N.invalidAt=function(){return T(this).overflow},N.isAfter=function(f,b){return f=q(f)?f:me(f),!(!this.isValid()||!f.isValid())&&((b=xt(b)||"millisecond")==="millisecond"?this.valueOf()>f.valueOf():f.valueOf()<this.clone().startOf(b).valueOf())},N.isBefore=function(f,b){return f=q(f)?f:me(f),!(!this.isValid()||!f.isValid())&&((b=xt(b)||"millisecond")==="millisecond"?this.valueOf()<f.valueOf():this.clone().endOf(b).valueOf()<f.valueOf())},N.isBetween=function(f,b,S,O){return f=q(f)?f:me(f),b=q(b)?b:me(b),!!(this.isValid()&&f.isValid()&&b.isValid())&&((O=O||"()")[0]==="("?this.isAfter(f,S):!this.isBefore(f,S))&&(O[1]===")"?this.isBefore(b,S):!this.isAfter(b,S))},N.isSame=function(S,b){var S=q(S)?S:me(S);return!(!this.isValid()||!S.isValid())&&((b=xt(b)||"millisecond")==="millisecond"?this.valueOf()===S.valueOf():(S=S.valueOf(),this.clone().startOf(b).valueOf()<=S&&S<=this.clone().endOf(b).valueOf()))},N.isSameOrAfter=function(f,b){return this.isSame(f,b)||this.isAfter(f,b)},N.isSameOrBefore=function(f,b){return this.isSame(f,b)||this.isBefore(f,b)},N.isValid=function(){return I(this)},N.lang=Le,N.locale=Br,N.localeData=Fr,N.max=at,N.min=Ft,N.parsingFlags=function(){return g({},T(this))},N.set=function(f,b){if(typeof f=="object")for(var S=function(lt){var bt,Ct=[];for(bt in lt)o(lt,bt)&&Ct.push({unit:bt,priority:Nt[bt]});return Ct.sort(function(Bt,$t){return Bt.priority-$t.priority}),Ct}(f=et(f)),O=S.length,V=0;V<O;V++)this[S[V].unit](f[S[V].unit]);else if(D(this[f=xt(f)]))return this[f](b);return this},N.startOf=function(f){var b,S;if((f=xt(f))===void 0||f==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Yr:Ur,f){case"year":b=S(this.year(),0,1);break;case"quarter":b=S(this.year(),this.month()-this.month()%3,1);break;case"month":b=S(this.year(),this.month(),1);break;case"week":b=S(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":b=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":b=S(this.year(),this.month(),this.date());break;case"hour":b=this._d.valueOf(),b-=ur(b+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":b=this._d.valueOf(),b-=ur(b,6e4);break;case"second":b=this._d.valueOf(),b-=ur(b,1e3);break}return this._d.setTime(b),n.updateOffset(this,!0),this},N.subtract=ke,N.toArray=function(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]},N.toObject=function(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}},N.toDate=function(){return new Date(this.valueOf())},N.toISOString=function(f){if(!this.isValid())return null;var b=(f=f!==!0)?this.clone().utc():this;return b.year()<0||9999<b.year()?ut(b,f?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?f?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",ut(b,"Z")):ut(b,f?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},N.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f,b="moment",S="";return this.isLocal()||(b=this.utcOffset()===0?"moment.utc":"moment.parseZone",S="Z"),b="["+b+'("]',f=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(b+f+"-MM-DD[T]HH:mm:ss.SSS"+(S+'[")]'))},typeof Symbol<"u"&&Symbol.for!=null&&(N[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},N.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},N.eraName=function(){for(var f,b=this.localeData().eras(),S=0,O=b.length;S<O;++S)if(f=this.clone().startOf("day").valueOf(),b[S].since<=f&&f<=b[S].until||b[S].until<=f&&f<=b[S].since)return b[S].name;return""},N.eraNarrow=function(){for(var f,b=this.localeData().eras(),S=0,O=b.length;S<O;++S)if(f=this.clone().startOf("day").valueOf(),b[S].since<=f&&f<=b[S].until||b[S].until<=f&&f<=b[S].since)return b[S].narrow;return""},N.eraAbbr=function(){for(var f,b=this.localeData().eras(),S=0,O=b.length;S<O;++S)if(f=this.clone().startOf("day").valueOf(),b[S].since<=f&&f<=b[S].until||b[S].until<=f&&f<=b[S].since)return b[S].abbr;return""},N.eraYear=function(){for(var f,b,S=this.localeData().eras(),O=0,V=S.length;O<V;++O)if(f=S[O].since<=S[O].until?1:-1,b=this.clone().startOf("day").valueOf(),S[O].since<=b&&b<=S[O].until||S[O].until<=b&&b<=S[O].since)return(this.year()-n(S[O].since).year())*f+S[O].offset;return this.year()},N.year=xr,N.isLeapYear=function(){return Z(this.year())},N.weekYear=function(f){return zr.call(this,f,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},N.isoWeekYear=function(f){return zr.call(this,f,this.isoWeek(),this.isoWeekday(),1,4)},N.quarter=N.quarters=function(f){return f==null?Math.ceil((this.month()+1)/3):this.month(3*(f-1)+this.month()%3)},N.month=te,N.daysInMonth=function(){return pt(this.year(),this.month())},N.week=N.weeks=function(f){var b=this.localeData().week(this);return f==null?b:this.add(7*(f-b),"d")},N.isoWeek=N.isoWeeks=function(f){var b=Te(this,1,4).week;return f==null?b:this.add(7*(f-b),"d")},N.weeksInYear=function(){var f=this.localeData()._week;return we(this.year(),f.dow,f.doy)},N.weeksInWeekYear=function(){var f=this.localeData()._week;return we(this.weekYear(),f.dow,f.doy)},N.isoWeeksInYear=function(){return we(this.year(),1,4)},N.isoWeeksInISOWeekYear=function(){return we(this.isoWeekYear(),1,4)},N.date=rr,N.day=N.days=function(f){if(!this.isValid())return f!=null?this:NaN;var b,S,O=this._isUTC?this._d.getUTCDay():this._d.getDay();return f!=null?(b=f,S=this.localeData(),f=typeof b!="string"?b:isNaN(b)?typeof(b=S.weekdaysParse(b))=="number"?b:null:parseInt(b,10),this.add(f-O,"d")):O},N.weekday=function(f){if(!this.isValid())return f!=null?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return f==null?b:this.add(f-b,"d")},N.isoWeekday=function(f){return this.isValid()?f!=null?(b=f,S=this.localeData(),S=typeof b=="string"?S.weekdaysParse(b)%7||7:isNaN(b)?null:b,this.day(this.day()%7?S:S-7)):this.day()||7:f!=null?this:NaN;var b,S},N.dayOfYear=function(f){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?b:this.add(f-b,"d")},N.hour=N.hours=yt,N.minute=N.minutes=or,N.second=N.seconds=tr,N.millisecond=N.milliseconds=er,N.utcOffset=function(f,b,S){var O,V=this._offset||0;if(!this.isValid())return f!=null?this:NaN;if(f==null)return this._isUTC?V:kr(this);if(typeof f=="string"){if((f=ar(Et,f))===null)return this}else Math.abs(f)<16&&!S&&(f*=60);return!this._isUTC&&b&&(O=kr(this)),this._offset=f,this._isUTC=!0,O!=null&&this.add(O,"m"),V!==f&&(!b||this._changeInProgress?Or(this,ze(f-V,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this},N.utc=function(f){return this.utcOffset(0,f)},N.local=function(f){return this._isUTC&&(this.utcOffset(0,f),this._isUTC=!1,f&&this.subtract(kr(this),"m")),this},N.parseZone=function(){var f;return this._tzm!=null?this.utcOffset(this._tzm,!1,!0):typeof this._i=="string"&&((f=ar(St,this._i))!=null?this.utcOffset(f):this.utcOffset(0,!0)),this},N.hasAlignedHourOffset=function(f){return!!this.isValid()&&(f=f?me(f).utcOffset():0,(this.utcOffset()-f)%60==0)},N.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},N.isLocal=function(){return!!this.isValid()&&!this._isUTC},N.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},N.isUtc=Rr,N.isUTC=Rr,N.zoneAbbr=function(){return this._isUTC?"UTC":""},N.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},N.dates=z("dates accessor is deprecated. Use date instead.",rr),N.months=z("months accessor is deprecated. Use month instead",te),N.years=z("years accessor is deprecated. Use year instead",xr),N.zone=z("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(f,b){return f!=null?(this.utcOffset(f=typeof f!="string"?-f:f,b),this):-this.utcOffset()}),N.isDSTShifted=z("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var f,b={};return F(b,this),(b=_r(b))._a?(f=(b._isUTC?m:me)(b._a),this._isDSTShifted=this.isValid()&&0<function(S,O,V){for(var lt=Math.min(S.length,O.length),bt=Math.abs(S.length-O.length),Ct=0,Bt=0;Bt<lt;Bt++)(V&&S[Bt]!==O[Bt]||!V&&W(S[Bt])!==W(O[Bt]))&&Ct++;return Ct+bt}(b._a,f.toArray())):this._isDSTShifted=!1,this._isDSTShifted}),ae=B.prototype;function Tr(f,b,S,lt){var V=ie(),lt=m().set(lt,b);return V[S](lt,f)}function Vr(f,b,S){if(h(f)&&(b=f,f=void 0),f=f||"",b!=null)return Tr(f,b,S,"month");for(var O=[],V=0;V<12;V++)O[V]=Tr(f,V,S,"month");return O}function Ar(f,b,S,O){b=(typeof f=="boolean"?h(b)&&(S=b,b=void 0):(b=f,f=!1,h(S=b)&&(S=b,b=void 0)),b||"");var V,lt=ie(),bt=f?lt._week.dow:0,Ct=[];if(S!=null)return Tr(b,(S+bt)%7,O,"day");for(V=0;V<7;V++)Ct[V]=Tr(b,(V+bt)%7,O,"day");return Ct}ae.calendar=function(f,b,S){return D(f=this._calendar[f]||this._calendar.sameElse)?f.call(b,S):f},ae.longDateFormat=function(f){var b=this._longDateFormat[f],S=this._longDateFormat[f.toUpperCase()];return b||!S?b:(this._longDateFormat[f]=S.match(E).map(function(O){return O==="MMMM"||O==="MM"||O==="DD"||O==="dddd"?O.slice(1):O}).join(""),this._longDateFormat[f])},ae.invalidDate=function(){return this._invalidDate},ae.ordinal=function(f){return this._ordinal.replace("%d",f)},ae.preparse=Hr,ae.postformat=Hr,ae.relativeTime=function(f,b,S,O){var V=this._relativeTime[S];return D(V)?V(f,b,S,O):V.replace(/%d/i,f)},ae.pastFuture=function(f,b){return D(f=this._relativeTime[0<f?"future":"past"])?f(b):f.replace(/%s/i,b)},ae.set=function(f){var b,S;for(S in f)o(f,S)&&(D(b=f[S])?this[S]=b:this["_"+S]=b);this._config=f,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},ae.eras=function(f,b){for(var S,O=this._eras||ie("en")._eras,V=0,lt=O.length;V<lt;++V){switch(typeof O[V].since){case"string":S=n(O[V].since).startOf("day"),O[V].since=S.valueOf();break}switch(typeof O[V].until){case"undefined":O[V].until=1/0;break;case"string":S=n(O[V].until).startOf("day").valueOf(),O[V].until=S.valueOf();break}}return O},ae.erasParse=function(f,b,S){var O,V,lt,bt,Ct,Bt=this.eras();for(f=f.toUpperCase(),O=0,V=Bt.length;O<V;++O)if(lt=Bt[O].name.toUpperCase(),bt=Bt[O].abbr.toUpperCase(),Ct=Bt[O].narrow.toUpperCase(),S)switch(b){case"N":case"NN":case"NNN":if(bt===f)return Bt[O];break;case"NNNN":if(lt===f)return Bt[O];break;case"NNNNN":if(Ct===f)return Bt[O];break}else if(0<=[lt,bt,Ct].indexOf(f))return Bt[O]},ae.erasConvertYear=function(f,b){var S=f.since<=f.until?1:-1;return b===void 0?n(f.since).year():n(f.since).year()+(b-f.offset)*S},ae.erasAbbrRegex=function(f){return o(this,"_erasAbbrRegex")||Cr.call(this),f?this._erasAbbrRegex:this._erasRegex},ae.erasNameRegex=function(f){return o(this,"_erasNameRegex")||Cr.call(this),f?this._erasNameRegex:this._erasRegex},ae.erasNarrowRegex=function(f){return o(this,"_erasNarrowRegex")||Cr.call(this),f?this._erasNarrowRegex:this._erasRegex},ae.months=function(f,b){return f?(a(this._months)?this._months:this._months[(this._months.isFormat||ue).test(b)?"format":"standalone"])[f.month()]:a(this._months)?this._months:this._months.standalone},ae.monthsShort=function(f,b){return f?(a(this._monthsShort)?this._monthsShort:this._monthsShort[ue.test(b)?"format":"standalone"])[f.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},ae.monthsParse=function(f,b,S){var O,V;if(this._monthsParseExact)return function(Qt,bt,Ct){var Bt,$t,se,Qt=Qt.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],Bt=0;Bt<12;++Bt)se=m([2e3,Bt]),this._shortMonthsParse[Bt]=this.monthsShort(se,"").toLocaleLowerCase(),this._longMonthsParse[Bt]=this.months(se,"").toLocaleLowerCase();return Ct?bt==="MMM"?($t=zt.call(this._shortMonthsParse,Qt))!==-1?$t:null:($t=zt.call(this._longMonthsParse,Qt))!==-1?$t:null:bt==="MMM"?($t=zt.call(this._shortMonthsParse,Qt))!==-1||($t=zt.call(this._longMonthsParse,Qt))!==-1?$t:null:($t=zt.call(this._longMonthsParse,Qt))!==-1||($t=zt.call(this._shortMonthsParse,Qt))!==-1?$t:null}.call(this,f,b,S);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),O=0;O<12;O++)if(V=m([2e3,O]),S&&!this._longMonthsParse[O]&&(this._longMonthsParse[O]=new RegExp("^"+this.months(V,"").replace(".","")+"$","i"),this._shortMonthsParse[O]=new RegExp("^"+this.monthsShort(V,"").replace(".","")+"$","i")),S||this._monthsParse[O]||(V="^"+this.months(V,"")+"|^"+this.monthsShort(V,""),this._monthsParse[O]=new RegExp(V.replace(".",""),"i")),S&&b==="MMMM"&&this._longMonthsParse[O].test(f)||S&&b==="MMM"&&this._shortMonthsParse[O].test(f)||!S&&this._monthsParse[O].test(f))return O},ae.monthsRegex=function(f){return this._monthsParseExact?(o(this,"_monthsRegex")||ce.call(this),f?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=fe),this._monthsStrictRegex&&f?this._monthsStrictRegex:this._monthsRegex)},ae.monthsShortRegex=function(f){return this._monthsParseExact?(o(this,"_monthsRegex")||ce.call(this),f?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=he),this._monthsShortStrictRegex&&f?this._monthsShortStrictRegex:this._monthsShortRegex)},ae.week=function(f){return Te(f,this._week.dow,this._week.doy).week},ae.firstDayOfYear=function(){return this._week.doy},ae.firstDayOfWeek=function(){return this._week.dow},ae.weekdays=function(f,b){return b=a(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(b)?"format":"standalone"],f===!0?Ee(b,this._week.dow):f?b[f.day()]:b},ae.weekdaysMin=function(f){return f===!0?Ee(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin},ae.weekdaysShort=function(f){return f===!0?Ee(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort},ae.weekdaysParse=function(f,b,S){var O,V;if(this._weekdaysParseExact)return function(Qt,bt,Ct){var Bt,$t,se,Qt=Qt.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],Bt=0;Bt<7;++Bt)se=m([2e3,1]).day(Bt),this._minWeekdaysParse[Bt]=this.weekdaysMin(se,"").toLocaleLowerCase(),this._shortWeekdaysParse[Bt]=this.weekdaysShort(se,"").toLocaleLowerCase(),this._weekdaysParse[Bt]=this.weekdays(se,"").toLocaleLowerCase();return Ct?bt==="dddd"?($t=zt.call(this._weekdaysParse,Qt))!==-1?$t:null:bt==="ddd"?($t=zt.call(this._shortWeekdaysParse,Qt))!==-1?$t:null:($t=zt.call(this._minWeekdaysParse,Qt))!==-1?$t:null:bt==="dddd"?($t=zt.call(this._weekdaysParse,Qt))!==-1||($t=zt.call(this._shortWeekdaysParse,Qt))!==-1||($t=zt.call(this._minWeekdaysParse,Qt))!==-1?$t:null:bt==="ddd"?($t=zt.call(this._shortWeekdaysParse,Qt))!==-1||($t=zt.call(this._weekdaysParse,Qt))!==-1||($t=zt.call(this._minWeekdaysParse,Qt))!==-1?$t:null:($t=zt.call(this._minWeekdaysParse,Qt))!==-1||($t=zt.call(this._weekdaysParse,Qt))!==-1||($t=zt.call(this._shortWeekdaysParse,Qt))!==-1?$t:null}.call(this,f,b,S);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),O=0;O<7;O++)if(V=m([2e3,1]).day(O),S&&!this._fullWeekdaysParse[O]&&(this._fullWeekdaysParse[O]=new RegExp("^"+this.weekdays(V,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[O]=new RegExp("^"+this.weekdaysShort(V,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[O]=new RegExp("^"+this.weekdaysMin(V,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[O]||(V="^"+this.weekdays(V,"")+"|^"+this.weekdaysShort(V,"")+"|^"+this.weekdaysMin(V,""),this._weekdaysParse[O]=new RegExp(V.replace(".",""),"i")),S&&b==="dddd"&&this._fullWeekdaysParse[O].test(f)||S&&b==="ddd"&&this._shortWeekdaysParse[O].test(f)||S&&b==="dd"&&this._minWeekdaysParse[O].test(f)||!S&&this._weekdaysParse[O].test(f))return O},ae.weekdaysRegex=function(f){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||At.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Ie),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)},ae.weekdaysShortRegex=function(f){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||At.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Yt),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},ae.weekdaysMinRegex=function(f){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||At.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=rt),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},ae.isPM=function(f){return(f+"").toLowerCase().charAt(0)==="p"},ae.meridiem=function(f,b,S){return 11<f?S?"pm":"PM":S?"am":"AM"},Vt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(f){var b=f%10;return f+(W(f%100/10)===1?"th":b==1?"st":b==2?"nd":b==3?"rd":"th")}}),n.lang=z("moment.lang is deprecated. Use moment.locale instead.",Vt),n.langData=z("moment.langData is deprecated. Use moment.localeData instead.",ie);var qe=Math.abs;function Wr(f,b,S,O){return b=ze(b,S),f._milliseconds+=O*b._milliseconds,f._days+=O*b._days,f._months+=O*b._months,f._bubble()}function Gr(f){return f<0?Math.floor(f):Math.ceil(f)}function jr(f){return 4800*f/146097}function Lr(f){return 146097*f/4800}function Ze(f){return function(){return this.as(f)}}Dt=Ze("ms"),gt=Ze("s"),Kt=Ze("m"),at=Ze("h"),Ft=Ze("d"),ke=Ze("w"),yt=Ze("M"),or=Ze("Q"),tr=Ze("y");function lr(f){return function(){return this.isValid()?this._data[f]:NaN}}var er=lr("milliseconds"),rr=lr("seconds"),xr=lr("minutes"),ae=lr("hours"),Qr=lr("days"),Jr=lr("months"),ti=lr("years"),Xe=Math.round,hr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ei(f,b,S,O){var $t=ze(f).abs(),se=Xe($t.as("s")),V=Xe($t.as("m")),lt=Xe($t.as("h")),bt=Xe($t.as("d")),Ct=Xe($t.as("M")),Bt=Xe($t.as("w")),$t=Xe($t.as("y")),se=(se<=S.ss?["s",se]:se<S.s&&["ss",se])||V<=1&&["m"]||V<S.m&&["mm",V]||lt<=1&&["h"]||lt<S.h&&["hh",lt]||bt<=1&&["d"]||bt<S.d&&["dd",bt];return(se=(se=S.w!=null?se||Bt<=1&&["w"]||Bt<S.w&&["ww",Bt]:se)||Ct<=1&&["M"]||Ct<S.M&&["MM",Ct]||$t<=1&&["y"]||["yy",$t])[2]=b,se[3]=0<+f,se[4]=O,function(Qt,Ae,Re,He,Dr){return Dr.relativeTime(Ae||1,!!Re,Qt,He)}.apply(null,se)}var Ir=Math.abs;function dr(f){return(0<f)-(f<0)||+f}function wr(){if(!this.isValid())return this.localeData().invalidDate();var f,b,S,O,V,lt,bt,Ct=Ir(this._milliseconds)/1e3,Bt=Ir(this._days),$t=Ir(this._months),se=this.asSeconds();return se?(f=tt(Ct/60),b=tt(f/60),Ct%=60,f%=60,S=tt($t/12),$t%=12,O=Ct?Ct.toFixed(3).replace(/\.?0+$/,""):"",V=dr(this._months)!==dr(se)?"-":"",lt=dr(this._days)!==dr(se)?"-":"",bt=dr(this._milliseconds)!==dr(se)?"-":"",(se<0?"-":"")+"P"+(S?V+S+"Y":"")+($t?V+$t+"M":"")+(Bt?lt+Bt+"D":"")+(b||f||Ct?"T":"")+(b?bt+b+"H":"")+(f?bt+f+"M":"")+(Ct?bt+O+"S":"")):"P0D"}var pe=Ye.prototype;return pe.isValid=function(){return this._isValid},pe.abs=function(){var f=this._data;return this._milliseconds=qe(this._milliseconds),this._days=qe(this._days),this._months=qe(this._months),f.milliseconds=qe(f.milliseconds),f.seconds=qe(f.seconds),f.minutes=qe(f.minutes),f.hours=qe(f.hours),f.months=qe(f.months),f.years=qe(f.years),this},pe.add=function(f,b){return Wr(this,f,b,1)},pe.subtract=function(f,b){return Wr(this,f,b,-1)},pe.as=function(f){if(!this.isValid())return NaN;var b,S,O=this._milliseconds;if((f=xt(f))==="month"||f==="quarter"||f==="year")switch(b=this._days+O/864e5,S=this._months+jr(b),f){case"month":return S;case"quarter":return S/3;case"year":return S/12}else switch(b=this._days+Math.round(Lr(this._months)),f){case"week":return b/7+O/6048e5;case"day":return b+O/864e5;case"hour":return 24*b+O/36e5;case"minute":return 1440*b+O/6e4;case"second":return 86400*b+O/1e3;case"millisecond":return Math.floor(864e5*b)+O;default:throw new Error("Unknown unit "+f)}},pe.asMilliseconds=Dt,pe.asSeconds=gt,pe.asMinutes=Kt,pe.asHours=at,pe.asDays=Ft,pe.asWeeks=ke,pe.asMonths=yt,pe.asQuarters=or,pe.asYears=tr,pe.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*W(this._months/12):NaN},pe._bubble=function(){var f=this._milliseconds,b=this._days,S=this._months,O=this._data;return 0<=f&&0<=b&&0<=S||f<=0&&b<=0&&S<=0||(f+=864e5*Gr(Lr(S)+b),S=b=0),O.milliseconds=f%1e3,f=tt(f/1e3),O.seconds=f%60,f=tt(f/60),O.minutes=f%60,f=tt(f/60),O.hours=f%24,b+=tt(f/24),S+=f=tt(jr(b)),b-=Gr(Lr(f)),f=tt(S/12),S%=12,O.days=b,O.months=S,O.years=f,this},pe.clone=function(){return ze(this)},pe.get=function(f){return f=xt(f),this.isValid()?this[f+"s"]():NaN},pe.milliseconds=er,pe.seconds=rr,pe.minutes=xr,pe.hours=ae,pe.days=Qr,pe.weeks=function(){return tt(this.days()/7)},pe.months=Jr,pe.years=ti,pe.humanize=function(f,b){if(!this.isValid())return this.localeData().invalidDate();var S=!1,O=hr;return typeof f=="object"&&(b=f,f=!1),typeof f=="boolean"&&(S=f),typeof b=="object"&&(O=Object.assign({},hr,b),b.s!=null&&b.ss==null&&(O.ss=b.s-1)),f=this.localeData(),b=ei(this,!S,O,f),S&&(b=f.pastFuture(+this,b)),f.postformat(b)},pe.toISOString=wr,pe.toString=wr,pe.toJSON=wr,pe.locale=Br,pe.localeData=Fr,pe.toIsoString=z("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",wr),pe.lang=Le,Q("X",0,0,"unix"),Q("x",0,0,"valueOf"),ct("x",_t),ct("X",/[+-]?\d+(\.\d{1,3})?/),Ht("X",function(f,b,S){S._d=new Date(1e3*parseFloat(f))}),Ht("x",function(f,b,S){S._d=new Date(W(f))}),n.version="2.29.4",r=me,n.fn=N,n.min=function(){return Oe("isBefore",[].slice.call(arguments,0))},n.max=function(){return Oe("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=m,n.unix=function(f){return me(1e3*f)},n.months=function(f,b){return Vr(f,b,"months")},n.isDate=d,n.locale=Vt,n.invalid=A,n.duration=ze,n.isMoment=q,n.weekdays=function(f,b,S){return Ar(f,b,S,"weekdays")},n.parseZone=function(){return me.apply(null,arguments).parseZone()},n.localeData=ie,n.isDuration=je,n.monthsShort=function(f,b){return Vr(f,b,"monthsShort")},n.weekdaysMin=function(f,b,S){return Ar(f,b,S,"weekdaysMin")},n.defineLocale=Xt,n.updateLocale=function(f,b){var S,O;return b!=null?(O=Ce,de[f]!=null&&de[f].parentLocale!=null?de[f].set(k(de[f]._config,b)):(b=k(O=(S=Me(f))!=null?S._config:O,b),S==null&&(b.abbr=f),(O=new B(b)).parentLocale=de[f],de[f]=O),Vt(f)):de[f]!=null&&(de[f].parentLocale!=null?(de[f]=de[f].parentLocale,f===Vt()&&Vt(f)):de[f]!=null&&delete de[f]),de[f]},n.locales=function(){return v(de)},n.weekdaysShort=function(f,b,S){return Ar(f,b,S,"weekdaysShort")},n.normalizeUnits=xt,n.relativeTimeRounding=function(f){return f===void 0?Xe:typeof f=="function"&&(Xe=f,!0)},n.relativeTimeThreshold=function(f,b){return hr[f]!==void 0&&(b===void 0?hr[f]:(hr[f]=b,f==="s"&&(hr.ss=b-1),!0))},n.calendarFormat=function(f,b){return(f=f.diff(b,"days",!0))<-6?"sameElse":f<-1?"lastWeek":f<0?"lastDay":f<1?"sameDay":f<2?"nextDay":f<7?"nextWeek":"sameElse"},n.prototype=N,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n})})(moment_min);const moment=moment_min.exports;var dist={};Object.defineProperty(dist,"__esModule",{value:!0});var sanitizeUrl_1=dist.sanitizeUrl=void 0,invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,urlSchemeRegex=/^([^:]+):/gm,relativeFirstCharacters=[".","/"];function isRelativeUrlWithoutProtocol(t){return relativeFirstCharacters.indexOf(t[0])>-1}function decodeHtmlCharacters(t){return t.replace(htmlEntitiesRegex,function(e,r){return String.fromCharCode(r)})}function sanitizeUrl(t){var e=decodeHtmlCharacters(t||"").replace(ctrlCharactersRegex,"").trim();if(!e)return"about:blank";if(isRelativeUrlWithoutProtocol(e))return e;var r=e.match(urlSchemeRegex);if(!r)return e;var n=r[0];return invalidProtocolRegex.test(n)?"about:blank":e}sanitizeUrl_1=dist.sanitizeUrl=sanitizeUrl;function ascending(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function bisector(t){let e=t,r=t,n=t;t.length!==2&&(e=(l,u)=>t(l)-u,r=ascending,n=(l,u)=>ascending(t(l),u));function a(l,u,h=0,d=l.length){if(h<d){if(r(u,u)!==0)return d;do{const p=h+d>>>1;n(l[p],u)<0?h=p+1:d=p}while(h<d)}return h}function s(l,u,h=0,d=l.length){if(h<d){if(r(u,u)!==0)return d;do{const p=h+d>>>1;n(l[p],u)<=0?h=p+1:d=p}while(h<d)}return h}function o(l,u,h=0,d=l.length){const p=a(l,u,h,d-1);return p>h&&e(l[p-1],u)>-e(l[p],u)?p-1:p}return{left:a,center:o,right:s}}function number$3(t){return t===null?NaN:+t}const ascendingBisect=bisector(ascending),bisectRight=ascendingBisect.right;bisector(number$3).center;const bisect=bisectRight;class InternMap extends Map{constructor(e,r=keyof){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,a]of e)this.set(n,a)}get(e){return super.get(intern_get(this,e))}has(e){return super.has(intern_get(this,e))}set(e,r){return super.set(intern_set(this,e),r)}delete(e){return super.delete(intern_delete(this,e))}}function intern_get({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function intern_set({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function intern_delete({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function keyof(t){return t!==null&&typeof t=="object"?t.valueOf():t}var e10=Math.sqrt(50),e5=Math.sqrt(10),e2=Math.sqrt(2);function ticks(t,e,r){var n,a=-1,s,o,l;if(e=+e,t=+t,r=+r,t===e&&r>0)return[t];if((n=e<t)&&(s=t,t=e,e=s),(l=tickIncrement(t,e,r))===0||!isFinite(l))return[];if(l>0){let u=Math.round(t/l),h=Math.round(e/l);for(u*l<t&&++u,h*l>e&&--h,o=new Array(s=h-u+1);++a<s;)o[a]=(u+a)*l}else{l=-l;let u=Math.round(t*l),h=Math.round(e*l);for(u/l<t&&++u,h/l>e&&--h,o=new Array(s=h-u+1);++a<s;)o[a]=(u+a)/l}return n&&o.reverse(),o}function tickIncrement(t,e,r){var n=(e-t)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),s=n/Math.pow(10,a);return a>=0?(s>=e10?10:s>=e5?5:s>=e2?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(s>=e10?10:s>=e5?5:s>=e2?2:1)}function tickStep(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),s=n/a;return s>=e10?a*=10:s>=e5?a*=5:s>=e2&&(a*=2),e<t?-a:a}function max$2(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let a of t)(a=e(a,++n,t))!=null&&(r<a||r===void 0&&a>=a)&&(r=a)}return r}function min$2(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let a of t)(a=e(a,++n,t))!=null&&(r>a||r===void 0&&a>=a)&&(r=a)}return r}function identity$4(t){return t}var top=1,right=2,bottom=3,left=4,epsilon$2=1e-6;function translateX(t){return"translate("+t+",0)"}function translateY(t){return"translate(0,"+t+")"}function number$2(t){return e=>+t(e)}function center(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function entering(){return!this.__axis}function axis(t,e){var r=[],n=null,a=null,s=6,o=6,l=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,h=t===top||t===left?-1:1,d=t===left||t===right?"x":"y",p=t===top||t===bottom?translateX:translateY;function g(m){var T=n??(e.ticks?e.ticks.apply(e,r):e.domain()),I=a??(e.tickFormat?e.tickFormat.apply(e,r):identity$4),A=Math.max(s,0)+l,C=e.range(),L=+C[0]+u,M=+C[C.length-1]+u,F=(e.bandwidth?center:number$2)(e.copy(),u),H=m.selection?m.selection():m,q=H.selectAll(".domain").data([null]),U=H.selectAll(".tick").data(T,e).order(),z=U.exit(),R=U.enter().append("g").attr("class","tick"),$=U.select("line"),D=U.select("text");q=q.merge(q.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),U=U.merge(R),$=$.merge(R.append("line").attr("stroke","currentColor").attr(d+"2",h*s)),D=D.merge(R.append("text").attr("fill","currentColor").attr(d,h*A).attr("dy",t===top?"0em":t===bottom?"0.71em":"0.32em")),m!==H&&(q=q.transition(m),U=U.transition(m),$=$.transition(m),D=D.transition(m),z=z.transition(m).attr("opacity",epsilon$2).attr("transform",function(k){return isFinite(k=F(k))?p(k+u):this.getAttribute("transform")}),R.attr("opacity",epsilon$2).attr("transform",function(k){var B=this.parentNode.__axis;return p((B&&isFinite(B=B(k))?B:F(k))+u)})),z.remove(),q.attr("d",t===left||t===right?o?"M"+h*o+","+L+"H"+u+"V"+M+"H"+h*o:"M"+u+","+L+"V"+M:o?"M"+L+","+h*o+"V"+u+"H"+M+"V"+h*o:"M"+L+","+u+"H"+M),U.attr("opacity",1).attr("transform",function(k){return p(F(k)+u)}),$.attr(d+"2",h*s),D.attr(d,h*A).text(I),H.filter(entering).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===right?"start":t===left?"end":"middle"),H.each(function(){this.__axis=F})}return g.scale=function(m){return arguments.length?(e=m,g):e},g.ticks=function(){return r=Array.from(arguments),g},g.tickArguments=function(m){return arguments.length?(r=m==null?[]:Array.from(m),g):r.slice()},g.tickValues=function(m){return arguments.length?(n=m==null?null:Array.from(m),g):n&&n.slice()},g.tickFormat=function(m){return arguments.length?(a=m,g):a},g.tickSize=function(m){return arguments.length?(s=o=+m,g):s},g.tickSizeInner=function(m){return arguments.length?(s=+m,g):s},g.tickSizeOuter=function(m){return arguments.length?(o=+m,g):o},g.tickPadding=function(m){return arguments.length?(l=+m,g):l},g.offset=function(m){return arguments.length?(u=+m,g):u},g}function axisTop(t){return axis(top,t)}function axisBottom(t){return axis(bottom,t)}function selectAll(t){return typeof t=="string"?new Selection([document.querySelectorAll(t)],[document.documentElement]):new Selection([array$1(t)],root$2)}const radians=Math.PI/180,degrees=180/Math.PI,K=18,Xn=.96422,Yn=1,Zn=.82521,t0$1=4/29,t1$1=6/29,t2=3*t1$1*t1$1,t3=t1$1*t1$1*t1$1;function labConvert(t){if(t instanceof Lab)return new Lab(t.l,t.a,t.b,t.opacity);if(t instanceof Hcl)return hcl2lab(t);t instanceof Rgb||(t=rgbConvert(t));var e=rgb2lrgb(t.r),r=rgb2lrgb(t.g),n=rgb2lrgb(t.b),a=xyz2lab((.2225045*e+.7168786*r+.0606169*n)/Yn),s,o;return e===r&&r===n?s=o=a:(s=xyz2lab((.4360747*e+.3850649*r+.1430804*n)/Xn),o=xyz2lab((.0139322*e+.0971045*r+.7141733*n)/Zn)),new Lab(116*a-16,500*(s-a),200*(a-o),t.opacity)}function lab(t,e,r,n){return arguments.length===1?labConvert(t):new Lab(t,e,r,n??1)}function Lab(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}define(Lab,lab,extend$1(Color,{brighter:function(t){return new Lab(this.l+K*(t??1),this.a,this.b,this.opacity)},darker:function(t){return new Lab(this.l-K*(t??1),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=Xn*lab2xyz(e),t=Yn*lab2xyz(t),r=Zn*lab2xyz(r),new Rgb(lrgb2rgb(3.1338561*e-1.6168667*t-.4906146*r),lrgb2rgb(-.9787684*e+1.9161415*t+.033454*r),lrgb2rgb(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function xyz2lab(t){return t>t3?Math.pow(t,1/3):t/t2+t0$1}function lab2xyz(t){return t>t1$1?t*t*t:t2*(t-t0$1)}function lrgb2rgb(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rgb2lrgb(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hclConvert(t){if(t instanceof Hcl)return new Hcl(t.h,t.c,t.l,t.opacity);if(t instanceof Lab||(t=labConvert(t)),t.a===0&&t.b===0)return new Hcl(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*degrees;return new Hcl(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function hcl$1(t,e,r,n){return arguments.length===1?hclConvert(t):new Hcl(t,e,r,n??1)}function Hcl(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function hcl2lab(t){if(isNaN(t.h))return new Lab(t.l,0,0,t.opacity);var e=t.h*radians;return new Lab(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}define(Hcl,hcl$1,extend$1(Color,{brighter:function(t){return new Hcl(this.h,this.c,this.l+K*(t??1),this.opacity)},darker:function(t){return new Hcl(this.h,this.c,this.l-K*(t??1),this.opacity)},rgb:function(){return hcl2lab(this).rgb()}}));function numberArray(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(s){for(a=0;a<r;++a)n[a]=t[a]*(1-s)+e[a]*s;return n}}function isNumberArray(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function genericArray(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),s=new Array(r),o;for(o=0;o<n;++o)a[o]=interpolate(t[o],e[o]);for(;o<r;++o)s[o]=e[o];return function(l){for(o=0;o<n;++o)s[o]=a[o](l);return s}}function date$1(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function object(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=interpolate(t[a],e[a]):n[a]=e[a];return function(s){for(a in r)n[a]=r[a](s);return n}}function interpolate(t,e){var r=typeof e,n;return e==null||r==="boolean"?constant$2(e):(r==="number"?interpolateNumber:r==="string"?(n=color(e))?(e=n,interpolateRgb):interpolateString:e instanceof color?interpolateRgb:e instanceof Date?date$1:isNumberArray(e)?numberArray:Array.isArray(e)?genericArray:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?object:interpolateNumber)(t,e)}function interpolateRound(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function hcl(t){return function(e,r){var n=t((e=hcl$1(e)).h,(r=hcl$1(r)).h),a=nogamma(e.c,r.c),s=nogamma(e.l,r.l),o=nogamma(e.opacity,r.opacity);return function(l){return e.h=n(l),e.c=a(l),e.l=s(l),e.opacity=o(l),e+""}}}const interpolateHcl=hcl(hue),pi$1=Math.PI,tau$1=2*pi$1,epsilon$1=1e-6,tauEpsilon=tau$1-epsilon$1;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path(){return new Path}Path.prototype=path.prototype={constructor:Path,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,a,s){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+a)+","+(this._y1=+s)},arcTo:function(t,e,r,n,a){t=+t,e=+e,r=+r,n=+n,a=+a;var s=this._x1,o=this._y1,l=r-t,u=n-e,h=s-t,d=o-e,p=h*h+d*d;if(a<0)throw new Error("negative radius: "+a);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>epsilon$1)if(!(Math.abs(d*l-u*h)>epsilon$1)||!a)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var g=r-s,m=n-o,T=l*l+u*u,I=g*g+m*m,A=Math.sqrt(T),C=Math.sqrt(p),L=a*Math.tan((pi$1-Math.acos((T+p-I)/(2*A*C)))/2),M=L/C,F=L/A;Math.abs(M-1)>epsilon$1&&(this._+="L"+(t+M*h)+","+(e+M*d)),this._+="A"+a+","+a+",0,0,"+ +(d*g>h*m)+","+(this._x1=t+F*l)+","+(this._y1=e+F*u)}},arc:function(t,e,r,n,a,s){t=+t,e=+e,r=+r,s=!!s;var o=r*Math.cos(n),l=r*Math.sin(n),u=t+o,h=e+l,d=1^s,p=s?n-a:a-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+u+","+h:(Math.abs(this._x1-u)>epsilon$1||Math.abs(this._y1-h)>epsilon$1)&&(this._+="L"+u+","+h),r&&(p<0&&(p=p%tau$1+tau$1),p>tauEpsilon?this._+="A"+r+","+r+",0,1,"+d+","+(t-o)+","+(e-l)+"A"+r+","+r+",0,1,"+d+","+(this._x1=u)+","+(this._y1=h):p>epsilon$1&&(this._+="A"+r+","+r+",0,"+ +(p>=pi$1)+","+d+","+(this._x1=t+r*Math.cos(a))+","+(this._y1=e+r*Math.sin(a))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function responseText(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function text$1(t,e){return fetch(t,e).then(responseText)}function parser$c(t){return(e,r)=>text$1(e,r).then(n=>new DOMParser().parseFromString(n,t))}var svg$2=parser$c("image/svg+xml");function formatDecimal(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function formatDecimalParts(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function exponent(t){return t=formatDecimalParts(Math.abs(t)),t?t[1]:NaN}function formatGroup(t,e){return function(r,n){for(var a=r.length,s=[],o=0,l=t[0],u=0;a>0&&l>0&&(u+l+1>n&&(l=Math.max(1,n-u)),s.push(r.substring(a-=l,a+l)),!((u+=l+1)>n));)l=t[o=(o+1)%t.length];return s.reverse().join(e)}}function formatNumerals(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(t){if(!(e=re.exec(t)))throw new Error("invalid format: "+t);var e;return new FormatSpecifier({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]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function formatTrim(t){t:for(var e=t.length,r=1,n=-1,a;r<e;++r)switch(t[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+t[r])break t;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(a+1):t}var prefixExponent;function formatPrefixAuto(t,e){var r=formatDecimalParts(t,e);if(!r)return t+"";var n=r[0],a=r[1],s=a-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return s===o?n:s>o?n+new Array(s-o+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+formatDecimalParts(t,Math.max(0,e+s-1))[0]}function formatRounded(t,e){var r=formatDecimalParts(t,e);if(!r)return t+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const formatTypes={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:formatDecimal,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)=>formatRounded(t*100,e),r:formatRounded,s:formatPrefixAuto,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function identity$3(t){return t}var map$2=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale$1(t){var e=t.grouping===void 0||t.thousands===void 0?identity$3:formatGroup(map$2.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",a=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?identity$3:formatNumerals(map$2.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function h(p){p=formatSpecifier(p);var g=p.fill,m=p.align,T=p.sign,I=p.symbol,A=p.zero,C=p.width,L=p.comma,M=p.precision,F=p.trim,H=p.type;H==="n"?(L=!0,H="g"):formatTypes[H]||(M===void 0&&(M=12),F=!0,H="g"),(A||g==="0"&&m==="=")&&(A=!0,g="0",m="=");var q=I==="$"?r:I==="#"&&/[boxX]/.test(H)?"0"+H.toLowerCase():"",U=I==="$"?n:/[%p]/.test(H)?o:"",z=formatTypes[H],R=/[defgprs%]/.test(H);M=M===void 0?6:/[gprs]/.test(H)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function $(D){var k=q,B=U,v,J,E;if(H==="c")B=z(D)+B,D="";else{D=+D;var ft=D<0||1/D<0;if(D=isNaN(D)?u:z(Math.abs(D),M),F&&(D=formatTrim(D)),ft&&+D==0&&T!=="+"&&(ft=!1),k=(ft?T==="("?T:l:T==="-"||T==="("?"":T)+k,B=(H==="s"?prefixes[8+prefixExponent/3]:"")+B+(ft&&T==="("?")":""),R){for(v=-1,J=D.length;++v<J;)if(E=D.charCodeAt(v),48>E||E>57){B=(E===46?a+D.slice(v+1):D.slice(v))+B,D=D.slice(0,v);break}}}L&&!A&&(D=e(D,1/0));var Lt=k.length+D.length+B.length,Tt=Lt<C?new Array(C-Lt+1).join(g):"";switch(L&&A&&(D=e(Tt+D,Tt.length?C-B.length:1/0),Tt=""),m){case"<":D=k+D+B+Tt;break;case"=":D=k+Tt+D+B;break;case"^":D=Tt.slice(0,Lt=Tt.length>>1)+k+D+B+Tt.slice(Lt);break;default:D=Tt+k+D+B;break}return s(D)}return $.toString=function(){return p+""},$}function d(p,g){var m=h((p=formatSpecifier(p),p.type="f",p)),T=Math.max(-8,Math.min(8,Math.floor(exponent(g)/3)))*3,I=Math.pow(10,-T),A=prefixes[8+T/3];return function(C){return m(I*C)+A}}return{format:h,formatPrefix:d}}var locale$1,format$1,formatPrefix;defaultLocale$1({thousands:",",grouping:[3],currency:["$",""]});function defaultLocale$1(t){return locale$1=formatLocale$1(t),format$1=locale$1.format,formatPrefix=locale$1.formatPrefix,locale$1}function precisionFixed(t){return Math.max(0,-exponent(Math.abs(t)))}function precisionPrefix(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(e)/3)))*3-exponent(Math.abs(t)))}function precisionRound(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,exponent(e)-exponent(t))+1}function initRange(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const implicit=Symbol("implicit");function ordinal(){var t=new InternMap,e=[],r=[],n=implicit;function a(s){let o=t.get(s);if(o===void 0){if(n!==implicit)return n;t.set(s,o=e.push(s)-1)}return r[o%r.length]}return a.domain=function(s){if(!arguments.length)return e.slice();e=[],t=new InternMap;for(const o of s)t.has(o)||t.set(o,e.push(o)-1);return a},a.range=function(s){return arguments.length?(r=Array.from(s),a):r.slice()},a.unknown=function(s){return arguments.length?(n=s,a):n},a.copy=function(){return ordinal(e,r).unknown(n)},initRange.apply(a,arguments),a}function constants(t){return function(){return t}}function number$1(t){return+t}var unit=[0,1];function identity$2(t){return t}function normalize(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:constants(isNaN(e)?NaN:.5)}function clamper(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function bimap(t,e,r){var n=t[0],a=t[1],s=e[0],o=e[1];return a<n?(n=normalize(a,n),s=r(o,s)):(n=normalize(n,a),s=r(s,o)),function(l){return s(n(l))}}function polymap(t,e,r){var n=Math.min(t.length,e.length)-1,a=new Array(n),s=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)a[o]=normalize(t[o],t[o+1]),s[o]=r(e[o],e[o+1]);return function(l){var u=bisect(t,l,1,n)-1;return s[u](a[u](l))}}function copy$1(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function transformer(){var t=unit,e=unit,r=interpolate,n,a,s,o=identity$2,l,u,h;function d(){var g=Math.min(t.length,e.length);return o!==identity$2&&(o=clamper(t[0],t[g-1])),l=g>2?polymap:bimap,u=h=null,p}function p(g){return g==null||isNaN(g=+g)?s:(u||(u=l(t.map(n),e,r)))(n(o(g)))}return p.invert=function(g){return o(a((h||(h=l(e,t.map(n),interpolateNumber)))(g)))},p.domain=function(g){return arguments.length?(t=Array.from(g,number$1),d()):t.slice()},p.range=function(g){return arguments.length?(e=Array.from(g),d()):e.slice()},p.rangeRound=function(g){return e=Array.from(g),r=interpolateRound,d()},p.clamp=function(g){return arguments.length?(o=g?!0:identity$2,d()):o!==identity$2},p.interpolate=function(g){return arguments.length?(r=g,d()):r},p.unknown=function(g){return arguments.length?(s=g,p):s},function(g,m){return n=g,a=m,d()}}function continuous(){return transformer()(identity$2,identity$2)}function tickFormat(t,e,r,n){var a=tickStep(t,e,r),s;switch(n=formatSpecifier(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(s=precisionPrefix(a,o))&&(n.precision=s),formatPrefix(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=precisionRound(a,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=precisionFixed(a))&&(n.precision=s-(n.type==="%")*2);break}}return format$1(n)}function linearish(t){var e=t.domain;return t.ticks=function(r){var n=e();return ticks(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var a=e();return tickFormat(a[0],a[a.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),a=0,s=n.length-1,o=n[a],l=n[s],u,h,d=10;for(l<o&&(h=o,o=l,l=h,h=a,a=s,s=h);d-- >0;){if(h=tickIncrement(o,l,r),h===u)return n[a]=o,n[s]=l,e(n);if(h>0)o=Math.floor(o/h)*h,l=Math.ceil(l/h)*h;else if(h<0)o=Math.ceil(o*h)/h,l=Math.floor(l*h)/h;else break;u=h}return t},t}function linear(){var t=continuous();return t.copy=function(){return copy$1(t,linear())},initRange.apply(t,arguments),linearish(t)}function nice(t,e){t=t.slice();var r=0,n=t.length-1,a=t[r],s=t[n],o;return s<a&&(o=r,r=n,n=o,o=a,a=s,s=o),t[r]=e.floor(a),t[n]=e.ceil(s),t}var t0=new Date,t1=new Date;function newInterval(t,e,r,n){function a(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return a.floor=function(s){return t(s=new Date(+s)),s},a.ceil=function(s){return t(s=new Date(s-1)),e(s,1),t(s),s},a.round=function(s){var o=a(s),l=a.ceil(s);return s-o<l-s?o:l},a.offset=function(s,o){return e(s=new Date(+s),o==null?1:Math.floor(o)),s},a.range=function(s,o,l){var u=[],h;if(s=a.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return u;do u.push(h=new Date(+s)),e(s,l),t(s);while(h<s&&s<o);return u},a.filter=function(s){return newInterval(function(o){if(o>=o)for(;t(o),!s(o);)o.setTime(o-1)},function(o,l){if(o>=o)if(l<0)for(;++l<=0;)for(;e(o,-1),!s(o););else for(;--l>=0;)for(;e(o,1),!s(o););})},r&&(a.count=function(s,o){return t0.setTime(+s),t1.setTime(+o),t(t0),t(t1),Math.floor(r(t0,t1))},a.every=function(s){return s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?a.filter(n?function(o){return n(o)%s===0}:function(o){return a.count(0,o)%s===0}):a}),a}var millisecond=newInterval(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});millisecond.every=function(t){return t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?newInterval(function(e){e.setTime(Math.floor(e/t)*t)},function(e,r){e.setTime(+e+r*t)},function(e,r){return(r-e)/t}):millisecond};const millisecond$1=millisecond;millisecond.range;const durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365;var second=newInterval(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*durationSecond)},function(t,e){return(e-t)/durationSecond},function(t){return t.getUTCSeconds()});const utcSecond=second;second.range;var minute=newInterval(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*durationSecond)},function(t,e){t.setTime(+t+e*durationMinute)},function(t,e){return(e-t)/durationMinute},function(t){return t.getMinutes()});const timeMinute=minute;minute.range;var hour=newInterval(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*durationSecond-t.getMinutes()*durationMinute)},function(t,e){t.setTime(+t+e*durationHour)},function(t,e){return(e-t)/durationHour},function(t){return t.getHours()});const timeHour=hour;hour.range;var day=newInterval(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*durationMinute)/durationDay,t=>t.getDate()-1);const timeDay=day;day.range;function weekday(t){return newInterval(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(e,r){e.setDate(e.getDate()+r*7)},function(e,r){return(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*durationMinute)/durationWeek})}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6);sunday.range;monday.range;tuesday.range;wednesday.range;thursday.range;friday.range;saturday.range;var month=newInterval(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12},function(t){return t.getMonth()});const timeMonth=month;month.range;var year=newInterval(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});year.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:newInterval(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,r){e.setFullYear(e.getFullYear()+r*t)})};const timeYear=year;year.range;var utcMinute=newInterval(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*durationMinute)},function(t,e){return(e-t)/durationMinute},function(t){return t.getUTCMinutes()});const utcMinute$1=utcMinute;utcMinute.range;var utcHour=newInterval(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*durationHour)},function(t,e){return(e-t)/durationHour},function(t){return t.getUTCHours()});const utcHour$1=utcHour;utcHour.range;var utcDay=newInterval(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/durationDay},function(t){return t.getUTCDate()-1});const utcDay$1=utcDay;utcDay.range;function utcWeekday(t){return newInterval(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCDate(e.getUTCDate()+r*7)},function(e,r){return(r-e)/durationWeek})}var utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6);utcSunday.range;utcMonday.range;utcTuesday.range;utcWednesday.range;utcThursday.range;utcFriday.range;utcSaturday.range;var utcMonth=newInterval(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12},function(t){return t.getUTCMonth()});const utcMonth$1=utcMonth;utcMonth.range;var utcYear=newInterval(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});utcYear.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:newInterval(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})};const utcYear$1=utcYear;utcYear.range;function ticker(t,e,r,n,a,s){const o=[[utcSecond,1,durationSecond],[utcSecond,5,5*durationSecond],[utcSecond,15,15*durationSecond],[utcSecond,30,30*durationSecond],[s,1,durationMinute],[s,5,5*durationMinute],[s,15,15*durationMinute],[s,30,30*durationMinute],[a,1,durationHour],[a,3,3*durationHour],[a,6,6*durationHour],[a,12,12*durationHour],[n,1,durationDay],[n,2,2*durationDay],[r,1,durationWeek],[e,1,durationMonth],[e,3,3*durationMonth],[t,1,durationYear]];function l(h,d,p){const g=d<h;g&&([h,d]=[d,h]);const m=p&&typeof p.range=="function"?p:u(h,d,p),T=m?m.range(h,+d+1):[];return g?T.reverse():T}function u(h,d,p){const g=Math.abs(d-h)/p,m=bisector(([,,A])=>A).right(o,g);if(m===o.length)return t.every(tickStep(h/durationYear,d/durationYear,p));if(m===0)return millisecond$1.every(Math.max(tickStep(h,d,p),1));const[T,I]=o[g/o[m-1][2]<o[m][2]/g?m-1:m];return T.every(I)}return[l,u]}ticker(utcYear$1,utcMonth$1,utcSunday,utcDay$1,utcHour$1,utcMinute$1);const[timeTicks,timeTickInterval]=ticker(timeYear,timeMonth,sunday,timeDay,timeHour,timeMinute);function localDate(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 utcDate(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 newDate(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function formatLocale(t){var e=t.dateTime,r=t.date,n=t.time,a=t.periods,s=t.days,o=t.shortDays,l=t.months,u=t.shortMonths,h=formatRe(a),d=formatLookup(a),p=formatRe(s),g=formatLookup(s),m=formatRe(o),T=formatLookup(o),I=formatRe(l),A=formatLookup(l),C=formatRe(u),L=formatLookup(u),M={a:ft,A:Lt,b:Tt,B:Q,c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,g:formatYearISO,G:formatFullYearISO,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:ut,q:st,Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},F={a:ot,A:dt,b:xt,B:et,c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,g:formatUTCYearISO,G:formatUTCFullYearISO,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:Nt,q:G,Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},H={a:$,A:D,b:k,B,c:v,d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,g:parseYear,G:parseFullYear,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:R,q:parseQuarter,Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:J,X:E,y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};M.x=q(r,M),M.X=q(n,M),M.c=q(e,M),F.x=q(r,F),F.X=q(n,F),F.c=q(e,F);function q(Z,tt){return function(W){var Y=[],P=-1,it=0,N=Z.length,gt,j,Ft;for(W instanceof Date||(W=new Date(+W));++P<N;)Z.charCodeAt(P)===37&&(Y.push(Z.slice(it,P)),(j=pads[gt=Z.charAt(++P)])!=null?gt=Z.charAt(++P):j=gt==="e"?" ":"0",(Ft=tt[gt])&&(gt=Ft(W,j)),Y.push(gt),it=P+1);return Y.push(Z.slice(it,P)),Y.join("")}}function U(Z,tt){return function(W){var Y=newDate(1900,void 0,1),P=z(Y,Z,W+="",0),it,N;if(P!=W.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(tt&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(it=utcDate(newDate(Y.y,0,1)),N=it.getUTCDay(),it=N>4||N===0?utcMonday.ceil(it):utcMonday(it),it=utcDay$1.offset(it,(Y.V-1)*7),Y.y=it.getUTCFullYear(),Y.m=it.getUTCMonth(),Y.d=it.getUTCDate()+(Y.w+6)%7):(it=localDate(newDate(Y.y,0,1)),N=it.getDay(),it=N>4||N===0?monday.ceil(it):monday(it),it=timeDay.offset(it,(Y.V-1)*7),Y.y=it.getFullYear(),Y.m=it.getMonth(),Y.d=it.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),N="Z"in Y?utcDate(newDate(Y.y,0,1)).getUTCDay():localDate(newDate(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(N+5)%7:Y.w+Y.U*7-(N+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,utcDate(Y)):localDate(Y)}}function z(Z,tt,W,Y){for(var P=0,it=tt.length,N=W.length,gt,j;P<it;){if(Y>=N)return-1;if(gt=tt.charCodeAt(P++),gt===37){if(gt=tt.charAt(P++),j=H[gt in pads?tt.charAt(P++):gt],!j||(Y=j(Z,W,Y))<0)return-1}else if(gt!=W.charCodeAt(Y++))return-1}return Y}function R(Z,tt,W){var Y=h.exec(tt.slice(W));return Y?(Z.p=d.get(Y[0].toLowerCase()),W+Y[0].length):-1}function $(Z,tt,W){var Y=m.exec(tt.slice(W));return Y?(Z.w=T.get(Y[0].toLowerCase()),W+Y[0].length):-1}function D(Z,tt,W){var Y=p.exec(tt.slice(W));return Y?(Z.w=g.get(Y[0].toLowerCase()),W+Y[0].length):-1}function k(Z,tt,W){var Y=C.exec(tt.slice(W));return Y?(Z.m=L.get(Y[0].toLowerCase()),W+Y[0].length):-1}function B(Z,tt,W){var Y=I.exec(tt.slice(W));return Y?(Z.m=A.get(Y[0].toLowerCase()),W+Y[0].length):-1}function v(Z,tt,W){return z(Z,e,tt,W)}function J(Z,tt,W){return z(Z,r,tt,W)}function E(Z,tt,W){return z(Z,n,tt,W)}function ft(Z){return o[Z.getDay()]}function Lt(Z){return s[Z.getDay()]}function Tt(Z){return u[Z.getMonth()]}function Q(Z){return l[Z.getMonth()]}function ut(Z){return a[+(Z.getHours()>=12)]}function st(Z){return 1+~~(Z.getMonth()/3)}function ot(Z){return o[Z.getUTCDay()]}function dt(Z){return s[Z.getUTCDay()]}function xt(Z){return u[Z.getUTCMonth()]}function et(Z){return l[Z.getUTCMonth()]}function Nt(Z){return a[+(Z.getUTCHours()>=12)]}function G(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var tt=q(Z+="",M);return tt.toString=function(){return Z},tt},parse:function(Z){var tt=U(Z+="",!1);return tt.toString=function(){return Z},tt},utcFormat:function(Z){var tt=q(Z+="",F);return tt.toString=function(){return Z},tt},utcParse:function(Z){var tt=U(Z+="",!0);return tt.toString=function(){return Z},tt}}}var pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function pad(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",s=a.length;return n+(s<r?new Array(r-s+1).join(e)+a:a)}function requote(t){return t.replace(requoteRe,"\\$&")}function formatRe(t){return new RegExp("^(?:"+t.map(requote).join("|")+")","i")}function formatLookup(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function parseWeekdayNumberSunday(t,e,r){var n=numberRe.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function parseWeekdayNumberMonday(t,e,r){var n=numberRe.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function parseWeekNumberSunday(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function parseWeekNumberISO(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function parseWeekNumberMonday(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function parseFullYear(t,e,r){var n=numberRe.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function parseYear(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function parseZone(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function parseQuarter(t,e,r){var n=numberRe.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function parseMonthNumber(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function parseDayOfMonth(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function parseDayOfYear(t,e,r){var n=numberRe.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function parseHour24(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function parseMinutes(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function parseSeconds(t,e,r){var n=numberRe.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function parseMilliseconds(t,e,r){var n=numberRe.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function parseMicroseconds(t,e,r){var n=numberRe.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function parseLiteralPercent(t,e,r){var n=percentRe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function parseUnixTimestamp(t,e,r){var n=numberRe.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function parseUnixTimestampSeconds(t,e,r){var n=numberRe.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function formatDayOfMonth(t,e){return pad(t.getDate(),e,2)}function formatHour24(t,e){return pad(t.getHours(),e,2)}function formatHour12(t,e){return pad(t.getHours()%12||12,e,2)}function formatDayOfYear(t,e){return pad(1+timeDay.count(timeYear(t),t),e,3)}function formatMilliseconds(t,e){return pad(t.getMilliseconds(),e,3)}function formatMicroseconds(t,e){return formatMilliseconds(t,e)+"000"}function formatMonthNumber(t,e){return pad(t.getMonth()+1,e,2)}function formatMinutes(t,e){return pad(t.getMinutes(),e,2)}function formatSeconds(t,e){return pad(t.getSeconds(),e,2)}function formatWeekdayNumberMonday(t){var e=t.getDay();return e===0?7:e}function formatWeekNumberSunday(t,e){return pad(sunday.count(timeYear(t)-1,t),e,2)}function dISO(t){var e=t.getDay();return e>=4||e===0?thursday(t):thursday.ceil(t)}function formatWeekNumberISO(t,e){return t=dISO(t),pad(thursday.count(timeYear(t),t)+(timeYear(t).getDay()===4),e,2)}function formatWeekdayNumberSunday(t){return t.getDay()}function formatWeekNumberMonday(t,e){return pad(monday.count(timeYear(t)-1,t),e,2)}function formatYear(t,e){return pad(t.getFullYear()%100,e,2)}function formatYearISO(t,e){return t=dISO(t),pad(t.getFullYear()%100,e,2)}function formatFullYear(t,e){return pad(t.getFullYear()%1e4,e,4)}function formatFullYearISO(t,e){var r=t.getDay();return t=r>=4||r===0?thursday(t):thursday.ceil(t),pad(t.getFullYear()%1e4,e,4)}function formatZone(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+pad(e/60|0,"0",2)+pad(e%60,"0",2)}function formatUTCDayOfMonth(t,e){return pad(t.getUTCDate(),e,2)}function formatUTCHour24(t,e){return pad(t.getUTCHours(),e,2)}function formatUTCHour12(t,e){return pad(t.getUTCHours()%12||12,e,2)}function formatUTCDayOfYear(t,e){return pad(1+utcDay$1.count(utcYear$1(t),t),e,3)}function formatUTCMilliseconds(t,e){return pad(t.getUTCMilliseconds(),e,3)}function formatUTCMicroseconds(t,e){return formatUTCMilliseconds(t,e)+"000"}function formatUTCMonthNumber(t,e){return pad(t.getUTCMonth()+1,e,2)}function formatUTCMinutes(t,e){return pad(t.getUTCMinutes(),e,2)}function formatUTCSeconds(t,e){return pad(t.getUTCSeconds(),e,2)}function formatUTCWeekdayNumberMonday(t){var e=t.getUTCDay();return e===0?7:e}function formatUTCWeekNumberSunday(t,e){return pad(utcSunday.count(utcYear$1(t)-1,t),e,2)}function UTCdISO(t){var e=t.getUTCDay();return e>=4||e===0?utcThursday(t):utcThursday.ceil(t)}function formatUTCWeekNumberISO(t,e){return t=UTCdISO(t),pad(utcThursday.count(utcYear$1(t),t)+(utcYear$1(t).getUTCDay()===4),e,2)}function formatUTCWeekdayNumberSunday(t){return t.getUTCDay()}function formatUTCWeekNumberMonday(t,e){return pad(utcMonday.count(utcYear$1(t)-1,t),e,2)}function formatUTCYear(t,e){return pad(t.getUTCFullYear()%100,e,2)}function formatUTCYearISO(t,e){return t=UTCdISO(t),pad(t.getUTCFullYear()%100,e,2)}function formatUTCFullYear(t,e){return pad(t.getUTCFullYear()%1e4,e,4)}function formatUTCFullYearISO(t,e){var r=t.getUTCDay();return t=r>=4||r===0?utcThursday(t):utcThursday.ceil(t),pad(t.getUTCFullYear()%1e4,e,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(t){return+t}function formatUnixTimestampSeconds(t){return Math.floor(+t/1e3)}var locale,timeFormat;defaultLocale({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"]});function defaultLocale(t){return locale=formatLocale(t),timeFormat=locale.format,locale.parse,locale.utcFormat,locale.utcParse,locale}function date(t){return new Date(t)}function number(t){return t instanceof Date?+t:+new Date(+t)}function calendar(t,e,r,n,a,s,o,l,u,h){var d=continuous(),p=d.invert,g=d.domain,m=h(".%L"),T=h(":%S"),I=h("%I:%M"),A=h("%I %p"),C=h("%a %d"),L=h("%b %d"),M=h("%B"),F=h("%Y");function H(q){return(u(q)<q?m:l(q)<q?T:o(q)<q?I:s(q)<q?A:n(q)<q?a(q)<q?C:L:r(q)<q?M:F)(q)}return d.invert=function(q){return new Date(p(q))},d.domain=function(q){return arguments.length?g(Array.from(q,number)):g().map(date)},d.ticks=function(q){var U=g();return t(U[0],U[U.length-1],q??10)},d.tickFormat=function(q,U){return U==null?H:h(U)},d.nice=function(q){var U=g();return(!q||typeof q.range!="function")&&(q=e(U[0],U[U.length-1],q??10)),q?g(nice(U,q)):d},d.copy=function(){return copy$1(d,calendar(t,e,r,n,a,s,o,l,u,h))},d}function time$1(){return initRange.apply(calendar(timeTicks,timeTickInterval,timeYear,timeMonth,sunday,timeDay,timeHour,timeMinute,utcSecond,timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function constant$1(t){return function(){return t}}var abs$1=Math.abs,atan2=Math.atan2,cos=Math.cos,max$1=Math.max,min$1=Math.min,sin=Math.sin,sqrt=Math.sqrt,epsilon=1e-12,pi=Math.PI,halfPi=pi/2,tau=2*pi;function acos(t){return t>1?0:t<-1?pi:Math.acos(t)}function asin(t){return t>=1?halfPi:t<=-1?-halfPi:Math.asin(t)}function arcInnerRadius(t){return t.innerRadius}function arcOuterRadius(t){return t.outerRadius}function arcStartAngle(t){return t.startAngle}function arcEndAngle(t){return t.endAngle}function arcPadAngle(t){return t&&t.padAngle}function intersect$1(t,e,r,n,a,s,o,l){var u=r-t,h=n-e,d=o-a,p=l-s,g=p*u-d*h;if(!(g*g<epsilon))return g=(d*(e-s)-p*(t-a))/g,[t+g*u,e+g*h]}function cornerTangents(t,e,r,n,a,s,o){var l=t-r,u=e-n,h=(o?s:-s)/sqrt(l*l+u*u),d=h*u,p=-h*l,g=t+d,m=e+p,T=r+d,I=n+p,A=(g+T)/2,C=(m+I)/2,L=T-g,M=I-m,F=L*L+M*M,H=a-s,q=g*I-T*m,U=(M<0?-1:1)*sqrt(max$1(0,H*H*F-q*q)),z=(q*M-L*U)/F,R=(-q*L-M*U)/F,$=(q*M+L*U)/F,D=(-q*L+M*U)/F,k=z-A,B=R-C,v=$-A,J=D-C;return k*k+B*B>v*v+J*J&&(z=$,R=D),{cx:z,cy:R,x01:-d,y01:-p,x11:z*(a/H-1),y11:R*(a/H-1)}}function arc(){var t=arcInnerRadius,e=arcOuterRadius,r=constant$1(0),n=null,a=arcStartAngle,s=arcEndAngle,o=arcPadAngle,l=null;function u(){var h,d,p=+t.apply(this,arguments),g=+e.apply(this,arguments),m=a.apply(this,arguments)-halfPi,T=s.apply(this,arguments)-halfPi,I=abs$1(T-m),A=T>m;if(l||(l=h=path()),g<p&&(d=g,g=p,p=d),!(g>epsilon))l.moveTo(0,0);else if(I>tau-epsilon)l.moveTo(g*cos(m),g*sin(m)),l.arc(0,0,g,m,T,!A),p>epsilon&&(l.moveTo(p*cos(T),p*sin(T)),l.arc(0,0,p,T,m,A));else{var C=m,L=T,M=m,F=T,H=I,q=I,U=o.apply(this,arguments)/2,z=U>epsilon&&(n?+n.apply(this,arguments):sqrt(p*p+g*g)),R=min$1(abs$1(g-p)/2,+r.apply(this,arguments)),$=R,D=R,k,B;if(z>epsilon){var v=asin(z/p*sin(U)),J=asin(z/g*sin(U));(H-=v*2)>epsilon?(v*=A?1:-1,M+=v,F-=v):(H=0,M=F=(m+T)/2),(q-=J*2)>epsilon?(J*=A?1:-1,C+=J,L-=J):(q=0,C=L=(m+T)/2)}var E=g*cos(C),ft=g*sin(C),Lt=p*cos(F),Tt=p*sin(F);if(R>epsilon){var Q=g*cos(L),ut=g*sin(L),st=p*cos(M),ot=p*sin(M),dt;if(I<pi&&(dt=intersect$1(E,ft,st,ot,Q,ut,Lt,Tt))){var xt=E-dt[0],et=ft-dt[1],Nt=Q-dt[0],G=ut-dt[1],Z=1/sin(acos((xt*Nt+et*G)/(sqrt(xt*xt+et*et)*sqrt(Nt*Nt+G*G)))/2),tt=sqrt(dt[0]*dt[0]+dt[1]*dt[1]);$=min$1(R,(p-tt)/(Z-1)),D=min$1(R,(g-tt)/(Z+1))}}q>epsilon?D>epsilon?(k=cornerTangents(st,ot,E,ft,g,D,A),B=cornerTangents(Q,ut,Lt,Tt,g,D,A),l.moveTo(k.cx+k.x01,k.cy+k.y01),D<R?l.arc(k.cx,k.cy,D,atan2(k.y01,k.x01),atan2(B.y01,B.x01),!A):(l.arc(k.cx,k.cy,D,atan2(k.y01,k.x01),atan2(k.y11,k.x11),!A),l.arc(0,0,g,atan2(k.cy+k.y11,k.cx+k.x11),atan2(B.cy+B.y11,B.cx+B.x11),!A),l.arc(B.cx,B.cy,D,atan2(B.y11,B.x11),atan2(B.y01,B.x01),!A))):(l.moveTo(E,ft),l.arc(0,0,g,C,L,!A)):l.moveTo(E,ft),!(p>epsilon)||!(H>epsilon)?l.lineTo(Lt,Tt):$>epsilon?(k=cornerTangents(Lt,Tt,Q,ut,p,-$,A),B=cornerTangents(E,ft,st,ot,p,-$,A),l.lineTo(k.cx+k.x01,k.cy+k.y01),$<R?l.arc(k.cx,k.cy,$,atan2(k.y01,k.x01),atan2(B.y01,B.x01),!A):(l.arc(k.cx,k.cy,$,atan2(k.y01,k.x01),atan2(k.y11,k.x11),!A),l.arc(0,0,p,atan2(k.cy+k.y11,k.cx+k.x11),atan2(B.cy+B.y11,B.cx+B.x11),A),l.arc(B.cx,B.cy,$,atan2(B.y11,B.x11),atan2(B.y01,B.x01),!A))):l.arc(0,0,p,F,M,A)}if(l.closePath(),h)return l=null,h+""||null}return u.centroid=function(){var h=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,d=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-pi/2;return[cos(d)*h,sin(d)*h]},u.innerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:constant$1(+h),u):t},u.outerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:constant$1(+h),u):e},u.cornerRadius=function(h){return arguments.length?(r=typeof h=="function"?h:constant$1(+h),u):r},u.padRadius=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:constant$1(+h),u):n},u.startAngle=function(h){return arguments.length?(a=typeof h=="function"?h:constant$1(+h),u):a},u.endAngle=function(h){return arguments.length?(s=typeof h=="function"?h:constant$1(+h),u):s},u.padAngle=function(h){return arguments.length?(o=typeof h=="function"?h:constant$1(+h),u):o},u.context=function(h){return arguments.length?(l=h??null,u):l},u}function array(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Linear(t){this._context=t}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),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:this._context.lineTo(t,e);break}}};function curveLinear(t){return new Linear(t)}function x(t){return t[0]}function y(t){return t[1]}function line$1(t,e){var r=constant$1(!0),n=null,a=curveLinear,s=null;t=typeof t=="function"?t:t===void 0?x:constant$1(t),e=typeof e=="function"?e:e===void 0?y:constant$1(e);function o(l){var u,h=(l=array(l)).length,d,p=!1,g;for(n==null&&(s=a(g=path())),u=0;u<=h;++u)!(u<h&&r(d=l[u],u,l))===p&&((p=!p)?s.lineStart():s.lineEnd()),p&&s.point(+t(d,u,l),+e(d,u,l));if(g)return s=null,g+""||null}return o.x=function(l){return arguments.length?(t=typeof l=="function"?l:constant$1(+l),o):t},o.y=function(l){return arguments.length?(e=typeof l=="function"?l:constant$1(+l),o):e},o.defined=function(l){return arguments.length?(r=typeof l=="function"?l:constant$1(!!l),o):r},o.curve=function(l){return arguments.length?(a=l,n!=null&&(s=a(n)),o):a},o.context=function(l){return arguments.length?(l==null?n=s=null:s=a(n=l),o):n},o}function descending(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function identity$1(t){return t}function pie(){var t=identity$1,e=descending,r=null,n=constant$1(0),a=constant$1(tau),s=constant$1(0);function o(l){var u,h=(l=array(l)).length,d,p,g=0,m=new Array(h),T=new Array(h),I=+n.apply(this,arguments),A=Math.min(tau,Math.max(-tau,a.apply(this,arguments)-I)),C,L=Math.min(Math.abs(A)/h,s.apply(this,arguments)),M=L*(A<0?-1:1),F;for(u=0;u<h;++u)(F=T[m[u]=u]=+t(l[u],u,l))>0&&(g+=F);for(e!=null?m.sort(function(H,q){return e(T[H],T[q])}):r!=null&&m.sort(function(H,q){return r(l[H],l[q])}),u=0,p=g?(A-h*M)/g:0;u<h;++u,I=C)d=m[u],F=T[d],C=I+(F>0?F*p:0)+M,T[d]={data:l[d],index:u,value:F,startAngle:I,endAngle:C,padAngle:L};return T}return o.value=function(l){return arguments.length?(t=typeof l=="function"?l:constant$1(+l),o):t},o.sortValues=function(l){return arguments.length?(e=l,r=null,o):e},o.sort=function(l){return arguments.length?(r=l,e=null,o):r},o.startAngle=function(l){return arguments.length?(n=typeof l=="function"?l:constant$1(+l),o):n},o.endAngle=function(l){return arguments.length?(a=typeof l=="function"?l:constant$1(+l),o):a},o.padAngle=function(l){return arguments.length?(s=typeof l=="function"?l:constant$1(+l),o):s},o}function noop$1(){}function point$2(t,e,r){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+r)/6)}function Basis(t){this._context=t}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),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;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$2(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function curveBasis(t){return new Basis(t)}function BasisClosed(t){this._context=t}BasisClosed.prototype={areaStart:noop$1,areaEnd:noop$1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:point$2(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function curveBasisClosed(t){return new BasisClosed(t)}function BasisOpen(t){this._context=t}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:point$2(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function curveBasisOpen(t){return new BasisOpen(t)}function LinearClosed(t){this._context=t}LinearClosed.prototype={areaStart:noop$1,areaEnd:noop$1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function curveLinearClosed(t){return new LinearClosed(t)}function sign(t){return t<0?-1:1}function slope3(t,e,r){var n=t._x1-t._x0,a=e-t._x1,s=(t._y1-t._y0)/(n||a<0&&-0),o=(r-t._y1)/(a||n<0&&-0),l=(s*a+o*n)/(n+a);return(sign(s)+sign(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function slope2(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function point$1(t,e,r){var n=t._x0,a=t._y0,s=t._x1,o=t._y1,l=(s-n)/3;t._context.bezierCurveTo(n+l,a+l*e,s-l,o-l*r,s,o)}function MonotoneX(t){this._context=t}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point$1(this,this._t0,slope2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(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;break;case 2:this._point=3,point$1(this,slope2(this,r=slope3(this,t,e)),r);break;default:point$1(this,this._t0,r=slope3(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function MonotoneY(t){this._context=new ReflectContext(t)}(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(t,e){MonotoneX.prototype.point.call(this,e,t)};function ReflectContext(t){this._context=t}ReflectContext.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,a,s){this._context.bezierCurveTo(e,t,n,r,s,a)}};function monotoneX(t){return new MonotoneX(t)}function monotoneY(t){return new MonotoneY(t)}function Natural(t){this._context=t}Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=controlPoints(t),a=controlPoints(e),s=0,o=1;o<r;++s,++o)this._context.bezierCurveTo(n[0][s],a[0][s],n[1][s],a[1][s],t[o],e[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function controlPoints(t){var e,r=t.length-1,n,a=new Array(r),s=new Array(r),o=new Array(r);for(a[0]=0,s[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)a[e]=1,s[e]=4,o[e]=4*t[e]+2*t[e+1];for(a[r-1]=2,s[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=a[e]/s[e-1],s[e]-=n,o[e]-=n*o[e-1];for(a[r-1]=o[r-1]/s[r-1],e=r-2;e>=0;--e)a[e]=(o[e]-a[e+1])/s[e];for(s[r-1]=(t[r]+a[r-1])/2,e=0;e<r-1;++e)s[e]=2*t[e+1]-a[e+1];return[a,s]}function curveNatural(t){return new Natural(t)}function Step(t,e){this._context=t,this._t=e}Step.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function curveStep(t){return new Step(t,.5)}function stepBefore(t){return new Step(t,0)}function stepAfter(t){return new Step(t,1)}function _typeof(t){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(t)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},_setPrototypeOf(t,e)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(t,e,r){return _isNativeReflectConstruct()?_construct=Reflect.construct:_construct=function(a,s,o){var l=[null];l.push.apply(l,s);var u=Function.bind.apply(a,l),h=new u;return o&&_setPrototypeOf(h,o.prototype),h},_construct.apply(null,arguments)}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _iterableToArray(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _unsupportedIterableToArray(t,e){if(t){if(typeof t=="string")return _arrayLikeToArray(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(t,e)}}function _arrayLikeToArray(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var hasOwnProperty$g=Object.hasOwnProperty,setPrototypeOf=Object.setPrototypeOf,isFrozen=Object.isFrozen,getPrototypeOf=Object.getPrototypeOf,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,freeze=Object.freeze,seal=Object.seal,create=Object.create,_ref=typeof Reflect<"u"&&Reflect,apply$2=_ref.apply,construct=_ref.construct;apply$2||(apply$2=function(e,r,n){return e.apply(r,n)});freeze||(freeze=function(e){return e});seal||(seal=function(e){return e});construct||(construct=function(e,r){return _construct(e,_toConsumableArray(r))});var arrayForEach=unapply(Array.prototype.forEach),arrayPop=unapply(Array.prototype.pop),arrayPush$1=unapply(Array.prototype.push),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return apply$2(t,e,n)}}function unconstruct(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return construct(t,r)}}function addToSet(t,e,r){r=r||stringToLowerCase,setPrototypeOf&&setPrototypeOf(t,null);for(var n=e.length;n--;){var a=e[n];if(typeof a=="string"){var s=r(a);s!==a&&(isFrozen(e)||(e[n]=s),a=s)}t[a]=!0}return t}function clone$2(t){var e=create(null),r;for(r in t)apply$2(hasOwnProperty$g,t,[r])&&(e[r]=t[r]);return e}function lookupGetter(t,e){for(;t!==null;){var r=getOwnPropertyDescriptor(t,e);if(r){if(r.get)return unapply(r.get);if(typeof r.value=="function")return unapply(r.value)}t=getPrototypeOf(t)}function n(a){return console.warn("fallback value for",a),null}return n}var html$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\${[\w\W]*}/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),getGlobal=function t(){return typeof window>"u"?null:window},_createTrustedTypesPolicy=function t(e,r){if(_typeof(e)!=="object"||typeof e.createPolicy!="function")return null;var n=null,a="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(a)&&(n=r.currentScript.getAttribute(a));var s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML:function(l){return l},createScriptURL:function(l){return l}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function createDOMPurify(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal(),e=function(rt){return createDOMPurify(rt)};if(e.version="2.4.1",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;var r=t.document,n=t.document,a=t.DocumentFragment,s=t.HTMLTemplateElement,o=t.Node,l=t.Element,u=t.NodeFilter,h=t.NamedNodeMap,d=h===void 0?t.NamedNodeMap||t.MozNamedAttrMap:h,p=t.HTMLFormElement,g=t.DOMParser,m=t.trustedTypes,T=l.prototype,I=lookupGetter(T,"cloneNode"),A=lookupGetter(T,"nextSibling"),C=lookupGetter(T,"childNodes"),L=lookupGetter(T,"parentNode");if(typeof s=="function"){var M=n.createElement("template");M.content&&M.content.ownerDocument&&(n=M.content.ownerDocument)}var F=_createTrustedTypesPolicy(m,r),H=F?F.createHTML(""):"",q=n,U=q.implementation,z=q.createNodeIterator,R=q.createDocumentFragment,$=q.getElementsByTagName,D=r.importNode,k={};try{k=clone$2(n).documentMode?n.documentMode:{}}catch{}var B={};e.isSupported=typeof L=="function"&&U&&typeof U.createHTMLDocument<"u"&&k!==9;var v=MUSTACHE_EXPR,J=ERB_EXPR,E=TMPLIT_EXPR,ft=DATA_ATTR,Lt=ARIA_ATTR,Tt=IS_SCRIPT_OR_DATA,Q=ATTR_WHITESPACE,ut=IS_ALLOWED_URI,st=null,ot=addToSet({},[].concat(_toConsumableArray(html$1),_toConsumableArray(svg$1),_toConsumableArray(svgFilters),_toConsumableArray(mathMl$1),_toConsumableArray(text))),dt=null,xt=addToSet({},[].concat(_toConsumableArray(html),_toConsumableArray(svg),_toConsumableArray(mathMl),_toConsumableArray(xml))),et=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}})),Nt=null,G=null,Z=!0,tt=!0,W=!1,Y=!1,P=!1,it=!1,N=!1,gt=!1,j=!1,Ft=!1,at=!0,Dt=!1,kt="user-content-",_t=!0,St=!1,Et={},yt=null,ct=addToSet({},["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"]),ne=null,jt=addToSet({},["audio","video","img","source","image","track"]),Wt=null,qt=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ht="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",zt="http://www.w3.org/1999/xhtml",Pt=zt,Mt=!1,wt=null,mt=addToSet({},[Ht,ge,zt],stringToString),It,vt=["application/xhtml+xml","text/html"],Ut="text/html",ht,Jt=null,pt=n.createElement("form"),Kt=function(rt){return rt instanceof RegExp||rt instanceof Function},oe=function(rt){Jt&&Jt===rt||((!rt||_typeof(rt)!=="object")&&(rt={}),rt=clone$2(rt),It=vt.indexOf(rt.PARSER_MEDIA_TYPE)===-1?It=Ut:It=rt.PARSER_MEDIA_TYPE,ht=It==="application/xhtml+xml"?stringToString:stringToLowerCase,st="ALLOWED_TAGS"in rt?addToSet({},rt.ALLOWED_TAGS,ht):ot,dt="ALLOWED_ATTR"in rt?addToSet({},rt.ALLOWED_ATTR,ht):xt,wt="ALLOWED_NAMESPACES"in rt?addToSet({},rt.ALLOWED_NAMESPACES,stringToString):mt,Wt="ADD_URI_SAFE_ATTR"in rt?addToSet(clone$2(qt),rt.ADD_URI_SAFE_ATTR,ht):qt,ne="ADD_DATA_URI_TAGS"in rt?addToSet(clone$2(jt),rt.ADD_DATA_URI_TAGS,ht):jt,yt="FORBID_CONTENTS"in rt?addToSet({},rt.FORBID_CONTENTS,ht):ct,Nt="FORBID_TAGS"in rt?addToSet({},rt.FORBID_TAGS,ht):{},G="FORBID_ATTR"in rt?addToSet({},rt.FORBID_ATTR,ht):{},Et="USE_PROFILES"in rt?rt.USE_PROFILES:!1,Z=rt.ALLOW_ARIA_ATTR!==!1,tt=rt.ALLOW_DATA_ATTR!==!1,W=rt.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=rt.SAFE_FOR_TEMPLATES||!1,P=rt.WHOLE_DOCUMENT||!1,gt=rt.RETURN_DOM||!1,j=rt.RETURN_DOM_FRAGMENT||!1,Ft=rt.RETURN_TRUSTED_TYPE||!1,N=rt.FORCE_BODY||!1,at=rt.SANITIZE_DOM!==!1,Dt=rt.SANITIZE_NAMED_PROPS||!1,_t=rt.KEEP_CONTENT!==!1,St=rt.IN_PLACE||!1,ut=rt.ALLOWED_URI_REGEXP||ut,Pt=rt.NAMESPACE||zt,rt.CUSTOM_ELEMENT_HANDLING&&Kt(rt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(et.tagNameCheck=rt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),rt.CUSTOM_ELEMENT_HANDLING&&Kt(rt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(et.attributeNameCheck=rt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),rt.CUSTOM_ELEMENT_HANDLING&&typeof rt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=rt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(tt=!1),j&&(gt=!0),Et&&(st=addToSet({},_toConsumableArray(text)),dt=[],Et.html===!0&&(addToSet(st,html$1),addToSet(dt,html)),Et.svg===!0&&(addToSet(st,svg$1),addToSet(dt,svg),addToSet(dt,xml)),Et.svgFilters===!0&&(addToSet(st,svgFilters),addToSet(dt,svg),addToSet(dt,xml)),Et.mathMl===!0&&(addToSet(st,mathMl$1),addToSet(dt,mathMl),addToSet(dt,xml))),rt.ADD_TAGS&&(st===ot&&(st=clone$2(st)),addToSet(st,rt.ADD_TAGS,ht)),rt.ADD_ATTR&&(dt===xt&&(dt=clone$2(dt)),addToSet(dt,rt.ADD_ATTR,ht)),rt.ADD_URI_SAFE_ATTR&&addToSet(Wt,rt.ADD_URI_SAFE_ATTR,ht),rt.FORBID_CONTENTS&&(yt===ct&&(yt=clone$2(yt)),addToSet(yt,rt.FORBID_CONTENTS,ht)),_t&&(st["#text"]=!0),P&&addToSet(st,["html","head","body"]),st.table&&(addToSet(st,["tbody"]),delete Nt.tbody),freeze&&freeze(rt),Jt=rt)},ue=addToSet({},["mi","mo","mn","ms","mtext"]),he=addToSet({},["foreignobject","desc","title","annotation-xml"]),fe=addToSet({},["title","style","font","a","script"]),Gt=addToSet({},svg$1);addToSet(Gt,svgFilters),addToSet(Gt,svgDisallowed);var te=addToSet({},mathMl$1);addToSet(te,mathMlDisallowed);var ce=function(rt){var At=L(rt);(!At||!At.tagName)&&(At={namespaceURI:Pt,tagName:"template"});var Rt=stringToLowerCase(rt.tagName),le=stringToLowerCase(At.tagName);return wt[rt.namespaceURI]?rt.namespaceURI===ge?At.namespaceURI===zt?Rt==="svg":At.namespaceURI===Ht?Rt==="svg"&&(le==="annotation-xml"||ue[le]):Boolean(Gt[Rt]):rt.namespaceURI===Ht?At.namespaceURI===zt?Rt==="math":At.namespaceURI===ge?Rt==="math"&&he[le]:Boolean(te[Rt]):rt.namespaceURI===zt?At.namespaceURI===ge&&!he[le]||At.namespaceURI===Ht&&!ue[le]?!1:!te[Rt]&&(fe[Rt]||!Gt[Rt]):!!(It==="application/xhtml+xml"&&wt[rt.namespaceURI]):!1},Zt=function(rt){arrayPush$1(e.removed,{element:rt});try{rt.parentNode.removeChild(rt)}catch{try{rt.outerHTML=H}catch{rt.remove()}}},Ue=function(rt,At){try{arrayPush$1(e.removed,{attribute:At.getAttributeNode(rt),from:At})}catch{arrayPush$1(e.removed,{attribute:null,from:At})}if(At.removeAttribute(rt),rt==="is"&&!dt[rt])if(gt||j)try{Zt(At)}catch{}else try{At.setAttribute(rt,"")}catch{}},Be=function(rt){var At,Rt;if(N)rt="<remove></remove>"+rt;else{var le=stringMatch(rt,/^[\r\n\t ]+/);Rt=le&&le[0]}It==="application/xhtml+xml"&&Pt===zt&&(rt='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+rt+"</body></html>");var be=F?F.createHTML(rt):rt;if(Pt===zt)try{At=new g().parseFromString(be,It)}catch{}if(!At||!At.documentElement){At=U.createDocument(Pt,"template",null);try{At.documentElement.innerHTML=Mt?"":be}catch{}}var ye=At.body||At.documentElement;return rt&&Rt&&ye.insertBefore(n.createTextNode(Rt),ye.childNodes[0]||null),Pt===zt?$.call(At,P?"html":"body")[0]:P?At.documentElement:ye},_e=function(rt){return z.call(rt.ownerDocument||rt,rt,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},ee=function(rt){return rt instanceof p&&(typeof rt.nodeName!="string"||typeof rt.textContent!="string"||typeof rt.removeChild!="function"||!(rt.attributes instanceof d)||typeof rt.removeAttribute!="function"||typeof rt.setAttribute!="function"||typeof rt.namespaceURI!="string"||typeof rt.insertBefore!="function"||typeof rt.hasChildNodes!="function")},Te=function(rt){return _typeof(o)==="object"?rt instanceof o:rt&&_typeof(rt)==="object"&&typeof rt.nodeType=="number"&&typeof rt.nodeName=="string"},we=function(rt,At,Rt){B[rt]&&arrayForEach(B[rt],function(le){le.call(e,At,Rt,Jt)})},Ee=function(rt){var At;if(we("beforeSanitizeElements",rt,null),ee(rt)||regExpTest(/[\u0080-\uFFFF]/,rt.nodeName))return Zt(rt),!0;var Rt=ht(rt.nodeName);if(we("uponSanitizeElement",rt,{tagName:Rt,allowedTags:st}),rt.hasChildNodes()&&!Te(rt.firstElementChild)&&(!Te(rt.content)||!Te(rt.content.firstElementChild))&&regExpTest(/<[/\w]/g,rt.innerHTML)&&regExpTest(/<[/\w]/g,rt.textContent)||Rt==="select"&&regExpTest(/<template/i,rt.innerHTML))return Zt(rt),!0;if(!st[Rt]||Nt[Rt]){if(!Nt[Rt]&&xe(Rt)&&(et.tagNameCheck instanceof RegExp&&regExpTest(et.tagNameCheck,Rt)||et.tagNameCheck instanceof Function&&et.tagNameCheck(Rt)))return!1;if(_t&&!yt[Rt]){var le=L(rt)||rt.parentNode,be=C(rt)||rt.childNodes;if(be&&le)for(var ye=be.length,Ce=ye-1;Ce>=0;--Ce)le.insertBefore(I(be[Ce],!0),A(rt))}return Zt(rt),!0}return rt instanceof l&&!ce(rt)||(Rt==="noscript"||Rt==="noembed")&&regExpTest(/<\/no(script|embed)/i,rt.innerHTML)?(Zt(rt),!0):(Y&&rt.nodeType===3&&(At=rt.textContent,At=stringReplace(At,v," "),At=stringReplace(At,J," "),At=stringReplace(At,E," "),rt.textContent!==At&&(arrayPush$1(e.removed,{element:rt.cloneNode()}),rt.textContent=At)),we("afterSanitizeElements",rt,null),!1)},ke=function(rt,At,Rt){if(at&&(At==="id"||At==="name")&&(Rt in n||Rt in pt))return!1;if(!(tt&&!G[At]&&regExpTest(ft,At))){if(!(Z&&regExpTest(Lt,At))){if(!dt[At]||G[At]){if(!(xe(rt)&&(et.tagNameCheck instanceof RegExp&&regExpTest(et.tagNameCheck,rt)||et.tagNameCheck instanceof Function&&et.tagNameCheck(rt))&&(et.attributeNameCheck instanceof RegExp&&regExpTest(et.attributeNameCheck,At)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(At))||At==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&regExpTest(et.tagNameCheck,Rt)||et.tagNameCheck instanceof Function&&et.tagNameCheck(Rt))))return!1}else if(!Wt[At]){if(!regExpTest(ut,stringReplace(Rt,Q,""))){if(!((At==="src"||At==="xlink:href"||At==="href")&&rt!=="script"&&stringIndexOf(Rt,"data:")===0&&ne[rt])){if(!(W&&!regExpTest(Tt,stringReplace(Rt,Q,"")))){if(Rt)return!1}}}}}}return!0},xe=function(rt){return rt.indexOf("-")>0},Le=function(rt){var At,Rt,le,be;we("beforeSanitizeAttributes",rt,null);var ye=rt.attributes;if(ye){var Ce={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:dt};for(be=ye.length;be--;){At=ye[be];var de=At,ve=de.name,Ke=de.namespaceURI;if(Rt=ve==="value"?At.value:stringTrim(At.value),le=ht(ve),Ce.attrName=le,Ce.attrValue=Rt,Ce.keepAttr=!0,Ce.forceKeepAttr=void 0,we("uponSanitizeAttribute",rt,Ce),Rt=Ce.attrValue,!Ce.forceKeepAttr&&(Ue(ve,rt),!!Ce.keepAttr)){if(regExpTest(/\/>/i,Rt)){Ue(ve,rt);continue}Y&&(Rt=stringReplace(Rt,v," "),Rt=stringReplace(Rt,J," "),Rt=stringReplace(Rt,E," "));var Qe=ht(rt.nodeName);if(ke(Qe,le,Rt)){if(Dt&&(le==="id"||le==="name")&&(Ue(ve,rt),Rt=kt+Rt),F&&_typeof(m)==="object"&&typeof m.getAttributeType=="function"&&!Ke)switch(m.getAttributeType(Qe,le)){case"TrustedHTML":Rt=F.createHTML(Rt);break;case"TrustedScriptURL":Rt=F.createScriptURL(Rt);break}try{Ke?rt.setAttributeNS(Ke,ve,Rt):rt.setAttribute(ve,Rt),arrayPop(e.removed)}catch{}}}}we("afterSanitizeAttributes",rt,null)}},Ie=function Yt(rt){var At,Rt=_e(rt);for(we("beforeSanitizeShadowDOM",rt,null);At=Rt.nextNode();)we("uponSanitizeShadowNode",At,null),!Ee(At)&&(At.content instanceof a&&Yt(At.content),Le(At));we("afterSanitizeShadowDOM",rt,null)};return e.sanitize=function(Yt){var rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},At,Rt,le,be,ye;if(Mt=!Yt,Mt&&(Yt="<!-->"),typeof Yt!="string"&&!Te(Yt)){if(typeof Yt.toString!="function")throw typeErrorCreate("toString is not a function");if(Yt=Yt.toString(),typeof Yt!="string")throw typeErrorCreate("dirty is not a string, aborting")}if(!e.isSupported){if(_typeof(t.toStaticHTML)==="object"||typeof t.toStaticHTML=="function"){if(typeof Yt=="string")return t.toStaticHTML(Yt);if(Te(Yt))return t.toStaticHTML(Yt.outerHTML)}return Yt}if(it||oe(rt),e.removed=[],typeof Yt=="string"&&(St=!1),St){if(Yt.nodeName){var Ce=ht(Yt.nodeName);if(!st[Ce]||Nt[Ce])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(Yt instanceof o)At=Be("<!---->"),Rt=At.ownerDocument.importNode(Yt,!0),Rt.nodeType===1&&Rt.nodeName==="BODY"||Rt.nodeName==="HTML"?At=Rt:At.appendChild(Rt);else{if(!gt&&!Y&&!P&&Yt.indexOf("<")===-1)return F&&Ft?F.createHTML(Yt):Yt;if(At=Be(Yt),!At)return gt?null:Ft?H:""}At&&N&&Zt(At.firstChild);for(var de=_e(St?Yt:At);le=de.nextNode();)le.nodeType===3&&le===be||Ee(le)||(le.content instanceof a&&Ie(le.content),Le(le),be=le);if(be=null,St)return Yt;if(gt){if(j)for(ye=R.call(At.ownerDocument);At.firstChild;)ye.appendChild(At.firstChild);else ye=At;return dt.shadowroot&&(ye=D.call(r,ye,!0)),ye}var ve=P?At.outerHTML:At.innerHTML;return P&&st["!doctype"]&&At.ownerDocument&&At.ownerDocument.doctype&&At.ownerDocument.doctype.name&&regExpTest(DOCTYPE_NAME,At.ownerDocument.doctype.name)&&(ve="<!DOCTYPE "+At.ownerDocument.doctype.name+`>
`+ve),Y&&(ve=stringReplace(ve,v," "),ve=stringReplace(ve,J," "),ve=stringReplace(ve,E," ")),F&&Ft?F.createHTML(ve):ve},e.setConfig=function(Yt){oe(Yt),it=!0},e.clearConfig=function(){Jt=null,it=!1},e.isValidAttribute=function(Yt,rt,At){Jt||oe({});var Rt=ht(Yt),le=ht(rt);return ke(Rt,le,At)},e.addHook=function(Yt,rt){typeof rt=="function"&&(B[Yt]=B[Yt]||[],arrayPush$1(B[Yt],rt))},e.removeHook=function(Yt){if(B[Yt])return arrayPop(B[Yt])},e.removeHooks=function(Yt){B[Yt]&&(B[Yt]=[])},e.removeAllHooks=function(){B={}},e}var purify=createDOMPurify();const change=(t,e)=>{const r=Color$1.parse(t);for(const n in e)r[n]=_.channel.clamp[n](e[n]);return Color$1.stringify(r)},change$1=change,rgba=(t,e,r=0,n=1)=>{if(typeof t!="number")return change$1(t,{a:e});const a=ChannelsReusable.set({r:_.channel.clamp.r(t),g:_.channel.clamp.g(e),b:_.channel.clamp.b(r),a:_.channel.clamp.a(n)});return Color$1.stringify(a)},rgba$1=rgba,adjust$1=(t,e)=>{const r=Color$1.parse(t),n={};for(const a in e)e[a]&&(n[a]=r[a]+e[a]);return change$1(t,n)},adjust$2=adjust$1,mix=(t,e,r=50)=>{const{r:n,g:a,b:s,a:o}=Color$1.parse(t),{r:l,g:u,b:h,a:d}=Color$1.parse(e),p=r/100,g=p*2-1,m=o-d,I=((g*m===-1?g:(g+m)/(1+g*m))+1)/2,A=1-I,C=n*I+l*A,L=a*I+u*A,M=s*I+h*A,F=o*p+d*(1-p);return rgba$1(C,L,M,F)},mix$1=mix,invert=(t,e=100)=>{const r=Color$1.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,mix$1(r,t,e)},invert$1=invert;var freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global;const freeGlobal$1=freeGlobal;var freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal$1||freeSelf||Function("return this")();const root$1=root;var Symbol$1=root$1.Symbol;const Symbol$2=Symbol$1;var objectProto$i=Object.prototype,hasOwnProperty$f=objectProto$i.hasOwnProperty,nativeObjectToString$1=objectProto$i.toString,symToStringTag$1=Symbol$2?Symbol$2.toStringTag:void 0;function getRawTag(t){var e=hasOwnProperty$f.call(t,symToStringTag$1),r=t[symToStringTag$1];try{t[symToStringTag$1]=void 0;var n=!0}catch{}var a=nativeObjectToString$1.call(t);return n&&(e?t[symToStringTag$1]=r:delete t[symToStringTag$1]),a}var objectProto$h=Object.prototype,nativeObjectToString=objectProto$h.toString;function objectToString(t){return nativeObjectToString.call(t)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$2?Symbol$2.toStringTag:void 0;function baseGetTag(t){return t==null?t===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(t)?getRawTag(t):objectToString(t)}function isObject$1(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var asyncTag="[object AsyncFunction]",funcTag$2="[object Function]",genTag$1="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(t){if(!isObject$1(t))return!1;var e=baseGetTag(t);return e==funcTag$2||e==genTag$1||e==asyncTag||e==proxyTag}var coreJsData=root$1["__core-js_shared__"];const coreJsData$1=coreJsData;var maskSrcKey=function(){var t=/[^.]+$/.exec(coreJsData$1&&coreJsData$1.keys&&coreJsData$1.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function isMasked(t){return!!maskSrcKey&&maskSrcKey in t}var funcProto$2=Function.prototype,funcToString$2=funcProto$2.toString;function toSource(t){if(t!=null){try{return funcToString$2.call(t)}catch{}try{return t+""}catch{}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$g=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$e=objectProto$g.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$e).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(t){if(!isObject$1(t)||isMasked(t))return!1;var e=isFunction(t)?reIsNative:reIsHostCtor;return e.test(toSource(t))}function getValue(t,e){return t==null?void 0:t[e]}function getNative(t,e){var r=getValue(t,e);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");const nativeCreate$1=nativeCreate;function hashClear(){this.__data__=nativeCreate$1?nativeCreate$1(null):{},this.size=0}function hashDelete(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$f=Object.prototype,hasOwnProperty$d=objectProto$f.hasOwnProperty;function hashGet(t){var e=this.__data__;if(nativeCreate$1){var r=e[t];return r===HASH_UNDEFINED$2?void 0:r}return hasOwnProperty$d.call(e,t)?e[t]:void 0}var objectProto$e=Object.prototype,hasOwnProperty$c=objectProto$e.hasOwnProperty;function hashHas(t){var e=this.__data__;return nativeCreate$1?e[t]!==void 0:hasOwnProperty$c.call(e,t)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=nativeCreate$1&&e===void 0?HASH_UNDEFINED$1:e,this}function Hash(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Hash.prototype.clear=hashClear;Hash.prototype.delete=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function eq(t,e){return t===e||t!==t&&e!==e}function assocIndexOf(t,e){for(var r=t.length;r--;)if(eq(t[r][0],e))return r;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(t){var e=this.__data__,r=assocIndexOf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():splice.call(e,r,1),--this.size,!0}function listCacheGet(t){var e=this.__data__,r=assocIndexOf(e,t);return r<0?void 0:e[r][1]}function listCacheHas(t){return assocIndexOf(this.__data__,t)>-1}function listCacheSet(t,e){var r=this.__data__,n=assocIndexOf(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function ListCache(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ListCache.prototype.clear=listCacheClear;ListCache.prototype.delete=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;var Map$1=getNative(root$1,"Map");const Map$2=Map$1;function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function getMapData(t,e){var r=t.__data__;return isKeyable(e)?r[typeof e=="string"?"string":"hash"]:r.map}function mapCacheDelete(t){var e=getMapData(this,t).delete(t);return this.size-=e?1:0,e}function mapCacheGet(t){return getMapData(this,t).get(t)}function mapCacheHas(t){return getMapData(this,t).has(t)}function mapCacheSet(t,e){var r=getMapData(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function MapCache(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}MapCache.prototype.clear=mapCacheClear;MapCache.prototype.delete=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],s=r.cache;if(s.has(a))return s.get(a);var o=t.apply(this,n);return r.cache=s.set(a,o)||s,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var COMMENT="comm",RULESET="rule",DECLARATION="decl",IMPORT="@import",KEYFRAMES="@keyframes",abs=Math.abs,from=String.fromCharCode;function trim(t){return t.trim()}function replace(t,e,r){return t.replace(e,r)}function indexof(t,e){return t.indexOf(e)}function charat(t,e){return t.charCodeAt(e)|0}function substr(t,e,r){return t.slice(e,r)}function strlen(t){return t.length}function sizeof(t){return t.length}function append(t,e){return e.push(t),t}var line=1,column=1,length=0,position$1=0,character=0,characters="";function node(t,e,r,n,a,s,o){return{value:t,root:e,parent:r,type:n,props:a,children:s,line,column,length:o,return:""}}function char(){return character}function prev(){return character=position$1>0?charat(characters,--position$1):0,column--,character===10&&(column=1,line--),character}function next(){return character=position$1<length?charat(characters,position$1++):0,column++,character===10&&(column=1,line++),character}function peek(){return charat(characters,position$1)}function caret(){return position$1}function slice(t,e){return substr(characters,t,e)}function token(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(t){return line=column=1,length=strlen(characters=t),position$1=0,[]}function dealloc(t){return characters="",t}function delimit(t){return trim(slice(position$1-1,delimiter(t===91?t+2:t===40?t+1:t)))}function whitespace(t){for(;(character=peek())&&character<33;)next();return token(t)>2||token(character)>3?"":" "}function escaping(t,e){for(;--e&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(t,caret()+(e<6&&peek()==32&&next()==32))}function delimiter(t){for(;next();)switch(character){case t:return position$1;case 34:case 39:t!==34&&t!==39&&delimiter(character);break;case 40:t===41&&delimiter(t);break;case 92:next();break}return position$1}function commenter(t,e){for(;next()&&t+character!==47+10;)if(t+character===42+42&&peek()===47)break;return"/*"+slice(e,position$1-1)+"*"+from(t===47?t:next())}function identifier(t){for(;!token(peek());)next();return slice(t,position$1)}function compile(t){return dealloc(parse$3("",null,null,null,[""],t=alloc(t),0,[0],t))}function parse$3(t,e,r,n,a,s,o,l,u){for(var h=0,d=0,p=o,g=0,m=0,T=0,I=1,A=1,C=1,L=0,M="",F=a,H=s,q=n,U=M;A;)switch(T=L,L=next()){case 40:if(T!=108&&charat(U,p-1)==58){indexof(U+=replace(delimit(L),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:U+=delimit(L);break;case 9:case 10:case 13:case 32:U+=whitespace(T);break;case 92:U+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment(commenter(next(),caret()),e,r),u);break;default:U+="/"}break;case 123*I:l[h++]=strlen(U)*C;case 125*I:case 59:case 0:switch(L){case 0:case 125:A=0;case 59+d:m>0&&strlen(U)-p&&append(m>32?declaration(U+";",n,r,p-1):declaration(replace(U," ","")+";",n,r,p-2),u);break;case 59:U+=";";default:if(append(q=ruleset(U,e,r,h,d,a,l,M,F=[],H=[],p),s),L===123)if(d===0)parse$3(U,e,q,q,F,s,p,l,H);else switch(g){case 100:case 109:case 115:parse$3(t,q,q,n&&append(ruleset(t,q,q,0,0,a,l,M,a,F=[],p),H),a,H,p,l,n?F:H);break;default:parse$3(U,q,q,q,[""],H,0,l,H)}}h=d=m=0,I=C=1,M=U="",p=o;break;case 58:p=1+strlen(U),m=T;default:if(I<1){if(L==123)--I;else if(L==125&&I++==0&&prev()==125)continue}switch(U+=from(L),L*I){case 38:C=d>0?1:(U+="\f",-1);break;case 44:l[h++]=(strlen(U)-1)*C,C=1;break;case 64:peek()===45&&(U+=delimit(next())),g=peek(),d=p=strlen(M=U+=identifier(caret())),L++;break;case 45:T===45&&strlen(U)==2&&(I=0)}}return s}function ruleset(t,e,r,n,a,s,o,l,u,h,d){for(var p=a-1,g=a===0?s:[""],m=sizeof(g),T=0,I=0,A=0;T<n;++T)for(var C=0,L=substr(t,p+1,p=abs(I=o[T])),M=t;C<m;++C)(M=trim(I>0?g[C]+" "+L:replace(L,/&\f/g,g[C])))&&(u[A++]=M);return node(t,e,r,a===0?RULESET:l,u,h,d)}function comment(t,e,r){return node(t,e,r,COMMENT,from(char()),substr(t,2,-2),0)}function declaration(t,e,r,n){return node(t,e,r,DECLARATION,substr(t,0,n),substr(t,n+1,-1),n)}function serialize(t,e){for(var r="",n=sizeof(t),a=0;a<n;a++)r+=e(t[a],a,t,e)||"";return r}function stringify(t,e,r,n){switch(t.type){case IMPORT:case DECLARATION:return t.return=t.return||t.value;case COMMENT:return"";case KEYFRAMES:return t.return=t.value+"{"+serialize(t.children,n)+"}";case RULESET:t.value=t.props.join(",")}return strlen(r=serialize(t.children,n))?t.return=t.value+"{"+r+"}":""}function isObjectLike(t){return t!=null&&typeof t=="object"}var symbolTag$3="[object Symbol]";function isSymbol(t){return typeof t=="symbol"||isObjectLike(t)&&baseGetTag(t)==symbolTag$3}function arrayMap(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var isArray=Array.isArray;const isArray$1=isArray;var INFINITY$3=1/0,symbolProto$2=Symbol$2?Symbol$2.prototype:void 0,symbolToString=symbolProto$2?symbolProto$2.toString:void 0;function baseToString(t){if(typeof t=="string")return t;if(isArray$1(t))return arrayMap(t,baseToString)+"";if(isSymbol(t))return symbolToString?symbolToString.call(t):"";var e=t+"";return e=="0"&&1/t==-INFINITY$3?"-0":e}var reWhitespace=/\s/;function trimmedEndIndex(t){for(var e=t.length;e--&&reWhitespace.test(t.charAt(e)););return e}var reTrimStart=/^\s+/;function baseTrim(t){return t&&t.slice(0,trimmedEndIndex(t)+1).replace(reTrimStart,"")}var NAN=0/0,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber(t){if(typeof t=="number")return t;if(isSymbol(t))return NAN;if(isObject$1(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=isObject$1(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=baseTrim(t);var r=reIsBinary.test(t);return r||reIsOctal.test(t)?freeParseInt(t.slice(2),r?2:8):reIsBadHex.test(t)?NAN:+t}var INFINITY$2=1/0,MAX_INTEGER=17976931348623157e292;function toFinite(t){if(!t)return t===0?t:0;if(t=toNumber(t),t===INFINITY$2||t===-INFINITY$2){var e=t<0?-1:1;return e*MAX_INTEGER}return t===t?t:0}function toInteger(t){var e=toFinite(t),r=e%1;return e===e?r?e-r:e:0}function identity(t){return t}var WeakMap=getNative(root$1,"WeakMap");const WeakMap$1=WeakMap;var objectCreate=Object.create,baseCreate=function(){function t(){}return function(e){if(!isObject$1(e))return{};if(objectCreate)return objectCreate(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const baseCreate$1=baseCreate;function apply$1(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function noop(){}function copyArray(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(t){var e=0,r=0;return function(){var n=nativeNow(),a=HOT_SPAN-(n-r);if(r=n,a>0){if(++e>=HOT_COUNT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function constant(t){return function(){return t}}var defineProperty=function(){try{var t=getNative(Object,"defineProperty");return t({},"",{}),t}catch{}}();const defineProperty$1=defineProperty;var baseSetToString=defineProperty$1?function(t,e){return defineProperty$1(t,"toString",{configurable:!0,enumerable:!1,value:constant(e),writable:!0})}:identity;const baseSetToString$1=baseSetToString;var setToString=shortOut(baseSetToString$1);const setToString$1=setToString;function arrayEach(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function baseFindIndex(t,e,r,n){for(var a=t.length,s=r+(n?1:-1);n?s--:++s<a;)if(e(t[s],s,t))return s;return-1}function baseIsNaN(t){return t!==t}function strictIndexOf(t,e,r){for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1}function baseIndexOf(t,e,r){return e===e?strictIndexOf(t,e,r):baseFindIndex(t,baseIsNaN,r)}function arrayIncludes(t,e){var r=t==null?0:t.length;return!!r&&baseIndexOf(t,e,0)>-1}var MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(t,e){var r=typeof t;return e=e??MAX_SAFE_INTEGER$1,!!e&&(r=="number"||r!="symbol"&&reIsUint.test(t))&&t>-1&&t%1==0&&t<e}function baseAssignValue(t,e,r){e=="__proto__"&&defineProperty$1?defineProperty$1(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var objectProto$d=Object.prototype,hasOwnProperty$b=objectProto$d.hasOwnProperty;function assignValue(t,e,r){var n=t[e];(!(hasOwnProperty$b.call(t,e)&&eq(n,r))||r===void 0&&!(e in t))&&baseAssignValue(t,e,r)}function copyObject(t,e,r,n){var a=!r;r||(r={});for(var s=-1,o=e.length;++s<o;){var l=e[s],u=n?n(r[l],t[l],l,r,t):void 0;u===void 0&&(u=t[l]),a?baseAssignValue(r,l,u):assignValue(r,l,u)}return r}var nativeMax$2=Math.max;function overRest(t,e,r){return e=nativeMax$2(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,s=nativeMax$2(n.length-e,0),o=Array(s);++a<s;)o[a]=n[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=n[a];return l[e]=r(o),apply$1(t,this,l)}}function baseRest(t,e){return setToString$1(overRest(t,e,identity),t+"")}var MAX_SAFE_INTEGER=9007199254740991;function isLength(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=MAX_SAFE_INTEGER}function isArrayLike(t){return t!=null&&isLength(t.length)&&!isFunction(t)}function isIterateeCall(t,e,r){if(!isObject$1(r))return!1;var n=typeof e;return(n=="number"?isArrayLike(r)&&isIndex(e,r.length):n=="string"&&e in r)?eq(r[e],t):!1}function createAssigner(t){return baseRest(function(e,r){var n=-1,a=r.length,s=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(a--,s):void 0,o&&isIterateeCall(r[0],r[1],o)&&(s=a<3?void 0:s,a=1),e=Object(e);++n<a;){var l=r[n];l&&t(e,l,n,s)}return e})}var objectProto$c=Object.prototype;function isPrototype(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||objectProto$c;return t===r}function baseTimes(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var argsTag$3="[object Arguments]";function baseIsArguments(t){return isObjectLike(t)&&baseGetTag(t)==argsTag$3}var objectProto$b=Object.prototype,hasOwnProperty$a=objectProto$b.hasOwnProperty,propertyIsEnumerable$1=objectProto$b.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(t){return isObjectLike(t)&&hasOwnProperty$a.call(t,"callee")&&!propertyIsEnumerable$1.call(t,"callee")};const isArguments$1=isArguments;function stubFalse(){return!1}var freeExports$2=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$2=moduleExports$2?root$1.Buffer:void 0,nativeIsBuffer=Buffer$2?Buffer$2.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse;const isBuffer$1=isBuffer;var argsTag$2="[object Arguments]",arrayTag$2="[object Array]",boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",funcTag$1="[object Function]",mapTag$6="[object Map]",numberTag$3="[object Number]",objectTag$4="[object Object]",regexpTag$3="[object RegExp]",setTag$6="[object Set]",stringTag$3="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0;typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$2]=typedArrayTags[arrayBufferTag$3]=typedArrayTags[boolTag$3]=typedArrayTags[dataViewTag$4]=typedArrayTags[dateTag$3]=typedArrayTags[errorTag$2]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$6]=typedArrayTags[numberTag$3]=typedArrayTags[objectTag$4]=typedArrayTags[regexpTag$3]=typedArrayTags[setTag$6]=typedArrayTags[stringTag$3]=typedArrayTags[weakMapTag$2]=!1;function baseIsTypedArray(t){return isObjectLike(t)&&isLength(t.length)&&!!typedArrayTags[baseGetTag(t)]}function baseUnary(t){return function(e){return t(e)}}var freeExports$1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal$1.process,nodeUtil=function(){try{var t=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return t||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}();const nodeUtil$1=nodeUtil;var nodeIsTypedArray=nodeUtil$1&&nodeUtil$1.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;const isTypedArray$1=isTypedArray;var objectProto$a=Object.prototype,hasOwnProperty$9=objectProto$a.hasOwnProperty;function arrayLikeKeys(t,e){var r=isArray$1(t),n=!r&&isArguments$1(t),a=!r&&!n&&isBuffer$1(t),s=!r&&!n&&!a&&isTypedArray$1(t),o=r||n||a||s,l=o?baseTimes(t.length,String):[],u=l.length;for(var h in t)(e||hasOwnProperty$9.call(t,h))&&!(o&&(h=="length"||a&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||isIndex(h,u)))&&l.push(h);return l}function overArg(t,e){return function(r){return t(e(r))}}var nativeKeys=overArg(Object.keys,Object);const nativeKeys$1=nativeKeys;var objectProto$9=Object.prototype,hasOwnProperty$8=objectProto$9.hasOwnProperty;function baseKeys(t){if(!isPrototype(t))return nativeKeys$1(t);var e=[];for(var r in Object(t))hasOwnProperty$8.call(t,r)&&r!="constructor"&&e.push(r);return e}function keys(t){return isArrayLike(t)?arrayLikeKeys(t):baseKeys(t)}function nativeKeysIn(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var objectProto$8=Object.prototype,hasOwnProperty$7=objectProto$8.hasOwnProperty;function baseKeysIn(t){if(!isObject$1(t))return nativeKeysIn(t);var e=isPrototype(t),r=[];for(var n in t)n=="constructor"&&(e||!hasOwnProperty$7.call(t,n))||r.push(n);return r}function keysIn(t){return isArrayLike(t)?arrayLikeKeys(t,!0):baseKeysIn(t)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(t,e){if(isArray$1(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||isSymbol(t)?!0:reIsPlainProp.test(t)||!reIsDeepProp.test(t)||e!=null&&t in Object(e)}var MAX_MEMOIZE_SIZE=500;function memoizeCapped(t){var e=memoize(t,function(n){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),n}),r=e.cache;return e}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(rePropName,function(r,n,a,s){e.push(a?s.replace(reEscapeChar,"$1"):n||r)}),e});const stringToPath$1=stringToPath;function toString(t){return t==null?"":baseToString(t)}function castPath(t,e){return isArray$1(t)?t:isKey(t,e)?[t]:stringToPath$1(toString(t))}var INFINITY$1=1/0;function toKey(t){if(typeof t=="string"||isSymbol(t))return t;var e=t+"";return e=="0"&&1/t==-INFINITY$1?"-0":e}function baseGet(t,e){e=castPath(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[toKey(e[r++])];return r&&r==n?t:void 0}function get(t,e,r){var n=t==null?void 0:baseGet(t,e);return n===void 0?r:n}function arrayPush(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var spreadableSymbol=Symbol$2?Symbol$2.isConcatSpreadable:void 0;function isFlattenable(t){return isArray$1(t)||isArguments$1(t)||!!(spreadableSymbol&&t&&t[spreadableSymbol])}function baseFlatten(t,e,r,n,a){var s=-1,o=t.length;for(r||(r=isFlattenable),a||(a=[]);++s<o;){var l=t[s];e>0&&r(l)?e>1?baseFlatten(l,e-1,r,n,a):arrayPush(a,l):n||(a[a.length]=l)}return a}function flatten(t){var e=t==null?0:t.length;return e?baseFlatten(t,1):[]}function flatRest(t){return setToString$1(overRest(t,void 0,flatten),t+"")}var getPrototype=overArg(Object.getPrototypeOf,Object);const getPrototype$1=getPrototype;var objectTag$3="[object Object]",funcProto=Function.prototype,objectProto$7=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$6=objectProto$7.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject(t){if(!isObjectLike(t)||baseGetTag(t)!=objectTag$3)return!1;var e=getPrototype$1(t);if(e===null)return!0;var r=hasOwnProperty$6.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&funcToString.call(r)==objectCtorString}function arrayReduce(t,e,r,n){var a=-1,s=t==null?0:t.length;for(n&&s&&(r=t[++a]);++a<s;)r=e(r,t[a],a,t);return r}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function stackGet(t){return this.__data__.get(t)}function stackHas(t){return this.__data__.has(t)}var LARGE_ARRAY_SIZE$1=200;function stackSet(t,e){var r=this.__data__;if(r instanceof ListCache){var n=r.__data__;if(!Map$2||n.length<LARGE_ARRAY_SIZE$1-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new MapCache(n)}return r.set(t,e),this.size=r.size,this}function Stack(t){var e=this.__data__=new ListCache(t);this.size=e.size}Stack.prototype.clear=stackClear;Stack.prototype.delete=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;function baseAssign(t,e){return t&&copyObject(e,keys(e),t)}function baseAssignIn(t,e){return t&&copyObject(e,keysIn(e),t)}var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer$1=moduleExports?root$1.Buffer:void 0,allocUnsafe=Buffer$1?Buffer$1.allocUnsafe:void 0;function cloneBuffer(t,e){if(e)return t.slice();var r=t.length,n=allocUnsafe?allocUnsafe(r):new t.constructor(r);return t.copy(n),n}function arrayFilter(t,e){for(var r=-1,n=t==null?0:t.length,a=0,s=[];++r<n;){var o=t[r];e(o,r,t)&&(s[a++]=o)}return s}function stubArray(){return[]}var objectProto$6=Object.prototype,propertyIsEnumerable=objectProto$6.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(t){return t==null?[]:(t=Object(t),arrayFilter(nativeGetSymbols$1(t),function(e){return propertyIsEnumerable.call(t,e)}))}:stubArray;const getSymbols$1=getSymbols;function copySymbols(t,e){return copyObject(t,getSymbols$1(t),e)}var nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols?function(t){for(var e=[];t;)arrayPush(e,getSymbols$1(t)),t=getPrototype$1(t);return e}:stubArray;const getSymbolsIn$1=getSymbolsIn;function copySymbolsIn(t,e){return copyObject(t,getSymbolsIn$1(t),e)}function baseGetAllKeys(t,e,r){var n=e(t);return isArray$1(t)?n:arrayPush(n,r(t))}function getAllKeys(t){return baseGetAllKeys(t,keys,getSymbols$1)}function getAllKeysIn(t){return baseGetAllKeys(t,keysIn,getSymbolsIn$1)}var DataView$1=getNative(root$1,"DataView");const DataView$2=DataView$1;var Promise$1=getNative(root$1,"Promise");const Promise$2=Promise$1;var Set$1=getNative(root$1,"Set");const Set$2=Set$1;var mapTag$5="[object Map]",objectTag$2="[object Object]",promiseTag="[object Promise]",setTag$5="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$3="[object DataView]",dataViewCtorString=toSource(DataView$2),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$2),setCtorString=toSource(Set$2),weakMapCtorString=toSource(WeakMap$1),getTag=baseGetTag;(DataView$2&&getTag(new DataView$2(new ArrayBuffer(1)))!=dataViewTag$3||Map$2&&getTag(new Map$2)!=mapTag$5||Promise$2&&getTag(Promise$2.resolve())!=promiseTag||Set$2&&getTag(new Set$2)!=setTag$5||WeakMap$1&&getTag(new WeakMap$1)!=weakMapTag$1)&&(getTag=function(t){var e=baseGetTag(t),r=e==objectTag$2?t.constructor:void 0,n=r?toSource(r):"";if(n)switch(n){case dataViewCtorString:return dataViewTag$3;case mapCtorString:return mapTag$5;case promiseCtorString:return promiseTag;case setCtorString:return setTag$5;case weakMapCtorString:return weakMapTag$1}return e});const getTag$1=getTag;var objectProto$5=Object.prototype,hasOwnProperty$5=objectProto$5.hasOwnProperty;function initCloneArray(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&hasOwnProperty$5.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Uint8Array$1=root$1.Uint8Array;const Uint8Array$2=Uint8Array$1;function cloneArrayBuffer(t){var e=new t.constructor(t.byteLength);return new Uint8Array$2(e).set(new Uint8Array$2(t)),e}function cloneDataView(t,e){var r=e?cloneArrayBuffer(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var reFlags=/\w*$/;function cloneRegExp(t){var e=new t.constructor(t.source,reFlags.exec(t));return e.lastIndex=t.lastIndex,e}var symbolProto$1=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf$1=symbolProto$1?symbolProto$1.valueOf:void 0;function cloneSymbol(t){return symbolValueOf$1?Object(symbolValueOf$1.call(t)):{}}function cloneTypedArray(t,e){var r=e?cloneArrayBuffer(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var boolTag$2="[object Boolean]",dateTag$2="[object Date]",mapTag$4="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$4="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$2="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(t,e,r){var n=t.constructor;switch(e){case arrayBufferTag$2:return cloneArrayBuffer(t);case boolTag$2:case dateTag$2:return new n(+t);case dataViewTag$2:return cloneDataView(t,r);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(t,r);case mapTag$4:return new n;case numberTag$2:case stringTag$2:return new n(t);case regexpTag$2:return cloneRegExp(t);case setTag$4:return new n;case symbolTag$2:return cloneSymbol(t)}}function initCloneObject(t){return typeof t.constructor=="function"&&!isPrototype(t)?baseCreate$1(getPrototype$1(t)):{}}var mapTag$3="[object Map]";function baseIsMap(t){return isObjectLike(t)&&getTag$1(t)==mapTag$3}var nodeIsMap=nodeUtil$1&&nodeUtil$1.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap;const isMap$1=isMap;var setTag$3="[object Set]";function baseIsSet(t){return isObjectLike(t)&&getTag$1(t)==setTag$3}var nodeIsSet=nodeUtil$1&&nodeUtil$1.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet;const isSet$1=isSet;var CLONE_DEEP_FLAG$1=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG$2=4,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag$2="[object Map]",numberTag$1="[object Number]",objectTag$1="[object Object]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag$1="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};cloneableTags[argsTag$1]=cloneableTags[arrayTag$1]=cloneableTags[arrayBufferTag$1]=cloneableTags[dataViewTag$1]=cloneableTags[boolTag$1]=cloneableTags[dateTag$1]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag$2]=cloneableTags[numberTag$1]=cloneableTags[objectTag$1]=cloneableTags[regexpTag$1]=cloneableTags[setTag$2]=cloneableTags[stringTag$1]=cloneableTags[symbolTag$1]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0;cloneableTags[errorTag$1]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;function baseClone(t,e,r,n,a,s){var o,l=e&CLONE_DEEP_FLAG$1,u=e&CLONE_FLAT_FLAG,h=e&CLONE_SYMBOLS_FLAG$2;if(r&&(o=a?r(t,n,a,s):r(t)),o!==void 0)return o;if(!isObject$1(t))return t;var d=isArray$1(t);if(d){if(o=initCloneArray(t),!l)return copyArray(t,o)}else{var p=getTag$1(t),g=p==funcTag||p==genTag;if(isBuffer$1(t))return cloneBuffer(t,l);if(p==objectTag$1||p==argsTag$1||g&&!a){if(o=u||g?{}:initCloneObject(t),!l)return u?copySymbolsIn(t,baseAssignIn(o,t)):copySymbols(t,baseAssign(o,t))}else{if(!cloneableTags[p])return a?t:{};o=initCloneByTag(t,p,l)}}s||(s=new Stack);var m=s.get(t);if(m)return m;s.set(t,o),isSet$1(t)?t.forEach(function(A){o.add(baseClone(A,e,r,A,t,s))}):isMap$1(t)&&t.forEach(function(A,C){o.set(C,baseClone(A,e,r,C,t,s))});var T=h?u?getAllKeysIn:getAllKeys:u?keysIn:keys,I=d?void 0:T(t);return arrayEach(I||t,function(A,C){I&&(C=A,A=t[C]),assignValue(o,C,baseClone(A,e,r,C,t,s))}),o}var CLONE_SYMBOLS_FLAG$1=4;function clone$1(t){return baseClone(t,CLONE_SYMBOLS_FLAG$1)}var CLONE_DEEP_FLAG=1,CLONE_SYMBOLS_FLAG=4;function cloneDeep(t){return baseClone(t,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(t){return this.__data__.set(t,HASH_UNDEFINED),this}function setCacheHas(t){return this.__data__.has(t)}function SetCache(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new MapCache;++e<r;)this.add(t[e])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;function arraySome(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function cacheHas(t,e){return t.has(e)}var COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays(t,e,r,n,a,s){var o=r&COMPARE_PARTIAL_FLAG$5,l=t.length,u=e.length;if(l!=u&&!(o&&u>l))return!1;var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var p=-1,g=!0,m=r&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(s.set(t,e),s.set(e,t);++p<l;){var T=t[p],I=e[p];if(n)var A=o?n(I,T,p,e,t,s):n(T,I,p,t,e,s);if(A!==void 0){if(A)continue;g=!1;break}if(m){if(!arraySome(e,function(C,L){if(!cacheHas(m,L)&&(T===C||a(T,C,r,n,s)))return m.push(L)})){g=!1;break}}else if(!(T===I||a(T,I,r,n,s))){g=!1;break}}return s.delete(t),s.delete(e),g}function mapToArray(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function setToArray(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",mapTag$1="[object Map]",numberTag="[object Number]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",symbolProto=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(t,e,r,n,a,s,o){switch(r){case dataViewTag:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case arrayBufferTag:return!(t.byteLength!=e.byteLength||!s(new Uint8Array$2(t),new Uint8Array$2(e)));case boolTag:case dateTag:case numberTag:return eq(+t,+e);case errorTag:return t.name==e.name&&t.message==e.message;case regexpTag:case stringTag:return t==e+"";case mapTag$1:var l=mapToArray;case setTag$1:var u=n&COMPARE_PARTIAL_FLAG$4;if(l||(l=setToArray),t.size!=e.size&&!u)return!1;var h=o.get(t);if(h)return h==e;n|=COMPARE_UNORDERED_FLAG$2,o.set(t,e);var d=equalArrays(l(t),l(e),n,a,s,o);return o.delete(t),d;case symbolTag:if(symbolValueOf)return symbolValueOf.call(t)==symbolValueOf.call(e)}return!1}var COMPARE_PARTIAL_FLAG$3=1,objectProto$4=Object.prototype,hasOwnProperty$4=objectProto$4.hasOwnProperty;function equalObjects(t,e,r,n,a,s){var o=r&COMPARE_PARTIAL_FLAG$3,l=getAllKeys(t),u=l.length,h=getAllKeys(e),d=h.length;if(u!=d&&!o)return!1;for(var p=u;p--;){var g=l[p];if(!(o?g in e:hasOwnProperty$4.call(e,g)))return!1}var m=s.get(t),T=s.get(e);if(m&&T)return m==e&&T==t;var I=!0;s.set(t,e),s.set(e,t);for(var A=o;++p<u;){g=l[p];var C=t[g],L=e[g];if(n)var M=o?n(L,C,g,e,t,s):n(C,L,g,t,e,s);if(!(M===void 0?C===L||a(C,L,r,n,s):M)){I=!1;break}A||(A=g=="constructor")}if(I&&!A){var F=t.constructor,H=e.constructor;F!=H&&"constructor"in t&&"constructor"in e&&!(typeof F=="function"&&F instanceof F&&typeof H=="function"&&H instanceof H)&&(I=!1)}return s.delete(t),s.delete(e),I}var COMPARE_PARTIAL_FLAG$2=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto$3=Object.prototype,hasOwnProperty$3=objectProto$3.hasOwnProperty;function baseIsEqualDeep(t,e,r,n,a,s){var o=isArray$1(t),l=isArray$1(e),u=o?arrayTag:getTag$1(t),h=l?arrayTag:getTag$1(e);u=u==argsTag?objectTag:u,h=h==argsTag?objectTag:h;var d=u==objectTag,p=h==objectTag,g=u==h;if(g&&isBuffer$1(t)){if(!isBuffer$1(e))return!1;o=!0,d=!1}if(g&&!d)return s||(s=new Stack),o||isTypedArray$1(t)?equalArrays(t,e,r,n,a,s):equalByTag(t,e,u,r,n,a,s);if(!(r&COMPARE_PARTIAL_FLAG$2)){var m=d&&hasOwnProperty$3.call(t,"__wrapped__"),T=p&&hasOwnProperty$3.call(e,"__wrapped__");if(m||T){var I=m?t.value():t,A=T?e.value():e;return s||(s=new Stack),a(I,A,r,n,s)}}return g?(s||(s=new Stack),equalObjects(t,e,r,n,a,s)):!1}function baseIsEqual(t,e,r,n,a){return t===e?!0:t==null||e==null||!isObjectLike(t)&&!isObjectLike(e)?t!==t&&e!==e:baseIsEqualDeep(t,e,r,n,baseIsEqual,a)}var COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch(t,e,r,n){var a=r.length,s=a,o=!n;if(t==null)return!s;for(t=Object(t);a--;){var l=r[a];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++a<s;){l=r[a];var u=l[0],h=t[u],d=l[1];if(o&&l[2]){if(h===void 0&&!(u in t))return!1}else{var p=new Stack;if(n)var g=n(h,d,u,t,e,p);if(!(g===void 0?baseIsEqual(d,h,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,n,p):g))return!1}}return!0}function isStrictComparable(t){return t===t&&!isObject$1(t)}function getMatchData(t){for(var e=keys(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,isStrictComparable(a)]}return e}function matchesStrictComparable(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function baseMatches(t){var e=getMatchData(t);return e.length==1&&e[0][2]?matchesStrictComparable(e[0][0],e[0][1]):function(r){return r===t||baseIsMatch(r,t,e)}}function baseHasIn(t,e){return t!=null&&e in Object(t)}function hasPath(t,e,r){e=castPath(e,t);for(var n=-1,a=e.length,s=!1;++n<a;){var o=toKey(e[n]);if(!(s=t!=null&&r(t,o)))break;t=t[o]}return s||++n!=a?s:(a=t==null?0:t.length,!!a&&isLength(a)&&isIndex(o,a)&&(isArray$1(t)||isArguments$1(t)))}function hasIn(t,e){return t!=null&&hasPath(t,e,baseHasIn)}var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty(t,e){return isKey(t)&&isStrictComparable(e)?matchesStrictComparable(toKey(t),e):function(r){var n=get(r,t);return n===void 0&&n===e?hasIn(r,t):baseIsEqual(e,n,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}function baseProperty(t){return function(e){return e==null?void 0:e[t]}}function basePropertyDeep(t){return function(e){return baseGet(e,t)}}function property(t){return isKey(t)?baseProperty(toKey(t)):basePropertyDeep(t)}function baseIteratee(t){return typeof t=="function"?t:t==null?identity:typeof t=="object"?isArray$1(t)?baseMatchesProperty(t[0],t[1]):baseMatches(t):property(t)}function createBaseFor(t){return function(e,r,n){for(var a=-1,s=Object(e),o=n(e),l=o.length;l--;){var u=o[t?l:++a];if(r(s[u],u,s)===!1)break}return e}}var baseFor=createBaseFor();const baseFor$1=baseFor;function baseForOwn(t,e){return t&&baseFor$1(t,e,keys)}function createBaseEach(t,e){return function(r,n){if(r==null)return r;if(!isArrayLike(r))return t(r,n);for(var a=r.length,s=e?a:-1,o=Object(r);(e?s--:++s<a)&&n(o[s],s,o)!==!1;);return r}}var baseEach=createBaseEach(baseForOwn);const baseEach$1=baseEach;var now=function(){return root$1.Date.now()};const now$1=now;var objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty,defaults=baseRest(function(t,e){t=Object(t);var r=-1,n=e.length,a=n>2?e[2]:void 0;for(a&&isIterateeCall(e[0],e[1],a)&&(n=1);++r<n;)for(var s=e[r],o=keysIn(s),l=-1,u=o.length;++l<u;){var h=o[l],d=t[h];(d===void 0||eq(d,objectProto$2[h])&&!hasOwnProperty$2.call(t,h))&&(t[h]=s[h])}return t});const defaults$1=defaults;function assignMergeValue(t,e,r){(r!==void 0&&!eq(t[e],r)||r===void 0&&!(e in t))&&baseAssignValue(t,e,r)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function safeGet(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function toPlainObject(t){return copyObject(t,keysIn(t))}function baseMergeDeep(t,e,r,n,a,s,o){var l=safeGet(t,r),u=safeGet(e,r),h=o.get(u);if(h){assignMergeValue(t,r,h);return}var d=s?s(l,u,r+"",t,e,o):void 0,p=d===void 0;if(p){var g=isArray$1(u),m=!g&&isBuffer$1(u),T=!g&&!m&&isTypedArray$1(u);d=u,g||m||T?isArray$1(l)?d=l:isArrayLikeObject(l)?d=copyArray(l):m?(p=!1,d=cloneBuffer(u,!0)):T?(p=!1,d=cloneTypedArray(u,!0)):d=[]:isPlainObject(u)||isArguments$1(u)?(d=l,isArguments$1(l)?d=toPlainObject(l):(!isObject$1(l)||isFunction(l))&&(d=initCloneObject(u))):p=!1}p&&(o.set(u,d),a(d,u,n,s,o),o.delete(u)),assignMergeValue(t,r,d)}function baseMerge(t,e,r,n,a){t!==e&&baseFor$1(e,function(s,o){if(a||(a=new Stack),isObject$1(s))baseMergeDeep(t,e,o,r,baseMerge,n,a);else{var l=n?n(safeGet(t,o),s,o+"",t,e,a):void 0;l===void 0&&(l=s),assignMergeValue(t,o,l)}},keysIn)}function arrayIncludesWith(t,e,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(r(e,t[n]))return!0;return!1}function last(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function castFunction(t){return typeof t=="function"?t:identity}function forEach(t,e){var r=isArray$1(t)?arrayEach:baseEach$1;return r(t,castFunction(e))}function baseFilter(t,e){var r=[];return baseEach$1(t,function(n,a,s){e(n,a,s)&&r.push(n)}),r}function filter(t,e){var r=isArray$1(t)?arrayFilter:baseFilter;return r(t,baseIteratee(e))}function createFind(t){return function(e,r,n){var a=Object(e);if(!isArrayLike(e)){var s=baseIteratee(r);e=keys(e),r=function(l){return s(a[l],l,a)}}var o=t(e,r,n);return o>-1?a[s?e[o]:o]:void 0}}var nativeMax$1=Math.max;function findIndex(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=r==null?0:toInteger(r);return a<0&&(a=nativeMax$1(n+a,0)),baseFindIndex(t,baseIteratee(e),a)}var find=createFind(findIndex);const find$1=find;function baseMap(t,e){var r=-1,n=isArrayLike(t)?Array(t.length):[];return baseEach$1(t,function(a,s,o){n[++r]=e(a,s,o)}),n}function map$1(t,e){var r=isArray$1(t)?arrayMap:baseMap;return r(t,baseIteratee(e))}function forIn(t,e){return t==null?t:baseFor$1(t,castFunction(e),keysIn)}function baseGt(t,e){return t>e}var objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function baseHas(t,e){return t!=null&&hasOwnProperty$1.call(t,e)}function has(t,e){return t!=null&&hasPath(t,e,baseHas)}function baseValues(t,e){return arrayMap(e,function(r){return t[r]})}function values(t){return t==null?[]:baseValues(t,keys(t))}var mapTag="[object Map]",setTag="[object Set]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function isEmpty(t){if(t==null)return!0;if(isArrayLike(t)&&(isArray$1(t)||typeof t=="string"||typeof t.splice=="function"||isBuffer$1(t)||isTypedArray$1(t)||isArguments$1(t)))return!t.length;var e=getTag$1(t);if(e==mapTag||e==setTag)return!t.size;if(isPrototype(t))return!baseKeys(t).length;for(var r in t)if(hasOwnProperty.call(t,r))return!1;return!0}function isUndefined(t){return t===void 0}function baseLt(t,e){return t<e}function mapValues(t,e){var r={};return e=baseIteratee(e),baseForOwn(t,function(n,a,s){baseAssignValue(r,a,e(n,a,s))}),r}function baseExtremum(t,e,r){for(var n=-1,a=t.length;++n<a;){var s=t[n],o=e(s);if(o!=null&&(l===void 0?o===o&&!isSymbol(o):r(o,l)))var l=o,u=s}return u}function max(t){return t&&t.length?baseExtremum(t,identity,baseGt):void 0}var merge$2=createAssigner(function(t,e,r){baseMerge(t,e,r)});const merge$3=merge$2;function min(t){return t&&t.length?baseExtremum(t,identity,baseLt):void 0}function minBy(t,e){return t&&t.length?baseExtremum(t,baseIteratee(e),baseLt):void 0}function baseSet(t,e,r,n){if(!isObject$1(t))return t;e=castPath(e,t);for(var a=-1,s=e.length,o=s-1,l=t;l!=null&&++a<s;){var u=toKey(e[a]),h=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=o){var d=l[u];h=n?n(d,u,l):void 0,h===void 0&&(h=isObject$1(d)?d:isIndex(e[a+1])?[]:{})}assignValue(l,u,h),l=l[u]}return t}function basePickBy(t,e,r){for(var n=-1,a=e.length,s={};++n<a;){var o=e[n],l=baseGet(t,o);r(l,o)&&baseSet(s,castPath(o,t),l)}return s}function baseSortBy(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}function compareAscending(t,e){if(t!==e){var r=t!==void 0,n=t===null,a=t===t,s=isSymbol(t),o=e!==void 0,l=e===null,u=e===e,h=isSymbol(e);if(!l&&!h&&!s&&t>e||s&&o&&u&&!l&&!h||n&&o&&u||!r&&u||!a)return 1;if(!n&&!s&&!h&&t<e||h&&r&&a&&!n&&!s||l&&r&&a||!o&&a||!u)return-1}return 0}function compareMultiple(t,e,r){for(var n=-1,a=t.criteria,s=e.criteria,o=a.length,l=r.length;++n<o;){var u=compareAscending(a[n],s[n]);if(u){if(n>=l)return u;var h=r[n];return u*(h=="desc"?-1:1)}}return t.index-e.index}function baseOrderBy(t,e,r){e.length?e=arrayMap(e,function(s){return isArray$1(s)?function(o){return baseGet(o,s.length===1?s[0]:s)}:s}):e=[identity];var n=-1;e=arrayMap(e,baseUnary(baseIteratee));var a=baseMap(t,function(s,o,l){var u=arrayMap(e,function(h){return h(s)});return{criteria:u,index:++n,value:s}});return baseSortBy(a,function(s,o){return compareMultiple(s,o,r)})}function basePick(t,e){return basePickBy(t,e,function(r,n){return hasIn(t,n)})}var pick=flatRest(function(t,e){return t==null?{}:basePick(t,e)});const pick$1=pick;var nativeCeil=Math.ceil,nativeMax=Math.max;function baseRange(t,e,r,n){for(var a=-1,s=nativeMax(nativeCeil((e-t)/(r||1)),0),o=Array(s);s--;)o[n?s:++a]=t,t+=r;return o}function createRange(t){return function(e,r,n){return n&&typeof n!="number"&&isIterateeCall(e,r,n)&&(r=n=void 0),e=toFinite(e),r===void 0?(r=e,e=0):r=toFinite(r),n=n===void 0?e<r?1:-1:toFinite(n),baseRange(e,r,n,t)}}var range=createRange();const range$1=range;function baseReduce(t,e,r,n,a){return a(t,function(s,o,l){r=n?(n=!1,s):e(r,s,o,l)}),r}function reduce(t,e,r){var n=isArray$1(t)?arrayReduce:baseReduce,a=arguments.length<3;return n(t,baseIteratee(e),r,a,baseEach$1)}var sortBy=baseRest(function(t,e){if(t==null)return[];var r=e.length;return r>1&&isIterateeCall(t,e[0],e[1])?e=[]:r>2&&isIterateeCall(e[0],e[1],e[2])&&(e=[e[0]]),baseOrderBy(t,baseFlatten(e,1),[])});const sortBy$1=sortBy;var INFINITY=1/0,createSet=Set$2&&1/setToArray(new Set$2([,-0]))[1]==INFINITY?function(t){return new Set$2(t)}:noop;const createSet$1=createSet;var LARGE_ARRAY_SIZE=200;function baseUniq(t,e,r){var n=-1,a=arrayIncludes,s=t.length,o=!0,l=[],u=l;if(r)o=!1,a=arrayIncludesWith;else if(s>=LARGE_ARRAY_SIZE){var h=e?null:createSet$1(t);if(h)return setToArray(h);o=!1,a=cacheHas,u=new SetCache}else u=e?[]:l;t:for(;++n<s;){var d=t[n],p=e?e(d):d;if(d=r||d!==0?d:0,o&&p===p){for(var g=u.length;g--;)if(u[g]===p)continue t;e&&u.push(p),l.push(d)}else a(u,p,r)||(u!==l&&u.push(p),l.push(d))}return l}var union=baseRest(function(t){return baseUniq(baseFlatten(t,1,isArrayLikeObject,!0))});const union$1=union;var idCounter=0;function uniqueId(t){var e=++idCounter;return toString(t)+e}function baseZipObject(t,e,r){for(var n=-1,a=t.length,s=e.length,o={};++n<a;){var l=n<s?e[n]:void 0;r(o,t[n],l)}return o}function zipObject(t,e){return baseZipObject(t||[],e||[],assignValue)}var DEFAULT_EDGE_NAME="\0",GRAPH_NODE="\0",EDGE_KEY_DELIM="";class Graph{constructor(e={}){this._isDirected=has(e,"directed")?e.directed:!0,this._isMultigraph=has(e,"multigraph")?e.multigraph:!1,this._isCompound=has(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=constant(void 0),this._defaultEdgeLabelFn=constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[GRAPH_NODE]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return isFunction(e)||(e=constant(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return keys(this._nodes)}sources(){var e=this;return filter(this.nodes(),function(r){return isEmpty(e._in[r])})}sinks(){var e=this;return filter(this.nodes(),function(r){return isEmpty(e._out[r])})}setNodes(e,r){var n=arguments,a=this;return forEach(e,function(s){n.length>1?a.setNode(s,r):a.setNode(s)}),this}setNode(e,r){return has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=GRAPH_NODE,this._children[e]={},this._children[GRAPH_NODE][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return has(this._nodes,e)}removeNode(e){var r=this;if(has(this._nodes,e)){var n=function(a){r.removeEdge(r._edgeObjs[a])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],forEach(this.children(e),function(a){r.setParent(a)}),delete this._children[e]),forEach(keys(this._in[e]),n),delete this._in[e],delete this._preds[e],forEach(keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(isUndefined(r))r=GRAPH_NODE;else{r+="";for(var n=r;!isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==GRAPH_NODE)return r}}children(e){if(isUndefined(e)&&(e=GRAPH_NODE),this._isCompound){var r=this._children[e];if(r)return keys(r)}else{if(e===GRAPH_NODE)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return keys(r)}successors(e){var r=this._sucs[e];if(r)return keys(r)}neighbors(e){var r=this.predecessors(e);if(r)return union$1(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;forEach(this._nodes,function(o,l){e(l)&&r.setNode(l,o)}),forEach(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var a={};function s(o){var l=n.parent(o);return l===void 0||r.hasNode(l)?(a[o]=l,l):l in a?a[l]:s(l)}return this._isCompound&&forEach(r.nodes(),function(o){r.setParent(o,s(o))}),r}setDefaultEdgeLabel(e){return isFunction(e)||(e=constant(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return values(this._edgeObjs)}setPath(e,r){var n=this,a=arguments;return reduce(e,function(s,o){return a.length>1?n.setEdge(s,o,r):n.setEdge(s,o),o}),this}setEdge(){var e,r,n,a,s=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(e=o.v,r=o.w,n=o.name,arguments.length===2&&(a=arguments[1],s=!0)):(e=o,r=arguments[1],n=arguments[3],arguments.length>2&&(a=arguments[2],s=!0)),e=""+e,r=""+r,isUndefined(n)||(n=""+n);var l=edgeArgsToId(this._isDirected,e,r,n);if(has(this._edgeLabels,l))return s&&(this._edgeLabels[l]=a),this;if(!isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[l]=s?a:this._defaultEdgeLabelFn(e,r,n);var u=edgeArgsToObj(this._isDirected,e,r,n);return e=u.v,r=u.w,Object.freeze(u),this._edgeObjs[l]=u,incrementOrInitEntry(this._preds[r],e),incrementOrInitEntry(this._sucs[e],r),this._in[r][l]=u,this._out[e][l]=u,this._edgeCount++,this}edge(e,r,n){var a=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,e,r,n);return this._edgeLabels[a]}hasEdge(e,r,n){var a=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,e,r,n);return has(this._edgeLabels,a)}removeEdge(e,r,n){var a=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,e,r,n),s=this._edgeObjs[a];return s&&(e=s.v,r=s.w,delete this._edgeLabels[a],delete this._edgeObjs[a],decrementOrRemoveEntry(this._preds[r],e),decrementOrRemoveEntry(this._sucs[e],r),delete this._in[r][a],delete this._out[e][a],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var a=values(n);return r?filter(a,function(s){return s.v===r}):a}}outEdges(e,r){var n=this._out[e];if(n){var a=values(n);return r?filter(a,function(s){return s.w===r}):a}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}Graph.prototype._nodeCount=0;Graph.prototype._edgeCount=0;function incrementOrInitEntry(t,e){t[e]?t[e]++:t[e]=1}function decrementOrRemoveEntry(t,e){--t[e]||delete t[e]}function edgeArgsToId(t,e,r,n){var a=""+e,s=""+r;if(!t&&a>s){var o=a;a=s,s=o}return a+EDGE_KEY_DELIM+s+EDGE_KEY_DELIM+(isUndefined(n)?DEFAULT_EDGE_NAME:n)}function edgeArgsToObj(t,e,r,n){var a=""+e,s=""+r;if(!t&&a>s){var o=a;a=s,s=o}var l={v:a,w:s};return n&&(l.name=n),l}function edgeObjToId(t,e){return edgeArgsToId(t,e.v,e.w,e.name)}class List{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return unlink(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&unlink(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,filterOutLinks)),n=n._prev;return"["+e.join(", ")+"]"}}function unlink(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function filterOutLinks(t,e){if(t!=="_next"&&t!=="_prev")return e}var DEFAULT_WEIGHT_FN=constant(1);function greedyFAS(t,e){if(t.nodeCount()<=1)return[];var r=buildState(t,e||DEFAULT_WEIGHT_FN),n=doGreedyFAS(r.graph,r.buckets,r.zeroIdx);return flatten(map$1(n,function(a){return t.outEdges(a.v,a.w)}))}function doGreedyFAS(t,e,r){for(var n=[],a=e[e.length-1],s=e[0],o;t.nodeCount();){for(;o=s.dequeue();)removeNode(t,e,r,o);for(;o=a.dequeue();)removeNode(t,e,r,o);if(t.nodeCount()){for(var l=e.length-2;l>0;--l)if(o=e[l].dequeue(),o){n=n.concat(removeNode(t,e,r,o,!0));break}}}return n}function removeNode(t,e,r,n,a){var s=a?[]:void 0;return forEach(t.inEdges(n.v),function(o){var l=t.edge(o),u=t.node(o.v);a&&s.push({v:o.v,w:o.w}),u.out-=l,assignBucket(e,r,u)}),forEach(t.outEdges(n.v),function(o){var l=t.edge(o),u=o.w,h=t.node(u);h.in-=l,assignBucket(e,r,h)}),t.removeNode(n.v),s}function buildState(t,e){var r=new Graph,n=0,a=0;forEach(t.nodes(),function(l){r.setNode(l,{v:l,in:0,out:0})}),forEach(t.edges(),function(l){var u=r.edge(l.v,l.w)||0,h=e(l),d=u+h;r.setEdge(l.v,l.w,d),a=Math.max(a,r.node(l.v).out+=h),n=Math.max(n,r.node(l.w).in+=h)});var s=range$1(a+n+3).map(function(){return new List}),o=n+1;return forEach(r.nodes(),function(l){assignBucket(s,o,r.node(l))}),{graph:r,buckets:s,zeroIdx:o}}function assignBucket(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function run$2(t){var e=t.graph().acyclicer==="greedy"?greedyFAS(t,r(t)):dfsFAS(t);forEach(e,function(n){var a=t.edge(n);t.removeEdge(n),a.forwardName=n.name,a.reversed=!0,t.setEdge(n.w,n.v,a,uniqueId("rev"))});function r(n){return function(a){return n.edge(a).weight}}}function dfsFAS(t){var e=[],r={},n={};function a(s){has(n,s)||(n[s]=!0,r[s]=!0,forEach(t.outEdges(s),function(o){has(r,o.w)?e.push(o):a(o.w)}),delete r[s])}return forEach(t.nodes(),a),e}function undo$2(t){forEach(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function addDummyNode(t,e,r,n){var a;do a=uniqueId(n);while(t.hasNode(a));return r.dummy=e,t.setNode(a,r),a}function simplify(t){var e=new Graph().setGraph(t.graph());return forEach(t.nodes(),function(r){e.setNode(r,t.node(r))}),forEach(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},a=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+a.weight,minlen:Math.max(n.minlen,a.minlen)})}),e}function asNonCompoundGraph(t){var e=new Graph({multigraph:t.isMultigraph()}).setGraph(t.graph());return forEach(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),forEach(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function intersectRect$3(t,e){var r=t.x,n=t.y,a=e.x-r,s=e.y-n,o=t.width/2,l=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");var u,h;return Math.abs(s)*o>Math.abs(a)*l?(s<0&&(l=-l),u=l*a/s,h=l):(a<0&&(o=-o),u=o,h=o*s/a),{x:r+u,y:n+h}}function buildLayerMatrix(t){var e=map$1(range$1(maxRank(t)+1),function(){return[]});return forEach(t.nodes(),function(r){var n=t.node(r),a=n.rank;isUndefined(a)||(e[a][n.order]=r)}),e}function normalizeRanks(t){var e=min(map$1(t.nodes(),function(r){return t.node(r).rank}));forEach(t.nodes(),function(r){var n=t.node(r);has(n,"rank")&&(n.rank-=e)})}function removeEmptyRanks(t){var e=min(map$1(t.nodes(),function(s){return t.node(s).rank})),r=[];forEach(t.nodes(),function(s){var o=t.node(s).rank-e;r[o]||(r[o]=[]),r[o].push(s)});var n=0,a=t.graph().nodeRankFactor;forEach(r,function(s,o){isUndefined(s)&&o%a!==0?--n:n&&forEach(s,function(l){t.node(l).rank+=n})})}function addBorderNode$1(t,e,r,n){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=n),addDummyNode(t,"border",a,e)}function maxRank(t){return max(map$1(t.nodes(),function(e){var r=t.node(e).rank;if(!isUndefined(r))return r}))}function partition(t,e){var r={lhs:[],rhs:[]};return forEach(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function time(t,e){var r=now$1();try{return e()}finally{console.log(t+" time: "+(now$1()-r)+"ms")}}function notime(t,e){return e()}function addBorderSegments(t){function e(r){var n=t.children(r),a=t.node(r);if(n.length&&forEach(n,e),has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,o=a.maxRank+1;s<o;++s)addBorderNode(t,"borderLeft","_bl",r,a,s),addBorderNode(t,"borderRight","_br",r,a,s)}}forEach(t.children(),e)}function addBorderNode(t,e,r,n,a,s){var o={width:0,height:0,rank:s,borderType:e},l=a[e][s-1],u=addDummyNode(t,"border",o,r);a[e][s]=u,t.setParent(u,n),l&&t.setEdge(l,u,{weight:1})}function adjust(t){var e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&swapWidthHeight(t)}function undo$1(t){var e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&reverseY(t),(e==="lr"||e==="rl")&&(swapXY(t),swapWidthHeight(t))}function swapWidthHeight(t){forEach(t.nodes(),function(e){swapWidthHeightOne(t.node(e))}),forEach(t.edges(),function(e){swapWidthHeightOne(t.edge(e))})}function swapWidthHeightOne(t){var e=t.width;t.width=t.height,t.height=e}function reverseY(t){forEach(t.nodes(),function(e){reverseYOne(t.node(e))}),forEach(t.edges(),function(e){var r=t.edge(e);forEach(r.points,reverseYOne),has(r,"y")&&reverseYOne(r)})}function reverseYOne(t){t.y=-t.y}function swapXY(t){forEach(t.nodes(),function(e){swapXYOne(t.node(e))}),forEach(t.edges(),function(e){var r=t.edge(e);forEach(r.points,swapXYOne),has(r,"x")&&swapXYOne(r)})}function swapXYOne(t){var e=t.x;t.x=t.y,t.y=e}function run$1(t){var e=addDummyNode(t,"root",{},"_root"),r=treeDepths(t),n=max(values(r))-1,a=2*n+1;t.graph().nestingRoot=e,forEach(t.edges(),function(o){t.edge(o).minlen*=a});var s=sumWeights(t)+1;forEach(t.children(),function(o){dfs$1(t,e,a,s,n,r,o)}),t.graph().nodeRankFactor=a}function dfs$1(t,e,r,n,a,s,o){var l=t.children(o);if(!l.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:r});return}var u=addBorderNode$1(t,"_bt"),h=addBorderNode$1(t,"_bb"),d=t.node(o);t.setParent(u,o),d.borderTop=u,t.setParent(h,o),d.borderBottom=h,forEach(l,function(p){dfs$1(t,e,r,n,a,s,p);var g=t.node(p),m=g.borderTop?g.borderTop:p,T=g.borderBottom?g.borderBottom:p,I=g.borderTop?n:2*n,A=m!==T?1:a-s[o]+1;t.setEdge(u,m,{weight:I,minlen:A,nestingEdge:!0}),t.setEdge(T,h,{weight:I,minlen:A,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,u,{weight:0,minlen:a+s[o]})}function treeDepths(t){var e={};function r(n,a){var s=t.children(n);s&&s.length&&forEach(s,function(o){r(o,a+1)}),e[n]=a}return forEach(t.children(),function(n){r(n,1)}),e}function sumWeights(t){return reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function cleanup(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,forEach(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function addSubgraphConstraints(t,e,r){var n={},a;forEach(r,function(s){for(var o=t.parent(s),l,u;o;){if(l=t.parent(o),l?(u=n[l],n[l]=o):(u=a,a=o),u&&u!==o){e.setEdge(u,o);return}o=l}})}function buildLayerGraph(t,e,r){var n=createRootNode(t),a=new Graph({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(s){return t.node(s)});return forEach(t.nodes(),function(s){var o=t.node(s),l=t.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(a.setNode(s),a.setParent(s,l||n),forEach(t[r](s),function(u){var h=u.v===s?u.w:u.v,d=a.edge(h,s),p=isUndefined(d)?0:d.weight;a.setEdge(h,s,{weight:t.edge(u).weight+p})}),has(o,"minRank")&&a.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),a}function createRootNode(t){for(var e;t.hasNode(e=uniqueId("_root")););return e}function crossCount(t,e){for(var r=0,n=1;n<e.length;++n)r+=twoLayerCrossCount(t,e[n-1],e[n]);return r}function twoLayerCrossCount(t,e,r){for(var n=zipObject(r,map$1(r,function(h,d){return d})),a=flatten(map$1(e,function(h){return sortBy$1(map$1(t.outEdges(h),function(d){return{pos:n[d.w],weight:t.edge(d).weight}}),"pos")})),s=1;s<r.length;)s<<=1;var o=2*s-1;s-=1;var l=map$1(new Array(o),function(){return 0}),u=0;return forEach(a.forEach(function(h){var d=h.pos+s;l[d]+=h.weight;for(var p=0;d>0;)d%2&&(p+=l[d+1]),d=d-1>>1,l[d]+=h.weight;u+=h.weight*p})),u}function initOrder(t){var e={},r=filter(t.nodes(),function(l){return!t.children(l).length}),n=max(map$1(r,function(l){return t.node(l).rank})),a=map$1(range$1(n+1),function(){return[]});function s(l){if(!has(e,l)){e[l]=!0;var u=t.node(l);a[u.rank].push(l),forEach(t.successors(l),s)}}var o=sortBy$1(r,function(l){return t.node(l).rank});return forEach(o,s),a}function barycenter(t,e){return map$1(e,function(r){var n=t.inEdges(r);if(n.length){var a=reduce(n,function(s,o){var l=t.edge(o),u=t.node(o.v);return{sum:s.sum+l.weight*u.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function resolveConflicts(t,e){var r={};forEach(t,function(a,s){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i:s};isUndefined(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),forEach(e.edges(),function(a){var s=r[a.v],o=r[a.w];!isUndefined(s)&&!isUndefined(o)&&(o.indegree++,s.out.push(r[a.w]))});var n=filter(r,function(a){return!a.indegree});return doResolveConflicts(n)}function doResolveConflicts(t){var e=[];function r(s){return function(o){o.merged||(isUndefined(o.barycenter)||isUndefined(s.barycenter)||o.barycenter>=s.barycenter)&&mergeEntries(s,o)}}function n(s){return function(o){o.in.push(s),--o.indegree===0&&t.push(o)}}for(;t.length;){var a=t.pop();e.push(a),forEach(a.in.reverse(),r(a)),forEach(a.out,n(a))}return map$1(filter(e,function(s){return!s.merged}),function(s){return pick$1(s,["vs","i","barycenter","weight"])})}function mergeEntries(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function sort(t,e){var r=partition(t,function(d){return has(d,"barycenter")}),n=r.lhs,a=sortBy$1(r.rhs,function(d){return-d.i}),s=[],o=0,l=0,u=0;n.sort(compareWithBias(!!e)),u=consumeUnsortable(s,a,u),forEach(n,function(d){u+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,u=consumeUnsortable(s,a,u)});var h={vs:flatten(s)};return l&&(h.barycenter=o/l,h.weight=l),h}function consumeUnsortable(t,e,r){for(var n;e.length&&(n=last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function compareWithBias(t){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}}function sortSubgraph(t,e,r,n){var a=t.children(e),s=t.node(e),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,u={};o&&(a=filter(a,function(T){return T!==o&&T!==l}));var h=barycenter(t,a);forEach(h,function(T){if(t.children(T.v).length){var I=sortSubgraph(t,T.v,r,n);u[T.v]=I,has(I,"barycenter")&&mergeBarycenters(T,I)}});var d=resolveConflicts(h,r);expandSubgraphs(d,u);var p=sort(d,n);if(o&&(p.vs=flatten([o,p.vs,l]),t.predecessors(o).length)){var g=t.node(t.predecessors(o)[0]),m=t.node(t.predecessors(l)[0]);has(p,"barycenter")||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+g.order+m.order)/(p.weight+2),p.weight+=2}return p}function expandSubgraphs(t,e){forEach(t,function(r){r.vs=flatten(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function mergeBarycenters(t,e){isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function order(t){var e=maxRank(t),r=buildLayerGraphs(t,range$1(1,e+1),"inEdges"),n=buildLayerGraphs(t,range$1(e-1,-1,-1),"outEdges"),a=initOrder(t);assignOrder(t,a);for(var s=Number.POSITIVE_INFINITY,o,l=0,u=0;u<4;++l,++u){sweepLayerGraphs(l%2?r:n,l%4>=2),a=buildLayerMatrix(t);var h=crossCount(t,a);h<s&&(u=0,o=cloneDeep(a),s=h)}assignOrder(t,o)}function buildLayerGraphs(t,e,r){return map$1(e,function(n){return buildLayerGraph(t,n,r)})}function sweepLayerGraphs(t,e){var r=new Graph;forEach(t,function(n){var a=n.graph().root,s=sortSubgraph(n,a,r,e);forEach(s.vs,function(o,l){n.node(o).order=l}),addSubgraphConstraints(n,r,s.vs)})}function assignOrder(t,e){forEach(e,function(r){forEach(r,function(n,a){t.node(n).order=a})})}function parentDummyChains(t){var e=postorder$1(t);forEach(t.graph().dummyChains,function(r){for(var n=t.node(r),a=n.edgeObj,s=findPath(t,e,a.v,a.w),o=s.path,l=s.lca,u=0,h=o[u],d=!0;r!==a.w;){if(n=t.node(r),d){for(;(h=o[u])!==l&&t.node(h).maxRank<n.rank;)u++;h===l&&(d=!1)}if(!d){for(;u<o.length-1&&t.node(h=o[u+1]).minRank<=n.rank;)u++;h=o[u]}t.setParent(r,h),r=t.successors(r)[0]}})}function findPath(t,e,r,n){var a=[],s=[],o=Math.min(e[r].low,e[n].low),l=Math.max(e[r].lim,e[n].lim),u,h;u=r;do u=t.parent(u),a.push(u);while(u&&(e[u].low>o||l>e[u].lim));for(h=u,u=n;(u=t.parent(u))!==h;)s.push(u);return{path:a.concat(s.reverse()),lca:h}}function postorder$1(t){var e={},r=0;function n(a){var s=r;forEach(t.children(a),n),e[a]={low:s,lim:r++}}return forEach(t.children(),n),e}function findType1Conflicts(t,e){var r={};function n(a,s){var o=0,l=0,u=a.length,h=last(s);return forEach(s,function(d,p){var g=findOtherInnerSegmentNode(t,d),m=g?t.node(g).order:u;(g||d===h)&&(forEach(s.slice(l,p+1),function(T){forEach(t.predecessors(T),function(I){var A=t.node(I),C=A.order;(C<o||m<C)&&!(A.dummy&&t.node(T).dummy)&&addConflict(r,I,T)})}),l=p+1,o=m)}),s}return reduce(e,n),r}function findType2Conflicts(t,e){var r={};function n(s,o,l,u,h){var d;forEach(range$1(o,l),function(p){d=s[p],t.node(d).dummy&&forEach(t.predecessors(d),function(g){var m=t.node(g);m.dummy&&(m.order<u||m.order>h)&&addConflict(r,g,d)})})}function a(s,o){var l=-1,u,h=0;return forEach(o,function(d,p){if(t.node(d).dummy==="border"){var g=t.predecessors(d);g.length&&(u=t.node(g[0]).order,n(o,h,p,l,u),h=p,l=u)}n(o,h,o.length,u,s.length)}),o}return reduce(e,a),r}function findOtherInnerSegmentNode(t,e){if(t.node(e).dummy)return find$1(t.predecessors(e),function(r){return t.node(r).dummy})}function addConflict(t,e,r){if(e>r){var n=e;e=r,r=n}var a=t[e];a||(t[e]=a={}),a[r]=!0}function hasConflict(t,e,r){if(e>r){var n=e;e=r,r=n}return has(t[e],r)}function verticalAlignment(t,e,r,n){var a={},s={},o={};return forEach(e,function(l){forEach(l,function(u,h){a[u]=u,s[u]=u,o[u]=h})}),forEach(e,function(l){var u=-1;forEach(l,function(h){var d=n(h);if(d.length){d=sortBy$1(d,function(I){return o[I]});for(var p=(d.length-1)/2,g=Math.floor(p),m=Math.ceil(p);g<=m;++g){var T=d[g];s[h]===h&&u<o[T]&&!hasConflict(r,h,T)&&(s[T]=h,s[h]=a[h]=a[T],u=o[T])}}})}),{root:a,align:s}}function horizontalCompaction(t,e,r,n,a){var s={},o=buildBlockGraph(t,e,r,a),l=a?"borderLeft":"borderRight";function u(p,g){for(var m=o.nodes(),T=m.pop(),I={};T;)I[T]?p(T):(I[T]=!0,m.push(T),m=m.concat(g(T))),T=m.pop()}function h(p){s[p]=o.inEdges(p).reduce(function(g,m){return Math.max(g,s[m.v]+o.edge(m))},0)}function d(p){var g=o.outEdges(p).reduce(function(T,I){return Math.min(T,s[I.w]-o.edge(I))},Number.POSITIVE_INFINITY),m=t.node(p);g!==Number.POSITIVE_INFINITY&&m.borderType!==l&&(s[p]=Math.max(s[p],g))}return u(h,o.predecessors.bind(o)),u(d,o.successors.bind(o)),forEach(n,function(p){s[p]=s[r[p]]}),s}function buildBlockGraph(t,e,r,n){var a=new Graph,s=t.graph(),o=sep(s.nodesep,s.edgesep,n);return forEach(e,function(l){var u;forEach(l,function(h){var d=r[h];if(a.setNode(d),u){var p=r[u],g=a.edge(p,d);a.setEdge(p,d,Math.max(o(t,h,u),g||0))}u=h})}),a}function findSmallestWidthAlignment(t,e){return minBy(values(e),function(r){var n=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return forIn(r,function(s,o){var l=width$1(t,o)/2;n=Math.max(s+l,n),a=Math.min(s-l,a)}),n-a})}function alignCoordinates(t,e){var r=values(e),n=min(r),a=max(r);forEach(["u","d"],function(s){forEach(["l","r"],function(o){var l=s+o,u=t[l],h;if(u!==e){var d=values(u);h=o==="l"?n-min(d):a-max(d),h&&(t[l]=mapValues(u,function(p){return p+h}))}})})}function balance(t,e){return mapValues(t.ul,function(r,n){if(e)return t[e.toLowerCase()][n];var a=sortBy$1(map$1(t,n));return(a[1]+a[2])/2})}function positionX(t){var e=buildLayerMatrix(t),r=merge$3(findType1Conflicts(t,e),findType2Conflicts(t,e)),n={},a;forEach(["u","d"],function(o){a=o==="u"?e:values(e).reverse(),forEach(["l","r"],function(l){l==="r"&&(a=map$1(a,function(p){return values(p).reverse()}));var u=(o==="u"?t.predecessors:t.successors).bind(t),h=verticalAlignment(t,a,r,u),d=horizontalCompaction(t,a,h.root,h.align,l==="r");l==="r"&&(d=mapValues(d,function(p){return-p})),n[o+l]=d})});var s=findSmallestWidthAlignment(t,n);return alignCoordinates(n,s),balance(n,t.graph().align)}function sep(t,e,r){return function(n,a,s){var o=n.node(a),l=n.node(s),u=0,h;if(u+=o.width/2,has(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":h=-o.width/2;break;case"r":h=o.width/2;break}if(h&&(u+=r?h:-h),h=0,u+=(o.dummy?e:t)/2,u+=(l.dummy?e:t)/2,u+=l.width/2,has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":h=l.width/2;break;case"r":h=-l.width/2;break}return h&&(u+=r?h:-h),h=0,u}}function width$1(t,e){return t.node(e).width}function position(t){t=asNonCompoundGraph(t),positionY(t),forEach(positionX(t),function(e,r){t.node(r).x=e})}function positionY(t){var e=buildLayerMatrix(t),r=t.graph().ranksep,n=0;forEach(e,function(a){var s=max(map$1(a,function(o){return t.node(o).height}));forEach(a,function(o){t.node(o).y=n+s/2}),n+=s+r})}function layout(t,e){var r=e&&e.debugTiming?time:notime;r("layout",function(){var n=r(" buildLayoutGraph",function(){return buildLayoutGraph(t)});r(" runLayout",function(){runLayout(n,r)}),r(" updateInputGraph",function(){updateInputGraph(t,n)})})}function runLayout(t,e){e(" makeSpaceForEdgeLabels",function(){makeSpaceForEdgeLabels(t)}),e(" removeSelfEdges",function(){removeSelfEdges(t)}),e(" acyclic",function(){run$2(t)}),e(" nestingGraph.run",function(){run$1(t)}),e(" rank",function(){rank(asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){injectEdgeLabelProxies(t)}),e(" removeEmptyRanks",function(){removeEmptyRanks(t)}),e(" nestingGraph.cleanup",function(){cleanup(t)}),e(" normalizeRanks",function(){normalizeRanks(t)}),e(" assignRankMinMax",function(){assignRankMinMax(t)}),e(" removeEdgeLabelProxies",function(){removeEdgeLabelProxies(t)}),e(" normalize.run",function(){run(t)}),e(" parentDummyChains",function(){parentDummyChains(t)}),e(" addBorderSegments",function(){addBorderSegments(t)}),e(" order",function(){order(t)}),e(" insertSelfEdges",function(){insertSelfEdges(t)}),e(" adjustCoordinateSystem",function(){adjust(t)}),e(" position",function(){position(t)}),e(" positionSelfEdges",function(){positionSelfEdges(t)}),e(" removeBorderNodes",function(){removeBorderNodes(t)}),e(" normalize.undo",function(){undo(t)}),e(" fixupEdgeLabelCoords",function(){fixupEdgeLabelCoords(t)}),e(" undoCoordinateSystem",function(){undo$1(t)}),e(" translateGraph",function(){translateGraph(t)}),e(" assignNodeIntersects",function(){assignNodeIntersects(t)}),e(" reversePoints",function(){reversePointsForReversedEdges(t)}),e(" acyclic.undo",function(){undo$2(t)})}function updateInputGraph(t,e){forEach(t.nodes(),function(r){var n=t.node(r),a=e.node(r);n&&(n.x=a.x,n.y=a.y,e.children(r).length&&(n.width=a.width,n.height=a.height))}),forEach(t.edges(),function(r){var n=t.edge(r),a=e.edge(r);n.points=a.points,has(a,"x")&&(n.x=a.x,n.y=a.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var graphNumAttrs=["nodesep","edgesep","ranksep","marginx","marginy"],graphDefaults={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},graphAttrs=["acyclicer","ranker","rankdir","align"],nodeNumAttrs=["width","height"],nodeDefaults={width:0,height:0},edgeNumAttrs=["minlen","weight","width","height","labeloffset"],edgeDefaults={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},edgeAttrs=["labelpos"];function buildLayoutGraph(t){var e=new Graph({multigraph:!0,compound:!0}),r=canonicalize(t.graph());return e.setGraph(merge$3({},graphDefaults,selectNumberAttrs(r,graphNumAttrs),pick$1(r,graphAttrs))),forEach(t.nodes(),function(n){var a=canonicalize(t.node(n));e.setNode(n,defaults$1(selectNumberAttrs(a,nodeNumAttrs),nodeDefaults)),e.setParent(n,t.parent(n))}),forEach(t.edges(),function(n){var a=canonicalize(t.edge(n));e.setEdge(n,merge$3({},edgeDefaults,selectNumberAttrs(a,edgeNumAttrs),pick$1(a,edgeAttrs)))}),e}function makeSpaceForEdgeLabels(t){var e=t.graph();e.ranksep/=2,forEach(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function injectEdgeLabelProxies(t){forEach(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),a=t.node(e.w),s={rank:(a.rank-n.rank)/2+n.rank,e};addDummyNode(t,"edge-proxy",s,"_ep")}})}function assignRankMinMax(t){var e=0;forEach(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=max(e,n.maxRank))}),t.graph().maxRank=e}function removeEdgeLabelProxies(t){forEach(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function translateGraph(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,a=0,s=t.graph(),o=s.marginx||0,l=s.marginy||0;function u(h){var d=h.x,p=h.y,g=h.width,m=h.height;e=Math.min(e,d-g/2),r=Math.max(r,d+g/2),n=Math.min(n,p-m/2),a=Math.max(a,p+m/2)}forEach(t.nodes(),function(h){u(t.node(h))}),forEach(t.edges(),function(h){var d=t.edge(h);has(d,"x")&&u(d)}),e-=o,n-=l,forEach(t.nodes(),function(h){var d=t.node(h);d.x-=e,d.y-=n}),forEach(t.edges(),function(h){var d=t.edge(h);forEach(d.points,function(p){p.x-=e,p.y-=n}),has(d,"x")&&(d.x-=e),has(d,"y")&&(d.y-=n)}),s.width=r-e+o,s.height=a-n+l}function assignNodeIntersects(t){forEach(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),a=t.node(e.w),s,o;r.points?(s=r.points[0],o=r.points[r.points.length-1]):(r.points=[],s=a,o=n),r.points.unshift(intersectRect$3(n,s)),r.points.push(intersectRect$3(a,o))})}function fixupEdgeLabelCoords(t){forEach(t.edges(),function(e){var r=t.edge(e);if(has(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function reversePointsForReversedEdges(t){forEach(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function removeBorderNodes(t){forEach(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),a=t.node(r.borderBottom),s=t.node(last(r.borderLeft)),o=t.node(last(r.borderRight));r.width=Math.abs(o.x-s.x),r.height=Math.abs(a.y-n.y),r.x=s.x+r.width/2,r.y=n.y+r.height/2}}),forEach(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function removeSelfEdges(t){forEach(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function insertSelfEdges(t){var e=buildLayerMatrix(t);forEach(e,function(r){var n=0;forEach(r,function(a,s){var o=t.node(a);o.order=s+n,forEach(o.selfEdges,function(l){addDummyNode(t,"selfedge",{width:l.label.width,height:l.label.height,rank:o.rank,order:s+ ++n,e:l.e,label:l.label},"_se")}),delete o.selfEdges})})}function positionSelfEdges(t){forEach(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),a=n.x+n.width/2,s=n.y,o=r.x-a,l=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:a+2*o/3,y:s-l},{x:a+5*o/6,y:s-l},{x:a+o,y:s},{x:a+5*o/6,y:s+l},{x:a+2*o/3,y:s+l}],r.label.x=r.x,r.label.y=r.y}})}function selectNumberAttrs(t,e){return mapValues(pick$1(t,e),Number)}function canonicalize(t){var e={};return forEach(t,function(r,n){e[n.toLowerCase()]=r}),e}function run(t){t.graph().dummyChains=[],forEach(t.edges(),function(e){normalizeEdge(t,e)})}function normalizeEdge(t,e){var r=e.v,n=t.node(r).rank,a=e.w,s=t.node(a).rank,o=e.name,l=t.edge(e),u=l.labelRank;if(s!==n+1){t.removeEdge(e);var h,d,p;for(p=0,++n;n<s;++p,++n)l.points=[],d={width:0,height:0,edgeLabel:l,edgeObj:e,rank:n},h=addDummyNode(t,"edge",d,"_d"),n===u&&(d.width=l.width,d.height=l.height,d.dummy="edge-label",d.labelpos=l.labelpos),t.setEdge(r,h,{weight:l.weight},o),p===0&&t.graph().dummyChains.push(h),r=h;t.setEdge(r,a,{weight:l.weight},o)}}function undo(t){forEach(t.graph().dummyChains,function(e){var r=t.node(e),n=r.edgeLabel,a;for(t.setEdge(r.edgeObj,n);r.dummy;)a=t.successors(e)[0],t.removeNode(e),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),e=a,r=t.node(e)})}function longestPath(t){var e={};function r(n){var a=t.node(n);if(has(e,n))return a.rank;e[n]=!0;var s=min(map$1(t.outEdges(n),function(o){return r(o.w)-t.edge(o).minlen}));return(s===Number.POSITIVE_INFINITY||s===void 0||s===null)&&(s=0),a.rank=s}forEach(t.sources(),r)}function slack(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function feasibleTree(t){var e=new Graph({directed:!1}),r=t.nodes()[0],n=t.nodeCount();e.setNode(r,{});for(var a,s;tightTree(e,t)<n;)a=findMinSlackEdge(e,t),s=e.hasNode(a.v)?slack(t,a):-slack(t,a),shiftRanks(e,t,s);return e}function tightTree(t,e){function r(n){forEach(e.nodeEdges(n),function(a){var s=a.v,o=n===s?a.w:s;!t.hasNode(o)&&!slack(e,a)&&(t.setNode(o,{}),t.setEdge(n,o,{}),r(o))})}return forEach(t.nodes(),r),t.nodeCount()}function findMinSlackEdge(t,e){return minBy(e.edges(),function(r){if(t.hasNode(r.v)!==t.hasNode(r.w))return slack(e,r)})}function shiftRanks(t,e,r){forEach(t.nodes(),function(n){e.node(n).rank+=r})}function CycleException(){}CycleException.prototype=new Error;function dfs(t,e,r){isArray$1(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],s={};return forEach(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);doDfs(t,o,r==="post",s,n,a)}),a}function doDfs(t,e,r,n,a,s){has(n,e)||(n[e]=!0,r||s.push(e),forEach(a(e),function(o){doDfs(t,o,r,n,a,s)}),r&&s.push(e))}function postorder(t,e){return dfs(t,e,"post")}function preorder(t,e){return dfs(t,e,"pre")}networkSimplex.initLowLimValues=initLowLimValues;networkSimplex.initCutValues=initCutValues;networkSimplex.calcCutValue=calcCutValue;networkSimplex.leaveEdge=leaveEdge;networkSimplex.enterEdge=enterEdge;networkSimplex.exchangeEdges=exchangeEdges;function networkSimplex(t){t=simplify(t),longestPath(t);var e=feasibleTree(t);initLowLimValues(e),initCutValues(e,t);for(var r,n;r=leaveEdge(e);)n=enterEdge(e,t,r),exchangeEdges(e,t,r,n)}function initCutValues(t,e){var r=postorder(t,t.nodes());r=r.slice(0,r.length-1),forEach(r,function(n){assignCutValue(t,e,n)})}function assignCutValue(t,e,r){var n=t.node(r),a=n.parent;t.edge(r,a).cutvalue=calcCutValue(t,e,r)}function calcCutValue(t,e,r){var n=t.node(r),a=n.parent,s=!0,o=e.edge(r,a),l=0;return o||(s=!1,o=e.edge(a,r)),l=o.weight,forEach(e.nodeEdges(r),function(u){var h=u.v===r,d=h?u.w:u.v;if(d!==a){var p=h===s,g=e.edge(u).weight;if(l+=p?g:-g,isTreeEdge(t,r,d)){var m=t.edge(r,d).cutvalue;l+=p?-m:m}}}),l}function initLowLimValues(t,e){arguments.length<2&&(e=t.nodes()[0]),dfsAssignLowLim(t,{},1,e)}function dfsAssignLowLim(t,e,r,n,a){var s=r,o=t.node(n);return e[n]=!0,forEach(t.neighbors(n),function(l){has(e,l)||(r=dfsAssignLowLim(t,e,r,l,n))}),o.low=s,o.lim=r++,a?o.parent=a:delete o.parent,r}function leaveEdge(t){return find$1(t.edges(),function(e){return t.edge(e).cutvalue<0})}function enterEdge(t,e,r){var n=r.v,a=r.w;e.hasEdge(n,a)||(n=r.w,a=r.v);var s=t.node(n),o=t.node(a),l=s,u=!1;s.lim>o.lim&&(l=o,u=!0);var h=filter(e.edges(),function(d){return u===isDescendant$1(t,t.node(d.v),l)&&u!==isDescendant$1(t,t.node(d.w),l)});return minBy(h,function(d){return slack(e,d)})}function exchangeEdges(t,e,r,n){var a=r.v,s=r.w;t.removeEdge(a,s),t.setEdge(n.v,n.w,{}),initLowLimValues(t),initCutValues(t,e),updateRanks(t,e)}function updateRanks(t,e){var r=find$1(t.nodes(),function(a){return!e.node(a).parent}),n=preorder(t,r);n=n.slice(1),forEach(n,function(a){var s=t.node(a).parent,o=e.edge(a,s),l=!1;o||(o=e.edge(s,a),l=!0),e.node(a).rank=e.node(s).rank+(l?o.minlen:-o.minlen)})}function isTreeEdge(t,e,r){return t.hasEdge(e,r)}function isDescendant$1(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function rank(t){switch(t.graph().ranker){case"network-simplex":networkSimplexRanker(t);break;case"tight-tree":tightTreeRanker(t);break;case"longest-path":longestPathRanker(t);break;default:networkSimplexRanker(t)}}var longestPathRanker=longestPath;function tightTreeRanker(t){longestPath(t),feasibleTree(t)}function networkSimplexRanker(t){networkSimplex(t)}function write(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:writeNodes(t),edges:writeEdges(t)};return isUndefined(t.graph())||(e.value=clone$1(t.graph())),e}function writeNodes(t){return map$1(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),a={v:e};return isUndefined(r)||(a.value=r),isUndefined(n)||(a.parent=n),a})}function writeEdges(t){return map$1(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return isUndefined(e.name)||(n.name=e.name),isUndefined(r)||(n.value=r),n})}function isSubgraph(t,e){return!!t.children(e).length}function edgeToId(t){return escapeId(t.v)+":"+escapeId(t.w)+":"+escapeId(t.name)}var ID_DELIM=/:/g;function escapeId(t){return t?String(t).replace(ID_DELIM,"\\:"):""}function applyStyle$1(t,e){e&&t.attr("style",e)}function applyClass(t,e,r){e&&t.attr("class",e).attr("class",r+" "+t.attr("class"))}function applyTransition(t,e){var r=e.graph();if(isPlainObject(r)){var n=r.transition;if(isFunction(n))return n(t)}return t}var arrows={normal,vee,undirected};function setArrows(t){arrows=t}function normal(t,e,r,n){var a=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");applyStyle$1(s,r[n+"Style"]),r[n+"Class"]&&s.attr("class",r[n+"Class"])}function vee(t,e,r,n){var a=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");applyStyle$1(s,r[n+"Style"]),r[n+"Class"]&&s.attr("class",r[n+"Class"])}function undirected(t,e,r,n){var a=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");applyStyle$1(s,r[n+"Style"]),r[n+"Class"]&&s.attr("class",r[n+"Class"])}function addHtmlLabel$1(t,e){var r=t.append("foreignObject").attr("width","100000"),n=r.append("xhtml:div");n.attr("xmlns","http://www.w3.org/1999/xhtml");var a=e.label;switch(typeof a){case"function":n.insert(a);break;case"object":n.insert(function(){return a});break;default:n.html(a)}applyStyle$1(n,e.labelStyle),n.style("display","inline-block"),n.style("white-space","nowrap");var s=n.node().getBoundingClientRect();return r.attr("width",s.width).attr("height",s.height),r}function addSVGLabel(t,e){var r=t;return r.node().appendChild(e.label),applyStyle$1(r,e.labelStyle),r}function addTextLabel(t,e){for(var r=t.append("text"),n=processEscapeSequences(e.label).split(`
`),a=0;a<n.length;a++)r.append("tspan").attr("xml:space","preserve").attr("dy","1em").attr("x","1").text(n[a]);return applyStyle$1(r,e.labelStyle),r}function processEscapeSequences(t){for(var e="",r=!1,n,a=0;a<t.length;++a)if(n=t[a],r){switch(n){case"n":e+=`
`;break;default:e+=n}r=!1}else n==="\\"?r=!0:e+=n;return e}function addLabel(t,e,r){var n=e.label,a=t.append("g");e.labelType==="svg"?addSVGLabel(a,e):typeof n!="string"||e.labelType==="html"?addHtmlLabel$1(a,e):addTextLabel(a,e);var s=a.node().getBBox(),o;switch(r){case"top":o=-e.height/2;break;case"bottom":o=e.height/2-s.height;break;default:o=-s.height/2}return a.attr("transform","translate("+-s.width/2+","+o+")"),a}var createClusters=function(t,e){var r=e.nodes().filter(function(s){return isSubgraph(e,s)}),n=t.selectAll("g.cluster").data(r,function(s){return s});applyTransition(n.exit(),e).style("opacity",0).remove();var a=n.enter().append("g").attr("class","cluster").attr("id",function(s){var o=e.node(s);return o.id}).style("opacity",0).each(function(s){var o=e.node(s),l=select(this);select(this).append("rect");var u=l.append("g").attr("class","label");addLabel(u,o,o.clusterLabelPos)});return n=n.merge(a),n=applyTransition(n,e).style("opacity",1),n.selectAll("rect").each(function(s){var o=e.node(s),l=select(this);applyStyle$1(l,o.style)}),n};function setCreateClusters(t){createClusters=t}let createEdgeLabels=function(t,e){var r=t.selectAll("g.edgeLabel").data(e.edges(),function(a){return edgeToId(a)}).classed("update",!0);r.exit().remove(),r.enter().append("g").classed("edgeLabel",!0).style("opacity",0),r=t.selectAll("g.edgeLabel"),r.each(function(a){var s=select(this);s.select(".label").remove();var o=e.edge(a),l=addLabel(s,e.edge(a),0).classed("label",!0),u=l.node().getBBox();o.labelId&&l.attr("id",o.labelId),has(o,"width")||(o.width=u.width),has(o,"height")||(o.height=u.height)});var n;return r.exit?n=r.exit():n=r.selectAll(null),applyTransition(n,e).style("opacity",0).remove(),r};function setCreateEdgeLabels(t){createEdgeLabels=t}function intersectNode$1(t,e){return t.intersect(e)}var createEdgePaths=function(t,e,r){var n=t.selectAll("g.edgePath").data(e.edges(),function(o){return edgeToId(o)}).classed("update",!0),a=enter(n,e);exit(n,e);var s=n.merge!==void 0?n.merge(a):n;return applyTransition(s,e).style("opacity",1),s.each(function(o){var l=select(this),u=e.edge(o);u.elem=this,u.id&&l.attr("id",u.id),applyClass(l,u.class,(l.classed("update")?"update ":"")+"edgePath")}),s.selectAll("path.path").each(function(o){var l=e.edge(o);l.arrowheadId=uniqueId("arrowhead");var u=select(this).attr("marker-end",function(){return"url("+makeFragmentRef(location.href,l.arrowheadId)+")"}).style("fill","none");applyTransition(u,e).attr("d",function(h){return calcPoints(e,h)}),applyStyle$1(u,l.style)}),s.selectAll("defs *").remove(),s.selectAll("defs").each(function(o){var l=e.edge(o),u=r[l.arrowhead];u(select(this),l.arrowheadId,l,"arrowhead")}),s};function setCreateEdgePaths(t){createEdgePaths=t}function makeFragmentRef(t,e){var r=t.split("#")[0];return r+"#"+e}function calcPoints(t,e){var r=t.edge(e),n=t.node(e.v),a=t.node(e.w),s=r.points.slice(1,r.points.length-1);return s.unshift(intersectNode$1(n,s[0])),s.push(intersectNode$1(a,s[s.length-1])),createLine(r,s)}function createLine(t,e){var r=(line$1||svg$2.line)().x(function(n){return n.x}).y(function(n){return n.y});return(r.curve||r.interpolate)(t.curve),r(e)}function getCoords(t){var e=t.getBBox(),r=t.ownerSVGElement.getScreenCTM().inverse().multiply(t.getScreenCTM()).translate(e.width/2,e.height/2);return{x:r.e,y:r.f}}function enter(t,e){var r=t.enter().append("g").attr("class","edgePath").style("opacity",0);return r.append("path").attr("class","path").attr("d",function(n){var a=e.edge(n),s=e.node(n.v).elem,o=range$1(a.points.length).map(function(){return getCoords(s)});return createLine(a,o)}),r.append("defs"),r}function exit(t,e){var r=t.exit();applyTransition(r,e).style("opacity",0).remove()}var createNodes=function(t,e,r){var n=e.nodes().filter(function(o){return!isSubgraph(e,o)}),a=t.selectAll("g.node").data(n,function(o){return o}).classed("update",!0);a.exit().remove(),a.enter().append("g").attr("class","node").style("opacity",0),a=t.selectAll("g.node"),a.each(function(o){var l=e.node(o),u=select(this);applyClass(u,l.class,(u.classed("update")?"update ":"")+"node"),u.select("g.label").remove();var h=u.append("g").attr("class","label"),d=addLabel(h,l),p=r[l.shape],g=pick$1(d.node().getBBox(),"width","height");l.elem=this,l.id&&u.attr("id",l.id),l.labelId&&h.attr("id",l.labelId),has(l,"width")&&(g.width=l.width),has(l,"height")&&(g.height=l.height),g.width+=l.paddingLeft+l.paddingRight,g.height+=l.paddingTop+l.paddingBottom,h.attr("transform","translate("+(l.paddingLeft-l.paddingRight)/2+","+(l.paddingTop-l.paddingBottom)/2+")");var m=select(this);m.select(".label-container").remove();var T=p(m,g,l).classed("label-container",!0);applyStyle$1(T,l.style);var I=T.node().getBBox();l.width=I.width,l.height=I.height});var s;return a.exit?s=a.exit():s=a.selectAll(null),applyTransition(s,e).style("opacity",0).remove(),a};function setCreateNodes(t){createNodes=t}function positionClusters(t,e){var r=t.filter(function(){return!select(this).classed("update")});function n(a){var s=e.node(a);return"translate("+s.x+","+s.y+")"}r.attr("transform",n),applyTransition(t,e).style("opacity",1).attr("transform",n),applyTransition(r.selectAll("rect"),e).attr("width",function(a){return e.node(a).width}).attr("height",function(a){return e.node(a).height}).attr("x",function(a){var s=e.node(a);return-s.width/2}).attr("y",function(a){var s=e.node(a);return-s.height/2})}function positionEdgeLabels(t,e){var r=t.filter(function(){return!select(this).classed("update")});function n(a){var s=e.edge(a);return has(s,"x")?"translate("+s.x+","+s.y+")":""}r.attr("transform",n),applyTransition(t,e).style("opacity",1).attr("transform",n)}function positionNodes(t,e){var r=t.filter(function(){return!select(this).classed("update")});function n(a){var s=e.node(a);return"translate("+s.x+","+s.y+")"}r.attr("transform",n),applyTransition(t,e).style("opacity",1).attr("transform",n)}function intersectEllipse$1(t,e,r,n){var a=t.x,s=t.y,o=a-n.x,l=s-n.y,u=Math.sqrt(e*e*l*l+r*r*o*o),h=Math.abs(e*r*o/u);n.x<a&&(h=-h);var d=Math.abs(e*r*l/u);return n.y<s&&(d=-d),{x:a+h,y:s+d}}function intersectCircle$1(t,e,r){return intersectEllipse$1(t,e,e,r)}function intersectLine$1(t,e,r,n){var a,s,o,l,u,h,d,p,g,m,T,I,A,C,L;if(a=e.y-t.y,o=t.x-e.x,u=e.x*t.y-t.x*e.y,g=a*r.x+o*r.y+u,m=a*n.x+o*n.y+u,!(g!==0&&m!==0&&sameSign$1(g,m))&&(s=n.y-r.y,l=r.x-n.x,h=n.x*r.y-r.x*n.y,d=s*t.x+l*t.y+h,p=s*e.x+l*e.y+h,!(d!==0&&p!==0&&sameSign$1(d,p))&&(T=a*l-s*o,T!==0)))return I=Math.abs(T/2),A=o*h-l*u,C=A<0?(A-I)/T:(A+I)/T,A=s*u-a*h,L=A<0?(A-I)/T:(A+I)/T,{x:C,y:L}}function sameSign$1(t,e){return t*e>0}function intersectPolygon$1(t,e,r){var n=t.x,a=t.y,s=[],o=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;e.forEach(function(T){o=Math.min(o,T.x),l=Math.min(l,T.y)});for(var u=n-t.width/2-o,h=a-t.height/2-l,d=0;d<e.length;d++){var p=e[d],g=e[d<e.length-1?d+1:0],m=intersectLine$1(t,r,{x:u+p.x,y:h+p.y},{x:u+g.x,y:h+g.y});m&&s.push(m)}return s.length?(s.length>1&&s.sort(function(T,I){var A=T.x-r.x,C=T.y-r.y,L=Math.sqrt(A*A+C*C),M=I.x-r.x,F=I.y-r.y,H=Math.sqrt(M*M+F*F);return L<H?-1:L===H?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}function intersectRect$2(t,e){var r=t.x,n=t.y,a=e.x-r,s=e.y-n,o=t.width/2,l=t.height/2,u,h;return Math.abs(s)*o>Math.abs(a)*l?(s<0&&(l=-l),u=s===0?0:l*a/s,h=l):(a<0&&(o=-o),u=o,h=a===0?0:o*s/a),{x:r+u,y:n+h}}var shapes$2={rect:rect$2,ellipse,circle:circle$2,diamond};function setShapes(t){shapes$2=t}function rect$2(t,e,r){var n=t.insert("rect",":first-child").attr("rx",r.rx).attr("ry",r.ry).attr("x",-e.width/2).attr("y",-e.height/2).attr("width",e.width).attr("height",e.height);return r.intersect=function(a){return intersectRect$2(r,a)},n}function ellipse(t,e,r){var n=e.width/2,a=e.height/2,s=t.insert("ellipse",":first-child").attr("x",-e.width/2).attr("y",-e.height/2).attr("rx",n).attr("ry",a);return r.intersect=function(o){return intersectEllipse$1(r,n,a,o)},s}function circle$2(t,e,r){var n=Math.max(e.width,e.height)/2,a=t.insert("circle",":first-child").attr("x",-e.width/2).attr("y",-e.height/2).attr("r",n);return r.intersect=function(s){return intersectCircle$1(r,n,s)},a}function diamond(t,e,r){var n=e.width*Math.SQRT2/2,a=e.height*Math.SQRT2/2,s=[{x:0,y:-a},{x:-n,y:0},{x:0,y:a},{x:n,y:0}],o=t.insert("polygon",":first-child").attr("points",s.map(function(l){return l.x+","+l.y}).join(" "));return r.intersect=function(l){return intersectPolygon$1(r,s,l)},o}function render$3(){var t=function(e,r){preProcessGraph(r);var n=createOrSelectGroup(e,"output"),a=createOrSelectGroup(n,"clusters"),s=createOrSelectGroup(n,"edgePaths"),o=createEdgeLabels(createOrSelectGroup(n,"edgeLabels"),r),l=createNodes(createOrSelectGroup(n,"nodes"),r,shapes$2);layout(r),positionNodes(l,r),positionEdgeLabels(o,r),createEdgePaths(s,r,arrows);var u=createClusters(a,r);positionClusters(u,r),postProcessGraph(r)};return t.createNodes=function(e){return arguments.length?(setCreateNodes(e),t):createNodes},t.createClusters=function(e){return arguments.length?(setCreateClusters(e),t):createClusters},t.createEdgeLabels=function(e){return arguments.length?(setCreateEdgeLabels(e),t):createEdgeLabels},t.createEdgePaths=function(e){return arguments.length?(setCreateEdgePaths(e),t):createEdgePaths},t.shapes=function(e){return arguments.length?(setShapes(e),t):shapes$2},t.arrows=function(e){return arguments.length?(setArrows(e),t):arrows},t}var NODE_DEFAULT_ATTRS={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},EDGE_DEFAULT_ATTRS={arrowhead:"normal",curve:curveLinear};function preProcessGraph(t){t.nodes().forEach(function(e){var r=t.node(e);!has(r,"label")&&!t.children(e).length&&(r.label=e),has(r,"paddingX")&&defaults$1(r,{paddingLeft:r.paddingX,paddingRight:r.paddingX}),has(r,"paddingY")&&defaults$1(r,{paddingTop:r.paddingY,paddingBottom:r.paddingY}),has(r,"padding")&&defaults$1(r,{paddingLeft:r.padding,paddingRight:r.padding,paddingTop:r.padding,paddingBottom:r.padding}),defaults$1(r,NODE_DEFAULT_ATTRS),forEach(["paddingLeft","paddingRight","paddingTop","paddingBottom"],function(n){r[n]=Number(r[n])}),has(r,"width")&&(r._prevWidth=r.width),has(r,"height")&&(r._prevHeight=r.height)}),t.edges().forEach(function(e){var r=t.edge(e);has(r,"label")||(r.label=""),defaults$1(r,EDGE_DEFAULT_ATTRS)})}function postProcessGraph(t){forEach(t.nodes(),function(e){var r=t.node(e);has(r,"_prevWidth")?r.width=r._prevWidth:delete r.width,has(r,"_prevHeight")?r.height=r._prevHeight:delete r.height,delete r._prevWidth,delete r._prevHeight})}function createOrSelectGroup(t,e){var r=t.select("g."+e);return r.empty()&&(r=t.append("g").attr("class",e)),r}var __defProp=Object.defineProperty,__defNormalProp=(t,e,r)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,__publicField=(t,e,r)=>(__defNormalProp(t,typeof e!="symbol"?e+"":e,r),r);const LEVELS={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},log$1={trace:(...t)=>{},debug:(...t)=>{},info:(...t)=>{},warn:(...t)=>{},error:(...t)=>{},fatal:(...t)=>{}},setLogLevel$1=function(t="fatal"){let e=LEVELS.fatal;typeof t=="string"?(t=t.toLowerCase(),t in LEVELS&&(e=LEVELS[t])):typeof t=="number"&&(e=t),log$1.trace=()=>{},log$1.debug=()=>{},log$1.info=()=>{},log$1.warn=()=>{},log$1.error=()=>{},log$1.fatal=()=>{},e<=LEVELS.fatal&&(log$1.fatal=console.error?console.error.bind(console,format("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",format("FATAL"))),e<=LEVELS.error&&(log$1.error=console.error?console.error.bind(console,format("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",format("ERROR"))),e<=LEVELS.warn&&(log$1.warn=console.warn?console.warn.bind(console,format("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",format("WARN"))),e<=LEVELS.info&&(log$1.info=console.info?console.info.bind(console,format("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",format("INFO"))),e<=LEVELS.debug&&(log$1.debug=console.debug?console.debug.bind(console,format("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",format("DEBUG"))),e<=LEVELS.trace&&(log$1.trace=console.debug?console.debug.bind(console,format("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",format("TRACE")))},format=t=>`%c${moment().format("ss.SSS")} : ${t} : `,getRows=t=>t?breakToPlaceholder(t).replace(/\\n/g,"#br#").split("#br#"):[""],removeScript=t=>purify.sanitize(t),sanitizeMore=(t,e)=>{var r;if(((r=e.flowchart)==null?void 0:r.htmlLabels)!==!1){const n=e.securityLevel;n==="antiscript"||n==="strict"?t=removeScript(t):n!=="loose"&&(t=breakToPlaceholder(t),t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=t.replace(/=/g,"&equals;"),t=placeholderToBreak(t))}return t},sanitizeText$5=(t,e)=>t&&(e.dompurifyConfig?t=purify.sanitize(sanitizeMore(t,e),e.dompurifyConfig).toString():t=purify.sanitize(sanitizeMore(t,e),{FORBID_TAGS:["style"]}).toString(),t),sanitizeTextOrArray=(t,e)=>typeof t=="string"?sanitizeText$5(t,e):t.flat().map(r=>sanitizeText$5(r,e)),lineBreakRegex=/<br\s*\/?>/gi,hasBreaks=t=>lineBreakRegex.test(t),splitBreaks=t=>t.split(lineBreakRegex),placeholderToBreak=t=>t.replace(/#br#/g,"<br/>"),breakToPlaceholder=t=>t.replace(lineBreakRegex,"#br#"),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=t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),parseGenericTypes=function(t){let e=t;return t.includes("~")?(e=e.replace(/~([^~].*)/,"<$1"),e=e.replace(/~([^~]*)$/,">$1"),parseGenericTypes(e)):e},common$1={getRows,sanitizeText:sanitizeText$5,sanitizeTextOrArray,hasBreaks,splitBreaks,lineBreakRegex,removeScript,getUrl,evaluate},mkBorder=(t,e)=>e?adjust$2(t,{s:-40,l:10}):adjust$2(t,{s:-40,l:-10}),oldAttributeBackgroundColorOdd="#ffffff",oldAttributeBackgroundColorEven="#f2f2f2";class Theme$4{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||adjust$2(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||adjust$2(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mkBorder(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mkBorder(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mkBorder(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mkBorder(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||invert$1(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||invert$1(this.tertiaryColor),this.lineColor=this.lineColor||invert$1(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?darken(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||darken(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||invert$1(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||lighten(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||adjust$2(this.primaryColor,{h:30}),this.cScale4=this.cScale4||adjust$2(this.primaryColor,{h:60}),this.cScale5=this.cScale5||adjust$2(this.primaryColor,{h:90}),this.cScale6=this.cScale6||adjust$2(this.primaryColor,{h:120}),this.cScale7=this.cScale7||adjust$2(this.primaryColor,{h:150}),this.cScale8=this.cScale8||adjust$2(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||adjust$2(this.primaryColor,{h:270}),this.cScale10=this.cScale10||adjust$2(this.primaryColor,{h:300}),this.cScale11=this.cScale11||adjust$2(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=darken(this["cScale"+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=darken(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||invert$1(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this["cScalePeer"+e]=this["cScalePeer"+e]||lighten(this["cScale"+e],10):this["cScalePeer"+e]=this["cScalePeer"+e]||darken(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||adjust$2(this.primaryColor,{h:64}),this.fillType3=this.fillType3||adjust$2(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||adjust$2(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||adjust$2(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||adjust$2(this.primaryColor,{h:128}),this.fillType7=this.fillType7||adjust$2(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||adjust$2(this.primaryColor,{l:-10}),this.pie5=this.pie5||adjust$2(this.secondaryColor,{l:-10}),this.pie6=this.pie6||adjust$2(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||adjust$2(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||adjust$2(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||adjust$2(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||adjust$2(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||adjust$2(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||adjust$2(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?darken(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||adjust$2(this.primaryColor,{h:-30}),this.git4=this.git4||adjust$2(this.primaryColor,{h:-60}),this.git5=this.git5||adjust$2(this.primaryColor,{h:-90}),this.git6=this.git6||adjust$2(this.primaryColor,{h:60}),this.git7=this.git7||adjust$2(this.primaryColor,{h:120}),this.darkMode?(this.git0=lighten(this.git0,25),this.git1=lighten(this.git1,25),this.git2=lighten(this.git2,25),this.git3=lighten(this.git3,25),this.git4=lighten(this.git4,25),this.git5=lighten(this.git5,25),this.git6=lighten(this.git6,25),this.git7=lighten(this.git7,25)):(this.git0=darken(this.git0,25),this.git1=darken(this.git1,25),this.git2=darken(this.git2,25),this.git3=darken(this.git3,25),this.git4=darken(this.git4,25),this.git5=darken(this.git5,25),this.git6=darken(this.git6,25),this.git7=darken(this.git7,25)),this.gitInv0=this.gitInv0||invert$1(this.git0),this.gitInv1=this.gitInv1||invert$1(this.git1),this.gitInv2=this.gitInv2||invert$1(this.git2),this.gitInv3=this.gitInv3||invert$1(this.git3),this.gitInv4=this.gitInv4||invert$1(this.git4),this.gitInv5=this.gitInv5||invert$1(this.git5),this.gitInv6=this.gitInv6||invert$1(this.git6),this.gitInv7=this.gitInv7||invert$1(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||oldAttributeBackgroundColorOdd,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oldAttributeBackgroundColorEven}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}}const getThemeVariables$4=t=>{const e=new Theme$4;return e.calculate(t),e};class Theme$3{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lighten(this.primaryColor,16),this.tertiaryColor=adjust$2(this.primaryColor,{h:-160}),this.primaryBorderColor=invert$1(this.background),this.secondaryBorderColor=mkBorder(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mkBorder(this.tertiaryColor,this.darkMode),this.primaryTextColor=invert$1(this.primaryColor),this.secondaryTextColor=invert$1(this.secondaryColor),this.tertiaryTextColor=invert$1(this.tertiaryColor),this.lineColor=invert$1(this.background),this.textColor=invert$1(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lighten(invert$1("#323D47"),10),this.lineColor="calculated",this.border1="#81B1DB",this.border2=rgba$1(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=darken("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.taskBorderColor=rgba$1(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=rgba$1(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=lighten(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=lighten(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=lighten(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=adjust$2(this.primaryColor,{h:64}),this.fillType3=adjust$2(this.secondaryColor,{h:64}),this.fillType4=adjust$2(this.primaryColor,{h:-64}),this.fillType5=adjust$2(this.secondaryColor,{h:-64}),this.fillType6=adjust$2(this.primaryColor,{h:128}),this.fillType7=adjust$2(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||adjust$2(this.primaryColor,{h:30}),this.cScale4=this.cScale4||adjust$2(this.primaryColor,{h:60}),this.cScale5=this.cScale5||adjust$2(this.primaryColor,{h:90}),this.cScale6=this.cScale6||adjust$2(this.primaryColor,{h:120}),this.cScale7=this.cScale7||adjust$2(this.primaryColor,{h:150}),this.cScale8=this.cScale8||adjust$2(this.primaryColor,{h:210}),this.cScale9=this.cScale9||adjust$2(this.primaryColor,{h:270}),this.cScale10=this.cScale10||adjust$2(this.primaryColor,{h:300}),this.cScale11=this.cScale11||adjust$2(this.primaryColor,{h:330});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||invert$1(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScalePeer"+e]=this["cScalePeer"+e]||lighten(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["pie"+e]=this["cScale"+e];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?darken(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=lighten(this.secondaryColor,20),this.git1=lighten(this.pie2||this.secondaryColor,20),this.git2=lighten(this.pie3||this.tertiaryColor,20),this.git3=lighten(this.pie4||adjust$2(this.primaryColor,{h:-30}),20),this.git4=lighten(this.pie5||adjust$2(this.primaryColor,{h:-60}),20),this.git5=lighten(this.pie6||adjust$2(this.primaryColor,{h:-90}),10),this.git6=lighten(this.pie7||adjust$2(this.primaryColor,{h:60}),10),this.git7=lighten(this.pie8||adjust$2(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||invert$1(this.git0),this.gitInv1=this.gitInv1||invert$1(this.git1),this.gitInv2=this.gitInv2||invert$1(this.git2),this.gitInv3=this.gitInv3||invert$1(this.git3),this.gitInv4=this.gitInv4||invert$1(this.git4),this.gitInv5=this.gitInv5||invert$1(this.git5),this.gitInv6=this.gitInv6||invert$1(this.git6),this.gitInv7=this.gitInv7||invert$1(this.git7),this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||lighten(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||lighten(this.background,2)}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}}const getThemeVariables$3=t=>{const e=new Theme$3;return e.calculate(t),e};class Theme$2{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=adjust$2(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=adjust$2(this.primaryColor,{h:-160}),this.primaryBorderColor=mkBorder(this.primaryColor,this.darkMode),this.secondaryBorderColor=mkBorder(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mkBorder(this.tertiaryColor,this.darkMode),this.primaryTextColor=invert$1(this.primaryColor),this.secondaryTextColor=invert$1(this.secondaryColor),this.tertiaryTextColor=invert$1(this.tertiaryColor),this.lineColor=invert$1(this.background),this.textColor=invert$1(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=rgba$1(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||adjust$2(this.primaryColor,{h:30}),this.cScale4=this.cScale4||adjust$2(this.primaryColor,{h:60}),this.cScale5=this.cScale5||adjust$2(this.primaryColor,{h:90}),this.cScale6=this.cScale6||adjust$2(this.primaryColor,{h:120}),this.cScale7=this.cScale7||adjust$2(this.primaryColor,{h:150}),this.cScale8=this.cScale8||adjust$2(this.primaryColor,{h:210}),this.cScale9=this.cScale9||adjust$2(this.primaryColor,{h:270}),this.cScale10=this.cScale10||adjust$2(this.primaryColor,{h:300}),this.cScale11=this.cScale11||adjust$2(this.primaryColor,{h:330}),this["cScalePeer"+1]=this["cScalePeer"+1]||darken(this.secondaryColor,45),this["cScalePeer"+2]=this["cScalePeer"+2]||darken(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=darken(this["cScale"+e],10),this["cScalePeer"+e]=this["cScalePeer"+e]||darken(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||adjust$2(this["cScale"+e],{h:180});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||invert$1(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||invert$1(this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=lighten(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,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||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=adjust$2(this.primaryColor,{h:64}),this.fillType3=adjust$2(this.secondaryColor,{h:64}),this.fillType4=adjust$2(this.primaryColor,{h:-64}),this.fillType5=adjust$2(this.secondaryColor,{h:-64}),this.fillType6=adjust$2(this.primaryColor,{h:128}),this.fillType7=adjust$2(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||adjust$2(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||adjust$2(this.primaryColor,{l:-10}),this.pie5=this.pie5||adjust$2(this.secondaryColor,{l:-30}),this.pie6=this.pie6||adjust$2(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||adjust$2(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||adjust$2(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||adjust$2(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||adjust$2(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||adjust$2(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||adjust$2(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||adjust$2(this.primaryColor,{h:-30}),this.git4=this.git4||adjust$2(this.primaryColor,{h:-60}),this.git5=this.git5||adjust$2(this.primaryColor,{h:-90}),this.git6=this.git6||adjust$2(this.primaryColor,{h:60}),this.git7=this.git7||adjust$2(this.primaryColor,{h:120}),this.darkMode?(this.git0=lighten(this.git0,25),this.git1=lighten(this.git1,25),this.git2=lighten(this.git2,25),this.git3=lighten(this.git3,25),this.git4=lighten(this.git4,25),this.git5=lighten(this.git5,25),this.git6=lighten(this.git6,25),this.git7=lighten(this.git7,25)):(this.git0=darken(this.git0,25),this.git1=darken(this.git1,25),this.git2=darken(this.git2,25),this.git3=darken(this.git3,25),this.git4=darken(this.git4,25),this.git5=darken(this.git5,25),this.git6=darken(this.git6,25),this.git7=darken(this.git7,25)),this.gitInv0=this.gitInv0||darken(invert$1(this.git0),25),this.gitInv1=this.gitInv1||invert$1(this.git1),this.gitInv2=this.gitInv2||invert$1(this.git2),this.gitInv3=this.gitInv3||invert$1(this.git3),this.gitInv4=this.gitInv4||invert$1(this.git4),this.gitInv5=this.gitInv5||invert$1(this.git5),this.gitInv6=this.gitInv6||invert$1(this.git6),this.gitInv7=this.gitInv7||invert$1(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||invert$1(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||invert$1(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||oldAttributeBackgroundColorOdd,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oldAttributeBackgroundColorEven}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}}const getThemeVariables$2=t=>{const e=new Theme$2;return e.calculate(t),e};class Theme$1{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=lighten("#cde498",10),this.primaryBorderColor=mkBorder(this.primaryColor,this.darkMode),this.secondaryBorderColor=mkBorder(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mkBorder(this.tertiaryColor,this.darkMode),this.primaryTextColor=invert$1(this.primaryColor),this.secondaryTextColor=invert$1(this.secondaryColor),this.tertiaryTextColor=invert$1(this.primaryColor),this.lineColor=invert$1(this.background),this.textColor=invert$1(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||adjust$2(this.primaryColor,{h:30}),this.cScale4=this.cScale4||adjust$2(this.primaryColor,{h:60}),this.cScale5=this.cScale5||adjust$2(this.primaryColor,{h:90}),this.cScale6=this.cScale6||adjust$2(this.primaryColor,{h:120}),this.cScale7=this.cScale7||adjust$2(this.primaryColor,{h:150}),this.cScale8=this.cScale8||adjust$2(this.primaryColor,{h:210}),this.cScale9=this.cScale9||adjust$2(this.primaryColor,{h:270}),this.cScale10=this.cScale10||adjust$2(this.primaryColor,{h:300}),this.cScale11=this.cScale11||adjust$2(this.primaryColor,{h:330}),this["cScalePeer"+1]=this["cScalePeer"+1]||darken(this.secondaryColor,45),this["cScalePeer"+2]=this["cScalePeer"+2]||darken(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=darken(this["cScale"+e],10),this["cScalePeer"+e]=this["cScalePeer"+e]||darken(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||adjust$2(this["cScale"+e],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.actorBorder=darken(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=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||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=adjust$2(this.primaryColor,{h:64}),this.fillType3=adjust$2(this.secondaryColor,{h:64}),this.fillType4=adjust$2(this.primaryColor,{h:-64}),this.fillType5=adjust$2(this.secondaryColor,{h:-64}),this.fillType6=adjust$2(this.primaryColor,{h:128}),this.fillType7=adjust$2(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||adjust$2(this.primaryColor,{l:-30}),this.pie5=this.pie5||adjust$2(this.secondaryColor,{l:-30}),this.pie6=this.pie6||adjust$2(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||adjust$2(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||adjust$2(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||adjust$2(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||adjust$2(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||adjust$2(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||adjust$2(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||adjust$2(this.primaryColor,{h:-30}),this.git4=this.git4||adjust$2(this.primaryColor,{h:-60}),this.git5=this.git5||adjust$2(this.primaryColor,{h:-90}),this.git6=this.git6||adjust$2(this.primaryColor,{h:60}),this.git7=this.git7||adjust$2(this.primaryColor,{h:120}),this.darkMode?(this.git0=lighten(this.git0,25),this.git1=lighten(this.git1,25),this.git2=lighten(this.git2,25),this.git3=lighten(this.git3,25),this.git4=lighten(this.git4,25),this.git5=lighten(this.git5,25),this.git6=lighten(this.git6,25),this.git7=lighten(this.git7,25)):(this.git0=darken(this.git0,25),this.git1=darken(this.git1,25),this.git2=darken(this.git2,25),this.git3=darken(this.git3,25),this.git4=darken(this.git4,25),this.git5=darken(this.git5,25),this.git6=darken(this.git6,25),this.git7=darken(this.git7,25)),this.gitInv0=this.gitInv0||invert$1(this.git0),this.gitInv1=this.gitInv1||invert$1(this.git1),this.gitInv2=this.gitInv2||invert$1(this.git2),this.gitInv3=this.gitInv3||invert$1(this.git3),this.gitInv4=this.gitInv4||invert$1(this.git4),this.gitInv5=this.gitInv5||invert$1(this.git5),this.gitInv6=this.gitInv6||invert$1(this.git6),this.gitInv7=this.gitInv7||invert$1(this.git7),this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||oldAttributeBackgroundColorOdd,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oldAttributeBackgroundColorEven}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}}const getThemeVariables$1=t=>{const e=new Theme$1;return e.calculate(t),e};class Theme{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=lighten(this.contrast,55),this.background="#ffffff",this.tertiaryColor=adjust$2(this.primaryColor,{h:-160}),this.primaryBorderColor=mkBorder(this.primaryColor,this.darkMode),this.secondaryBorderColor=mkBorder(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mkBorder(this.tertiaryColor,this.darkMode),this.primaryTextColor=invert$1(this.primaryColor),this.secondaryTextColor=invert$1(this.secondaryColor),this.tertiaryTextColor=invert$1(this.tertiaryColor),this.lineColor=invert$1(this.background),this.textColor=invert$1(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=lighten(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 e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||invert$1(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this["cScalePeer"+e]=this["cScalePeer"+e]||lighten(this["cScale"+e],10):this["cScalePeer"+e]=this["cScalePeer"+e]||darken(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.actorBorder=lighten(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.lineColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.sectionBkgColor=lighten(this.contrast,30),this.sectionBkgColor2=lighten(this.contrast,30),this.taskBorderColor=darken(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=lighten(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=darken(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.transitionColor=this.transitionColor||"#000",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||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=adjust$2(this.primaryColor,{h:64}),this.fillType3=adjust$2(this.secondaryColor,{h:64}),this.fillType4=adjust$2(this.primaryColor,{h:-64}),this.fillType5=adjust$2(this.secondaryColor,{h:-64}),this.fillType6=adjust$2(this.primaryColor,{h:128}),this.fillType7=adjust$2(this.secondaryColor,{h:128});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["pie"+e]=this["cScale"+e];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=darken(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||adjust$2(this.primaryColor,{h:-30}),this.git4=this.pie5||adjust$2(this.primaryColor,{h:-60}),this.git5=this.pie6||adjust$2(this.primaryColor,{h:-90}),this.git6=this.pie7||adjust$2(this.primaryColor,{h:60}),this.git7=this.pie8||adjust$2(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||invert$1(this.git0),this.gitInv1=this.gitInv1||invert$1(this.git1),this.gitInv2=this.gitInv2||invert$1(this.git2),this.gitInv3=this.gitInv3||invert$1(this.git3),this.gitInv4=this.gitInv4||invert$1(this.git4),this.gitInv5=this.gitInv5||invert$1(this.git5),this.gitInv6=this.gitInv6||invert$1(this.git6),this.gitInv7=this.gitInv7||invert$1(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||oldAttributeBackgroundColorOdd,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oldAttributeBackgroundColorEven}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}}const getThemeVariables=t=>{const e=new Theme;return e.calculate(t),e},theme={base:{getThemeVariables:getThemeVariables$4},dark:{getThemeVariables:getThemeVariables$3},default:{getThemeVariables:getThemeVariables$2},forest:{getThemeVariables:getThemeVariables$1},neutral:{getThemeVariables}},config$1={theme:"default",themeVariables:theme.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};config$1.class&&(config$1.class.arrowMarkerAbsolute=config$1.arrowMarkerAbsolute);config$1.gitGraph&&(config$1.gitGraph.arrowMarkerAbsolute=config$1.arrowMarkerAbsolute);const keyify=(t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...keyify(t[n],"")]:[...r,e+n],[]),configKeys=keyify(config$1,""),config$2=config$1;function isNothing(t){return typeof t>"u"||t===null}function isObject(t){return typeof t=="object"&&t!==null}function toArray(t){return Array.isArray(t)?t:isNothing(t)?[]:[t]}function extend(t,e){var r,n,a,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)a=s[r],t[a]=e[a];return t}function repeat(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function isNegativeZero(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var isNothing_1=isNothing,isObject_1=isObject,toArray_1=toArray,repeat_1=repeat,isNegativeZero_1=isNegativeZero,extend_1=extend,common={isNothing:isNothing_1,isObject:isObject_1,toArray:toArray_1,repeat:repeat_1,isNegativeZero:isNegativeZero_1,extend:extend_1};function formatError(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
`+t.mark.snippet),n+" "+r):n}function YAMLException$1(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=formatError(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}YAMLException$1.prototype=Object.create(Error.prototype);YAMLException$1.prototype.constructor=YAMLException$1;YAMLException$1.prototype.toString=function t(e){return this.name+": "+formatError(this,e)};var exception=YAMLException$1;function getLine(t,e,r,n,a){var s="",o="",l=Math.floor(a/2)-1;return n-e>l&&(s=" ... ",e=n-l+s.length),r-n>l&&(o=" ...",r=n+l-o.length),{str:s+t.slice(e,r).replace(/\t/g,"→")+o,pos:n-e+s.length}}function padStart(t,e){return common.repeat(" ",e-t.length)+t}function makeSnippet(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],a=[],s,o=-1;s=r.exec(t.buffer);)a.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var l="",u,h,d=Math.min(t.line+e.linesAfter,a.length).toString().length,p=e.maxLength-(e.indent+d+3);for(u=1;u<=e.linesBefore&&!(o-u<0);u++)h=getLine(t.buffer,n[o-u],a[o-u],t.position-(n[o]-n[o-u]),p),l=common.repeat(" ",e.indent)+padStart((t.line-u+1).toString(),d)+" | "+h.str+`
`+l;for(h=getLine(t.buffer,n[o],a[o],t.position,p),l+=common.repeat(" ",e.indent)+padStart((t.line+1).toString(),d)+" | "+h.str+`
`,l+=common.repeat("-",e.indent+d+3+h.pos)+`^
`,u=1;u<=e.linesAfter&&!(o+u>=a.length);u++)h=getLine(t.buffer,n[o+u],a[o+u],t.position-(n[o]-n[o+u]),p),l+=common.repeat(" ",e.indent)+padStart((t.line+u+1).toString(),d)+" | "+h.str+`
`;return l.replace(/\n$/,"")}var snippet=makeSnippet,TYPE_CONSTRUCTOR_OPTIONS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],YAML_NODE_KINDS=["scalar","sequence","mapping"];function compileStyleAliases(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function Type$1(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(TYPE_CONSTRUCTOR_OPTIONS.indexOf(r)===-1)throw new exception('Unknown option "'+r+'" 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(r){return r},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=compileStyleAliases(e.styleAliases||null),YAML_NODE_KINDS.indexOf(this.kind)===-1)throw new exception('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var type=Type$1;function compileList(t,e){var r=[];return t[e].forEach(function(n){var a=r.length;r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(a=o)}),r[a]=n}),r}function compileMap(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(a){a.multi?(t.multi[a.kind].push(a),t.multi.fallback.push(a)):t[a.kind][a.tag]=t.fallback[a.tag]=a}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(n);return t}function Schema$1(t){return this.extend(t)}Schema$1.prototype.extend=function t(e){var r=[],n=[];if(e instanceof type)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof type))throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof type))throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(Schema$1.prototype);return a.implicit=(this.implicit||[]).concat(r),a.explicit=(this.explicit||[]).concat(n),a.compiledImplicit=compileList(a,"implicit"),a.compiledExplicit=compileList(a,"explicit"),a.compiledTypeMap=compileMap(a.compiledImplicit,a.compiledExplicit),a};var schema=Schema$1,str=new type("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),seq$1=new type("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),map=new type("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),failsafe=new schema({explicit:[str,seq$1,map]});function resolveYamlNull(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function constructYamlNull(){return null}function isNull(t){return t===null}var _null=new type("tag:yaml.org,2002:null",{kind:"scalar",resolve:resolveYamlNull,construct:constructYamlNull,predicate:isNull,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function resolveYamlBoolean(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function constructYamlBoolean(t){return t==="true"||t==="True"||t==="TRUE"}function isBoolean(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var bool=new type("tag:yaml.org,2002:bool",{kind:"scalar",resolve:resolveYamlBoolean,construct:constructYamlBoolean,predicate:isBoolean,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function isHexCode(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function isOctCode(t){return 48<=t&&t<=55}function isDecCode(t){return 48<=t&&t<=57}function resolveYamlInteger(t){if(t===null)return!1;var e=t.length,r=0,n=!1,a;if(!e)return!1;if(a=t[r],(a==="-"||a==="+")&&(a=t[++r]),a==="0"){if(r+1===e)return!0;if(a=t[++r],a==="b"){for(r++;r<e;r++)if(a=t[r],a!=="_"){if(a!=="0"&&a!=="1")return!1;n=!0}return n&&a!=="_"}if(a==="x"){for(r++;r<e;r++)if(a=t[r],a!=="_"){if(!isHexCode(t.charCodeAt(r)))return!1;n=!0}return n&&a!=="_"}if(a==="o"){for(r++;r<e;r++)if(a=t[r],a!=="_"){if(!isOctCode(t.charCodeAt(r)))return!1;n=!0}return n&&a!=="_"}}if(a==="_")return!1;for(;r<e;r++)if(a=t[r],a!=="_"){if(!isDecCode(t.charCodeAt(r)))return!1;n=!0}return!(!n||a==="_")}function constructYamlInteger(t){var e=t,r=1,n;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),n=e[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}function isInteger(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!common.isNegativeZero(t)}var int=new type("tag:yaml.org,2002:int",{kind:"scalar",resolve:resolveYamlInteger,construct:constructYamlInteger,predicate:isInteger,represent:{binary:function(t){return 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"]}}),YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(t){return!(t===null||!YAML_FLOAT_PATTERN.test(t)||t[t.length-1]==="_")}function constructYamlFloat(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}var SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/;function representYamlFloat(t,e){var r;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(common.isNegativeZero(t))return"-0.0";return r=t.toString(10),SCIENTIFIC_WITHOUT_DOT.test(r)?r.replace("e",".e"):r}function isFloat(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||common.isNegativeZero(t))}var float=new type("tag:yaml.org,2002:float",{kind:"scalar",resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:"lowercase"}),json=failsafe.extend({implicit:[_null,bool,int,float]}),core=json,YAML_DATE_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),YAML_TIMESTAMP_REGEXP=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]))?))?$");function resolveYamlTimestamp(t){return t===null?!1:YAML_DATE_REGEXP.exec(t)!==null||YAML_TIMESTAMP_REGEXP.exec(t)!==null}function constructYamlTimestamp(t){var e,r,n,a,s,o,l,u=0,h=null,d,p,g;if(e=YAML_DATE_REGEXP.exec(t),e===null&&(e=YAML_TIMESTAMP_REGEXP.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,a=+e[3],!e[4])return new Date(Date.UTC(r,n,a));if(s=+e[4],o=+e[5],l=+e[6],e[7]){for(u=e[7].slice(0,3);u.length<3;)u+="0";u=+u}return e[9]&&(d=+e[10],p=+(e[11]||0),h=(d*60+p)*6e4,e[9]==="-"&&(h=-h)),g=new Date(Date.UTC(r,n,a,s,o,l,u)),h&&g.setTime(g.getTime()-h),g}function representYamlTimestamp(t){return t.toISOString()}var timestamp=new type("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:resolveYamlTimestamp,construct:constructYamlTimestamp,instanceOf:Date,represent:representYamlTimestamp});function resolveYamlMerge(t){return t==="<<"||t===null}var merge$1=new type("tag:yaml.org,2002:merge",{kind:"scalar",resolve:resolveYamlMerge}),BASE64_MAP=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function resolveYamlBinary(t){if(t===null)return!1;var e,r,n=0,a=t.length,s=BASE64_MAP;for(r=0;r<a;r++)if(e=s.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;n+=6}return n%8===0}function constructYamlBinary(t){var e,r,n=t.replace(/[\r\n=]/g,""),a=n.length,s=BASE64_MAP,o=0,l=[];for(e=0;e<a;e++)e%4===0&&e&&(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)),o=o<<6|s.indexOf(n.charAt(e));return r=a%4*6,r===0?(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)):r===18?(l.push(o>>10&255),l.push(o>>2&255)):r===12&&l.push(o>>4&255),new Uint8Array(l)}function representYamlBinary(t){var e="",r=0,n,a,s=t.length,o=BASE64_MAP;for(n=0;n<s;n++)n%3===0&&n&&(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]),r=(r<<8)+t[n];return a=s%3,a===0?(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]):a===2?(e+=o[r>>10&63],e+=o[r>>4&63],e+=o[r<<2&63],e+=o[64]):a===1&&(e+=o[r>>2&63],e+=o[r<<4&63],e+=o[64],e+=o[64]),e}function isBinary(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var binary=new type("tag:yaml.org,2002:binary",{kind:"scalar",resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary}),_hasOwnProperty$3=Object.prototype.hasOwnProperty,_toString$2=Object.prototype.toString;function resolveYamlOmap(t){if(t===null)return!0;var e=[],r,n,a,s,o,l=t;for(r=0,n=l.length;r<n;r+=1){if(a=l[r],o=!1,_toString$2.call(a)!=="[object Object]")return!1;for(s in a)if(_hasOwnProperty$3.call(a,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function constructYamlOmap(t){return t!==null?t:[]}var omap=new type("tag:yaml.org,2002:omap",{kind:"sequence",resolve:resolveYamlOmap,construct:constructYamlOmap}),_toString$1=Object.prototype.toString;function resolveYamlPairs(t){if(t===null)return!0;var e,r,n,a,s,o=t;for(s=new Array(o.length),e=0,r=o.length;e<r;e+=1){if(n=o[e],_toString$1.call(n)!=="[object Object]"||(a=Object.keys(n),a.length!==1))return!1;s[e]=[a[0],n[a[0]]]}return!0}function constructYamlPairs(t){if(t===null)return[];var e,r,n,a,s,o=t;for(s=new Array(o.length),e=0,r=o.length;e<r;e+=1)n=o[e],a=Object.keys(n),s[e]=[a[0],n[a[0]]];return s}var pairs=new type("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:resolveYamlPairs,construct:constructYamlPairs}),_hasOwnProperty$2=Object.prototype.hasOwnProperty;function resolveYamlSet(t){if(t===null)return!0;var e,r=t;for(e in r)if(_hasOwnProperty$2.call(r,e)&&r[e]!==null)return!1;return!0}function constructYamlSet(t){return t!==null?t:{}}var set$1=new type("tag:yaml.org,2002:set",{kind:"mapping",resolve:resolveYamlSet,construct:constructYamlSet}),_default=core.extend({implicit:[timestamp,merge$1],explicit:[binary,omap,pairs,set$1]}),_hasOwnProperty$1=Object.prototype.hasOwnProperty,CONTEXT_FLOW_IN=1,CONTEXT_FLOW_OUT=2,CONTEXT_BLOCK_IN=3,CONTEXT_BLOCK_OUT=4,CHOMPING_CLIP=1,CHOMPING_STRIP=2,CHOMPING_KEEP=3,PATTERN_NON_PRINTABLE=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PATTERN_NON_ASCII_LINE_BREAKS=/[\x85\u2028\u2029]/,PATTERN_FLOW_INDICATORS=/[,\[\]\{\}]/,PATTERN_TAG_HANDLE=/^(?:!|!!|![a-z\-]+!)$/i,PATTERN_TAG_URI=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class(t){return Object.prototype.toString.call(t)}function is_EOL(t){return t===10||t===13}function is_WHITE_SPACE(t){return t===9||t===32}function is_WS_OR_EOL(t){return t===9||t===32||t===10||t===13}function is_FLOW_INDICATOR(t){return t===44||t===91||t===93||t===123||t===125}function fromHexCode(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function escapedHexLen(t){return t===120?2:t===117?4:t===85?8:0}function fromDecimalCode(t){return 48<=t&&t<=57?t-48:-1}function simpleEscapeSequence(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"…":t===95?" ":t===76?"\u2028":t===80?"\u2029":""}function charFromCodepoint(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var simpleEscapeCheck=new Array(256),simpleEscapeMap=new Array(256);for(var i=0;i<256;i++)simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0,simpleEscapeMap[i]=simpleEscapeSequence(i);function State$1(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||_default,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 generateError(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=snippet(r),new exception(e,r)}function throwError(t,e){throw generateError(t,e)}function throwWarning(t,e){t.onWarning&&t.onWarning.call(null,generateError(t,e))}var directiveHandlers={YAML:function t(e,r,n){var a,s,o;e.version!==null&&throwError(e,"duplication of %YAML directive"),n.length!==1&&throwError(e,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),a===null&&throwError(e,"ill-formed argument of the YAML directive"),s=parseInt(a[1],10),o=parseInt(a[2],10),s!==1&&throwError(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&throwWarning(e,"unsupported YAML version of the document")},TAG:function t(e,r,n){var a,s;n.length!==2&&throwError(e,"TAG directive accepts exactly two arguments"),a=n[0],s=n[1],PATTERN_TAG_HANDLE.test(a)||throwError(e,"ill-formed tag handle (first argument) of the TAG directive"),_hasOwnProperty$1.call(e.tagMap,a)&&throwError(e,'there is a previously declared suffix for "'+a+'" tag handle'),PATTERN_TAG_URI.test(s)||throwError(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{throwError(e,"tag prefix is malformed: "+s)}e.tagMap[a]=s}};function captureSegment(t,e,r,n){var a,s,o,l;if(e<r){if(l=t.input.slice(e,r),n)for(a=0,s=l.length;a<s;a+=1)o=l.charCodeAt(a),o===9||32<=o&&o<=1114111||throwError(t,"expected valid JSON character");else PATTERN_NON_PRINTABLE.test(l)&&throwError(t,"the stream contains non-printable characters");t.result+=l}}function mergeMappings(t,e,r,n){var a,s,o,l;for(common.isObject(r)||throwError(t,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(r),o=0,l=a.length;o<l;o+=1)s=a[o],_hasOwnProperty$1.call(e,s)||(e[s]=r[s],n[s]=!0)}function storeMappingPair(t,e,r,n,a,s,o,l,u){var h,d;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),h=0,d=a.length;h<d;h+=1)Array.isArray(a[h])&&throwError(t,"nested arrays are not supported inside keys"),typeof a=="object"&&_class(a[h])==="[object Object]"&&(a[h]="[object Object]");if(typeof a=="object"&&_class(a)==="[object Object]"&&(a="[object Object]"),a=String(a),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(h=0,d=s.length;h<d;h+=1)mergeMappings(t,e,s[h],r);else mergeMappings(t,e,s,r);else!t.json&&!_hasOwnProperty$1.call(r,a)&&_hasOwnProperty$1.call(e,a)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=u||t.position,throwError(t,"duplicated mapping key")),a==="__proto__"?Object.defineProperty(e,a,{configurable:!0,enumerable:!0,writable:!0,value:s}):e[a]=s,delete r[a];return e}function readLineBreak(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):throwError(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function skipSeparationSpace(t,e,r){for(var n=0,a=t.input.charCodeAt(t.position);a!==0;){for(;is_WHITE_SPACE(a);)a===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),a=t.input.charCodeAt(++t.position);if(e&&a===35)do a=t.input.charCodeAt(++t.position);while(a!==10&&a!==13&&a!==0);if(is_EOL(a))for(readLineBreak(t),a=t.input.charCodeAt(t.position),n++,t.lineIndent=0;a===32;)t.lineIndent++,a=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&throwWarning(t,"deficient indentation"),n}function testDocumentSeparator(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||is_WS_OR_EOL(r)))}function writeFoldedLines(t,e){e===1?t.result+=" ":e>1&&(t.result+=common.repeat(`
`,e-1))}function readPlainScalar(t,e,r){var n,a,s,o,l,u,h,d,p=t.kind,g=t.result,m;if(m=t.input.charCodeAt(t.position),is_WS_OR_EOL(m)||is_FLOW_INDICATOR(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(a=t.input.charCodeAt(t.position+1),is_WS_OR_EOL(a)||r&&is_FLOW_INDICATOR(a)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,l=!1;m!==0;){if(m===58){if(a=t.input.charCodeAt(t.position+1),is_WS_OR_EOL(a)||r&&is_FLOW_INDICATOR(a))break}else if(m===35){if(n=t.input.charCodeAt(t.position-1),is_WS_OR_EOL(n))break}else{if(t.position===t.lineStart&&testDocumentSeparator(t)||r&&is_FLOW_INDICATOR(m))break;if(is_EOL(m))if(u=t.line,h=t.lineStart,d=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){l=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=u,t.lineStart=h,t.lineIndent=d;break}}l&&(captureSegment(t,s,o,!1),writeFoldedLines(t,t.line-u),s=o=t.position,l=!1),is_WHITE_SPACE(m)||(o=t.position+1),m=t.input.charCodeAt(++t.position)}return captureSegment(t,s,o,!1),t.result?!0:(t.kind=p,t.result=g,!1)}function readSingleQuotedScalar(t,e){var r,n,a;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=a=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(captureSegment(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,a=t.position;else return!0;else is_EOL(r)?(captureSegment(t,n,a,!0),writeFoldedLines(t,skipSeparationSpace(t,!1,e)),n=a=t.position):t.position===t.lineStart&&testDocumentSeparator(t)?throwError(t,"unexpected end of the document within a single quoted scalar"):(t.position++,a=t.position);throwError(t,"unexpected end of the stream within a single quoted scalar")}function readDoubleQuotedScalar(t,e){var r,n,a,s,o,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return captureSegment(t,r,t.position,!0),t.position++,!0;if(l===92){if(captureSegment(t,r,t.position,!0),l=t.input.charCodeAt(++t.position),is_EOL(l))skipSeparationSpace(t,!1,e);else if(l<256&&simpleEscapeCheck[l])t.result+=simpleEscapeMap[l],t.position++;else if((o=escapedHexLen(l))>0){for(a=o,s=0;a>0;a--)l=t.input.charCodeAt(++t.position),(o=fromHexCode(l))>=0?s=(s<<4)+o:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(s),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(l)?(captureSegment(t,r,n,!0),writeFoldedLines(t,skipSeparationSpace(t,!1,e)),r=n=t.position):t.position===t.lineStart&&testDocumentSeparator(t)?throwError(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}throwError(t,"unexpected end of the stream within a double quoted scalar")}function readFlowCollection(t,e){var r=!0,n,a,s,o=t.tag,l,u=t.anchor,h,d,p,g,m,T=Object.create(null),I,A,C,L;if(L=t.input.charCodeAt(t.position),L===91)d=93,m=!1,l=[];else if(L===123)d=125,m=!0,l={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=l),L=t.input.charCodeAt(++t.position);L!==0;){if(skipSeparationSpace(t,!0,e),L=t.input.charCodeAt(t.position),L===d)return t.position++,t.tag=o,t.anchor=u,t.kind=m?"mapping":"sequence",t.result=l,!0;r?L===44&&throwError(t,"expected the node content, but found ','"):throwError(t,"missed comma between flow collection entries"),A=I=C=null,p=g=!1,L===63&&(h=t.input.charCodeAt(t.position+1),is_WS_OR_EOL(h)&&(p=g=!0,t.position++,skipSeparationSpace(t,!0,e))),n=t.line,a=t.lineStart,s=t.position,composeNode(t,e,CONTEXT_FLOW_IN,!1,!0),A=t.tag,I=t.result,skipSeparationSpace(t,!0,e),L=t.input.charCodeAt(t.position),(g||t.line===n)&&L===58&&(p=!0,L=t.input.charCodeAt(++t.position),skipSeparationSpace(t,!0,e),composeNode(t,e,CONTEXT_FLOW_IN,!1,!0),C=t.result),m?storeMappingPair(t,l,T,A,I,C,n,a,s):p?l.push(storeMappingPair(t,null,T,A,I,C,n,a,s)):l.push(I),skipSeparationSpace(t,!0,e),L=t.input.charCodeAt(t.position),L===44?(r=!0,L=t.input.charCodeAt(++t.position)):r=!1}throwError(t,"unexpected end of the stream within a flow collection")}function readBlockScalar(t,e){var r,n,a=CHOMPING_CLIP,s=!1,o=!1,l=e,u=0,h=!1,d,p;if(p=t.input.charCodeAt(t.position),p===124)n=!1;else if(p===62)n=!0;else return!1;for(t.kind="scalar",t.result="";p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)CHOMPING_CLIP===a?a=p===43?CHOMPING_KEEP:CHOMPING_STRIP:throwError(t,"repeat of a chomping mode identifier");else if((d=fromDecimalCode(p))>=0)d===0?throwError(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?throwError(t,"repeat of an indentation width identifier"):(l=e+d-1,o=!0);else break;if(is_WHITE_SPACE(p)){do p=t.input.charCodeAt(++t.position);while(is_WHITE_SPACE(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!is_EOL(p)&&p!==0)}for(;p!==0;){for(readLineBreak(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!o||t.lineIndent<l)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>l&&(l=t.lineIndent),is_EOL(p)){u++;continue}if(t.lineIndent<l){a===CHOMPING_KEEP?t.result+=common.repeat(`
`,s?1+u:u):a===CHOMPING_CLIP&&s&&(t.result+=`
`);break}for(n?is_WHITE_SPACE(p)?(h=!0,t.result+=common.repeat(`
`,s?1+u:u)):h?(h=!1,t.result+=common.repeat(`
`,u+1)):u===0?s&&(t.result+=" "):t.result+=common.repeat(`
`,u):t.result+=common.repeat(`
`,s?1+u:u),s=!0,o=!0,u=0,r=t.position;!is_EOL(p)&&p!==0;)p=t.input.charCodeAt(++t.position);captureSegment(t,r,t.position,!1)}return!0}function readBlockSequence(t,e){var r,n=t.tag,a=t.anchor,s=[],o,l=!1,u;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),u=t.input.charCodeAt(t.position);u!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,throwError(t,"tab characters must not be used in indentation")),!(u!==45||(o=t.input.charCodeAt(t.position+1),!is_WS_OR_EOL(o))));){if(l=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e){s.push(null),u=t.input.charCodeAt(t.position);continue}if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),s.push(t.result),skipSeparationSpace(t,!0,-1),u=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&u!==0)throwError(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return l?(t.tag=n,t.anchor=a,t.kind="sequence",t.result=s,!0):!1}function readBlockMapping(t,e,r){var n,a,s,o,l,u,h=t.tag,d=t.anchor,p={},g=Object.create(null),m=null,T=null,I=null,A=!1,C=!1,L;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=p),L=t.input.charCodeAt(t.position);L!==0;){if(!A&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,throwError(t,"tab characters must not be used in indentation")),n=t.input.charCodeAt(t.position+1),s=t.line,(L===63||L===58)&&is_WS_OR_EOL(n))L===63?(A&&(storeMappingPair(t,p,g,m,T,null,o,l,u),m=T=I=null),C=!0,A=!0,a=!0):A?(A=!1,a=!0):throwError(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,L=n;else{if(o=t.line,l=t.lineStart,u=t.position,!composeNode(t,r,CONTEXT_FLOW_OUT,!1,!0))break;if(t.line===s){for(L=t.input.charCodeAt(t.position);is_WHITE_SPACE(L);)L=t.input.charCodeAt(++t.position);if(L===58)L=t.input.charCodeAt(++t.position),is_WS_OR_EOL(L)||throwError(t,"a whitespace character is expected after the key-value separator within a block mapping"),A&&(storeMappingPair(t,p,g,m,T,null,o,l,u),m=T=I=null),C=!0,A=!1,a=!1,m=t.tag,T=t.result;else if(C)throwError(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=h,t.anchor=d,!0}else if(C)throwError(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=h,t.anchor=d,!0}if((t.line===s||t.lineIndent>e)&&(A&&(o=t.line,l=t.lineStart,u=t.position),composeNode(t,e,CONTEXT_BLOCK_OUT,!0,a)&&(A?T=t.result:I=t.result),A||(storeMappingPair(t,p,g,m,T,I,o,l,u),m=T=I=null),skipSeparationSpace(t,!0,-1),L=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&L!==0)throwError(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return A&&storeMappingPair(t,p,g,m,T,null,o,l,u),C&&(t.tag=h,t.anchor=d,t.kind="mapping",t.result=p),C}function readTagProperty(t){var e,r=!1,n=!1,a,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&throwError(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(r=!0,o=t.input.charCodeAt(++t.position)):o===33?(n=!0,a="!!",o=t.input.charCodeAt(++t.position)):a="!",e=t.position,r){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):throwError(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!is_WS_OR_EOL(o);)o===33&&(n?throwError(t,"tag suffix cannot contain exclamation marks"):(a=t.input.slice(e-1,t.position+1),PATTERN_TAG_HANDLE.test(a)||throwError(t,"named tag handle cannot contain such characters"),n=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),PATTERN_FLOW_INDICATORS.test(s)&&throwError(t,"tag suffix cannot contain flow indicator characters")}s&&!PATTERN_TAG_URI.test(s)&&throwError(t,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{throwError(t,"tag name is malformed: "+s)}return r?t.tag=s:_hasOwnProperty$1.call(t.tagMap,a)?t.tag=t.tagMap[a]+s:a==="!"?t.tag="!"+s:a==="!!"?t.tag="tag:yaml.org,2002:"+s:throwError(t,'undeclared tag handle "'+a+'"'),!0}function readAnchorProperty(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&throwError(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!is_WS_OR_EOL(r)&&!is_FLOW_INDICATOR(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&throwError(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function readAlias(t){var e,r,n;if(n=t.input.charCodeAt(t.position),n!==42)return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&throwError(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),_hasOwnProperty$1.call(t.anchorMap,r)||throwError(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],skipSeparationSpace(t,!0,-1),!0}function composeNode(t,e,r,n,a){var s,o,l,u=1,h=!1,d=!1,p,g,m,T,I,A;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=o=l=CONTEXT_BLOCK_OUT===r||CONTEXT_BLOCK_IN===r,n&&skipSeparationSpace(t,!0,-1)&&(h=!0,t.lineIndent>e?u=1:t.lineIndent===e?u=0:t.lineIndent<e&&(u=-1)),u===1)for(;readTagProperty(t)||readAnchorProperty(t);)skipSeparationSpace(t,!0,-1)?(h=!0,l=s,t.lineIndent>e?u=1:t.lineIndent===e?u=0:t.lineIndent<e&&(u=-1)):l=!1;if(l&&(l=h||a),(u===1||CONTEXT_BLOCK_OUT===r)&&(CONTEXT_FLOW_IN===r||CONTEXT_FLOW_OUT===r?I=e:I=e+1,A=t.position-t.lineStart,u===1?l&&(readBlockSequence(t,A)||readBlockMapping(t,A,I))||readFlowCollection(t,I)?d=!0:(o&&readBlockScalar(t,I)||readSingleQuotedScalar(t,I)||readDoubleQuotedScalar(t,I)?d=!0:readAlias(t)?(d=!0,(t.tag!==null||t.anchor!==null)&&throwError(t,"alias node should not have any properties")):readPlainScalar(t,I,CONTEXT_FLOW_IN===r)&&(d=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):u===0&&(d=l&&readBlockSequence(t,A))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&throwError(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),p=0,g=t.implicitTypes.length;p<g;p+=1)if(T=t.implicitTypes[p],T.resolve(t.result)){t.result=T.construct(t.result),t.tag=T.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(_hasOwnProperty$1.call(t.typeMap[t.kind||"fallback"],t.tag))T=t.typeMap[t.kind||"fallback"][t.tag];else for(T=null,m=t.typeMap.multi[t.kind||"fallback"],p=0,g=m.length;p<g;p+=1)if(t.tag.slice(0,m[p].tag.length)===m[p].tag){T=m[p];break}T||throwError(t,"unknown tag !<"+t.tag+">"),t.result!==null&&T.kind!==t.kind&&throwError(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+T.kind+'", not "'+t.kind+'"'),T.resolve(t.result,t.tag)?(t.result=T.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):throwError(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||d}function readDocument(t){var e=t.position,r,n,a,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(skipSeparationSpace(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),r=t.position;o!==0&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),a=[],n.length<1&&throwError(t,"directive name must not be less than one character in length");o!==0;){for(;is_WHITE_SPACE(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!is_EOL(o));break}if(is_EOL(o))break;for(r=t.position;o!==0&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);a.push(t.input.slice(r,t.position))}o!==0&&readLineBreak(t),_hasOwnProperty$1.call(directiveHandlers,n)?directiveHandlers[n](t,n,a):throwWarning(t,'unknown document directive "'+n+'"')}if(skipSeparationSpace(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,skipSeparationSpace(t,!0,-1)):s&&throwError(t,"directives end mark is expected"),composeNode(t,t.lineIndent-1,CONTEXT_BLOCK_OUT,!1,!0),skipSeparationSpace(t,!0,-1),t.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(t.input.slice(e,t.position))&&throwWarning(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&testDocumentSeparator(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,skipSeparationSpace(t,!0,-1));return}if(t.position<t.length-1)throwError(t,"end of the stream or a document separator is expected");else return}function loadDocuments(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new State$1(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,throwError(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)readDocument(r);return r.documents}function loadAll$1(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var n=loadDocuments(t,r);if(typeof e!="function")return n;for(var a=0,s=n.length;a<s;a+=1)e(n[a])}function load$1(t,e){var r=loadDocuments(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new exception("expected a single document in the stream, but found more")}}var loadAll_1=loadAll$1,load_1=load$1,loader$1={loadAll:loadAll_1,load:load_1},FAILSAFE_SCHEMA=failsafe,load=loader$1.load;const frontMatterRegex=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;function extractFrontMatter(t,e){var r;const n=t.match(frontMatterRegex);if(n){const a=load(n[1],{schema:FAILSAFE_SCHEMA});return a!=null&&a.title&&((r=e.setDiagramTitle)==null||r.call(e,a.title)),t.slice(n[0].length)}else return t}const directive$1=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,anyComment=/\s*%%.*\n/gm,detectors={},detectType=function(t,e){t=t.replace(frontMatterRegex,"").replace(directive$1,"").replace(anyComment,`
`);for(const[r,{detector:n}]of Object.entries(detectors))if(n(t,e))return r;throw new Error(`No diagram type detected for text: ${t}`)},addDetector=(t,e,r)=>{if(detectors[t])throw new Error(`Detector with key ${t} already exists`);detectors[t]={detector:e,loader:r},log$1.debug(`Detector with key ${t} added${r?" with loader":""}`)},getDiagramLoader=t=>detectors[t].loader,assignWithDepth=function(t,e,r){const{depth:n,clobber:a}=Object.assign({depth:2,clobber:!1},r);return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(s=>assignWithDepth(t,s,r)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(s=>{t.includes(s)||t.push(s)}),t):t===void 0||n<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(s=>{typeof e[s]=="object"&&(t[s]===void 0||typeof t[s]=="object")?(t[s]===void 0&&(t[s]=Array.isArray(e[s])?[]:{}),t[s]=assignWithDepth(t[s],e[s],{depth:n-1,clobber:a})):(a||typeof t[s]!="object"&&typeof e[s]!="object")&&(t[s]=e[s])}),t)},assignWithDepth$1=assignWithDepth,d3CurveTypes={curveBasis,curveBasisClosed,curveBasisOpen,curveLinear,curveLinearClosed,curveMonotoneX:monotoneX,curveMonotoneY:monotoneY,curveNatural,curveStep,curveStepAfter:stepAfter,curveStepBefore:stepBefore},directive=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,directiveWithoutOpen=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,detectInit=function(t,e){const r=detectDirective(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const a=r.map(s=>s.args);directiveSanitizer(a),n=assignWithDepth$1(n,[...a])}else n=r.args;if(n){let a=detectType(t,e);["config"].forEach(s=>{n[s]!==void 0&&(a==="flowchart-v2"&&(a="flowchart"),n[a]=n[s],delete n[s])})}return n},detectDirective=function(t,e=null){try{const r=new RegExp(`[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*
`,"ig");t=t.trim().replace(r,"").replace(/'/gm,'"'),log$1.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let n;const a=[];for(;(n=directive.exec(t))!==null;)if(n.index===directive.lastIndex&&directive.lastIndex++,n&&!e||e&&n[1]&&n[1].match(e)||e&&n[2]&&n[2].match(e)){const s=n[1]?n[1]:n[2],o=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;a.push({type:s,args:o})}return a.length===0&&a.push({type:t,args:null}),a.length===1?a[0]:a}catch(r){return log$1.error(`ERROR: ${r.message} - Unable to parse directive
${e!==null?" type:"+e:""} based on the text:${t}`),{type:null,args:null}}},isSubstringInArray=function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1};function interpolateToCurve(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return d3CurveTypes[r]||e}function formatUrl(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?sanitizeUrl_1(r):r}const runFunc=(t,...e)=>{const r=t.split("."),n=r.length-1,a=r[n];let s=window;for(let o=0;o<n;o++)if(s=s[r[o]],!s)return;s[a](...e)};function distance(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function traverseEdge(t){let e,r=0;t.forEach(s=>{r+=distance(s,e),e=s});let n=r/2,a;return e=void 0,t.forEach(s=>{if(e&&!a){const o=distance(s,e);if(o<n)n-=o;else{const l=n/o;l<=0&&(a=e),l>=1&&(a={x:s.x,y:s.y}),l>0&&l<1&&(a={x:(1-l)*e.x+l*s.x,y:(1-l)*e.y+l*s.y})}}e=s}),a}function calcLabelPosition(t){return t.length===1?t[0]:traverseEdge(t)}const calcCardinalityPosition=(t,e,r)=>{let n;log$1.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());let s=25,o;n=void 0,e.forEach(d=>{if(n&&!o){const p=distance(d,n);if(p<s)s-=p;else{const g=s/p;g<=0&&(o=n),g>=1&&(o={x:d.x,y:d.y}),g>0&&g<1&&(o={x:(1-g)*n.x+g*d.x,y:(1-g)*n.y+g*d.y})}}n=d});const l=t?10:5,u=Math.atan2(e[0].y-o.y,e[0].x-o.x),h={x:0,y:0};return h.x=Math.sin(u)*l+(e[0].x+o.x)/2,h.y=-Math.cos(u)*l+(e[0].y+o.y)/2,h};function calcTerminalLabelPosition(t,e,r){let n=JSON.parse(JSON.stringify(r)),a;log$1.info("our points",n),e!=="start_left"&&e!=="start_right"&&(n=n.reverse()),n.forEach(p=>{a=p});let o=25+t,l;a=void 0,n.forEach(p=>{if(a&&!l){const g=distance(p,a);if(g<o)o-=g;else{const m=o/g;m<=0&&(l=a),m>=1&&(l={x:p.x,y:p.y}),m>0&&m<1&&(l={x:(1-m)*a.x+m*p.x,y:(1-m)*a.y+m*p.y})}}a=p});const u=10+t*.5,h=Math.atan2(n[0].y-l.y,n[0].x-l.x),d={x:0,y:0};return d.x=Math.sin(h)*u+(n[0].x+l.x)/2,d.y=-Math.cos(h)*u+(n[0].y+l.y)/2,e==="start_left"&&(d.x=Math.sin(h+Math.PI)*u+(n[0].x+l.x)/2,d.y=-Math.cos(h+Math.PI)*u+(n[0].y+l.y)/2),e==="end_right"&&(d.x=Math.sin(h-Math.PI)*u+(n[0].x+l.x)/2-5,d.y=-Math.cos(h-Math.PI)*u+(n[0].y+l.y)/2-5),e==="end_left"&&(d.x=Math.sin(h)*u+(n[0].x+l.x)/2-5,d.y=-Math.cos(h)*u+(n[0].y+l.y)/2-5),d}function getStylesFromArray(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}let cnt=0;const generateId$1=()=>(cnt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+cnt);function makeid(t){let e="";const r="0123456789abcdef",n=r.length;for(let a=0;a<t;a++)e+=r.charAt(Math.floor(Math.random()*n));return e}const random=t=>makeid(t.length),getTextObj$2=function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0}},drawSimpleText=function(t,e){const r=e.text.replace(common$1.lineBreakRegex," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.style("text-anchor",e.anchor),n.style("font-family",e.fontFamily),n.style("font-size",e.fontSize),n.style("font-weight",e.fontWeight),n.attr("fill",e.fill),e.class!==void 0&&n.attr("class",e.class);const a=n.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),n},wrapLabel=memoize((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),common$1.lineBreakRegex.test(t)))return t;const n=t.split(" "),a=[];let s="";return n.forEach((o,l)=>{const u=calculateTextWidth(`${o} `,r),h=calculateTextWidth(s,r);if(u>e){const{hyphenatedStrings:g,remainingWord:m}=breakString(o,e,"-",r);a.push(s,...g),s=m}else h+u>=e?(a.push(s),s=o):s=[s,o].filter(Boolean).join(" ");l+1===n.length&&a.push(s)}),a.filter(o=>o!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),breakString=memoize((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const a=[...t],s=[];let o="";return a.forEach((l,u)=>{const h=`${o}${l}`;if(calculateTextWidth(h,n)>=e){const p=u+1,g=a.length===p,m=`${h}${r}`;s.push(g?h:m),o=""}else o=h}),{hyphenatedStrings:s,remainingWord:o}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function calculateTextHeight(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:15},e),calculateTextDimensions(t,e).height}function calculateTextWidth(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e),calculateTextDimensions(t,e).width}const calculateTextDimensions=memoize((t,e)=>{e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e);const{fontSize:r,fontFamily:n,fontWeight:a}=e;if(!t)return{width:0,height:0};const s=["sans-serif",n],o=t.split(common$1.lineBreakRegex),l=[],u=select("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const p of s){let g=0;const m={width:0,height:0,lineHeight:0};for(const T of o){const I=getTextObj$2();I.text=T;const A=drawSimpleText(h,I).style("font-size",r).style("font-weight",a).style("font-family",p),C=(A._groups||A)[0][0].getBBox();m.width=Math.round(Math.max(m.width,C.width)),g=Math.round(C.height),m.height+=g,m.lineHeight=Math.round(Math.max(m.lineHeight,g))}l.push(m)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),initIdGenerator=class{constructor(e,r){this.deterministic=e,this.seed=r,this.count=r?r.length:0}next(){return this.deterministic?this.count++:Date.now()}};let decoder;const entityDecode=function(t){return decoder=decoder||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),decoder.innerHTML=t,unescape(decoder.textContent)},directiveSanitizer=t=>{if(log$1.debug("directiveSanitizer called with",t),typeof t=="object"&&(t.length?t.forEach(e=>directiveSanitizer(e)):Object.keys(t).forEach(e=>{log$1.debug("Checking key",e),e.startsWith("__")&&(log$1.debug("sanitize deleting __ option",e),delete t[e]),e.includes("proto")&&(log$1.debug("sanitize deleting proto option",e),delete t[e]),e.includes("constr")&&(log$1.debug("sanitize deleting constr option",e),delete t[e]),e.includes("themeCSS")&&(log$1.debug("sanitizing themeCss option"),t[e]=sanitizeCss(t[e])),e.includes("fontFamily")&&(log$1.debug("sanitizing fontFamily option"),t[e]=sanitizeCss(t[e])),e.includes("altFontFamily")&&(log$1.debug("sanitizing altFontFamily option"),t[e]=sanitizeCss(t[e])),configKeys.includes(e)?typeof t[e]=="object"&&(log$1.debug("sanitize deleting object",e),directiveSanitizer(t[e])):(log$1.debug("sanitize deleting option",e),delete t[e])})),t.themeVariables){const e=Object.keys(t.themeVariables);for(const r of e){const n=t.themeVariables[r];n&&n.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[r]="")}}log$1.debug("After sanitization",t)},sanitizeCss=t=>{let e=0,r=0;for(const n of t){if(e<r)return"{ /* ERROR: Unbalanced CSS */ }";n==="{"?e++:n==="}"&&r++}return e!==r?"{ /* ERROR: Unbalanced CSS */ }":t};function isDetailedError(t){return"str"in t}function getErrorMessage(t){return t instanceof Error?t.message:String(t)}const insertTitle=(t,e,r,n)=>{if(!n)return;const a=t.node().getBBox();t.append("text").text(n).attr("x",a.x+a.width/2).attr("y",-r).attr("class",e)},utils={assignWithDepth:assignWithDepth$1,wrapLabel,calculateTextHeight,calculateTextWidth,calculateTextDimensions,detectInit,detectDirective,isSubstringInArray,interpolateToCurve,calcLabelPosition,calcCardinalityPosition,calcTerminalLabelPosition,formatUrl,getStylesFromArray,generateId:generateId$1,random,runFunc,entityDecode,initIdGenerator,directiveSanitizer,sanitizeCss,insertTitle},name="mermaid",version$1="9.3.0",description$1="Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",main="./dist/mermaid.min.js",module$1="./dist/mermaid.core.mjs",types="./dist/mermaid.d.ts",exports$1={".":{require:"./dist/mermaid.min.js",import:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts"},"./*":"./*"},keywords=["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],scripts={clean:"rimraf dist","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaidAPI.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts","docs:verify":"pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts --verify","docs:pre:vitepress":"rimraf src/vitepress && pnpm docs:code && ts-node-esm src/docs.mts --vitepress","docs:build:vitepress":"pnpm docs:pre:vitepress && vitepress build src/vitepress","docs:dev":'pnpm docs:pre:vitepress && concurrently "vitepress dev src/vitepress" "ts-node-esm src/docs.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell --config ../../cSpell.json "src/docs/**/*.md"',release:"pnpm build",prepublishOnly:"pnpm -w run build"},repository={type:"git",url:"https://github.com/mermaid-js/mermaid"},author="Knut Sveidqvist",license="MIT",standard={ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies={"@braintree/sanitize-url":"^6.0.0",d3:"^7.0.0","dagre-d3-es":"7.0.6",dompurify:"2.4.1",khroma:"^2.0.0","lodash-es":"^4.17.21","moment-mini":"^2.24.0","non-layered-tidy-tree-layout":"^2.0.2",stylis:"^4.1.2",uuid:"^9.0.0"},devDependencies={"@types/d3":"^7.4.0","@types/dompurify":"^2.4.0","@types/jsdom":"^20.0.1","@types/lodash-es":"^4.17.6","@types/micromatch":"^4.0.2","@types/prettier":"^2.7.1","@types/stylis":"^4.0.2","@types/uuid":"^8.3.4","@typescript-eslint/eslint-plugin":"^5.42.1","@typescript-eslint/parser":"^5.42.1",chokidar:"^3.5.3",concurrently:"^7.5.0",coveralls:"^3.1.1",cspell:"^6.14.3",globby:"^13.1.2",jison:"^0.4.18","js-base64":"^3.7.2",jsdom:"^20.0.2",micromatch:"^4.0.5",moment:"^2.29.4","path-browserify":"^1.0.1",prettier:"^2.7.1",remark:"^14.0.2",rimraf:"^3.0.2","start-server-and-test":"^1.14.0",typedoc:"^0.23.18","typedoc-plugin-markdown":"^3.13.6",typescript:"^4.8.4","unist-util-flatmap":"^1.0.0",vitepress:"^1.0.0-alpha.28","vitepress-plugin-search":"^1.0.4-alpha.15"},files=["dist","README.md"],sideEffects=["**/*.css","**/*.scss"],pkg={name,version:version$1,description:description$1,main,module:module$1,types,exports:exports$1,keywords,scripts,repository,author,license,standard,dependencies,devDependencies,files,sideEffects},defaultConfig=Object.freeze(config$2);let siteConfig=assignWithDepth$1({},defaultConfig),configFromInitialize,directives=[],currentConfig=assignWithDepth$1({},defaultConfig);const updateCurrentConfig=(t,e)=>{let r=assignWithDepth$1({},t),n={};for(const a of e)sanitize(a),n=assignWithDepth$1(n,a);if(r=assignWithDepth$1(r,n),n.theme&&n.theme in theme){const a=assignWithDepth$1({},configFromInitialize),s=assignWithDepth$1(a.themeVariables||{},n.themeVariables);r.theme&&r.theme in theme&&(r.themeVariables=theme[r.theme].getThemeVariables(s))}return currentConfig=r,checkConfig(currentConfig),currentConfig},setSiteConfig=t=>(siteConfig=assignWithDepth$1({},defaultConfig),siteConfig=assignWithDepth$1(siteConfig,t),t.theme&&theme[t.theme]&&(siteConfig.themeVariables=theme[t.theme].getThemeVariables(t.themeVariables)),updateCurrentConfig(siteConfig,directives),siteConfig),saveConfigFromInitialize=t=>{configFromInitialize=assignWithDepth$1({},t)},updateSiteConfig=t=>(siteConfig=assignWithDepth$1(siteConfig,t),updateCurrentConfig(siteConfig,directives),siteConfig),getSiteConfig=()=>assignWithDepth$1({},siteConfig),setConfig=t=>(checkConfig(t),assignWithDepth$1(currentConfig,t),getConfig$1()),getConfig$1=()=>assignWithDepth$1({},currentConfig),sanitize=t=>{var e;["secure",...(e=siteConfig.secure)!=null?e:[]].forEach(r=>{t[r]!==void 0&&(log$1.debug(`Denied attempt to modify a secure key ${r}`,t[r]),delete t[r])}),Object.keys(t).forEach(r=>{r.indexOf("__")===0&&delete t[r]}),Object.keys(t).forEach(r=>{typeof t[r]=="string"&&(t[r].includes("<")||t[r].includes(">")||t[r].includes("url(data:"))&&delete t[r],typeof t[r]=="object"&&sanitize(t[r])})},addDirective=t=>{t.fontFamily&&(t.themeVariables?t.themeVariables.fontFamily||(t.themeVariables={fontFamily:t.fontFamily}):t.themeVariables={fontFamily:t.fontFamily}),directives.push(t),updateCurrentConfig(siteConfig,directives)},reset=(t=siteConfig)=>{directives=[],updateCurrentConfig(t,directives)};var ConfigWarning=(t=>(t.LAZY_LOAD_DEPRECATED="The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",t))(ConfigWarning||{});const issuedWarnings={},issueWarning=t=>{issuedWarnings[t]||(log$1.warn(ConfigWarning[t]),issuedWarnings[t]=!0)},checkConfig=t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&issueWarning("LAZY_LOAD_DEPRECATED")},d3Attrs=function(t,e){for(let r of e)t.attr(r[0],r[1])},calculateSvgSizeAttrs=function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},configureSvgSize=function(t,e,r,n){const a=calculateSvgSizeAttrs(e,r,n);d3Attrs(t,a)},setupGraphViewbox$1=function(t,e,r,n){const a=e.node().getBBox(),s=a.width,o=a.height;log$1.info(`SVG bounds: ${s}x${o}`,a);let l=0,u=0;log$1.info(`Graph bounds: ${l}x${u}`,t),l=s+r*2,u=o+r*2,log$1.info(`Calculated bounds: ${l}x${u}`),configureSvgSize(e,u,l,n);const h=`${a.x-r} ${a.y-r} ${a.width+2*r} ${a.height+2*r}`;e.attr("viewBox",h)},getStyles$e=t=>`g.classGroup text {
fill: ${t.nodeBorder};
fill: ${t.classText};
stroke: none;
font-family: ${t.fontFamily};
font-size: 10px;
.title {
font-weight: bolder;
}
}
.nodeLabel, .edgeLabel {
color: ${t.classText};
}
.edgeLabel .label rect {
fill: ${t.mainBkg};
}
.label text {
fill: ${t.classText};
}
.edgeLabel .label span {
background: ${t.mainBkg};
}
.classTitle {
font-weight: bolder;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: 1px;
}
.divider {
stroke: ${t.nodeBorder};
stroke: 1;
}
g.clickable {
cursor: pointer;
}
g.classGroup rect {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
}
g.classGroup line {
stroke: ${t.nodeBorder};
stroke-width: 1;
}
.classLabel .box {
stroke: none;
stroke-width: 0;
fill: ${t.mainBkg};
opacity: 0.5;
}
.classLabel .label {
fill: ${t.nodeBorder};
font-size: 10px;
}
.relation {
stroke: ${t.lineColor};
stroke-width: 1;
fill: none;
}
.dashed-line{
stroke-dasharray: 3;
}
.dotted-line{
stroke-dasharray: 1 2;
}
#compositionStart, .composition {
fill: ${t.lineColor} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#compositionEnd, .composition {
fill: ${t.lineColor} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#dependencyStart, .dependency {
fill: ${t.lineColor} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#dependencyStart, .dependency {
fill: ${t.lineColor} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#extensionStart, .extension {
fill: ${t.mainBkg} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#extensionEnd, .extension {
fill: ${t.mainBkg} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#aggregationStart, .aggregation {
fill: ${t.mainBkg} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#aggregationEnd, .aggregation {
fill: ${t.mainBkg} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#lollipopStart, .lollipop {
fill: ${t.mainBkg} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
#lollipopEnd, .lollipop {
fill: ${t.mainBkg} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
.edgeTerminals {
font-size: 11px;
}
.classTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
`,classStyles=getStyles$e,getStyles$d=t=>`
.entityBox {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
}
.attributeBoxOdd {
fill: ${t.attributeBackgroundColorOdd};
stroke: ${t.nodeBorder};
}
.attributeBoxEven {
fill: ${t.attributeBackgroundColorEven};
stroke: ${t.nodeBorder};
}
.relationshipLabelBox {
fill: ${t.tertiaryColor};
opacity: 0.7;
background-color: ${t.tertiaryColor};
rect {
opacity: 0.5;
}
}
.relationshipLine {
stroke: ${t.lineColor};
}
.entityTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
`,erStyles=getStyles$d,getStyles$c=()=>"",errorStyles=getStyles$c,getStyles$b=t=>`.label {
font-family: ${t.fontFamily};
color: ${t.nodeTextColor||t.textColor};
}
.cluster-label text {
fill: ${t.titleColor};
}
.cluster-label span {
color: ${t.titleColor};
}
.label text,span {
fill: ${t.nodeTextColor||t.textColor};
color: ${t.nodeTextColor||t.textColor};
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: 1px;
}
.node .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.arrowheadPath {
fill: ${t.arrowheadColor};
}
.edgePath .path {
stroke: ${t.lineColor};
stroke-width: 2.0px;
}
.flowchart-link {
stroke: ${t.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
rect {
opacity: 0.5;
background-color: ${t.edgeLabelBackground};
fill: ${t.edgeLabelBackground};
}
text-align: center;
}
.cluster rect {
fill: ${t.clusterBkg};
stroke: ${t.clusterBorder};
stroke-width: 1px;
}
.cluster text {
fill: ${t.titleColor};
}
.cluster span {
color: ${t.titleColor};
}
/* .cluster div {
color: ${t.titleColor};
} */
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: ${t.fontFamily};
font-size: 12px;
background: ${t.tertiaryColor};
border: 1px solid ${t.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.flowchartTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
`,flowStyles=getStyles$b,getStyles$a=t=>`
.mermaid-main-font {
font-family: "trebuchet ms", verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
}
.exclude-range {
fill: ${t.excludeBkgColor};
}
.section {
stroke: none;
opacity: 0.2;
}
.section0 {
fill: ${t.sectionBkgColor};
}
.section2 {
fill: ${t.sectionBkgColor2};
}
.section1,
.section3 {
fill: ${t.altSectionBkgColor};
opacity: 0.2;
}
.sectionTitle0 {
fill: ${t.titleColor};
}
.sectionTitle1 {
fill: ${t.titleColor};
}
.sectionTitle2 {
fill: ${t.titleColor};
}
.sectionTitle3 {
fill: ${t.titleColor};
}
.sectionTitle {
text-anchor: start;
// font-size: ${t.ganttFontSize};
// text-height: 14px;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
}
/* Grid and axis */
.grid .tick {
stroke: ${t.gridColor};
opacity: 0.8;
shape-rendering: crispEdges;
text {
font-family: ${t.fontFamily};
fill: ${t.textColor};
}
}
.grid path {
stroke-width: 0;
}
/* Today line */
.today {
fill: none;
stroke: ${t.todayLineColor};
stroke-width: 2px;
}
/* Task styling */
/* Default task */
.task {
stroke-width: 2;
}
.taskText {
text-anchor: middle;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
}
// .taskText:not([font-size]) {
// font-size: ${t.ganttFontSize};
// }
.taskTextOutsideRight {
fill: ${t.taskTextDarkColor};
text-anchor: start;
// font-size: ${t.ganttFontSize};
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
}
.taskTextOutsideLeft {
fill: ${t.taskTextDarkColor};
text-anchor: end;
// font-size: ${t.ganttFontSize};
}
/* Special case clickable */
.task.clickable {
cursor: pointer;
}
.taskText.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
.taskTextOutsideLeft.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
.taskTextOutsideRight.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
/* Specific task settings for the sections*/
.taskText0,
.taskText1,
.taskText2,
.taskText3 {
fill: ${t.taskTextColor};
}
.task0,
.task1,
.task2,
.task3 {
fill: ${t.taskBkgColor};
stroke: ${t.taskBorderColor};
}
.taskTextOutside0,
.taskTextOutside2
{
fill: ${t.taskTextOutsideColor};
}
.taskTextOutside1,
.taskTextOutside3 {
fill: ${t.taskTextOutsideColor};
}
/* Active task */
.active0,
.active1,
.active2,
.active3 {
fill: ${t.activeTaskBkgColor};
stroke: ${t.activeTaskBorderColor};
}
.activeText0,
.activeText1,
.activeText2,
.activeText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Completed task */
.done0,
.done1,
.done2,
.done3 {
stroke: ${t.doneTaskBorderColor};
fill: ${t.doneTaskBkgColor};
stroke-width: 2;
}
.doneText0,
.doneText1,
.doneText2,
.doneText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Tasks on the critical line */
.crit0,
.crit1,
.crit2,
.crit3 {
stroke: ${t.critBorderColor};
fill: ${t.critBkgColor};
stroke-width: 2;
}
.activeCrit0,
.activeCrit1,
.activeCrit2,
.activeCrit3 {
stroke: ${t.critBorderColor};
fill: ${t.activeTaskBkgColor};
stroke-width: 2;
}
.doneCrit0,
.doneCrit1,
.doneCrit2,
.doneCrit3 {
stroke: ${t.critBorderColor};
fill: ${t.doneTaskBkgColor};
stroke-width: 2;
cursor: pointer;
shape-rendering: crispEdges;
}
.milestone {
transform: rotate(45deg) scale(0.8,0.8);
}
.milestoneText {
font-style: italic;
}
.doneCritText0,
.doneCritText1,
.doneCritText2,
.doneCritText3 {
fill: ${t.taskTextDarkColor} !important;
}
.activeCritText0,
.activeCritText1,
.activeCritText2,
.activeCritText3 {
fill: ${t.taskTextDarkColor} !important;
}
.titleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor} ;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
}
`,ganttStyles=getStyles$a,getStyles$9=()=>"",infoStyles=getStyles$9,getStyles$8=t=>`
.pieCircle{
stroke: ${t.pieStrokeColor};
stroke-width : ${t.pieStrokeWidth};
opacity : ${t.pieOpacity};
}
.pieTitleText {
text-anchor: middle;
font-size: ${t.pieTitleTextSize};
fill: ${t.pieTitleTextColor};
font-family: ${t.fontFamily};
}
.slice {
font-family: ${t.fontFamily};
fill: ${t.pieSectionTextColor};
font-size:${t.pieSectionTextSize};
// fill: white;
}
.legend text {
fill: ${t.pieLegendTextColor};
font-family: ${t.fontFamily};
font-size: ${t.pieLegendTextSize};
}
`,pieStyles=getStyles$8,getStyles$7=t=>`
marker {
fill: ${t.relationColor};
stroke: ${t.relationColor};
}
marker.cross {
stroke: ${t.lineColor};
}
svg {
font-family: ${t.fontFamily};
font-size: ${t.fontSize};
}
.reqBox {
fill: ${t.requirementBackground};
fill-opacity: 100%;
stroke: ${t.requirementBorderColor};
stroke-width: ${t.requirementBorderSize};
}
.reqTitle, .reqLabel{
fill: ${t.requirementTextColor};
}
.reqLabelBox {
fill: ${t.relationLabelBackground};
fill-opacity: 100%;
}
.req-title-line {
stroke: ${t.requirementBorderColor};
stroke-width: ${t.requirementBorderSize};
}
.relationshipLine {
stroke: ${t.relationColor};
stroke-width: 1;
}
.relationshipLabel {
fill: ${t.relationLabelColor};
}
`,requirementStyles=getStyles$7,getStyles$6=t=>`.actor {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
}
text.actor > tspan {
fill: ${t.actorTextColor};
stroke: none;
}
.actor-line {
stroke: ${t.actorLineColor};
}
.messageLine0 {
stroke-width: 1.5;
stroke-dasharray: none;
stroke: ${t.signalColor};
}
.messageLine1 {
stroke-width: 1.5;
stroke-dasharray: 2, 2;
stroke: ${t.signalColor};
}
#arrowhead path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.sequenceNumber {
fill: ${t.sequenceNumberColor};
}
#sequencenumber {
fill: ${t.signalColor};
}
#crosshead path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.messageText {
fill: ${t.signalTextColor};
stroke: none;
}
.labelBox {
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBkgColor};
}
.labelText, .labelText > tspan {
fill: ${t.labelTextColor};
stroke: none;
}
.loopText, .loopText > tspan {
fill: ${t.loopTextColor};
stroke: none;
}
.loopLine {
stroke-width: 2px;
stroke-dasharray: 2, 2;
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBorderColor};
}
.note {
//stroke: #decc93;
stroke: ${t.noteBorderColor};
fill: ${t.noteBkgColor};
}
.noteText, .noteText > tspan {
fill: ${t.noteTextColor};
stroke: none;
}
.activation0 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.activation1 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.activation2 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.actorPopupMenu {
position: absolute;
}
.actorPopupMenuPanel {
position: absolute;
fill: ${t.actorBkg};
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}
.actor-man line {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
}
.actor-man circle, line {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
stroke-width: 2px;
}
`,sequenceStyles=getStyles$6,getStyles$5=t=>`
defs #statediagram-barbEnd {
fill: ${t.transitionColor};
stroke: ${t.transitionColor};
}
g.stateGroup text {
fill: ${t.nodeBorder};
stroke: none;
font-size: 10px;
}
g.stateGroup text {
fill: ${t.textColor};
stroke: none;
font-size: 10px;
}
g.stateGroup .state-title {
font-weight: bolder;
fill: ${t.stateLabelColor};
}
g.stateGroup rect {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
}
g.stateGroup line {
stroke: ${t.lineColor};
stroke-width: 1;
}
.transition {
stroke: ${t.transitionColor};
stroke-width: 1;
fill: none;
}
.stateGroup .composit {
fill: ${t.background};
border-bottom: 1px
}
.stateGroup .alt-composit {
fill: #e0e0e0;
border-bottom: 1px
}
.state-note {
stroke: ${t.noteBorderColor};
fill: ${t.noteBkgColor};
text {
fill: ${t.noteTextColor};
stroke: none;
font-size: 10px;
}
}
.stateLabel .box {
stroke: none;
stroke-width: 0;
fill: ${t.mainBkg};
opacity: 0.5;
}
.edgeLabel .label rect {
fill: ${t.labelBackgroundColor};
opacity: 0.5;
}
.edgeLabel .label text {
fill: ${t.transitionLabelColor||t.tertiaryTextColor};
}
.label div .edgeLabel {
color: ${t.transitionLabelColor||t.tertiaryTextColor};
}
.stateLabel text {
fill: ${t.stateLabelColor};
font-size: 10px;
font-weight: bold;
}
.node circle.state-start {
fill: ${t.specialStateColor};
stroke: ${t.specialStateColor};
}
.node .fork-join {
fill: ${t.specialStateColor};
stroke: ${t.specialStateColor};
}
.node circle.state-end {
fill: ${t.innerEndBackground};
stroke: ${t.background};
stroke-width: 1.5
}
.end-state-inner {
fill: ${t.compositeBackground||t.background};
// stroke: ${t.background};
stroke-width: 1.5
}
.node rect {
fill: ${t.stateBkg||t.mainBkg};
stroke: ${t.stateBorder||t.nodeBorder};
stroke-width: 1px;
}
.node polygon {
fill: ${t.mainBkg};
stroke: ${t.stateBorder||t.nodeBorder};;
stroke-width: 1px;
}
#statediagram-barbEnd {
fill: ${t.lineColor};
}
.statediagram-cluster rect {
fill: ${t.compositeTitleBackground};
stroke: ${t.stateBorder||t.nodeBorder};
stroke-width: 1px;
}
.cluster-label, .nodeLabel {
color: ${t.stateLabelColor};
}
.statediagram-cluster rect.outer {
rx: 5px;
ry: 5px;
}
.statediagram-state .divider {
stroke: ${t.stateBorder||t.nodeBorder};
}
.statediagram-state .title-state {
rx: 5px;
ry: 5px;
}
.statediagram-cluster.statediagram-cluster .inner {
fill: ${t.compositeBackground||t.background};
}
.statediagram-cluster.statediagram-cluster-alt .inner {
fill: ${t.altBackground?t.altBackground:"#efefef"};
}
.statediagram-cluster .inner {
rx:0;
ry:0;
}
.statediagram-state rect.basic {
rx: 5px;
ry: 5px;
}
.statediagram-state rect.divider {
stroke-dasharray: 10,10;
fill: ${t.altBackground?t.altBackground:"#efefef"};
}
.note-edge {
stroke-dasharray: 5;
}
.statediagram-note rect {
fill: ${t.noteBkgColor};
stroke: ${t.noteBorderColor};
stroke-width: 1px;
rx: 0;
ry: 0;
}
.statediagram-note rect {
fill: ${t.noteBkgColor};
stroke: ${t.noteBorderColor};
stroke-width: 1px;
rx: 0;
ry: 0;
}
.statediagram-note text {
fill: ${t.noteTextColor};
}
.statediagram-note .nodeLabel {
color: ${t.noteTextColor};
}
.statediagram .edgeLabel {
color: red; // ${t.noteTextColor};
}
#dependencyStart, #dependencyEnd {
fill: ${t.lineColor};
stroke: ${t.lineColor};
stroke-width: 1;
}
.statediagramTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
`,stateStyles=getStyles$5,getStyles$4=t=>`.label {
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
color: ${t.textColor};
}
.mouth {
stroke: #666;
}
line {
stroke: ${t.textColor}
}
.legend {
fill: ${t.textColor};
}
.label text {
fill: #333;
}
.label {
color: ${t.textColor}
}
.face {
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
stroke: #999;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: 1px;
}
.node .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.arrowheadPath {
fill: ${t.arrowheadColor};
}
.edgePath .path {
stroke: ${t.lineColor};
stroke-width: 1.5px;
}
.flowchart-link {
stroke: ${t.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
rect {
opacity: 0.5;
}
text-align: center;
}
.cluster rect {
}
.cluster text {
fill: ${t.titleColor};
}
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
font-size: 12px;
background: ${t.tertiaryColor};
border: 1px solid ${t.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.task-type-0, .section-type-0 {
${t.fillType0?`fill: ${t.fillType0}`:""};
}
.task-type-1, .section-type-1 {
${t.fillType0?`fill: ${t.fillType1}`:""};
}
.task-type-2, .section-type-2 {
${t.fillType0?`fill: ${t.fillType2}`:""};
}
.task-type-3, .section-type-3 {
${t.fillType0?`fill: ${t.fillType3}`:""};
}
.task-type-4, .section-type-4 {
${t.fillType0?`fill: ${t.fillType4}`:""};
}
.task-type-5, .section-type-5 {
${t.fillType0?`fill: ${t.fillType5}`:""};
}
.task-type-6, .section-type-6 {
${t.fillType0?`fill: ${t.fillType6}`:""};
}
.task-type-7, .section-type-7 {
${t.fillType0?`fill: ${t.fillType7}`:""};
}
.actor-0 {
${t.actor0?`fill: ${t.actor0}`:""};
}
.actor-1 {
${t.actor1?`fill: ${t.actor1}`:""};
}
.actor-2 {
${t.actor2?`fill: ${t.actor2}`:""};
}
.actor-3 {
${t.actor3?`fill: ${t.actor3}`:""};
}
.actor-4 {
${t.actor4?`fill: ${t.actor4}`:""};
}
.actor-5 {
${t.actor5?`fill: ${t.actor5}`:""};
}
`,journeyStyles=getStyles$4,getStyles$3=t=>`.person {
stroke: ${t.personBorder};
fill: ${t.personBkg};
}
`,c4Styles=getStyles$3,themes={flowchart:flowStyles,"flowchart-v2":flowStyles,sequence:sequenceStyles,gantt:ganttStyles,classDiagram:classStyles,"classDiagram-v2":classStyles,class:classStyles,stateDiagram:stateStyles,state:stateStyles,info:infoStyles,pie:pieStyles,er:erStyles,error:errorStyles,journey:journeyStyles,requirement:requirementStyles,c4:c4Styles},getStyles$1=(t,e,r)=>{let n="";return t in themes&&themes[t]?n=themes[t](r):log$1.warn(`No theme found for ${t}`),` & {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
fill: ${r.textColor}
}
/* Classes common for multiple diagrams */
& .error-icon {
fill: ${r.errorBkgColor};
}
& .error-text {
fill: ${r.errorTextColor};
stroke: ${r.errorTextColor};
}
& .edge-thickness-normal {
stroke-width: 2px;
}
& .edge-thickness-thick {
stroke-width: 3.5px
}
& .edge-pattern-solid {
stroke-dasharray: 0;
}
& .edge-pattern-dashed{
stroke-dasharray: 3;
}
.edge-pattern-dotted {
stroke-dasharray: 2;
}
& .marker {
fill: ${r.lineColor};
stroke: ${r.lineColor};
}
& .marker.cross {
stroke: ${r.lineColor};
}
& svg {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
}
${n}
${e}
`},addStylesForDiagram=(t,e)=>{themes[t]=e},getStyles$2=getStyles$1,log=log$1,setLogLevel=setLogLevel$1,getConfig=getConfig$1,sanitizeText$4=t=>sanitizeText$5(t,getConfig()),setupGraphViewbox=setupGraphViewbox$1,diagrams={},registerDiagram=(t,e,r)=>{if(diagrams[t])throw new Error(`Diagram ${t} already registered.`);diagrams[t]=e,r&&addDetector(t,r),addStylesForDiagram(t,e.styles),e.injectUtils&&e.injectUtils(log,setLogLevel,getConfig,sanitizeText$4,setupGraphViewbox)},getDiagram=t=>{if(t in diagrams)return diagrams[t];throw new Error(`Diagram ${t} not found.`)};var parser$b=function(){var t=function(z,R,$,D){for($=$||{},D=z.length;D--;$[z[D]]=R);return $},e=[1,4],r=[1,7],n=[1,5],a=[1,9],s=[1,6],o=[2,6],l=[1,16],u=[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],d=[8,13,14,20,22,24,25,27,29,32,37,40],p=[1,26],g=[6,8,14,50,55],m=[8,14,55],T=[1,53],I=[1,52],A=[8,14,30,33,35,38,55],C=[1,67],L=[1,68],M=[1,69],F=[8,14,33,35,42,55],H={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(R,$,D,k,B,v,J){var E=v.length-1;switch(B){case 3:return v[E];case 4:return v[E-1];case 5:return k.setDirection(v[E-3]),v[E-1];case 7:k.setOptions(v[E-1]),this.$=v[E];break;case 8:v[E-1]+=v[E],this.$=v[E-1];break;case 10:this.$=[];break;case 11:v[E-1].push(v[E]),this.$=v[E-1];break;case 12:this.$=v[E-1];break;case 17:this.$=v[E].trim(),k.setAccTitle(this.$);break;case 18:case 19:this.$=v[E].trim(),k.setAccDescription(this.$);break;case 20:k.addSection(v[E].substr(8)),this.$=v[E].substr(8);break;case 22:k.checkout(v[E]);break;case 23:k.branch(v[E]);break;case 24:k.branch(v[E-2],v[E]);break;case 25:k.cherryPick(v[E],"",void 0);break;case 26:k.cherryPick(v[E-2],"",v[E]);break;case 27:case 29:k.cherryPick(v[E-2],"","");break;case 28:k.cherryPick(v[E],"",v[E-2]);break;case 30:k.merge(v[E],"","","");break;case 31:k.merge(v[E-2],v[E],"","");break;case 32:k.merge(v[E-2],"",v[E],"");break;case 33:k.merge(v[E-2],"","",v[E]);break;case 34:k.merge(v[E-4],v[E],"",v[E-2]);break;case 35:k.merge(v[E-4],"",v[E],v[E-2]);break;case 36:k.merge(v[E-4],"",v[E-2],v[E]);break;case 37:k.merge(v[E-4],v[E-2],v[E],"");break;case 38:k.merge(v[E-4],v[E-2],"",v[E]);break;case 39:k.merge(v[E-4],v[E],v[E-2],"");break;case 40:k.merge(v[E-6],v[E-4],v[E-2],v[E]);break;case 41:k.merge(v[E-6],v[E],v[E-4],v[E-2]);break;case 42:k.merge(v[E-6],v[E-4],v[E],v[E-2]);break;case 43:k.merge(v[E-6],v[E-2],v[E-4],v[E]);break;case 44:k.merge(v[E-6],v[E],v[E-2],v[E-4]);break;case 45:k.merge(v[E-6],v[E-2],v[E],v[E-4]);break;case 46:k.commit(v[E]);break;case 47:k.commit("","",k.commitType.NORMAL,v[E]);break;case 48:k.commit("","",v[E],"");break;case 49:k.commit("","",v[E],v[E-2]);break;case 50:k.commit("","",v[E-2],v[E]);break;case 51:k.commit("",v[E],k.commitType.NORMAL,"");break;case 52:k.commit("",v[E-2],k.commitType.NORMAL,v[E]);break;case 53:k.commit("",v[E],k.commitType.NORMAL,v[E-2]);break;case 54:k.commit("",v[E-2],v[E],"");break;case 55:k.commit("",v[E],v[E-2],"");break;case 56:k.commit("",v[E-4],v[E-2],v[E]);break;case 57:k.commit("",v[E-4],v[E],v[E-2]);break;case 58:k.commit("",v[E-2],v[E-4],v[E]);break;case 59:k.commit("",v[E],v[E-4],v[E-2]);break;case 60:k.commit("",v[E],v[E-2],v[E-4]);break;case 61:k.commit("",v[E-2],v[E],v[E-4]);break;case 62:k.commit(v[E],"",k.commitType.NORMAL,"");break;case 63:k.commit(v[E],"",k.commitType.NORMAL,v[E-2]);break;case 64:k.commit(v[E-2],"",k.commitType.NORMAL,v[E]);break;case 65:k.commit(v[E-2],"",v[E],"");break;case 66:k.commit(v[E],"",v[E-2],"");break;case 67:k.commit(v[E],v[E-2],k.commitType.NORMAL,"");break;case 68:k.commit(v[E-2],v[E],k.commitType.NORMAL,"");break;case 69:k.commit(v[E-4],"",v[E-2],v[E]);break;case 70:k.commit(v[E-4],"",v[E],v[E-2]);break;case 71:k.commit(v[E-2],"",v[E-4],v[E]);break;case 72:k.commit(v[E],"",v[E-4],v[E-2]);break;case 73:k.commit(v[E],"",v[E-2],v[E-4]);break;case 74:k.commit(v[E-2],"",v[E],v[E-4]);break;case 75:k.commit(v[E-4],v[E],v[E-2],"");break;case 76:k.commit(v[E-4],v[E-2],v[E],"");break;case 77:k.commit(v[E-2],v[E],v[E-4],"");break;case 78:k.commit(v[E],v[E-2],v[E-4],"");break;case 79:k.commit(v[E],v[E-4],v[E-2],"");break;case 80:k.commit(v[E-2],v[E-4],v[E],"");break;case 81:k.commit(v[E-4],v[E],k.commitType.NORMAL,v[E-2]);break;case 82:k.commit(v[E-4],v[E-2],k.commitType.NORMAL,v[E]);break;case 83:k.commit(v[E-2],v[E],k.commitType.NORMAL,v[E-4]);break;case 84:k.commit(v[E],v[E-2],k.commitType.NORMAL,v[E-4]);break;case 85:k.commit(v[E],v[E-4],k.commitType.NORMAL,v[E-2]);break;case 86:k.commit(v[E-2],v[E-4],k.commitType.NORMAL,v[E]);break;case 87:k.commit(v[E-6],v[E-4],v[E-2],v[E]);break;case 88:k.commit(v[E-6],v[E-4],v[E],v[E-2]);break;case 89:k.commit(v[E-6],v[E-2],v[E-4],v[E]);break;case 90:k.commit(v[E-6],v[E],v[E-4],v[E-2]);break;case 91:k.commit(v[E-6],v[E-2],v[E],v[E-4]);break;case 92:k.commit(v[E-6],v[E],v[E-2],v[E-4]);break;case 93:k.commit(v[E-4],v[E-6],v[E-2],v[E]);break;case 94:k.commit(v[E-4],v[E-6],v[E],v[E-2]);break;case 95:k.commit(v[E-2],v[E-6],v[E-4],v[E]);break;case 96:k.commit(v[E],v[E-6],v[E-4],v[E-2]);break;case 97:k.commit(v[E-2],v[E-6],v[E],v[E-4]);break;case 98:k.commit(v[E],v[E-6],v[E-2],v[E-4]);break;case 99:k.commit(v[E],v[E-4],v[E-2],v[E-6]);break;case 100:k.commit(v[E-2],v[E-4],v[E],v[E-6]);break;case 101:k.commit(v[E],v[E-2],v[E-4],v[E-6]);break;case 102:k.commit(v[E-2],v[E],v[E-4],v[E-6]);break;case 103:k.commit(v[E-4],v[E-2],v[E],v[E-6]);break;case 104:k.commit(v[E-4],v[E],v[E-2],v[E-6]);break;case 105:k.commit(v[E-2],v[E-4],v[E-6],v[E]);break;case 106:k.commit(v[E],v[E-4],v[E-6],v[E-2]);break;case 107:k.commit(v[E-2],v[E],v[E-6],v[E-4]);break;case 108:k.commit(v[E],v[E-2],v[E-6],v[E-4]);break;case 109:k.commit(v[E-4],v[E-2],v[E-6],v[E]);break;case 110:k.commit(v[E-4],v[E],v[E-6],v[E-2]);break;case 111:this.$="";break;case 112:this.$=v[E];break;case 113:this.$=k.commitType.NORMAL;break;case 114:this.$=k.commitType.REVERSE;break;case 115:this.$=k.commitType.HIGHLIGHT;break;case 118:k.parseDirective("%%{","open_directive");break;case 119:k.parseDirective(v[E],"type_directive");break;case 120:v[E]=v[E].trim().replace(/'/g,'"'),k.parseDirective(v[E],"arg_directive");break;case 121:k.parseDirective("}%%","close_directive","gitGraph");break}},table:[{3:1,4:2,5:3,6:e,8:r,14:n,46:8,50:a,55:s},{1:[3]},{3:10,4:2,5:3,6:e,8:r,14:n,46:8,50:a,55:s},{3:11,4:2,5:3,6:e,8:r,14:n,46:8,50:a,55:s},{7:12,8:o,9:[1,13],10:[1,14],11:15,14:l},t(u,[2,124]),t(u,[2,125]),t(u,[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]},t(h,[2,10],{12:22,13:[1,23]}),t(d,[2,9]),{9:[1,25],48:24,53:p},t([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]},t(d,[2,8]),t(g,[2,116]),{49:45,52:[1,46]},t(g,[2,121]),{1:[2,4]},{8:[1,47]},t(h,[2,11]),{4:48,8:r,14:n,55:s},t(h,[2,13]),t(m,[2,14]),t(m,[2,15]),t(m,[2,16]),{21:[1,49]},{23:[1,50]},t(m,[2,19]),t(m,[2,20]),t(m,[2,21]),{28:51,34:T,54:I},t(m,[2,111],{41:54,33:[1,57],34:[1,59],35:[1,55],38:[1,56],42:[1,58]}),{28:60,34:T,54:I},{33:[1,61],35:[1,62]},{28:63,34:T,54:I},{48:64,53:p},{53:[2,120]},{1:[2,5]},t(h,[2,12]),t(m,[2,17]),t(m,[2,18]),t(m,[2,22]),t(A,[2,122]),t(A,[2,123]),t(m,[2,46]),{34:[1,65]},{39:66,43:C,44:L,45:M},{34:[1,70]},{34:[1,71]},t(m,[2,112]),t(m,[2,30],{33:[1,72],35:[1,74],38:[1,73]}),{34:[1,75]},{34:[1,76],36:[1,77]},t(m,[2,23],{30:[1,78]}),t(g,[2,117]),t(m,[2,47],{33:[1,80],38:[1,79],42:[1,81]}),t(m,[2,48],{33:[1,83],35:[1,82],42:[1,84]}),t(F,[2,113]),t(F,[2,114]),t(F,[2,115]),t(m,[2,51],{35:[1,85],38:[1,86],42:[1,87]}),t(m,[2,62],{33:[1,90],35:[1,88],38:[1,89]}),{34:[1,91]},{39:92,43:C,44:L,45:M},{34:[1,93]},t(m,[2,25],{35:[1,94]}),{33:[1,95]},{33:[1,96]},{31:[1,97]},{39:98,43:C,44:L,45:M},{34:[1,99]},{34:[1,100]},{34:[1,101]},{34:[1,102]},{34:[1,103]},{34:[1,104]},{39:105,43:C,44:L,45:M},{34:[1,106]},{34:[1,107]},{39:108,43:C,44:L,45:M},{34:[1,109]},t(m,[2,31],{35:[1,111],38:[1,110]}),t(m,[2,32],{33:[1,113],35:[1,112]}),t(m,[2,33],{33:[1,114],38:[1,115]}),{34:[1,116],36:[1,117]},{34:[1,118]},{34:[1,119]},t(m,[2,24]),t(m,[2,49],{33:[1,120],42:[1,121]}),t(m,[2,53],{38:[1,122],42:[1,123]}),t(m,[2,63],{33:[1,125],38:[1,124]}),t(m,[2,50],{33:[1,126],42:[1,127]}),t(m,[2,55],{35:[1,128],42:[1,129]}),t(m,[2,66],{33:[1,131],35:[1,130]}),t(m,[2,52],{38:[1,132],42:[1,133]}),t(m,[2,54],{35:[1,134],42:[1,135]}),t(m,[2,67],{35:[1,137],38:[1,136]}),t(m,[2,64],{33:[1,139],38:[1,138]}),t(m,[2,65],{33:[1,141],35:[1,140]}),t(m,[2,68],{35:[1,143],38:[1,142]}),{39:144,43:C,44:L,45:M},{34:[1,145]},{34:[1,146]},{34:[1,147]},{34:[1,148]},{39:149,43:C,44:L,45:M},t(m,[2,26]),t(m,[2,27]),t(m,[2,28]),t(m,[2,29]),{34:[1,150]},{34:[1,151]},{39:152,43:C,44:L,45:M},{34:[1,153]},{39:154,43:C,44:L,45:M},{34:[1,155]},{34:[1,156]},{34:[1,157]},{34:[1,158]},{34:[1,159]},{34:[1,160]},{34:[1,161]},{39:162,43:C,44:L,45:M},{34:[1,163]},{34:[1,164]},{34:[1,165]},{39:166,43:C,44:L,45:M},{34:[1,167]},{39:168,43:C,44:L,45:M},{34:[1,169]},{34:[1,170]},{34:[1,171]},{39:172,43:C,44:L,45:M},{34:[1,173]},t(m,[2,37],{35:[1,174]}),t(m,[2,38],{38:[1,175]}),t(m,[2,36],{33:[1,176]}),t(m,[2,39],{35:[1,177]}),t(m,[2,34],{38:[1,178]}),t(m,[2,35],{33:[1,179]}),t(m,[2,60],{42:[1,180]}),t(m,[2,73],{33:[1,181]}),t(m,[2,61],{42:[1,182]}),t(m,[2,84],{38:[1,183]}),t(m,[2,74],{33:[1,184]}),t(m,[2,83],{38:[1,185]}),t(m,[2,59],{42:[1,186]}),t(m,[2,72],{33:[1,187]}),t(m,[2,58],{42:[1,188]}),t(m,[2,78],{35:[1,189]}),t(m,[2,71],{33:[1,190]}),t(m,[2,77],{35:[1,191]}),t(m,[2,57],{42:[1,192]}),t(m,[2,85],{38:[1,193]}),t(m,[2,56],{42:[1,194]}),t(m,[2,79],{35:[1,195]}),t(m,[2,80],{35:[1,196]}),t(m,[2,86],{38:[1,197]}),t(m,[2,70],{33:[1,198]}),t(m,[2,81],{38:[1,199]}),t(m,[2,69],{33:[1,200]}),t(m,[2,75],{35:[1,201]}),t(m,[2,76],{35:[1,202]}),t(m,[2,82],{38:[1,203]}),{34:[1,204]},{39:205,43:C,44:L,45:M},{34:[1,206]},{34:[1,207]},{39:208,43:C,44:L,45:M},{34:[1,209]},{34:[1,210]},{34:[1,211]},{34:[1,212]},{39:213,43:C,44:L,45:M},{34:[1,214]},{39:215,43:C,44:L,45:M},{34:[1,216]},{34:[1,217]},{34:[1,218]},{34:[1,219]},{34:[1,220]},{34:[1,221]},{34:[1,222]},{39:223,43:C,44:L,45:M},{34:[1,224]},{34:[1,225]},{34:[1,226]},{39:227,43:C,44:L,45:M},{34:[1,228]},{39:229,43:C,44:L,45:M},{34:[1,230]},{34:[1,231]},{34:[1,232]},{39:233,43:C,44:L,45:M},t(m,[2,40]),t(m,[2,42]),t(m,[2,41]),t(m,[2,43]),t(m,[2,45]),t(m,[2,44]),t(m,[2,101]),t(m,[2,102]),t(m,[2,99]),t(m,[2,100]),t(m,[2,104]),t(m,[2,103]),t(m,[2,108]),t(m,[2,107]),t(m,[2,106]),t(m,[2,105]),t(m,[2,110]),t(m,[2,109]),t(m,[2,98]),t(m,[2,97]),t(m,[2,96]),t(m,[2,95]),t(m,[2,93]),t(m,[2,94]),t(m,[2,92]),t(m,[2,91]),t(m,[2,90]),t(m,[2,89]),t(m,[2,87]),t(m,[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(R,$){if($.recoverable)this.trace(R);else{var D=new Error(R);throw D.hash=$,D}},parse:function(R){var $=this,D=[0],k=[],B=[null],v=[],J=this.table,E="",ft=0,Lt=0,Tt=2,Q=1,ut=v.slice.call(arguments,1),st=Object.create(this.lexer),ot={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(ot.yy[dt]=this.yy[dt]);st.setInput(R,ot.yy),ot.yy.lexer=st,ot.yy.parser=this,typeof st.yylloc>"u"&&(st.yylloc={});var xt=st.yylloc;v.push(xt);var et=st.options&&st.options.ranges;typeof ot.yy.parseError=="function"?this.parseError=ot.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Nt(){var Ft;return Ft=k.pop()||st.lex()||Q,typeof Ft!="number"&&(Ft instanceof Array&&(k=Ft,Ft=k.pop()),Ft=$.symbols_[Ft]||Ft),Ft}for(var G,Z,tt,W,Y={},P,it,N,gt;;){if(Z=D[D.length-1],this.defaultActions[Z]?tt=this.defaultActions[Z]:((G===null||typeof G>"u")&&(G=Nt()),tt=J[Z]&&J[Z][G]),typeof tt>"u"||!tt.length||!tt[0]){var j="";gt=[];for(P in J[Z])this.terminals_[P]&&P>Tt&&gt.push("'"+this.terminals_[P]+"'");st.showPosition?j="Parse error on line "+(ft+1)+`:
`+st.showPosition()+`
Expecting `+gt.join(", ")+", got '"+(this.terminals_[G]||G)+"'":j="Parse error on line "+(ft+1)+": Unexpected "+(G==Q?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(j,{text:st.match,token:this.terminals_[G]||G,line:st.yylineno,loc:xt,expected:gt})}if(tt[0]instanceof Array&&tt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+G);switch(tt[0]){case 1:D.push(G),B.push(st.yytext),v.push(st.yylloc),D.push(tt[1]),G=null,Lt=st.yyleng,E=st.yytext,ft=st.yylineno,xt=st.yylloc;break;case 2:if(it=this.productions_[tt[1]][1],Y.$=B[B.length-it],Y._$={first_line:v[v.length-(it||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(it||1)].first_column,last_column:v[v.length-1].last_column},et&&(Y._$.range=[v[v.length-(it||1)].range[0],v[v.length-1].range[1]]),W=this.performAction.apply(Y,[E,Lt,ft,ot.yy,tt[1],B,v].concat(ut)),typeof W<"u")return W;it&&(D=D.slice(0,-1*it*2),B=B.slice(0,-1*it),v=v.slice(0,-1*it)),D.push(this.productions_[tt[1]][0]),B.push(Y.$),v.push(Y._$),N=J[D[D.length-2]][D[D.length-1]],D.push(N);break;case 3:return!0}}return!0}},q=function(){var z={EOF:1,parseError:function($,D){if(this.yy.parser)this.yy.parser.parseError($,D);else throw new Error($)},setInput:function(R,$){return this.yy=$||this.yy||{},this._input=R,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 R=this._input[0];this.yytext+=R,this.yyleng++,this.offset++,this.match+=R,this.matched+=R;var $=R.match(/(?:\r\n?|\n).*/g);return $?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),R},unput:function(R){var $=R.length,D=R.split(/(?:\r\n?|\n)/g);this._input=R+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-$),this.offset-=$;var k=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),D.length-1&&(this.yylineno-=D.length-1);var B=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:D?(D.length===k.length?this.yylloc.first_column:0)+k[k.length-D.length].length-D[0].length:this.yylloc.first_column-$},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-$]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(R){this.unput(this.match.slice(R))},pastInput:function(){var R=this.matched.substr(0,this.matched.length-this.match.length);return(R.length>20?"...":"")+R.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var R=this.match;return R.length<20&&(R+=this._input.substr(0,20-R.length)),(R.substr(0,20)+(R.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var R=this.pastInput(),$=new Array(R.length+1).join("-");return R+this.upcomingInput()+`
`+$+"^"},test_match:function(R,$){var D,k,B;if(this.options.backtrack_lexer&&(B={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&&(B.yylloc.range=this.yylloc.range.slice(0))),k=R[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+R[0].length},this.yytext+=R[0],this.match+=R[0],this.matches=R,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(R[0].length),this.matched+=R[0],D=this.performAction.call(this,this.yy,this,$,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),D)return D;if(this._backtrack){for(var v in B)this[v]=B[v];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var R,$,D,k;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),v=0;v<B.length;v++)if(D=this._input.match(this.rules[B[v]]),D&&(!$||D[0].length>$[0].length)){if($=D,k=v,this.options.backtrack_lexer){if(R=this.test_match(D,B[v]),R!==!1)return R;if(this._backtrack){$=!1;continue}else return!1}else if(!this.options.flex)break}return $?(R=this.test_match($,B[k]),R!==!1?R:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var $=this.next();return $||this.lex()},begin:function($){this.conditionStack.push($)},popState:function(){var $=this.conditionStack.length-1;return $>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($){return $=this.conditionStack.length-1-Math.abs($||0),$>=0?this.conditionStack[$]:"INITIAL"},pushState:function($){this.begin($)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function($,D,k,B){switch(k){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:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:return 14;case 13:break;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:return 10;case 30:return 10;case 31:return 9;case 32:return"CARET";case 33:this.begin("options");break;case 34:this.popState();break;case 35:return 13;case 36:return 36;case 37:this.begin("string");break;case 38:this.popState();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}}};return z}();H.lexer=q;function U(){this.yy={}}return U.prototype=H,H.Parser=U,new U}();parser$b.parser=parser$b;const gitGraphParser=parser$b,gitGraphDetector=t=>t.match(/^\s*gitGraph/)!==null;let title$1="",diagramTitle="",description="";const sanitizeText$3=t=>sanitizeText$5(t,getConfig$1()),clear$g=function(){title$1="",description="",diagramTitle=""},setAccTitle=function(t){title$1=sanitizeText$3(t).replace(/^\s+/g,"")},getAccTitle=function(){return title$1||diagramTitle},setAccDescription=function(t){description=sanitizeText$3(t).replace(/\n\s+/g,`
`)},getAccDescription=function(){return description},setDiagramTitle=function(t){diagramTitle=sanitizeText$3(t)},getDiagramTitle=function(){return diagramTitle};let mainBranchName=getConfig$1().gitGraph.mainBranchName,mainBranchOrder=getConfig$1().gitGraph.mainBranchOrder,commits={},head=null,branchesConfig={};branchesConfig[mainBranchName]={name:mainBranchName,order:mainBranchOrder};let branches={};branches[mainBranchName]=head;let curBranch=mainBranchName,direction$3="LR",seq=0;function getId(){return random({length:7})}const parseDirective$b=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)};function uniqBy(t,e){const r=Object.create(null);return t.reduce((n,a)=>{const s=e(a);return r[s]||(r[s]=!0,n.push(a)),n},[])}const setDirection$3=function(t){direction$3=t};let options={};const setOptions=function(t){log$1.debug("options str",t),t=t&&t.trim(),t=t||"{}";try{options=JSON.parse(t)}catch(e){log$1.error("error while parsing gitGraph options",e.message)}},getOptions=function(){return options},commit=function(t,e,r,n){log$1.debug("Entering commit:",t,e,r,n),e=common$1.sanitizeText(e,getConfig$1()),t=common$1.sanitizeText(t,getConfig$1()),n=common$1.sanitizeText(n,getConfig$1());const a={id:e||seq+"-"+getId(),message:t,seq:seq++,type:r||commitType$1.NORMAL,tag:n||"",parents:head==null?[]:[head.id],branch:curBranch};head=a,commits[a.id]=a,branches[curBranch]=a.id,log$1.debug("in pushCommit "+a.id)},branch=function(t,e){if(t=common$1.sanitizeText(t,getConfig$1()),branches[t]===void 0)branches[t]=head!=null?head.id:null,branchesConfig[t]={name:t,order:e?parseInt(e,10):null},checkout(t),log$1.debug("in createBranch");else{let r=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 r.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+'"']},r}},merge=function(t,e,r,n){t=common$1.sanitizeText(t,getConfig$1()),e=common$1.sanitizeText(e,getConfig$1());const a=commits[branches[curBranch]],s=commits[branches[t]];if(curBranch===t){let l=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw l.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"]},l}else if(a===void 0||!a){let l=new Error('Incorrect usage of "merge". Current branch ('+curBranch+")has no commits");throw l.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["commit"]},l}else if(branches[t]===void 0){let l=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw l.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]},l}else if(s===void 0||!s){let l=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw l.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"commit"']},l}else if(a===s){let l=new Error('Incorrect usage of "merge". Both branches have same head');throw l.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"]},l}else if(e&&commits[e]!==void 0){let l=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom Id");throw l.hash={text:"merge "+t+e+r+n,token:"merge "+t+e+r+n,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["merge "+t+" "+e+"_UNIQUE "+r+" "+n]},l}const o={id:e||seq+"-"+getId(),message:"merged branch "+t+" into "+curBranch,seq:seq++,parents:[head==null?null:head.id,branches[t]],branch:curBranch,type:commitType$1.MERGE,customType:r,customId:!!e,tag:n||""};head=o,commits[o.id]=o,branches[curBranch]=o.id,log$1.debug(branches),log$1.debug("in mergeBranch")},cherryPick=function(t,e,r){if(log$1.debug("Entering cherryPick:",t,e,r),t=common$1.sanitizeText(t,getConfig$1()),e=common$1.sanitizeText(e,getConfig$1()),r=common$1.sanitizeText(r,getConfig$1()),!t||commits[t]===void 0){let s=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw s.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"]},s}let n=commits[t],a=n.branch;if(n.type===commitType$1.MERGE){let s=new Error('Incorrect usage of "cherryPick". Source commit should not be a merge commit');throw s.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"]},s}if(!e||commits[e]===void 0){if(a===curBranch){let l=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw l.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"]},l}const s=commits[branches[curBranch]];if(s===void 0||!s){let l=new Error('Incorrect usage of "cherry-pick". Current branch ('+curBranch+")has no commits");throw l.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"]},l}const o={id:seq+"-"+getId(),message:"cherry-picked "+n+" into "+curBranch,seq:seq++,parents:[head==null?null:head.id,n.id],branch:curBranch,type:commitType$1.CHERRY_PICK,tag:r??"cherry-pick:"+n.id};head=o,commits[o.id]=o,branches[curBranch]=o.id,log$1.debug(branches),log$1.debug("in cherryPick")}},checkout=function(t){if(t=common$1.sanitizeText(t,getConfig$1()),branches[t]===void 0){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}else{curBranch=t;const e=branches[curBranch];head=commits[e]}};function upsert(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}function prettyPrintCommitHistory(t){const e=t.reduce((a,s)=>a.seq>s.seq?a:s,t[0]);let r="";t.forEach(function(a){a===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(let a in branches)branches[a]===e.id&&n.push(a);if(log$1.debug(n.join(" ")),e.parents&&e.parents.length==2){const a=commits[e.parents[0]];upsert(t,e,a),t.push(commits[e.parents[1]])}else{if(e.parents.length==0)return;{const a=commits[e.parents];upsert(t,e,a)}}t=uniqBy(t,a=>a.id),prettyPrintCommitHistory(t)}const prettyPrint=function(){log$1.debug(commits);const t=getCommitsArray()[0];prettyPrintCommitHistory([t])},clear$f=function(){commits={},head=null;let t=getConfig$1().gitGraph.mainBranchName,e=getConfig$1().gitGraph.mainBranchOrder;branches={},branches[t]=null,branchesConfig={},branchesConfig[t]={name:t,order:e},curBranch=t,seq=0,clear$g()},getBranchesAsObjArray=function(){return Object.values(branchesConfig).map((e,r)=>e.order!==null?e:{...e,order:parseFloat(`0.${r}`,10)}).sort((e,r)=>e.order-r.order).map(({name:e})=>({name:e}))},getBranches=function(){return branches},getCommits=function(){return commits},getCommitsArray=function(){const t=Object.keys(commits).map(function(e){return commits[e]});return t.forEach(function(e){log$1.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},getCurrentBranch=function(){return curBranch},getDirection$3=function(){return direction$3},getHead=function(){return head},commitType$1={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},gitGraphDb={parseDirective:parseDirective$b,getConfig:()=>getConfig$1().gitGraph,setDirection:setDirection$3,setOptions,getOptions,commit,branch,merge,cherryPick,checkout,prettyPrint,clear:clear$f,getBranchesAsObjArray,getBranches,getCommits,getCommitsArray,getCurrentBranch,getDirection:getDirection$3,getHead,setAccTitle,getAccTitle,getAccDescription,setAccDescription,setDiagramTitle,getDiagramTitle,commitType:commitType$1};let allCommitsDict={};const commitType={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},THEME_COLOR_LIMIT=8;let branchPos={},commitPos={},lanes=[],maxPos=0;const clear$e=()=>{branchPos={},commitPos={},allCommitsDict={},maxPos=0,lanes=[]},drawText$2=t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");let r=[];typeof t=="string"?r=t.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(t)?r=t:r=[];for(const n of r){const a=document.createElementNS("http://www.w3.org/2000/svg","tspan");a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),a.setAttribute("dy","1em"),a.setAttribute("x","0"),a.setAttribute("class","row"),a.textContent=n.trim(),e.appendChild(a)}return e},drawCommits=(t,e,r)=>{const n=getConfig().gitGraph,a=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels");let o=0;Object.keys(e).sort((h,d)=>e[h].seq-e[d].seq).forEach(h=>{const d=e[h],p=branchPos[d.branch].pos,g=o+10;if(r){let m,T=d.customType!==void 0&&d.customType!==""?d.customType:d.type;switch(T){case commitType.NORMAL:m="commit-normal";break;case commitType.REVERSE:m="commit-reverse";break;case commitType.HIGHLIGHT:m="commit-highlight";break;case commitType.MERGE:m="commit-merge";break;case commitType.CHERRY_PICK:m="commit-cherry-pick";break;default:m="commit-normal"}if(T===commitType.HIGHLIGHT){const I=a.append("rect");I.attr("x",g-10),I.attr("y",p-10),I.attr("height",20),I.attr("width",20),I.attr("class",`commit ${d.id} commit-highlight${branchPos[d.branch].index%THEME_COLOR_LIMIT} ${m}-outer`),a.append("rect").attr("x",g-6).attr("y",p-6).attr("height",12).attr("width",12).attr("class",`commit ${d.id} commit${branchPos[d.branch].index%THEME_COLOR_LIMIT} ${m}-inner`)}else if(T===commitType.CHERRY_PICK)a.append("circle").attr("cx",g).attr("cy",p).attr("r",10).attr("class",`commit ${d.id} ${m}`),a.append("circle").attr("cx",g-3).attr("cy",p+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${d.id} ${m}`),a.append("circle").attr("cx",g+3).attr("cy",p+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${d.id} ${m}`),a.append("line").attr("x1",g+3).attr("y1",p+1).attr("x2",g).attr("y2",p-5).attr("stroke","#fff").attr("class",`commit ${d.id} ${m}`),a.append("line").attr("x1",g-3).attr("y1",p+1).attr("x2",g).attr("y2",p-5).attr("stroke","#fff").attr("class",`commit ${d.id} ${m}`);else{const I=a.append("circle");if(I.attr("cx",g),I.attr("cy",p),I.attr("r",d.type===commitType.MERGE?9:10),I.attr("class",`commit ${d.id} commit${branchPos[d.branch].index%THEME_COLOR_LIMIT}`),T===commitType.MERGE){const A=a.append("circle");A.attr("cx",g),A.attr("cy",p),A.attr("r",6),A.attr("class",`commit ${m} ${d.id} commit${branchPos[d.branch].index%THEME_COLOR_LIMIT}`)}T===commitType.REVERSE&&a.append("path").attr("d",`M ${g-5},${p-5}L${g+5},${p+5}M${g-5},${p+5}L${g+5},${p-5}`).attr("class",`commit ${m} ${d.id} commit${branchPos[d.branch].index%THEME_COLOR_LIMIT}`)}}if(commitPos[d.id]={x:o+10,y:p},r){if(d.type!==commitType.CHERRY_PICK&&(d.customId&&d.type===commitType.MERGE||d.type!==commitType.MERGE)&&n.showCommitLabel){const I=s.append("g"),A=I.insert("rect").attr("class","commit-label-bkg"),C=I.append("text").attr("x",o).attr("y",p+25).attr("class","commit-label").text(d.id);let L=C.node().getBBox();if(A.attr("x",o+10-L.width/2-2).attr("y",p+13.5).attr("width",L.width+2*2).attr("height",L.height+2*2),C.attr("x",o+10-L.width/2),n.rotateCommitLabel){let M=-7.5-(L.width+10)/25*9.5,F=10+L.width/25*8.5;I.attr("transform","translate("+M+", "+F+") rotate("+-45+", "+o+", "+p+")")}}if(d.tag){const I=s.insert("polygon"),A=s.append("circle"),C=s.append("text").attr("y",p-16).attr("class","tag-label").text(d.tag);let L=C.node().getBBox();C.attr("x",o+10-L.width/2);const M=L.height/2,F=p-19.2;I.attr("class","tag-label-bkg").attr("points",`
${o-L.width/2-4/2},${F+2}
${o-L.width/2-4/2},${F-2}
${o+10-L.width/2-4},${F-M-2}
${o+10+L.width/2+4},${F-M-2}
${o+10+L.width/2+4},${F+M+2}
${o+10-L.width/2-4},${F+M+2}`),A.attr("cx",o-L.width/2+4/2).attr("cy",F).attr("r",1.5).attr("class","tag-hole")}}o+=50,o>maxPos&&(maxPos=o)})},hasOverlappingCommits=(t,e,r)=>Object.keys(r).filter(s=>r[s].branch===e.branch&&r[s].seq>t.seq&&r[s].seq<e.seq).length>0,findLane=(t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(lanes.every(o=>Math.abs(o-n)>=10))return lanes.push(n),n;const s=Math.abs(t-e);return findLane(t,e-s/5,r+1)},drawArrow=(t,e,r,n)=>{const a=commitPos[e.id],s=commitPos[r.id],o=hasOverlappingCommits(e,r,n);let l="",u="",h=0,d=0,p=branchPos[r.branch].index,g;if(o){l="A 10 10, 0, 0, 0,",u="A 10 10, 0, 0, 1,",h=10,d=10,p=branchPos[r.branch].index;const m=a.y<s.y?findLane(a.y,s.y):findLane(s.y,a.y);a.y<s.y?g=`M ${a.x} ${a.y} L ${a.x} ${m-h} ${l} ${a.x+d} ${m} L ${s.x-h} ${m} ${u} ${s.x} ${m+d} L ${s.x} ${s.y}`:g=`M ${a.x} ${a.y} L ${a.x} ${m+h} ${u} ${a.x+d} ${m} L ${s.x-h} ${m} ${l} ${s.x} ${m-d} L ${s.x} ${s.y}`}else a.y<s.y&&(l="A 20 20, 0, 0, 0,",h=20,d=20,p=branchPos[r.branch].index,g=`M ${a.x} ${a.y} L ${a.x} ${s.y-h} ${l} ${a.x+d} ${s.y} L ${s.x} ${s.y}`),a.y>s.y&&(l="A 20 20, 0, 0, 0,",h=20,d=20,p=branchPos[e.branch].index,g=`M ${a.x} ${a.y} L ${s.x-h} ${a.y} ${l} ${s.x} ${a.y-d} L ${s.x} ${s.y}`),a.y===s.y&&(p=branchPos[e.branch].index,g=`M ${a.x} ${a.y} L ${a.x} ${s.y-h} ${l} ${a.x+d} ${s.y} L ${s.x} ${s.y}`);t.append("path").attr("d",g).attr("class","arrow arrow"+p%THEME_COLOR_LIMIT)},drawArrows=(t,e)=>{const r=t.append("g").attr("class","commit-arrows");Object.keys(e).forEach(n=>{const a=e[n];a.parents&&a.parents.length>0&&a.parents.forEach(s=>{drawArrow(r,e[s],a,e)})})},drawBranches=(t,e)=>{const r=getConfig().gitGraph,n=t.append("g");e.forEach((a,s)=>{const o=s%THEME_COLOR_LIMIT,l=branchPos[a.name].pos,u=n.append("line");u.attr("x1",0),u.attr("y1",l),u.attr("x2",maxPos),u.attr("y2",l),u.attr("class","branch branch"+o),lanes.push(l);let h=a.name;const d=drawText$2(h),p=n.insert("rect"),m=n.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+o);m.node().appendChild(d);let T=d.getBBox();p.attr("class","branchLabelBkg label"+o).attr("rx",4).attr("ry",4).attr("x",-T.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-T.height/2+8).attr("width",T.width+18).attr("height",T.height+4),m.attr("transform","translate("+(-T.width-14-(r.rotateCommitLabel===!0?30:0))+", "+(l-T.height/2-1)+")"),p.attr("transform","translate("+-19+", "+(l-T.height/2)+")")})},draw$f=function(t,e,r,n){var a;clear$e();const s=getConfig(),o=s.gitGraph;log$1.debug("in gitgraph renderer",t+`
`,"id:",e,r),allCommitsDict=n.db.getCommits();const l=n.db.getBranchesAsObjArray();let u=0;l.forEach((d,p)=>{branchPos[d.name]={pos:u,index:p},u+=50+(o.rotateCommitLabel?40:0)});const h=select(`[id="${e}"]`);drawCommits(h,allCommitsDict,!1),o.showBranches&&drawBranches(h,l),drawArrows(h,allCommitsDict),drawCommits(h,allCommitsDict,!0),utils.insertTitle(h,"gitTitleText",o.titleTopMargin,n.db.getDiagramTitle()),setupGraphViewbox(void 0,h,o.diagramPadding,(a=o.useMaxWidth)!=null?a:s.useMaxWidth)},gitGraphRenderer={draw:draw$f},getStyles=t=>`
.commit-id,
.commit-msg,
.branch-label {
fill: lightgrey;
color: lightgrey;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
}
${[0,1,2,3,4,5,6,7].map(e=>`
.branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }
.commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }
.commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }
.label${e} { fill: ${t["git"+e]}; }
.arrow${e} { stroke: ${t["git"+e]}; }
`).join(`
`)}
.branch {
stroke-width: 1;
stroke: ${t.lineColor};
stroke-dasharray: 2;
}
.commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
.commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
.tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
.tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
.tag-hole { fill: ${t.textColor}; }
.commit-merge {
stroke: ${t.primaryColor};
fill: ${t.primaryColor};
}
.commit-reverse {
stroke: ${t.primaryColor};
fill: ${t.primaryColor};
stroke-width: 3;
}
.commit-highlight-outer {
}
.commit-highlight-inner {
stroke: ${t.primaryColor};
fill: ${t.primaryColor};
}
.arrow { stroke-width: 8; stroke-linecap: round; fill: none}
.gitTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
}
`,gitGraphStyles=getStyles;var parser$a=function(){var t=function(Mt,wt,mt,It){for(mt=mt||{},It=Mt.length;It--;mt[Mt[It]]=wt);return mt},e=[1,6],r=[1,7],n=[1,8],a=[1,9],s=[1,16],o=[1,11],l=[1,12],u=[1,13],h=[1,14],d=[1,15],p=[1,27],g=[1,33],m=[1,34],T=[1,35],I=[1,36],A=[1,37],C=[1,72],L=[1,73],M=[1,74],F=[1,75],H=[1,76],q=[1,77],U=[1,78],z=[1,38],R=[1,39],$=[1,40],D=[1,41],k=[1,42],B=[1,43],v=[1,44],J=[1,45],E=[1,46],ft=[1,47],Lt=[1,48],Tt=[1,49],Q=[1,50],ut=[1,51],st=[1,52],ot=[1,53],dt=[1,54],xt=[1,55],et=[1,56],Nt=[1,57],G=[1,59],Z=[1,60],tt=[1,61],W=[1,62],Y=[1,63],P=[1,64],it=[1,65],N=[1,66],gt=[1,67],j=[1,68],Ft=[1,69],at=[24,52],Dt=[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],kt=[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],_t=[1,94],St=[1,95],Et=[1,96],yt=[1,97],ct=[15,24,52],ne=[7,8,9,10,18,22,25,26,27,28],jt=[15,24,43,52],Wt=[15,24,43,52,86,87,89,90],qt=[15,43],Ht=[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],ge={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(wt,mt,It,vt,Ut,ht,Jt){var pt=ht.length-1;switch(Ut){case 4:vt.setDirection("TB");break;case 5:vt.setDirection("BT");break;case 6:vt.setDirection("RL");break;case 7:vt.setDirection("LR");break;case 11:vt.parseDirective("%%{","open_directive");break;case 12:break;case 13:ht[pt]=ht[pt].trim().replace(/'/g,'"'),vt.parseDirective(ht[pt],"arg_directive");break;case 14:vt.parseDirective("}%%","close_directive","c4Context");break;case 15:case 16:case 17:case 18:case 19:vt.setC4Type(ht[pt-3]);break;case 26:vt.setTitle(ht[pt].substring(6)),this.$=ht[pt].substring(6);break;case 27:vt.setAccDescription(ht[pt].substring(15)),this.$=ht[pt].substring(15);break;case 28:this.$=ht[pt].trim(),vt.setTitle(this.$);break;case 29:case 30:this.$=ht[pt].trim(),vt.setAccDescription(this.$);break;case 35:case 36:ht[pt].splice(2,0,"ENTERPRISE"),vt.addPersonOrSystemBoundary(...ht[pt]),this.$=ht[pt];break;case 37:vt.addPersonOrSystemBoundary(...ht[pt]),this.$=ht[pt];break;case 38:ht[pt].splice(2,0,"CONTAINER"),vt.addContainerBoundary(...ht[pt]),this.$=ht[pt];break;case 39:vt.addDeploymentNode("node",...ht[pt]),this.$=ht[pt];break;case 40:vt.addDeploymentNode("nodeL",...ht[pt]),this.$=ht[pt];break;case 41:vt.addDeploymentNode("nodeR",...ht[pt]),this.$=ht[pt];break;case 42:vt.popBoundaryParseStack();break;case 46:vt.addPersonOrSystem("person",...ht[pt]),this.$=ht[pt];break;case 47:vt.addPersonOrSystem("external_person",...ht[pt]),this.$=ht[pt];break;case 48:vt.addPersonOrSystem("system",...ht[pt]),this.$=ht[pt];break;case 49:vt.addPersonOrSystem("system_db",...ht[pt]),this.$=ht[pt];break;case 50:vt.addPersonOrSystem("system_queue",...ht[pt]),this.$=ht[pt];break;case 51:vt.addPersonOrSystem("external_system",...ht[pt]),this.$=ht[pt];break;case 52:vt.addPersonOrSystem("external_system_db",...ht[pt]),this.$=ht[pt];break;case 53:vt.addPersonOrSystem("external_system_queue",...ht[pt]),this.$=ht[pt];break;case 54:vt.addContainer("container",...ht[pt]),this.$=ht[pt];break;case 55:vt.addContainer("container_db",...ht[pt]),this.$=ht[pt];break;case 56:vt.addContainer("container_queue",...ht[pt]),this.$=ht[pt];break;case 57:vt.addContainer("external_container",...ht[pt]),this.$=ht[pt];break;case 58:vt.addContainer("external_container_db",...ht[pt]),this.$=ht[pt];break;case 59:vt.addContainer("external_container_queue",...ht[pt]),this.$=ht[pt];break;case 60:vt.addComponent("component",...ht[pt]),this.$=ht[pt];break;case 61:vt.addComponent("component_db",...ht[pt]),this.$=ht[pt];break;case 62:vt.addComponent("component_queue",...ht[pt]),this.$=ht[pt];break;case 63:vt.addComponent("external_component",...ht[pt]),this.$=ht[pt];break;case 64:vt.addComponent("external_component_db",...ht[pt]),this.$=ht[pt];break;case 65:vt.addComponent("external_component_queue",...ht[pt]),this.$=ht[pt];break;case 67:vt.addRel("rel",...ht[pt]),this.$=ht[pt];break;case 68:vt.addRel("birel",...ht[pt]),this.$=ht[pt];break;case 69:vt.addRel("rel_u",...ht[pt]),this.$=ht[pt];break;case 70:vt.addRel("rel_d",...ht[pt]),this.$=ht[pt];break;case 71:vt.addRel("rel_l",...ht[pt]),this.$=ht[pt];break;case 72:vt.addRel("rel_r",...ht[pt]),this.$=ht[pt];break;case 73:vt.addRel("rel_b",...ht[pt]),this.$=ht[pt];break;case 74:ht[pt].splice(0,1),vt.addRel("rel",...ht[pt]),this.$=ht[pt];break;case 75:vt.updateElStyle("update_el_style",...ht[pt]),this.$=ht[pt];break;case 76:vt.updateRelStyle("update_rel_style",...ht[pt]),this.$=ht[pt];break;case 77:vt.updateLayoutConfig("update_layout_config",...ht[pt]),this.$=ht[pt];break;case 78:this.$=[ht[pt]];break;case 79:ht[pt].unshift(ht[pt-1]),this.$=ht[pt];break;case 80:case 82:this.$=ht[pt].trim();break;case 81:let Kt={};Kt[ht[pt-1].trim()]=ht[pt].trim(),this.$=Kt;break;case 83:this.$="";break}},table:[{3:1,4:2,5:3,6:4,7:e,8:r,9:n,10:a,11:5,12:10,18:s,22:o,25:l,26:u,27:h,28:d},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:e,8:r,9:n,10:a,11:5,12:10,18:s,22:o,25:l,26:u,27:h,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},t([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:g,33:m,34:T,36:I,38:A,39:58,40:70,42:71,44:C,46:L,47:M,48:F,49:H,50:q,51:U,53:32,54:z,55:R,56:$,57:D,58:k,59:B,60:v,61:J,62:E,63:ft,64:Lt,65:Tt,66:Q,67:ut,68:st,69:ot,70:dt,71:xt,72:et,73:Nt,74:G,75:Z,76:tt,77:W,78:Y,79:P,80:it,81:N,82:gt,83:j,84:Ft},{23:79,29:29,30:30,31:31,32:g,33:m,34:T,36:I,38:A,39:58,40:70,42:71,44:C,46:L,47:M,48:F,49:H,50:q,51:U,53:32,54:z,55:R,56:$,57:D,58:k,59:B,60:v,61:J,62:E,63:ft,64:Lt,65:Tt,66:Q,67:ut,68:st,69:ot,70:dt,71:xt,72:et,73:Nt,74:G,75:Z,76:tt,77:W,78:Y,79:P,80:it,81:N,82:gt,83:j,84:Ft},{23:80,29:29,30:30,31:31,32:g,33:m,34:T,36:I,38:A,39:58,40:70,42:71,44:C,46:L,47:M,48:F,49:H,50:q,51:U,53:32,54:z,55:R,56:$,57:D,58:k,59:B,60:v,61:J,62:E,63:ft,64:Lt,65:Tt,66:Q,67:ut,68:st,69:ot,70:dt,71:xt,72:et,73:Nt,74:G,75:Z,76:tt,77:W,78:Y,79:P,80:it,81:N,82:gt,83:j,84:Ft},{23:81,29:29,30:30,31:31,32:g,33:m,34:T,36:I,38:A,39:58,40:70,42:71,44:C,46:L,47:M,48:F,49:H,50:q,51:U,53:32,54:z,55:R,56:$,57:D,58:k,59:B,60:v,61:J,62:E,63:ft,64:Lt,65:Tt,66:Q,67:ut,68:st,69:ot,70:dt,71:xt,72:et,73:Nt,74:G,75:Z,76:tt,77:W,78:Y,79:P,80:it,81:N,82:gt,83:j,84:Ft},{23:82,29:29,30:30,31:31,32:g,33:m,34:T,36:I,38:A,39:58,40:70,42:71,44:C,46:L,47:M,48:F,49:H,50:q,51:U,53:32,54:z,55:R,56:$,57:D,58:k,59:B,60:v,61:J,62:E,63:ft,64:Lt,65:Tt,66:Q,67:ut,68:st,69:ot,70:dt,71:xt,72:et,73:Nt,74:G,75:Z,76:tt,77:W,78:Y,79:P,80:it,81:N,82:gt,83:j,84:Ft},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},t(at,[2,20],{53:32,39:58,40:70,42:71,30:87,44:C,46:L,47:M,48:F,49:H,50:q,51:U,54:z,55:R,56:$,57:D,58:k,59:B,60:v,61:J,62:E,63:ft,64:Lt,65:Tt,66:Q,67:ut,68:st,69:ot,70:dt,71:xt,72:et,73:Nt,74:G,75:Z,76:tt,77:W,78:Y,79:P,80:it,81:N,82:gt,83:j,84:Ft}),t(at,[2,21]),t(Dt,[2,23],{15:[1,88]}),t(at,[2,43],{15:[1,89]}),t(kt,[2,26]),t(kt,[2,27]),{35:[1,90]},{37:[1,91]},t(kt,[2,30]),{45:92,85:93,86:_t,87:St,89:Et,90:yt},{45:98,85:93,86:_t,87:St,89:Et,90:yt},{45:99,85:93,86:_t,87:St,89:Et,90:yt},{45:100,85:93,86:_t,87:St,89:Et,90:yt},{45:101,85:93,86:_t,87:St,89:Et,90:yt},{45:102,85:93,86:_t,87:St,89:Et,90:yt},{45:103,85:93,86:_t,87:St,89:Et,90:yt},{45:104,85:93,86:_t,87:St,89:Et,90:yt},{45:105,85:93,86:_t,87:St,89:Et,90:yt},{45:106,85:93,86:_t,87:St,89:Et,90:yt},{45:107,85:93,86:_t,87:St,89:Et,90:yt},{45:108,85:93,86:_t,87:St,89:Et,90:yt},{45:109,85:93,86:_t,87:St,89:Et,90:yt},{45:110,85:93,86:_t,87:St,89:Et,90:yt},{45:111,85:93,86:_t,87:St,89:Et,90:yt},{45:112,85:93,86:_t,87:St,89:Et,90:yt},{45:113,85:93,86:_t,87:St,89:Et,90:yt},{45:114,85:93,86:_t,87:St,89:Et,90:yt},{45:115,85:93,86:_t,87:St,89:Et,90:yt},{45:116,85:93,86:_t,87:St,89:Et,90:yt},t(ct,[2,66]),{45:117,85:93,86:_t,87:St,89:Et,90:yt},{45:118,85:93,86:_t,87:St,89:Et,90:yt},{45:119,85:93,86:_t,87:St,89:Et,90:yt},{45:120,85:93,86:_t,87:St,89:Et,90:yt},{45:121,85:93,86:_t,87:St,89:Et,90:yt},{45:122,85:93,86:_t,87:St,89:Et,90:yt},{45:123,85:93,86:_t,87:St,89:Et,90:yt},{45:124,85:93,86:_t,87:St,89:Et,90:yt},{45:125,85:93,86:_t,87:St,89:Et,90:yt},{45:126,85:93,86:_t,87:St,89:Et,90:yt},{45:127,85:93,86:_t,87:St,89:Et,90:yt},{30:128,39:58,40:70,42:71,44:C,46:L,47:M,48:F,49:H,50:q,51:U,53:32,54:z,55:R,56:$,57:D,58:k,59:B,60:v,61:J,62:E,63:ft,64:Lt,65:Tt,66:Q,67:ut,68:st,69:ot,70:dt,71:xt,72:et,73:Nt,74:G,75:Z,76:tt,77:W,78:Y,79:P,80:it,81:N,82:gt,83:j,84:Ft},{15:[1,130],43:[1,129]},{45:131,85:93,86:_t,87:St,89:Et,90:yt},{45:132,85:93,86:_t,87:St,89:Et,90:yt},{45:133,85:93,86:_t,87:St,89:Et,90:yt},{45:134,85:93,86:_t,87:St,89:Et,90:yt},{45:135,85:93,86:_t,87:St,89:Et,90:yt},{45:136,85:93,86:_t,87:St,89:Et,90:yt},{45:137,85:93,86:_t,87:St,89:Et,90:yt},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},t(ne,[2,9]),{14:142,21:p},{21:[2,13]},{1:[2,15]},t(at,[2,22]),t(Dt,[2,24],{31:31,29:143,32:g,33:m,34:T,36:I,38:A}),t(at,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:g,33:m,34:T,36:I,38:A,44:C,46:L,47:M,48:F,49:H,50:q,51:U,54:z,55:R,56:$,57:D,58:k,59:B,60:v,61:J,62:E,63:ft,64:Lt,65:Tt,66:Q,67:ut,68:st,69:ot,70:dt,71:xt,72:et,73:Nt,74:G,75:Z,76:tt,77:W,78:Y,79:P,80:it,81:N,82:gt,83:j,84:Ft}),t(kt,[2,28]),t(kt,[2,29]),t(ct,[2,46]),t(jt,[2,78],{85:93,45:145,86:_t,87:St,89:Et,90:yt}),t(Wt,[2,80]),{88:[1,146]},t(Wt,[2,82]),t(Wt,[2,83]),t(ct,[2,47]),t(ct,[2,48]),t(ct,[2,49]),t(ct,[2,50]),t(ct,[2,51]),t(ct,[2,52]),t(ct,[2,53]),t(ct,[2,54]),t(ct,[2,55]),t(ct,[2,56]),t(ct,[2,57]),t(ct,[2,58]),t(ct,[2,59]),t(ct,[2,60]),t(ct,[2,61]),t(ct,[2,62]),t(ct,[2,63]),t(ct,[2,64]),t(ct,[2,65]),t(ct,[2,67]),t(ct,[2,68]),t(ct,[2,69]),t(ct,[2,70]),t(ct,[2,71]),t(ct,[2,72]),t(ct,[2,73]),t(ct,[2,74]),t(ct,[2,75]),t(ct,[2,76]),t(ct,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},t(qt,[2,35]),t(qt,[2,36]),t(qt,[2,37]),t(qt,[2,38]),t(qt,[2,39]),t(qt,[2,40]),t(qt,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},t(Dt,[2,25]),t(at,[2,45]),t(jt,[2,79]),t(Wt,[2,81]),t(ct,[2,31]),t(ct,[2,42]),t(Ht,[2,32]),t(Ht,[2,33],{15:[1,152]}),t(ne,[2,10]),t(Ht,[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(wt,mt){if(mt.recoverable)this.trace(wt);else{var It=new Error(wt);throw It.hash=mt,It}},parse:function(wt){var mt=this,It=[0],vt=[],Ut=[null],ht=[],Jt=this.table,pt="",Kt=0,oe=0,ue=2,he=1,fe=ht.slice.call(arguments,1),Gt=Object.create(this.lexer),te={yy:{}};for(var ce in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ce)&&(te.yy[ce]=this.yy[ce]);Gt.setInput(wt,te.yy),te.yy.lexer=Gt,te.yy.parser=this,typeof Gt.yylloc>"u"&&(Gt.yylloc={});var Zt=Gt.yylloc;ht.push(Zt);var Ue=Gt.options&&Gt.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Be(){var rt;return rt=vt.pop()||Gt.lex()||he,typeof rt!="number"&&(rt instanceof Array&&(vt=rt,rt=vt.pop()),rt=mt.symbols_[rt]||rt),rt}for(var _e,ee,Te,we,Ee={},ke,xe,Le,Ie;;){if(ee=It[It.length-1],this.defaultActions[ee]?Te=this.defaultActions[ee]:((_e===null||typeof _e>"u")&&(_e=Be()),Te=Jt[ee]&&Jt[ee][_e]),typeof Te>"u"||!Te.length||!Te[0]){var Yt="";Ie=[];for(ke in Jt[ee])this.terminals_[ke]&&ke>ue&&Ie.push("'"+this.terminals_[ke]+"'");Gt.showPosition?Yt="Parse error on line "+(Kt+1)+`:
`+Gt.showPosition()+`
Expecting `+Ie.join(", ")+", got '"+(this.terminals_[_e]||_e)+"'":Yt="Parse error on line "+(Kt+1)+": Unexpected "+(_e==he?"end of input":"'"+(this.terminals_[_e]||_e)+"'"),this.parseError(Yt,{text:Gt.match,token:this.terminals_[_e]||_e,line:Gt.yylineno,loc:Zt,expected:Ie})}if(Te[0]instanceof Array&&Te.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ee+", token: "+_e);switch(Te[0]){case 1:It.push(_e),Ut.push(Gt.yytext),ht.push(Gt.yylloc),It.push(Te[1]),_e=null,oe=Gt.yyleng,pt=Gt.yytext,Kt=Gt.yylineno,Zt=Gt.yylloc;break;case 2:if(xe=this.productions_[Te[1]][1],Ee.$=Ut[Ut.length-xe],Ee._$={first_line:ht[ht.length-(xe||1)].first_line,last_line:ht[ht.length-1].last_line,first_column:ht[ht.length-(xe||1)].first_column,last_column:ht[ht.length-1].last_column},Ue&&(Ee._$.range=[ht[ht.length-(xe||1)].range[0],ht[ht.length-1].range[1]]),we=this.performAction.apply(Ee,[pt,oe,Kt,te.yy,Te[1],Ut,ht].concat(fe)),typeof we<"u")return we;xe&&(It=It.slice(0,-1*xe*2),Ut=Ut.slice(0,-1*xe),ht=ht.slice(0,-1*xe)),It.push(this.productions_[Te[1]][0]),Ut.push(Ee.$),ht.push(Ee._$),Le=Jt[It[It.length-2]][It[It.length-1]],It.push(Le);break;case 3:return!0}}return!0}},zt=function(){var Mt={EOF:1,parseError:function(mt,It){if(this.yy.parser)this.yy.parser.parseError(mt,It);else throw new Error(mt)},setInput:function(wt,mt){return this.yy=mt||this.yy||{},this._input=wt,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 wt=this._input[0];this.yytext+=wt,this.yyleng++,this.offset++,this.match+=wt,this.matched+=wt;var mt=wt.match(/(?:\r\n?|\n).*/g);return mt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),wt},unput:function(wt){var mt=wt.length,It=wt.split(/(?:\r\n?|\n)/g);this._input=wt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-mt),this.offset-=mt;var vt=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),It.length-1&&(this.yylineno-=It.length-1);var Ut=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:It?(It.length===vt.length?this.yylloc.first_column:0)+vt[vt.length-It.length].length-It[0].length:this.yylloc.first_column-mt},this.options.ranges&&(this.yylloc.range=[Ut[0],Ut[0]+this.yyleng-mt]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(wt){this.unput(this.match.slice(wt))},pastInput:function(){var wt=this.matched.substr(0,this.matched.length-this.match.length);return(wt.length>20?"...":"")+wt.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var wt=this.match;return wt.length<20&&(wt+=this._input.substr(0,20-wt.length)),(wt.substr(0,20)+(wt.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var wt=this.pastInput(),mt=new Array(wt.length+1).join("-");return wt+this.upcomingInput()+`
`+mt+"^"},test_match:function(wt,mt){var It,vt,Ut;if(this.options.backtrack_lexer&&(Ut={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&&(Ut.yylloc.range=this.yylloc.range.slice(0))),vt=wt[0].match(/(?:\r\n?|\n).*/g),vt&&(this.yylineno+=vt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:vt?vt[vt.length-1].length-vt[vt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+wt[0].length},this.yytext+=wt[0],this.match+=wt[0],this.matches=wt,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(wt[0].length),this.matched+=wt[0],It=this.performAction.call(this,this.yy,this,mt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),It)return It;if(this._backtrack){for(var ht in Ut)this[ht]=Ut[ht];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var wt,mt,It,vt;this._more||(this.yytext="",this.match="");for(var Ut=this._currentRules(),ht=0;ht<Ut.length;ht++)if(It=this._input.match(this.rules[Ut[ht]]),It&&(!mt||It[0].length>mt[0].length)){if(mt=It,vt=ht,this.options.backtrack_lexer){if(wt=this.test_match(It,Ut[ht]),wt!==!1)return wt;if(this._backtrack){mt=!1;continue}else return!1}else if(!this.options.flex)break}return mt?(wt=this.test_match(mt,Ut[vt]),wt!==!1?wt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var mt=this.next();return mt||this.lex()},begin:function(mt){this.conditionStack.push(mt)},popState:function(){var mt=this.conditionStack.length-1;return mt>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(mt){return mt=this.conditionStack.length-1-Math.abs(mt||0),mt>=0?this.conditionStack[mt]:"INITIAL"},pushState:function(mt){this.begin(mt)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(mt,It,vt,Ut){switch(vt){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:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:break;case 19:c;break;case 20:return 15;case 21:break;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:return this.begin("node"),49;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:return this.begin("rel_u"),76;case 58:return this.begin("rel_u"),76;case 59:return this.begin("rel_d"),77;case 60:return this.begin("rel_d"),77;case 61:return this.begin("rel_l"),78;case 62:return this.begin("rel_l"),78;case 63:return this.begin("rel_r"),79;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:this.popState(),this.popState();break;case 74:return 90;case 75:break;case 76:return 90;case 77:this.begin("string");break;case 78:this.popState();break;case 79: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 84:this.popState(),this.popState();break;case 85:return"STR";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}}};return Mt}();ge.lexer=zt;function Pt(){this.yy={}}return Pt.prototype=ge,ge.Parser=Pt,new Pt}();parser$a.parser=parser$a;const c4Parser=parser$a,c4Detector=t=>t.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/)!==null;let c4ShapeArray=[],boundaryParseStack=[""],currentBoundaryParse="global",parentBoundaryParse="",boundarys=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],rels=[],title="",wrapEnabled$1=!1,c4ShapeInRow$1=4,c4BoundaryInRow$1=2;var c4Type;const getC4Type=function(){return c4Type},setC4Type=function(t){c4Type=sanitizeText$5(t,getConfig$1())},parseDirective$a=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},addRel=function(t,e,r,n,a,s,o,l,u){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let h={};const d=rels.find(p=>p.from===e&&p.to===r);if(d?h=d:rels.push(h),h.type=t,h.from=e,h.to=r,h.label={text:n},a==null)h.techn={text:""};else if(typeof a=="object"){let[p,g]=Object.entries(a)[0];h[p]={text:g}}else h.techn={text:a};if(s==null)h.descr={text:""};else if(typeof s=="object"){let[p,g]=Object.entries(s)[0];h[p]={text:g}}else h.descr={text:s};if(typeof o=="object"){let[p,g]=Object.entries(o)[0];h[p]=g}else h.sprite=o;if(typeof l=="object"){let[p,g]=Object.entries(l)[0];h[p]=g}else h.tags=l;if(typeof u=="object"){let[p,g]=Object.entries(u)[0];h[p]=g}else h.link=u;h.wrap=autoWrap$1()},addPersonOrSystem=function(t,e,r,n,a,s,o){if(e===null||r===null)return;let l={};const u=c4ShapeArray.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,c4ShapeArray.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.descr={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.descr={text:n};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.typeC4Shape={text:t},l.parentBoundary=currentBoundaryParse,l.wrap=autoWrap$1()},addContainer=function(t,e,r,n,a,s,o,l){if(e===null||r===null)return;let u={};const h=c4ShapeArray.find(d=>d.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,c4ShapeArray.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[d,p]=Object.entries(n)[0];u[d]={text:p}}else u.techn={text:n};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,p]=Object.entries(a)[0];u[d]={text:p}}else u.descr={text:a};if(typeof s=="object"){let[d,p]=Object.entries(s)[0];u[d]=p}else u.sprite=s;if(typeof o=="object"){let[d,p]=Object.entries(o)[0];u[d]=p}else u.tags=o;if(typeof l=="object"){let[d,p]=Object.entries(l)[0];u[d]=p}else u.link=l;u.wrap=autoWrap$1(),u.typeC4Shape={text:t},u.parentBoundary=currentBoundaryParse},addComponent=function(t,e,r,n,a,s,o,l){if(e===null||r===null)return;let u={};const h=c4ShapeArray.find(d=>d.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,c4ShapeArray.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[d,p]=Object.entries(n)[0];u[d]={text:p}}else u.techn={text:n};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,p]=Object.entries(a)[0];u[d]={text:p}}else u.descr={text:a};if(typeof s=="object"){let[d,p]=Object.entries(s)[0];u[d]=p}else u.sprite=s;if(typeof o=="object"){let[d,p]=Object.entries(o)[0];u[d]=p}else u.tags=o;if(typeof l=="object"){let[d,p]=Object.entries(l)[0];u[d]=p}else u.link=l;u.wrap=autoWrap$1(),u.typeC4Shape={text:t},u.parentBoundary=currentBoundaryParse},addPersonOrSystemBoundary=function(t,e,r,n,a){if(t===null||e===null)return;let s={};const o=boundarys.find(l=>l.alias===t);if(o&&t===o.alias?s=o:(s.alias=t,boundarys.push(s)),e==null?s.label={text:""}:s.label={text:e},r==null)s.type={text:"system"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];s[l]={text:u}}else s.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];s[l]=u}else s.tags=n;if(typeof a=="object"){let[l,u]=Object.entries(a)[0];s[l]=u}else s.link=a;s.parentBoundary=currentBoundaryParse,s.wrap=autoWrap$1(),parentBoundaryParse=currentBoundaryParse,currentBoundaryParse=t,boundaryParseStack.push(parentBoundaryParse)},addContainerBoundary=function(t,e,r,n,a){if(t===null||e===null)return;let s={};const o=boundarys.find(l=>l.alias===t);if(o&&t===o.alias?s=o:(s.alias=t,boundarys.push(s)),e==null?s.label={text:""}:s.label={text:e},r==null)s.type={text:"container"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];s[l]={text:u}}else s.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];s[l]=u}else s.tags=n;if(typeof a=="object"){let[l,u]=Object.entries(a)[0];s[l]=u}else s.link=a;s.parentBoundary=currentBoundaryParse,s.wrap=autoWrap$1(),parentBoundaryParse=currentBoundaryParse,currentBoundaryParse=t,boundaryParseStack.push(parentBoundaryParse)},addDeploymentNode=function(t,e,r,n,a,s,o,l){if(e===null||r===null)return;let u={};const h=boundarys.find(d=>d.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,boundarys.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.type={text:"node"};else if(typeof n=="object"){let[d,p]=Object.entries(n)[0];u[d]={text:p}}else u.type={text:n};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,p]=Object.entries(a)[0];u[d]={text:p}}else u.descr={text:a};if(typeof o=="object"){let[d,p]=Object.entries(o)[0];u[d]=p}else u.tags=o;if(typeof l=="object"){let[d,p]=Object.entries(l)[0];u[d]=p}else u.link=l;u.nodeType=t,u.parentBoundary=currentBoundaryParse,u.wrap=autoWrap$1(),parentBoundaryParse=currentBoundaryParse,currentBoundaryParse=e,boundaryParseStack.push(parentBoundaryParse)},popBoundaryParseStack=function(){currentBoundaryParse=parentBoundaryParse,boundaryParseStack.pop(),parentBoundaryParse=boundaryParseStack.pop(),boundaryParseStack.push(parentBoundaryParse)},updateElStyle=function(t,e,r,n,a,s,o,l,u,h,d){let p=c4ShapeArray.find(g=>g.alias===e);if(!(p===void 0&&(p=boundarys.find(g=>g.alias===e),p===void 0))){if(r!=null)if(typeof r=="object"){let[g,m]=Object.entries(r)[0];p[g]=m}else p.bgColor=r;if(n!=null)if(typeof n=="object"){let[g,m]=Object.entries(n)[0];p[g]=m}else p.fontColor=n;if(a!=null)if(typeof a=="object"){let[g,m]=Object.entries(a)[0];p[g]=m}else p.borderColor=a;if(s!=null)if(typeof s=="object"){let[g,m]=Object.entries(s)[0];p[g]=m}else p.shadowing=s;if(o!=null)if(typeof o=="object"){let[g,m]=Object.entries(o)[0];p[g]=m}else p.shape=o;if(l!=null)if(typeof l=="object"){let[g,m]=Object.entries(l)[0];p[g]=m}else p.sprite=l;if(u!=null)if(typeof u=="object"){let[g,m]=Object.entries(u)[0];p[g]=m}else p.techn=u;if(h!=null)if(typeof h=="object"){let[g,m]=Object.entries(h)[0];p[g]=m}else p.legendText=h;if(d!=null)if(typeof d=="object"){let[g,m]=Object.entries(d)[0];p[g]=m}else p.legendSprite=d}},updateRelStyle=function(t,e,r,n,a,s,o){const l=rels.find(u=>u.from===e&&u.to===r);if(l!==void 0){if(n!=null)if(typeof n=="object"){let[u,h]=Object.entries(n)[0];l[u]=h}else l.textColor=n;if(a!=null)if(typeof a=="object"){let[u,h]=Object.entries(a)[0];l[u]=h}else l.lineColor=a;if(s!=null)if(typeof s=="object"){let[u,h]=Object.entries(s)[0];l[u]=parseInt(h)}else l.offsetX=parseInt(s);if(o!=null)if(typeof o=="object"){let[u,h]=Object.entries(o)[0];l[u]=parseInt(h)}else l.offsetY=parseInt(o)}},updateLayoutConfig=function(t,e,r){let n=c4ShapeInRow$1,a=c4BoundaryInRow$1;if(typeof e=="object"){const s=Object.values(e)[0];n=parseInt(s)}else n=parseInt(e);if(typeof r=="object"){const s=Object.values(r)[0];a=parseInt(s)}else a=parseInt(r);n>=1&&(c4ShapeInRow$1=n),a>=1&&(c4BoundaryInRow$1=a)},getC4ShapeInRow=function(){return c4ShapeInRow$1},getC4BoundaryInRow=function(){return c4BoundaryInRow$1},getCurrentBoundaryParse=function(){return currentBoundaryParse},getParentBoundaryParse=function(){return parentBoundaryParse},getC4ShapeArray=function(t){return t==null?c4ShapeArray:c4ShapeArray.filter(e=>e.parentBoundary===t)},getC4Shape=function(t){return c4ShapeArray.find(e=>e.alias===t)},getC4ShapeKeys=function(t){return Object.keys(getC4ShapeArray(t))},getBoundarys=function(t){return t==null?boundarys:boundarys.filter(e=>e.parentBoundary===t)},getRels=function(){return rels},getTitle=function(){return title},setWrap$1=function(t){wrapEnabled$1=t},autoWrap$1=function(){return wrapEnabled$1},clear$d=function(){c4ShapeArray=[],boundarys=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],parentBoundaryParse="",currentBoundaryParse="global",boundaryParseStack=[""],rels=[],boundaryParseStack=[""],title="",wrapEnabled$1=!1,c4ShapeInRow$1=4,c4BoundaryInRow$1=2},LINETYPE$1={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$1={FILLED:0,OPEN:1},PLACEMENT$1={LEFTOF:0,RIGHTOF:1,OVER:2},setTitle=function(t){title=sanitizeText$5(t,getConfig$1())},c4Db={addPersonOrSystem,addPersonOrSystemBoundary,addContainer,addContainerBoundary,addComponent,addDeploymentNode,popBoundaryParseStack,addRel,updateElStyle,updateRelStyle,updateLayoutConfig,autoWrap:autoWrap$1,setWrap:setWrap$1,getC4ShapeArray,getC4Shape,getC4ShapeKeys,getBoundarys,getCurrentBoundaryParse,getParentBoundaryParse,getRels,getTitle,getC4Type,getC4ShapeInRow,getC4BoundaryInRow,setAccTitle,getAccTitle,getAccDescription,setAccDescription,parseDirective:parseDirective$a,getConfig:()=>getConfig$1().c4,clear:clear$d,LINETYPE:LINETYPE$1,ARROWTYPE:ARROWTYPE$1,PLACEMENT:PLACEMENT$1,setTitle,setC4Type},drawRect$2=function(t,e){const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.attrs!=="undefined"&&e.attrs!==null)for(let n in e.attrs)r.attr(n,e.attrs[n]);return e.class!=="undefined"&&r.attr("class",e.class),r},drawImage$1=function(t,e,r,n,a,s){const o=t.append("image");o.attr("width",e),o.attr("height",r),o.attr("x",n),o.attr("y",a);let l=s.startsWith("data:image/png;base64")?s:sanitizeUrl_1(s);o.attr("xlink:href",l)},drawRels$1=(t,e,r)=>{const n=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let g=n.append("line");g.attr("x1",s.startPoint.x),g.attr("y1",s.startPoint.y),g.attr("x2",s.endPoint.x),g.attr("y2",s.endPoint.y),g.attr("stroke-width","1"),g.attr("stroke",l),g.style("fill","none"),s.type!=="rel_b"&&g.attr("marker-end","url("+d+"#arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&g.attr("marker-start","url("+d+"#arrowend)"),a=-1}else{let g=n.append("path");g.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&g.attr("marker-end","url("+d+"#arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&g.attr("marker-start","url("+d+"#arrowend)")}let p=r.messageFont();_drawTextCandidateFunc$2(r)(s.label.text,n,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},p),s.techn&&s.techn.text!==""&&(p=r.messageFont(),_drawTextCandidateFunc$2(r)("["+s.techn.text+"]",n,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},p))}},drawBoundary$1=function(t,e,r){const n=t.append("g");let a=e.bgColor?e.bgColor:"none",s=e.borderColor?e.borderColor:"#444444",o=e.fontColor?e.fontColor:"black",l={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(l={"stroke-width":1});let u={x:e.x,y:e.y,fill:a,stroke:s,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:l};drawRect$2(n,u);let h=r.boundaryFont();h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=o,_drawTextCandidateFunc$2(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},h),e.type&&e.type.text!==""&&(h=r.boundaryFont(),h.fontColor=o,_drawTextCandidateFunc$2(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},h)),e.descr&&e.descr.text!==""&&(h=r.boundaryFont(),h.fontSize=h.fontSize-2,h.fontColor=o,_drawTextCandidateFunc$2(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},h))},drawC4Shape=function(t,e,r){let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],a=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],s=e.fontColor?e.fontColor:"#FFFFFF",o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const l=t.append("g");l.attr("class","person-man");const u=getNoteRect$2();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":u.x=e.x,u.y=e.y,u.fill=n,u.width=e.width,u.height=e.height,u.style="stroke:"+a+";stroke-width:0.5;",u.rx=2.5,u.ry=2.5,drawRect$2(l,u);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":l.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",a).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),l.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",a).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":l.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",a).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),l.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",a).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let h=getC4ShapeFont(r,e.typeC4Shape.text);switch(l.append("text").attr("fill",s).attr("font-family",h.fontFamily).attr("font-size",h.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":drawImage$1(l,48,48,e.x+e.width/2-24,e.y+e.image.Y,o);break}let d=r[e.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=s,_drawTextCandidateFunc$2(r)(e.label.text,l,e.x,e.y+e.label.Y,e.width,e.height,{fill:s},d),d=r[e.typeC4Shape.text+"Font"](),d.fontColor=s,e.thchn&&e.thchn.text!==""?_drawTextCandidateFunc$2(r)(e.thchn.text,l,e.x,e.y+e.thchn.Y,e.width,e.height,{fill:s,"font-style":"italic"},d):e.type&&e.type.text!==""&&_drawTextCandidateFunc$2(r)(e.type.text,l,e.x,e.y+e.type.Y,e.width,e.height,{fill:s,"font-style":"italic"},d),e.descr&&e.descr.text!==""&&(d=r.personFont(),d.fontColor=s,_drawTextCandidateFunc$2(r)(e.descr.text,l,e.x,e.y+e.descr.Y,e.width,e.height,{fill:s},d)),e.height},insertDatabaseIcon$1=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$1=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$1=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")},insertArrowHead$1=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")},insertArrowEnd=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")},insertArrowFilledHead$1=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")},insertDynamicNumber=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$1=function(t){const r=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);r.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"),r.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")},getNoteRect$2=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},getC4ShapeFont=(t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),_drawTextCandidateFunc$2=function(){function t(a,s,o,l,u,h,d){const p=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);n(p,d)}function e(a,s,o,l,u,h,d,p){const{fontSize:g,fontFamily:m,fontWeight:T}=p,I=a.split(common$1.lineBreakRegex);for(let A=0;A<I.length;A++){const C=A*g-g*(I.length-1)/2,L=s.append("text").attr("x",o+u/2).attr("y",l).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",g).style("font-weight",T).style("font-family",m);L.append("tspan").attr("dy",C).text(I[A]).attr("alignment-baseline","mathematical"),n(L,d)}}function r(a,s,o,l,u,h,d,p){const g=s.append("switch"),T=g.append("foreignObject").attr("x",o).attr("y",l).attr("width",u).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");T.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),e(a,g,o,l,u,h,d,p),n(T,d)}function n(a,s){for(const o in s)s.hasOwnProperty(o)&&a.attr(o,s[o])}return function(a){return a.textPlacement==="fo"?r:a.textPlacement==="old"?t:e}}(),svgDraw$3={drawRect:drawRect$2,drawBoundary:drawBoundary$1,drawC4Shape,drawRels:drawRels$1,drawImage:drawImage$1,insertArrowHead:insertArrowHead$1,insertArrowEnd,insertArrowFilledHead:insertArrowFilledHead$1,insertDynamicNumber,insertArrowCrossHead:insertArrowCrossHead$1,insertDatabaseIcon:insertDatabaseIcon$1,insertComputerIcon:insertComputerIcon$1,insertClockIcon:insertClockIcon$1,getNoteRect:getNoteRect$2,sanitizeUrl:sanitizeUrl_1};let globalBoundaryMaxX=0,globalBoundaryMaxY=0,c4ShapeInRow=4,c4BoundaryInRow=2;parser$a.yy=c4Db;let conf$a={};class Bounds{constructor(e){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,setConf$a(e.db.getConfig())}setData(e,r,n,a){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=a}updateVal(e,r,n,a){e[r]===void 0?e[r]=n:e[r]=a(n,e[r])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let r=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+e.margin:this.nextData.stopx+e.margin*2,n=r+e.width,a=this.nextData.starty+e.margin*2,s=a+e.height;(r>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>c4ShapeInRow)&&(r=this.nextData.startx+e.margin+conf$a.nextLinePaddingX,a=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=s=a+e.height,this.nextData.cnt=1),e.x=r,e.y=a,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",a,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",s,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",a,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",s,Math.max)}init(e){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},setConf$a(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}}const setConf$a=function(t){assignWithDepth$1(conf$a,t),t.fontFamily&&(conf$a.personFontFamily=conf$a.systemFontFamily=conf$a.messageFontFamily=t.fontFamily),t.fontSize&&(conf$a.personFontSize=conf$a.systemFontSize=conf$a.messageFontSize=t.fontSize),t.fontWeight&&(conf$a.personFontWeight=conf$a.systemFontWeight=conf$a.messageFontWeight=t.fontWeight)},c4ShapeFont=(t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),boundaryFont=t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),messageFont$1=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight});function calcC4ShapeTextWH(t,e,r,n,a){if(!e[t].width)if(r)e[t].text=wrapLabel(e[t].text,a,n),e[t].textLines=e[t].text.split(common$1.lineBreakRegex).length,e[t].width=a,e[t].height=calculateTextHeight(e[t].text,n);else{let s=e[t].text.split(common$1.lineBreakRegex);e[t].textLines=s.length;let o=0;e[t].height=0,e[t].width=0;for(const l of s)e[t].width=Math.max(calculateTextWidth(l,n),e[t].width),o=calculateTextHeight(l,n),e[t].height=e[t].height+o}}const drawBoundary=function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=conf$a.c4ShapeMargin-35;let n=e.wrap&&conf$a.wrap,a=boundaryFont(conf$a);a.fontSize=a.fontSize+2,a.fontWeight="bold";let s=calculateTextWidth(e.label.text,a);calcC4ShapeTextWH("label",e,n,a,s),svgDraw$3.drawBoundary(t,e,conf$a)},drawC4ShapeArray=function(t,e,r,n){let a=0;for(const s of n){a=0;const o=r[s];let l=c4ShapeFont(conf$a,o.typeC4Shape.text);switch(l.fontSize=l.fontSize-2,o.typeC4Shape.width=calculateTextWidth("<<"+o.typeC4Shape.text+">>",l),o.typeC4Shape.height=l.fontSize+2,o.typeC4Shape.Y=conf$a.c4ShapePadding,a=o.typeC4Shape.Y+o.typeC4Shape.height-4,o.image={width:0,height:0,Y:0},o.typeC4Shape.text){case"person":case"external_person":o.image.width=48,o.image.height=48,o.image.Y=a,a=o.image.Y+o.image.height;break}o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=a,a=o.image.Y+o.image.height);let u=o.wrap&&conf$a.wrap,h=conf$a.width-conf$a.c4ShapePadding*2,d=c4ShapeFont(conf$a,o.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",calcC4ShapeTextWH("label",o,u,d,h),o.label.Y=a+8,a=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let m=c4ShapeFont(conf$a,o.typeC4Shape.text);calcC4ShapeTextWH("type",o,u,m,h),o.type.Y=a+5,a=o.type.Y+o.type.height}else if(o.techn&&o.techn.text!==""){o.techn.text="["+o.techn.text+"]";let m=c4ShapeFont(conf$a,o.techn.text);calcC4ShapeTextWH("techn",o,u,m,h),o.techn.Y=a+5,a=o.techn.Y+o.techn.height}let p=a,g=o.label.width;if(o.descr&&o.descr.text!==""){let m=c4ShapeFont(conf$a,o.typeC4Shape.text);calcC4ShapeTextWH("descr",o,u,m,h),o.descr.Y=a+20,a=o.descr.Y+o.descr.height,g=Math.max(o.label.width,o.descr.width),p=a-o.descr.textLines*5}g=g+conf$a.c4ShapePadding,o.width=Math.max(o.width||conf$a.width,g,conf$a.width),o.height=Math.max(o.height||conf$a.height,p,conf$a.height),o.margin=o.margin||conf$a.c4ShapeMargin,t.insert(o),svgDraw$3.drawC4Shape(e,o,conf$a)}t.bumpLastMargin(conf$a.c4ShapeMargin)};class Point{constructor(e,r){this.x=e,this.y=r}}let getIntersectPoint=function(t,e){let r=t.x,n=t.y,a=e.x,s=e.y,o=r+t.width/2,l=n+t.height/2,u=Math.abs(r-a),h=Math.abs(n-s),d=h/u,p=t.height/t.width,g=null;return n==s&&r<a?g=new Point(r+t.width,l):n==s&&r>a?g=new Point(r,l):r==a&&n<s?g=new Point(o,n+t.height):r==a&&n>s&&(g=new Point(o,n)),r>a&&n<s?p>=d?g=new Point(r,l+d*t.width/2):g=new Point(o-u/h*t.height/2,n+t.height):r<a&&n<s?p>=d?g=new Point(r+t.width,l+d*t.width/2):g=new Point(o+u/h*t.height/2,n+t.height):r<a&&n>s?p>=d?g=new Point(r+t.width,l-d*t.width/2):g=new Point(o+t.height/2*u/h,n):r>a&&n>s&&(p>=d?g=new Point(r,l-t.width/2*d):g=new Point(o-t.height/2*u/h,n)),g},getIntersectPoints=function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=getIntersectPoint(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let a=getIntersectPoint(e,r);return{startPoint:n,endPoint:a}};const drawRels=function(t,e,r,n){let a=0;for(let s of e){a=a+1;let o=s.wrap&&conf$a.wrap,l=messageFont$1(conf$a);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=calculateTextWidth(s.label.text,l);calcC4ShapeTextWH("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=calculateTextWidth(s.techn.text,l),calcC4ShapeTextWH("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=calculateTextWidth(s.descr.text,l),calcC4ShapeTextWH("descr",s,o,l,h));let d=r(s.from),p=r(s.to),g=getIntersectPoints(d,p);s.startPoint=g.startPoint,s.endPoint=g.endPoint}svgDraw$3.drawRels(t,e,conf$a)};function drawInsideBoundary(t,e,r,n,a){let s=new Bounds(a);s.data.widthLimit=r.data.widthLimit/Math.min(c4BoundaryInRow,n.length);for(let[o,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);let h=l.wrap&&conf$a.wrap,d=boundaryFont(conf$a);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",calcC4ShapeTextWH("label",l,h,d,s.data.widthLimit),l.label.Y=u+8,u=l.label.Y+l.label.height,l.type&&l.type.text!==""){l.type.text="["+l.type.text+"]";let T=boundaryFont(conf$a);calcC4ShapeTextWH("type",l,h,T,s.data.widthLimit),l.type.Y=u+5,u=l.type.Y+l.type.height}if(l.descr&&l.descr.text!==""){let T=boundaryFont(conf$a);T.fontSize=T.fontSize-2,calcC4ShapeTextWH("descr",l,h,T,s.data.widthLimit),l.descr.Y=u+20,u=l.descr.Y+l.descr.height}if(o==0||o%c4BoundaryInRow===0){let T=r.data.startx+conf$a.diagramMarginX,I=r.data.stopy+conf$a.diagramMarginY+u;s.setData(T,T,I,I)}else{let T=s.data.stopx!==s.data.startx?s.data.stopx+conf$a.diagramMarginX:s.data.startx,I=s.data.starty;s.setData(T,T,I,I)}s.name=l.alias;let p=a.db.getC4ShapeArray(l.alias),g=a.db.getC4ShapeKeys(l.alias);g.length>0&&drawC4ShapeArray(s,t,p,g),e=l.alias;let m=a.db.getBoundarys(e);m.length>0&&drawInsideBoundary(t,e,s,m,a),l.alias!=="global"&&drawBoundary(t,l,s),r.data.stopy=Math.max(s.data.stopy+conf$a.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(s.data.stopx+conf$a.c4ShapeMargin,r.data.stopx),globalBoundaryMaxX=Math.max(globalBoundaryMaxX,r.data.stopx),globalBoundaryMaxY=Math.max(globalBoundaryMaxY,r.data.stopy)}}const draw$e=function(t,e,r,n){conf$a=getConfig$1().c4;const a=getConfig$1().securityLevel;let s;a==="sandbox"&&(s=select("#i"+e));const o=a==="sandbox"?select(s.nodes()[0].contentDocument.body):select("body");let l=n.db;n.db.setWrap(conf$a.wrap),c4ShapeInRow=l.getC4ShapeInRow(),c4BoundaryInRow=l.getC4BoundaryInRow(),log$1.debug(`C:${JSON.stringify(conf$a,null,2)}`);const u=a==="sandbox"?o.select(`[id="${e}"]`):select(`[id="${e}"]`);svgDraw$3.insertComputerIcon(u),svgDraw$3.insertDatabaseIcon(u),svgDraw$3.insertClockIcon(u);let h=new Bounds(n);h.setData(conf$a.diagramMarginX,conf$a.diagramMarginX,conf$a.diagramMarginY,conf$a.diagramMarginY),h.data.widthLimit=screen.availWidth,globalBoundaryMaxX=conf$a.diagramMarginX,globalBoundaryMaxY=conf$a.diagramMarginY;const d=n.db.getTitle();let p=n.db.getBoundarys("");drawInsideBoundary(u,"",h,p,n),svgDraw$3.insertArrowHead(u),svgDraw$3.insertArrowEnd(u),svgDraw$3.insertArrowCrossHead(u),svgDraw$3.insertArrowFilledHead(u),drawRels(u,n.db.getRels(),n.db.getC4Shape,n),h.data.stopx=globalBoundaryMaxX,h.data.stopy=globalBoundaryMaxY;const g=h.data;let T=g.stopy-g.starty+2*conf$a.diagramMarginY;const A=g.stopx-g.startx+2*conf$a.diagramMarginX;d&&u.append("text").text(d).attr("x",(g.stopx-g.startx)/2-4*conf$a.diagramMarginX).attr("y",g.starty+conf$a.diagramMarginY),configureSvgSize(u,T,A,conf$a.useMaxWidth);const C=d?60:0;u.attr("viewBox",g.startx-conf$a.diagramMarginX+" -"+(conf$a.diagramMarginY+C)+" "+A+" "+(T+C)),log$1.debug("models:",g)},c4Renderer={drawPersonOrSystemArray:drawC4ShapeArray,drawBoundary,setConf:setConf$a,draw:draw$e};var parser$9=function(){var t=function(W,Y,P,it){for(P=P||{},it=W.length;it--;P[W[it]]=Y);return P},e=[1,3],r=[1,7],n=[1,8],a=[1,9],s=[1,10],o=[1,13],l=[1,12],u=[1,16,25],h=[1,20],d=[1,32],p=[1,33],g=[1,34],m=[1,36],T=[1,39],I=[1,37],A=[1,38],C=[1,44],L=[1,45],M=[1,40],F=[1,41],H=[1,42],q=[1,43],U=[1,48],z=[1,49],R=[1,50],$=[1,51],D=[16,25],k=[1,65],B=[1,66],v=[1,67],J=[1,68],E=[1,69],ft=[1,70],Lt=[1,71],Tt=[1,80],Q=[16,25,32,45,46,54,60,61,62,63,64,65,66,71,73],ut=[16,25,30,32,45,46,50,54,60,61,62,63,64,65,66,71,73,88,89,90,91],st=[5,8,9,10,11,16,19,23,25],ot=[54,88,89,90,91],dt=[54,65,66,88,89,90,91],xt=[54,60,61,62,63,64,88,89,90,91],et=[16,25,32],Nt=[1,107],G={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(Y,P,it,N,gt,j,Ft){var at=j.length-1;switch(gt){case 5:N.setDirection("TB");break;case 6:N.setDirection("BT");break;case 7:N.setDirection("RL");break;case 8:N.setDirection("LR");break;case 12:N.parseDirective("%%{","open_directive");break;case 13:N.parseDirective(j[at],"type_directive");break;case 14:j[at]=j[at].trim().replace(/'/g,'"'),N.parseDirective(j[at],"arg_directive");break;case 15:N.parseDirective("}%%","close_directive","class");break;case 20:case 21:this.$=j[at];break;case 22:this.$=j[at-1]+j[at];break;case 23:case 24:this.$=j[at-1]+"~"+j[at];break;case 25:N.addRelation(j[at]);break;case 26:j[at-1].title=N.cleanupLabel(j[at]),N.addRelation(j[at-1]);break;case 35:this.$=j[at].trim(),N.setAccTitle(this.$);break;case 36:case 37:this.$=j[at].trim(),N.setAccDescription(this.$);break;case 38:N.addClass(j[at]);break;case 39:N.addClass(j[at-2]),N.setCssClass(j[at-2],j[at]);break;case 40:N.addClass(j[at-3]),N.addMembers(j[at-3],j[at-1]);break;case 41:N.addClass(j[at-5]),N.setCssClass(j[at-5],j[at-3]),N.addMembers(j[at-5],j[at-1]);break;case 42:N.addAnnotation(j[at],j[at-2]);break;case 43:this.$=[j[at]];break;case 44:j[at].push(j[at-1]),this.$=j[at];break;case 45:break;case 46:N.addMember(j[at-1],N.cleanupLabel(j[at]));break;case 47:break;case 48:break;case 49:this.$={id1:j[at-2],id2:j[at],relation:j[at-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:j[at-3],id2:j[at],relation:j[at-1],relationTitle1:j[at-2],relationTitle2:"none"};break;case 51:this.$={id1:j[at-3],id2:j[at],relation:j[at-2],relationTitle1:"none",relationTitle2:j[at-1]};break;case 52:this.$={id1:j[at-4],id2:j[at],relation:j[at-2],relationTitle1:j[at-3],relationTitle2:j[at-1]};break;case 53:N.addNote(j[at],j[at-1]);break;case 54:N.addNote(j[at]);break;case 55:this.$={type1:j[at-2],type2:j[at],lineType:j[at-1]};break;case 56:this.$={type1:"none",type2:j[at],lineType:j[at-1]};break;case 57:this.$={type1:j[at-1],type2:"none",lineType:j[at]};break;case 58:this.$={type1:"none",type2:"none",lineType:j[at]};break;case 59:this.$=N.relationType.AGGREGATION;break;case 60:this.$=N.relationType.EXTENSION;break;case 61:this.$=N.relationType.COMPOSITION;break;case 62:this.$=N.relationType.DEPENDENCY;break;case 63:this.$=N.relationType.LOLLIPOP;break;case 64:this.$=N.lineType.LINE;break;case 65:this.$=N.lineType.DOTTED_LINE;break;case 66:case 72:this.$=j[at-2],N.setClickEvent(j[at-1],j[at]);break;case 67:case 73:this.$=j[at-3],N.setClickEvent(j[at-2],j[at-1]),N.setTooltip(j[at-2],j[at]);break;case 68:case 76:this.$=j[at-2],N.setLink(j[at-1],j[at]);break;case 69:this.$=j[at-3],N.setLink(j[at-2],j[at-1],j[at]);break;case 70:case 78:this.$=j[at-3],N.setLink(j[at-2],j[at-1]),N.setTooltip(j[at-2],j[at]);break;case 71:case 79:this.$=j[at-4],N.setLink(j[at-3],j[at-2],j[at]),N.setTooltip(j[at-3],j[at-1]);break;case 74:this.$=j[at-3],N.setClickEvent(j[at-2],j[at-1],j[at]);break;case 75:this.$=j[at-4],N.setClickEvent(j[at-3],j[at-2],j[at-1]),N.setTooltip(j[at-3],j[at]);break;case 77:this.$=j[at-3],N.setLink(j[at-2],j[at-1],j[at]);break;case 80:N.setCssClass(j[at-1],j[at]);break}},table:[{3:1,4:2,5:e,6:4,7:5,8:r,9:n,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:e,6:4,7:5,8:r,9:n,10:a,11:s,12:6,13:11,19:o,23:l},{1:[2,9]},t(u,[2,5]),t(u,[2,6]),t(u,[2,7]),t(u,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:h},t([17,22],[2,13]),{6:31,7:30,8:r,9:n,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:d,41:p,43:g,44:m,49:T,51:I,52:A,55:C,57:L,67:M,68:F,70:H,74:q,88:U,89:z,90:R,91:$},{16:[1,52]},{18:53,21:[1,54]},{16:[2,15]},{25:[1,55]},{16:[1,56],25:[2,17]},t(D,[2,25],{32:[1,57]}),t(D,[2,27]),t(D,[2,28]),t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),{40:[1,58]},{42:[1,59]},t(D,[2,37]),t(D,[2,45],{53:60,58:63,59:64,32:[1,62],54:[1,61],60:k,61:B,62:v,63:J,64:E,65:ft,66:Lt}),{27:72,28:46,29:47,88:U,89:z,90:R,91:$},t(D,[2,47]),t(D,[2,48]),{28:73,88:U,89:z,90:R},{27:74,28:46,29:47,88:U,89:z,90:R,91:$},{27:75,28:46,29:47,88:U,89:z,90:R,91:$},{27:76,28:46,29:47,88:U,89:z,90:R,91:$},{54:[1,77]},{27:78,28:46,29:47,88:U,89:z,90:R,91:$},{54:Tt,56:79},t(Q,[2,20],{28:46,29:47,27:81,30:[1,82],88:U,89:z,90:R,91:$}),t(Q,[2,21],{30:[1,83]}),t(ut,[2,94]),t(ut,[2,95]),t(ut,[2,96]),t([16,25,30,32,45,46,54,60,61,62,63,64,65,66,71,73],[2,97]),t(st,[2,10]),{15:84,22:h},{22:[2,14]},{1:[2,16]},{6:31,7:30,8:r,9:n,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:d,41:p,43:g,44:m,49:T,51:I,52:A,55:C,57:L,67:M,68:F,70:H,74:q,88:U,89:z,90:R,91:$},t(D,[2,26]),t(D,[2,35]),t(D,[2,36]),{27:86,28:46,29:47,54:[1,87],88:U,89:z,90:R,91:$},{53:88,58:63,59:64,60:k,61:B,62:v,63:J,64:E,65:ft,66:Lt},t(D,[2,46]),{59:89,65:ft,66:Lt},t(ot,[2,58],{58:90,60:k,61:B,62:v,63:J,64:E}),t(dt,[2,59]),t(dt,[2,60]),t(dt,[2,61]),t(dt,[2,62]),t(dt,[2,63]),t(xt,[2,64]),t(xt,[2,65]),t(D,[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:U,89:z,90:R},{54:Tt,56:99},t(D,[2,54]),t(D,[2,98]),t(Q,[2,22]),t(Q,[2,23]),t(Q,[2,24]),{16:[1,100]},{25:[2,19]},t(et,[2,49]),{27:101,28:46,29:47,88:U,89:z,90:R,91:$},{27:102,28:46,29:47,54:[1,103],88:U,89:z,90:R,91:$},t(ot,[2,57],{58:104,60:k,61:B,62:v,63:J,64:E}),t(ot,[2,56]),{28:105,88:U,89:z,90:R},{47:106,51:Nt},{27:108,28:46,29:47,88:U,89:z,90:R,91:$},t(D,[2,66],{54:[1,109]}),t(D,[2,68],{54:[1,111],69:[1,110]}),t(D,[2,72],{54:[1,112],72:[1,113]}),t(D,[2,76],{54:[1,115],69:[1,114]}),t(D,[2,80]),t(D,[2,53]),t(st,[2,11]),t(et,[2,51]),t(et,[2,50]),{27:116,28:46,29:47,88:U,89:z,90:R,91:$},t(ot,[2,55]),t(D,[2,39],{46:[1,117]}),{48:[1,118]},{47:119,48:[2,43],51:Nt},t(D,[2,42]),t(D,[2,67]),t(D,[2,69]),t(D,[2,70],{69:[1,120]}),t(D,[2,73]),t(D,[2,74],{54:[1,121]}),t(D,[2,77]),t(D,[2,78],{69:[1,122]}),t(et,[2,52]),{47:123,51:Nt},t(D,[2,40]),{48:[2,44]},t(D,[2,71]),t(D,[2,75]),t(D,[2,79]),{48:[1,124]},t(D,[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(Y,P){if(P.recoverable)this.trace(Y);else{var it=new Error(Y);throw it.hash=P,it}},parse:function(Y){var P=this,it=[0],N=[],gt=[null],j=[],Ft=this.table,at="",Dt=0,kt=0,_t=2,St=1,Et=j.slice.call(arguments,1),yt=Object.create(this.lexer),ct={yy:{}};for(var ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ne)&&(ct.yy[ne]=this.yy[ne]);yt.setInput(Y,ct.yy),ct.yy.lexer=yt,ct.yy.parser=this,typeof yt.yylloc>"u"&&(yt.yylloc={});var jt=yt.yylloc;j.push(jt);var Wt=yt.options&&yt.options.ranges;typeof ct.yy.parseError=="function"?this.parseError=ct.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function qt(){var ht;return ht=N.pop()||yt.lex()||St,typeof ht!="number"&&(ht instanceof Array&&(N=ht,ht=N.pop()),ht=P.symbols_[ht]||ht),ht}for(var Ht,ge,zt,Pt,Mt={},wt,mt,It,vt;;){if(ge=it[it.length-1],this.defaultActions[ge]?zt=this.defaultActions[ge]:((Ht===null||typeof Ht>"u")&&(Ht=qt()),zt=Ft[ge]&&Ft[ge][Ht]),typeof zt>"u"||!zt.length||!zt[0]){var Ut="";vt=[];for(wt in Ft[ge])this.terminals_[wt]&&wt>_t&&vt.push("'"+this.terminals_[wt]+"'");yt.showPosition?Ut="Parse error on line "+(Dt+1)+`:
`+yt.showPosition()+`
Expecting `+vt.join(", ")+", got '"+(this.terminals_[Ht]||Ht)+"'":Ut="Parse error on line "+(Dt+1)+": Unexpected "+(Ht==St?"end of input":"'"+(this.terminals_[Ht]||Ht)+"'"),this.parseError(Ut,{text:yt.match,token:this.terminals_[Ht]||Ht,line:yt.yylineno,loc:jt,expected:vt})}if(zt[0]instanceof Array&&zt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+Ht);switch(zt[0]){case 1:it.push(Ht),gt.push(yt.yytext),j.push(yt.yylloc),it.push(zt[1]),Ht=null,kt=yt.yyleng,at=yt.yytext,Dt=yt.yylineno,jt=yt.yylloc;break;case 2:if(mt=this.productions_[zt[1]][1],Mt.$=gt[gt.length-mt],Mt._$={first_line:j[j.length-(mt||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(mt||1)].first_column,last_column:j[j.length-1].last_column},Wt&&(Mt._$.range=[j[j.length-(mt||1)].range[0],j[j.length-1].range[1]]),Pt=this.performAction.apply(Mt,[at,kt,Dt,ct.yy,zt[1],gt,j].concat(Et)),typeof Pt<"u")return Pt;mt&&(it=it.slice(0,-1*mt*2),gt=gt.slice(0,-1*mt),j=j.slice(0,-1*mt)),it.push(this.productions_[zt[1]][0]),gt.push(Mt.$),j.push(Mt._$),It=Ft[it[it.length-2]][it[it.length-1]],it.push(It);break;case 3:return!0}}return!0}},Z=function(){var W={EOF:1,parseError:function(P,it){if(this.yy.parser)this.yy.parser.parseError(P,it);else throw new Error(P)},setInput:function(Y,P){return this.yy=P||this.yy||{},this._input=Y,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 Y=this._input[0];this.yytext+=Y,this.yyleng++,this.offset++,this.match+=Y,this.matched+=Y;var P=Y.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Y},unput:function(Y){var P=Y.length,it=Y.split(/(?:\r\n?|\n)/g);this._input=Y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var N=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),it.length-1&&(this.yylineno-=it.length-1);var gt=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:it?(it.length===N.length?this.yylloc.first_column:0)+N[N.length-it.length].length-it[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[gt[0],gt[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(Y){this.unput(this.match.slice(Y))},pastInput:function(){var Y=this.matched.substr(0,this.matched.length-this.match.length);return(Y.length>20?"...":"")+Y.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Y=this.match;return Y.length<20&&(Y+=this._input.substr(0,20-Y.length)),(Y.substr(0,20)+(Y.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Y=this.pastInput(),P=new Array(Y.length+1).join("-");return Y+this.upcomingInput()+`
`+P+"^"},test_match:function(Y,P){var it,N,gt;if(this.options.backtrack_lexer&&(gt={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&&(gt.yylloc.range=this.yylloc.range.slice(0))),N=Y[0].match(/(?:\r\n?|\n).*/g),N&&(this.yylineno+=N.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:N?N[N.length-1].length-N[N.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Y[0].length},this.yytext+=Y[0],this.match+=Y[0],this.matches=Y,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(Y[0].length),this.matched+=Y[0],it=this.performAction.call(this,this.yy,this,P,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),it)return it;if(this._backtrack){for(var j in gt)this[j]=gt[j];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Y,P,it,N;this._more||(this.yytext="",this.match="");for(var gt=this._currentRules(),j=0;j<gt.length;j++)if(it=this._input.match(this.rules[gt[j]]),it&&(!P||it[0].length>P[0].length)){if(P=it,N=j,this.options.backtrack_lexer){if(Y=this.test_match(it,gt[j]),Y!==!1)return Y;if(this._backtrack){P=!1;continue}else return!1}else if(!this.options.flex)break}return P?(Y=this.test_match(P,gt[N]),Y!==!1?Y:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var P=this.next();return P||this.lex()},begin:function(P){this.conditionStack.push(P)},popState:function(){var P=this.conditionStack.length-1;return P>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(P){return P=this.conditionStack.length-1-Math.abs(P||0),P>=0?this.conditionStack[P]:"INITIAL"},pushState:function(P){this.begin(P)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(P,it,N,gt){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:break;case 10: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:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:return 16;case 19:break;case 20:return 23;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 27:break;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 39:this.popState();break;case 40:return"GENERICTYPE";case 41:this.begin("string");break;case 42:this.popState();break;case 43:return"STR";case 44:this.begin("bqstring");break;case 45:this.popState();break;case 46:return"BQUOTE_STR";case 47:this.begin("href");break;case 48:this.popState();break;case 49:return 73;case 50:this.begin("callback_name");break;case 51:this.popState();break;case 52:this.popState(),this.begin("callback_args");break;case 53:return 71;case 54:this.popState();break;case 55:return 72;case 56:return 69;case 57:return 69;case 58:return 69;case 59:return 69;case 60:return 61;case 61:return 61;case 62:return 63;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:return"EQUALS";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}}};return W}();G.lexer=Z;function tt(){this.yy={}}return tt.prototype=G,G.Parser=tt,new tt}();parser$9.parser=parser$9;const classParser=parser$9,classDetector=(t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:t.match(/^\s*classDiagram/)!==null},classDetectorV2=(t,e)=>{var r;return t.match(/^\s*classDiagram/)!==null&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:t.match(/^\s*classDiagram-v2/)!==null},MERMAID_DOM_ID_PREFIX$1="classid-";let relations$1=[],classes$2={},notes=[],classCounter=0,funs$2=[];const sanitizeText$2=t=>common$1.sanitizeText(t,getConfig$1()),parseDirective$9=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},splitClassNameAndType=function(t){let e="",r=t;if(t.indexOf("~")>0){let n=t.split("~");r=n[0],e=common$1.sanitizeText(n[1],getConfig$1())}return{className:r,type:e}},addClass$1=function(t){let e=splitClassNameAndType(t);classes$2[e.className]===void 0&&(classes$2[e.className]={id:e.className,type:e.type,cssClasses:[],methods:[],members:[],annotations:[],domId:MERMAID_DOM_ID_PREFIX$1+e.className+"-"+classCounter},classCounter++)},lookUpDomId$1=function(t){const e=Object.keys(classes$2);for(const r of e)if(classes$2[r].id===t)return classes$2[r].domId},clear$c=function(){relations$1=[],classes$2={},notes=[],funs$2=[],funs$2.push(setupToolTips$1),clear$g()},getClass=function(t){return classes$2[t]},getClasses$5=function(){return classes$2},getRelations$1=function(){return relations$1},getNotes=function(){return notes},addRelation$1=function(t){log$1.debug("Adding relation: "+JSON.stringify(t)),addClass$1(t.id1),addClass$1(t.id2),t.id1=splitClassNameAndType(t.id1).className,t.id2=splitClassNameAndType(t.id2).className,t.relationTitle1=common$1.sanitizeText(t.relationTitle1.trim(),getConfig$1()),t.relationTitle2=common$1.sanitizeText(t.relationTitle2.trim(),getConfig$1()),relations$1.push(t)},addAnnotation=function(t,e){const r=splitClassNameAndType(t).className;classes$2[r].annotations.push(e)},addMember=function(t,e){const r=splitClassNameAndType(t).className,n=classes$2[r];if(typeof e=="string"){const a=e.trim();a.startsWith("<<")&&a.endsWith(">>")?n.annotations.push(sanitizeText$2(a.substring(2,a.length-2))):a.indexOf(")")>0?n.methods.push(sanitizeText$2(a)):a&&n.members.push(sanitizeText$2(a))}},addMembers=function(t,e){Array.isArray(e)&&(e.reverse(),e.forEach(r=>addMember(t,r)))},addNote$1=function(t,e){const r={id:`note${notes.length}`,class:e,text:t};notes.push(r)},cleanupLabel$1=function(t){return t.substring(0,1)===":"?common$1.sanitizeText(t.substr(1).trim(),getConfig$1()):sanitizeText$2(t.trim())},setCssClass$1=function(t,e){t.split(",").forEach(function(r){let n=r;r[0].match(/\d/)&&(n=MERMAID_DOM_ID_PREFIX$1+n),classes$2[n]!==void 0&&classes$2[n].cssClasses.push(e)})},setTooltip$1=function(t,e){const r=getConfig$1();t.split(",").forEach(function(n){e!==void 0&&(classes$2[n].tooltip=common$1.sanitizeText(e,r))})},getTooltip$1=function(t){return classes$2[t].tooltip},setLink$2=function(t,e,r){const n=getConfig$1();t.split(",").forEach(function(a){let s=a;a[0].match(/\d/)&&(s=MERMAID_DOM_ID_PREFIX$1+s),classes$2[s]!==void 0&&(classes$2[s].link=utils.formatUrl(e,n),n.securityLevel==="sandbox"?classes$2[s].linkTarget="_top":typeof r=="string"?classes$2[s].linkTarget=sanitizeText$2(r):classes$2[s].linkTarget="_blank")}),setCssClass$1(t,"clickable")},setClickEvent$2=function(t,e,r){t.split(",").forEach(function(n){setClickFunc(n,e,r),classes$2[n].haveCallback=!0}),setCssClass$1(t,"clickable")},setClickFunc=function(t,e,r){const n=getConfig$1();let a=t,s=lookUpDomId$1(a);if(n.securityLevel==="loose"&&e!==void 0&&classes$2[a]!==void 0){let o=[];if(typeof r=="string"){o=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l<o.length;l++){let u=o[l].trim();u.charAt(0)==='"'&&u.charAt(u.length-1)==='"'&&(u=u.substr(1,u.length-2)),o[l]=u}}o.length===0&&o.push(s),funs$2.push(function(){const l=document.querySelector(`[id="${s}"]`);l!==null&&l.addEventListener("click",function(){utils.runFunc(e,...o)},!1)})}},bindFunctions$2=function(t){funs$2.forEach(function(e){e(t)})},lineType$1={LINE:0,DOTTED_LINE:1},relationType$1={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},setupToolTips$1=function(t){let e=select(".mermaidTooltip");(e._groups||e)[0][0]===null&&(e=select("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),select(t).select("svg").selectAll("g.node").on("mouseover",function(){const a=select(this);if(a.attr("title")===null)return;const o=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(a.attr("title")).style("left",window.scrollX+o.left+(o.right-o.left)/2+"px").style("top",window.scrollY+o.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),a.classed("hover",!0)}).on("mouseout",function(){e.transition().duration(500).style("opacity",0),select(this).classed("hover",!1)})};funs$2.push(setupToolTips$1);let direction$2="TB";const getDirection$2=()=>direction$2,setDirection$2=t=>{direction$2=t},classDb={parseDirective:parseDirective$9,setAccTitle,getAccTitle,getAccDescription,setAccDescription,getConfig:()=>getConfig$1().class,addClass:addClass$1,bindFunctions:bindFunctions$2,clear:clear$c,getClass,getClasses:getClasses$5,getNotes,addAnnotation,addNote:addNote$1,getRelations:getRelations$1,addRelation:addRelation$1,getDirection:getDirection$2,setDirection:setDirection$2,addMember,addMembers,cleanupLabel:cleanupLabel$1,lineType:lineType$1,relationType:relationType$1,setClickEvent:setClickEvent$2,setCssClass:setCssClass$1,setLink:setLink$2,getTooltip:getTooltip$1,setTooltip:setTooltip$1,lookUpDomId:lookUpDomId$1,setDiagramTitle,getDiagramTitle};let edgeCount$1=0;const drawEdge$1=function(t,e,r,n,a){const s=function(L){switch(L){case a.db.relationType.AGGREGATION:return"aggregation";case a.db.relationType.EXTENSION:return"extension";case a.db.relationType.COMPOSITION:return"composition";case a.db.relationType.DEPENDENCY:return"dependency";case a.db.relationType.LOLLIPOP:return"lollipop"}};e.points=e.points.filter(L=>!Number.isNaN(L.y));const o=e.points,l=line$1().x(function(L){return L.x}).y(function(L){return L.y}).curve(curveBasis),u=t.append("path").attr("d",l(o)).attr("id","edge"+edgeCount$1).attr("class","relation");let h="";n.arrowMarkerAbsolute&&(h=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,h=h.replace(/\(/g,"\\("),h=h.replace(/\)/g,"\\)")),r.relation.lineType==1&&u.attr("class","relation dashed-line"),r.relation.lineType==10&&u.attr("class","relation dotted-line"),r.relation.type1!=="none"&&u.attr("marker-start","url("+h+"#"+s(r.relation.type1)+"Start)"),r.relation.type2!=="none"&&u.attr("marker-end","url("+h+"#"+s(r.relation.type2)+"End)");let d,p;const g=e.points.length;let m=utils.calcLabelPosition(e.points);d=m.x,p=m.y;let T,I,A,C;if(g%2!==0&&g>1){let L=utils.calcCardinalityPosition(r.relation.type1!=="none",e.points,e.points[0]),M=utils.calcCardinalityPosition(r.relation.type2!=="none",e.points,e.points[g-1]);log$1.debug("cardinality_1_point "+JSON.stringify(L)),log$1.debug("cardinality_2_point "+JSON.stringify(M)),T=L.x,I=L.y,A=M.x,C=M.y}if(r.title!==void 0){const L=t.append("g").attr("class","classLabel"),M=L.append("text").attr("class","label").attr("x",d).attr("y",p).attr("fill","red").attr("text-anchor","middle").text(r.title);window.label=M;const F=M.node().getBBox();L.insert("rect",":first-child").attr("class","box").attr("x",F.x-n.padding/2).attr("y",F.y-n.padding/2).attr("width",F.width+n.padding).attr("height",F.height+n.padding)}log$1.info("Rendering relation "+JSON.stringify(r)),r.relationTitle1!==void 0&&r.relationTitle1!=="none"&&t.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",T).attr("y",I).attr("fill","black").attr("font-size","6").text(r.relationTitle1),r.relationTitle2!==void 0&&r.relationTitle2!=="none"&&t.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",A).attr("y",C).attr("fill","black").attr("font-size","6").text(r.relationTitle2),edgeCount$1++},drawClass=function(t,e,r,n){log$1.debug("Rendering class ",e,r);const a=e.id,s={id:a,label:e.id,width:0,height:0},o=t.append("g").attr("id",n.db.lookUpDomId(a)).attr("class","classGroup");let l;e.link?l=o.append("svg:a").attr("xlink:href",e.link).attr("target",e.linkTarget).append("text").attr("y",r.textHeight+r.padding).attr("x",0):l=o.append("text").attr("y",r.textHeight+r.padding).attr("x",0);let u=!0;e.annotations.forEach(function(H){const q=l.append("tspan").text("«"+H+"»");u||q.attr("dy",r.textHeight),u=!1});let h=e.id;e.type!==void 0&&e.type!==""&&(h+="<"+e.type+">");const d=l.append("tspan").text(h).attr("class","title");u||d.attr("dy",r.textHeight);const p=l.node().getBBox().height,g=o.append("line").attr("x1",0).attr("y1",r.padding+p+r.dividerMargin/2).attr("y2",r.padding+p+r.dividerMargin/2),m=o.append("text").attr("x",r.padding).attr("y",p+r.dividerMargin+r.textHeight).attr("fill","white").attr("class","classText");u=!0,e.members.forEach(function(H){addTspan(m,H,u,r),u=!1});const T=m.node().getBBox(),I=o.append("line").attr("x1",0).attr("y1",r.padding+p+r.dividerMargin+T.height).attr("y2",r.padding+p+r.dividerMargin+T.height),A=o.append("text").attr("x",r.padding).attr("y",p+2*r.dividerMargin+T.height+r.textHeight).attr("fill","white").attr("class","classText");u=!0,e.methods.forEach(function(H){addTspan(A,H,u,r),u=!1});const C=o.node().getBBox();var L=" ";e.cssClasses.length>0&&(L=L+e.cssClasses.join(" "));const F=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",C.width+2*r.padding).attr("height",C.height+r.padding+.5*r.dividerMargin).attr("class",L).node().getBBox().width;return l.node().childNodes.forEach(function(H){H.setAttribute("x",(F-H.getBBox().width)/2)}),e.tooltip&&l.insert("title").text(e.tooltip),g.attr("x2",F),I.attr("x2",F),s.width=F,s.height=C.height+r.padding+.5*r.dividerMargin,s},drawNote$2=function(t,e,r,n){log$1.debug("Rendering note ",e,r);const a=e.id,s={id:a,text:e.text,width:0,height:0},o=t.append("g").attr("id",a).attr("class","classGroup");let l=o.append("text").attr("y",r.textHeight+r.padding).attr("x",0);const u=JSON.parse(`"${e.text}"`).split(`
`);u.forEach(function(g){log$1.debug(`Adding line: ${g}`),l.append("tspan").text(g).attr("class","title").attr("dy",r.textHeight)});const h=o.node().getBBox(),p=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",h.width+2*r.padding).attr("height",h.height+u.length*r.textHeight+r.padding+.5*r.dividerMargin).node().getBBox().width;return l.node().childNodes.forEach(function(g){g.setAttribute("x",(p-g.getBBox().width)/2)}),s.width=p,s.height=h.height+u.length*r.textHeight+r.padding+.5*r.dividerMargin,s},parseMember=function(t){const e=/^([#+~-])?(\w+)(~\w+~|\[])?\s+(\w+) *([$*])?$/,r=/^([#+|~-])?(\w+) *\( *(.*)\) *([$*])? *(\w*[[\]|~]*\s*\w*~?)$/;let n=t.match(e),a=t.match(r);return n&&!a?buildFieldDisplay(n):a?buildMethodDisplay(a):buildLegacyDisplay(t)},buildFieldDisplay=function(t){let e="",r="";try{let n=t[1]?t[1].trim():"",a=t[2]?t[2].trim():"",s=t[3]?parseGenericTypes(t[3].trim()):"",o=t[4]?t[4].trim():"",l=t[5]?t[5].trim():"";r=n+a+s+" "+o,e=parseClassifier(l)}catch{r=t}return{displayText:r,cssStyle:e}},buildMethodDisplay=function(t){let e="",r="";try{let n=t[1]?t[1].trim():"",a=t[2]?t[2].trim():"",s=t[3]?parseGenericTypes(t[3].trim()):"",o=t[4]?t[4].trim():"",l=t[5]?" : "+parseGenericTypes(t[5]).trim():"";r=n+a+"("+s+")"+l,e=parseClassifier(o)}catch{r=t}return{displayText:r,cssStyle:e}},buildLegacyDisplay=function(t){let e="",r="",n="",a=t.indexOf("("),s=t.indexOf(")");if(a>1&&s>a&&s<=t.length){let o="",l="",u=t.substring(0,1);u.match(/\w/)?l=t.substring(0,a).trim():(u.match(/[#+~-]/)&&(o=u),l=t.substring(1,a).trim());const h=t.substring(a+1,s);t.substring(s+1,1),r=parseClassifier(t.substring(s+1,s+2)),e=o+l+"("+parseGenericTypes(h.trim())+")",s<t.length&&(n=t.substring(s+2).trim(),n!==""&&(n=" : "+parseGenericTypes(n),e+=n))}else e=parseGenericTypes(t);return{displayText:e,cssStyle:r}},addTspan=function(t,e,r,n){let a=parseMember(e);const s=t.append("tspan").attr("x",n.padding).text(a.displayText);a.cssStyle!==""&&s.attr("style",a.cssStyle),r||s.attr("dy",n.textHeight)},parseClassifier=function(t){switch(t){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}},svgDraw$2={drawClass,drawEdge:drawEdge$1,drawNote:drawNote$2,parseMember};let idCache$2={};const padding=20,getGraphId=function(t){const e=Object.entries(idCache$2).find(r=>r[1].label===t);if(e)return e[0]},insertMarkers$4=function(t){t.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"),t.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"),t.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"),t.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"),t.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"),t.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"),t.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"),t.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")},draw$d=function(t,e,r,n){const a=getConfig$1().class;idCache$2={},log$1.info("Rendering diagram "+t);const s=getConfig$1().securityLevel;let o;s==="sandbox"&&(o=select("#i"+e));const l=s==="sandbox"?select(o.nodes()[0].contentDocument.body):select("body"),u=l.select(`[id='${e}']`);insertMarkers$4(u);const h=new Graph({multigraph:!0});h.setGraph({isMultiGraph:!0}),h.setDefaultEdgeLabel(function(){return{}});const d=n.db.getClasses(),p=Object.keys(d);for(const L of p){const M=d[L],F=svgDraw$2.drawClass(u,M,a,n);idCache$2[F.id]=F,h.setNode(F.id,F),log$1.info("Org height: "+F.height)}n.db.getRelations().forEach(function(L){log$1.info("tjoho"+getGraphId(L.id1)+getGraphId(L.id2)+JSON.stringify(L)),h.setEdge(getGraphId(L.id1),getGraphId(L.id2),{relation:L},L.title||"DEFAULT")}),n.db.getNotes().forEach(function(L){log$1.debug(`Adding note: ${JSON.stringify(L)}`);const M=svgDraw$2.drawNote(u,L,a,n);idCache$2[M.id]=M,h.setNode(M.id,M),L.class&&L.class in d&&h.setEdge(L.id,getGraphId(L.class),{relation:{id1:L.id,id2:L.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")}),layout(h),h.nodes().forEach(function(L){L!==void 0&&h.node(L)!==void 0&&(log$1.debug("Node "+L+": "+JSON.stringify(h.node(L))),l.select("#"+(n.db.lookUpDomId(L)||L)).attr("transform","translate("+(h.node(L).x-h.node(L).width/2)+","+(h.node(L).y-h.node(L).height/2)+" )"))}),h.edges().forEach(function(L){L!==void 0&&h.edge(L)!==void 0&&(log$1.debug("Edge "+L.v+" -> "+L.w+": "+JSON.stringify(h.edge(L))),svgDraw$2.drawEdge(u,h.edge(L),h.edge(L).relation,a,n))});const T=u.node().getBBox(),I=T.width+padding*2,A=T.height+padding*2;configureSvgSize(u,A,I,a.useMaxWidth);const C=`${T.x-padding} ${T.y-padding} ${I} ${A}`;log$1.debug(`viewBox ${C}`),u.attr("viewBox",C)},classRenderer={draw:draw$d},insertMarkers$2=(t,e,r,n)=>{e.forEach(a=>{markers$1[a](t,r,n)})},extension=(t,e,r)=>{log$1.trace("Making markers for ",r),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$1=(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")},markers$1={extension,composition,aggregation,dependency,lollipop,point,circle:circle$1,cross,barb},insertMarkers$3=insertMarkers$2;function applyStyle(t,e){e&&t.attr("style",e)}function addHtmlLabel(t){const e=select(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label,a=t.isNode?"nodeLabel":"edgeLabel";return r.html('<span class="'+a+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+n+"</span>"),applyStyle(r,t.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}const createLabel=(t,e,r,n)=>{let a=t||"";if(typeof a=="object"&&(a=a[0]),evaluate(getConfig$1().flowchart.htmlLabels)){a=a.replace(/\\n|\n/g,"<br />"),log$1.info("vertexText"+a);const s={isNode:n,label:decodeEntities(a).replace(/fa[blrs]?:fa-[\w-]+/g,l=>`<i class='${l.replace(":"," ")}'></i>`),labelStyle:e.replace("fill:","color:")};return addHtmlLabel(s)}else{const s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("style",e.replace("color:","fill:"));let o=[];typeof a=="string"?o=a.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(a)?o=a:o=[];for(const l of o){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),r?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=l.trim(),s.appendChild(u)}return s}},createLabel$1=createLabel,labelHelper=(t,e,r,n)=>{let a;r?a=r:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("g").attr("class","label").attr("style",e.labelStyle);let l;e.labelText===void 0?l="":l=typeof e.labelText=="string"?e.labelText:e.labelText[0];const u=o.node().appendChild(createLabel$1(sanitizeText$5(decodeEntities(l),getConfig$1()),e.labelStyle,!1,n));let h=u.getBBox();if(evaluate(getConfig$1().flowchart.htmlLabels)){const p=u.children[0],g=select(u);h=p.getBoundingClientRect(),g.attr("width",h.width),g.attr("height",h.height)}const d=e.padding/2;return o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),{shapeSvg:s,bbox:h,halfPadding:d,label:o}},updateNodeBounds=(t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height};function insertPolygonShape$1(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}let clusterDb={},descendants={},parents={};const clear$b=()=>{descendants={},parents={},clusterDb={}},isDescendant=(t,e)=>(log$1.trace("In isDecendant",e," ",t," = ",descendants[e].includes(t)),!!descendants[e].includes(t)),edgeInCluster=(t,e)=>(log$1.info("Decendants of ",e," is ",descendants[e]),log$1.info("Edge is ",t),t.v===e||t.w===e?!1:descendants[e]?descendants[e].includes(t.v)||isDescendant(t.v,e)||isDescendant(t.w,e)||descendants[e].includes(t.w):(log$1.debug("Tilt, ",e,",not in decendants"),!1)),copy=(t,e,r,n)=>{log$1.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const a=e.children(t)||[];t!==n&&a.push(t),log$1.warn("Copying (nodes) clusterId",t,"nodes",a),a.forEach(s=>{if(e.children(s).length>0)copy(s,e,r,n);else{const o=e.node(s);log$1.info("cp ",s," to ",n," with parent ",t),r.setNode(s,o),n!==e.parent(s)&&(log$1.warn("Setting parent",s,e.parent(s)),r.setParent(s,e.parent(s))),t!==n&&s!==t?(log$1.debug("Setting parent",s,t),r.setParent(s,t)):(log$1.info("In copy ",t,"root",n,"data",e.node(t),n),log$1.debug("Not Setting parent for node=",s,"cluster!==rootId",t!==n,"node!==clusterId",s!==t));const l=e.edges(s);log$1.debug("Copying Edges",l),l.forEach(u=>{log$1.info("Edge",u);const h=e.edge(u.v,u.w,u.name);log$1.info("Edge data",h,n);try{edgeInCluster(u,n)?(log$1.info("Copying as ",u.v,u.w,h,u.name),r.setEdge(u.v,u.w,h,u.name),log$1.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):log$1.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",n," clusterId:",t)}catch(d){log$1.error(d)}})}log$1.debug("Removing node",s),e.removeNode(s)})},extractDescendants=(t,e)=>{const r=e.children(t);let n=[...r];for(const a of r)parents[a]=t,n=[...n,...extractDescendants(a,e)];return n},findNonClusterChild=(t,e)=>{log$1.trace("Searching",t);const r=e.children(t);if(log$1.trace("Searching children of id ",t,r),r.length<1)return log$1.trace("This is a valid node",t),t;for(const n of r){const a=findNonClusterChild(n,e);if(a)return log$1.trace("Found replacement for",t," => ",a),a}},getAnchorId=t=>!clusterDb[t]||!clusterDb[t].externalConnections?t:clusterDb[t]?clusterDb[t].id:t,adjustClustersAndEdges=(t,e)=>{if(!t||e>10){log$1.debug("Opting out, no graph ");return}else log$1.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(log$1.warn("Cluster identified",r," Replacement id in edges: ",findNonClusterChild(r,t)),descendants[r]=extractDescendants(r,t),clusterDb[r]={id:findNonClusterChild(r,t),clusterData:t.node(r)})}),t.nodes().forEach(function(r){const n=t.children(r),a=t.edges();n.length>0?(log$1.debug("Cluster identified",r,descendants),a.forEach(s=>{if(s.v!==r&&s.w!==r){const o=isDescendant(s.v,r),l=isDescendant(s.w,r);o^l&&(log$1.warn("Edge: ",s," leaves cluster ",r),log$1.warn("Decendants of XXX ",r,": ",descendants[r]),clusterDb[r].externalConnections=!0)}})):log$1.debug("Not a cluster ",r,descendants)}),t.edges().forEach(function(r){const n=t.edge(r);log$1.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),log$1.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let a=r.v,s=r.w;if(log$1.warn("Fix XXX",clusterDb,"ids:",r.v,r.w,"Translating: ",clusterDb[r.v]," --- ",clusterDb[r.w]),clusterDb[r.v]&&clusterDb[r.w]&&clusterDb[r.v]===clusterDb[r.w]){log$1.warn("Fixing and trixing link to self - removing XXX",r.v,r.w,r.name),log$1.warn("Fixing and trixing - removing XXX",r.v,r.w,r.name),a=getAnchorId(r.v),s=getAnchorId(r.w),t.removeEdge(r.v,r.w,r.name);const o=r.w+"---"+r.v;t.setNode(o,{domId:o,id:o,labelStyle:"",labelText:n.label,padding:0,shape:"labelRect",style:""});const l=JSON.parse(JSON.stringify(n)),u=JSON.parse(JSON.stringify(n));l.label="",l.arrowTypeEnd="none",u.label="",l.fromCluster=r.v,u.toCluster=r.v,t.setEdge(a,o,l,r.name+"-cyclic-special"),t.setEdge(o,s,u,r.name+"-cyclic-special")}else(clusterDb[r.v]||clusterDb[r.w])&&(log$1.warn("Fixing and trixing - removing XXX",r.v,r.w,r.name),a=getAnchorId(r.v),s=getAnchorId(r.w),t.removeEdge(r.v,r.w,r.name),a!==r.v&&(n.fromCluster=r.v),s!==r.w&&(n.toCluster=r.w),log$1.warn("Fix Replacing with XXX",a,s,r.name),t.setEdge(a,s,n,r.name))}),log$1.warn("Adjusted Graph",write(t)),extractor(t,0),log$1.trace(clusterDb)},extractor=(t,e)=>{if(log$1.warn("extractor - ",e,write(t),t.children("D")),e>10){log$1.error("Bailing out");return}let r=t.nodes(),n=!1;for(const a of r){const s=t.children(a);n=n||s.length>0}if(!n){log$1.debug("Done, no node has children",t.nodes());return}log$1.debug("Nodes = ",r,e);for(const a of r)if(log$1.debug("Extracting node",a,clusterDb,clusterDb[a]&&!clusterDb[a].externalConnections,!t.parent(a),t.node(a),t.children("D")," Depth ",e),!clusterDb[a])log$1.debug("Not a cluster",a,e);else if(!clusterDb[a].externalConnections&&t.children(a)&&t.children(a).length>0){log$1.warn("Cluster without external connections, without a parent and with children",a,e);let o=t.graph().rankdir==="TB"?"LR":"TB";clusterDb[a]&&clusterDb[a].clusterData&&clusterDb[a].clusterData.dir&&(o=clusterDb[a].clusterData.dir,log$1.warn("Fixing dir",clusterDb[a].clusterData.dir,o));const l=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});log$1.warn("Old graph before copy",write(t)),copy(a,t,l,a),t.setNode(a,{clusterNode:!0,id:a,clusterData:clusterDb[a].clusterData,labelText:clusterDb[a].labelText,graph:l}),log$1.warn("New graph after copy node: (",a,")",write(l)),log$1.debug("Old graph after copy",write(t))}else log$1.warn("Cluster ** ",a," **not meeting the criteria !externalConnections:",!clusterDb[a].externalConnections," no parent: ",!t.parent(a)," children ",t.children(a)&&t.children(a).length>0,t.children("D"),e),log$1.debug(clusterDb);r=t.nodes(),log$1.warn("New list of nodes",r);for(const a of r){const s=t.node(a);log$1.warn(" Now next level",a,s),s.clusterNode&&extractor(s.graph,e+1)}},sorter=(t,e)=>{if(e.length===0)return[];let r=Object.assign(e);return e.forEach(n=>{const a=t.children(n),s=sorter(t,a);r=[...r,...s]}),r},sortNodesByHierarchy=t=>sorter(t,t.children());function intersectNode(t,e){return t.intersect(e)}function intersectEllipse(t,e,r,n){var a=t.x,s=t.y,o=a-n.x,l=s-n.y,u=Math.sqrt(e*e*l*l+r*r*o*o),h=Math.abs(e*r*o/u);n.x<a&&(h=-h);var d=Math.abs(e*r*l/u);return n.y<s&&(d=-d),{x:a+h,y:s+d}}function intersectCircle(t,e,r){return intersectEllipse(t,e,e,r)}function intersectLine(t,e,r,n){var a,s,o,l,u,h,d,p,g,m,T,I,A,C,L;if(a=e.y-t.y,o=t.x-e.x,u=e.x*t.y-t.x*e.y,g=a*r.x+o*r.y+u,m=a*n.x+o*n.y+u,!(g!==0&&m!==0&&sameSign(g,m))&&(s=n.y-r.y,l=r.x-n.x,h=n.x*r.y-r.x*n.y,d=s*t.x+l*t.y+h,p=s*e.x+l*e.y+h,!(d!==0&&p!==0&&sameSign(d,p))&&(T=a*l-s*o,T!==0)))return I=Math.abs(T/2),A=o*h-l*u,C=A<0?(A-I)/T:(A+I)/T,A=s*u-a*h,L=A<0?(A-I)/T:(A+I)/T,{x:C,y:L}}function sameSign(t,e){return t*e>0}function intersectPolygon(t,e,r){var n=t.x,a=t.y,s=[],o=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(T){o=Math.min(o,T.x),l=Math.min(l,T.y)}):(o=Math.min(o,e.x),l=Math.min(l,e.y));for(var u=n-t.width/2-o,h=a-t.height/2-l,d=0;d<e.length;d++){var p=e[d],g=e[d<e.length-1?d+1:0],m=intersectLine(t,r,{x:u+p.x,y:h+p.y},{x:u+g.x,y:h+g.y});m&&s.push(m)}return s.length?(s.length>1&&s.sort(function(T,I){var A=T.x-r.x,C=T.y-r.y,L=Math.sqrt(A*A+C*C),M=I.x-r.x,F=I.y-r.y,H=Math.sqrt(M*M+F*F);return L<H?-1:L===H?0:1}),s[0]):t}const intersectRect=(t,e)=>{var r=t.x,n=t.y,a=e.x-r,s=e.y-n,o=t.width/2,l=t.height/2,u,h;return Math.abs(s)*o>Math.abs(a)*l?(s<0&&(l=-l),u=s===0?0:l*a/s,h=l):(a<0&&(o=-o),u=o,h=a===0?0:o*s/a),{x:r+u,y:n+h}},intersectRect$1=intersectRect,intersect={node:intersectNode,circle:intersectCircle,ellipse:intersectEllipse,polygon:intersectPolygon,rect:intersectRect$1},note=(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:a}=labelHelper(t,e,"node "+e.classes,!0);log$1.info("Classes = ",e.classes);const s=r.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-n.width/2-a).attr("y",-n.height/2-a).attr("width",n.width+e.padding).attr("height",n.height+e.padding),updateNodeBounds(e,s),e.intersect=function(o){return intersect.rect(e,o)},r},note$1=note,question$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=n.height+e.padding,o=a+s,l=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}];log$1.info("Question main (Circle)");const u=insertPolygonShape$1(r,o,o,l);return u.attr("style",e.style),updateNodeBounds(e,u),e.intersect=function(h){return log$1.warn("Intersect called"),intersect.polygon(e,l,h)},r},choice=(t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,a=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",a.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(o){return intersect.circle(e,14,o)},r},hexagon$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=4,s=n.height+e.padding,o=s/a,l=n.width+2*o+e.padding,u=[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}],h=insertPolygonShape$1(r,l,s,u);return h.attr("style",e.style),updateNodeBounds(e,h),e.intersect=function(d){return intersect.polygon(e,u,d)},r},rect_left_inv_arrow$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=n.height+e.padding,o=[{x:-s/2,y:0},{x:a,y:0},{x:a,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return insertPolygonShape$1(r,a,s,o).attr("style",e.style),e.width=a+s,e.height=s,e.intersect=function(u){return intersect.polygon(e,o,u)},r},lean_right$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=n.height+e.padding,o=[{x:-2*s/6,y:0},{x:a-s/6,y:0},{x:a+2*s/6,y:-s},{x:s/6,y:-s}],l=insertPolygonShape$1(r,a,s,o);return l.attr("style",e.style),updateNodeBounds(e,l),e.intersect=function(u){return intersect.polygon(e,o,u)},r},lean_left$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=n.height+e.padding,o=[{x:2*s/6,y:0},{x:a+s/6,y:0},{x:a-2*s/6,y:-s},{x:-s/6,y:-s}],l=insertPolygonShape$1(r,a,s,o);return l.attr("style",e.style),updateNodeBounds(e,l),e.intersect=function(u){return intersect.polygon(e,o,u)},r},trapezoid$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=n.height+e.padding,o=[{x:-2*s/6,y:0},{x:a+2*s/6,y:0},{x:a-s/6,y:-s},{x:s/6,y:-s}],l=insertPolygonShape$1(r,a,s,o);return l.attr("style",e.style),updateNodeBounds(e,l),e.intersect=function(u){return intersect.polygon(e,o,u)},r},inv_trapezoid$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=n.height+e.padding,o=[{x:s/6,y:0},{x:a-s/6,y:0},{x:a+2*s/6,y:-s},{x:-2*s/6,y:-s}],l=insertPolygonShape$1(r,a,s,o);return l.attr("style",e.style),updateNodeBounds(e,l),e.intersect=function(u){return intersect.polygon(e,o,u)},r},rect_right_inv_arrow$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=n.height+e.padding,o=[{x:0,y:0},{x:a+s/2,y:0},{x:a,y:-s/2},{x:a+s/2,y:-s},{x:0,y:-s}],l=insertPolygonShape$1(r,a,s,o);return l.attr("style",e.style),updateNodeBounds(e,l),e.intersect=function(u){return intersect.polygon(e,o,u)},r},cylinder$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=a/2,o=s/(2.5+a/50),l=n.height+o+e.padding,u="M 0,"+o+" a "+s+","+o+" 0,0,0 "+a+" 0 a "+s+","+o+" 0,0,0 "+-a+" 0 l 0,"+l+" a "+s+","+o+" 0,0,0 "+a+" 0 l 0,"+-l,h=r.attr("label-offset-y",o).insert("path",":first-child").attr("style",e.style).attr("d",u).attr("transform","translate("+-a/2+","+-(l/2+o)+")");return updateNodeBounds(e,h),e.intersect=function(d){const p=intersect.rect(e,d),g=p.x-e.x;if(s!=0&&(Math.abs(g)<e.width/2||Math.abs(g)==e.width/2&&Math.abs(p.y-e.y)>e.height/2-o)){let m=o*o*(1-g*g/(s*s));m!=0&&(m=Math.sqrt(m)),m=o-m,d.y-e.y>0&&(m=-m),p.y+=m}return p},r},rect$1=(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:a}=labelHelper(t,e,"node "+e.classes,!0);log$1.trace("Classes = ",e.classes);const s=r.insert("rect",":first-child"),o=n.width+e.padding,l=n.height+e.padding;if(s.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",-n.width/2-a).attr("y",-n.height/2-a).attr("width",o).attr("height",l),e.props){const u=new Set(Object.keys(e.props));e.props.borders&&(applyNodePropertyBorders(s,e.props.borders,o,l),u.delete("borders")),u.forEach(h=>{log$1.warn(`Unknown node property ${h}`)})}return updateNodeBounds(e,s),e.intersect=function(u){return intersect.rect(e,u)},r},labelRect=(t,e)=>{const{shapeSvg:r}=labelHelper(t,e,"label",!0);log$1.trace("Classes = ",e.classes);const n=r.insert("rect",":first-child"),a=0,s=0;if(n.attr("width",a).attr("height",s),r.attr("class","label edgeLabel"),e.props){const o=new Set(Object.keys(e.props));e.props.borders&&(applyNodePropertyBorders(n,e.props.borders,a,s),o.delete("borders")),o.forEach(l=>{log$1.warn(`Unknown node property ${l}`)})}return updateNodeBounds(e,n),e.intersect=function(o){return intersect.rect(e,o)},r};function applyNodePropertyBorders(t,e,r,n){const a=[],s=l=>{a.push(l,0)},o=l=>{a.push(0,l)};e.includes("t")?(log$1.debug("add top border"),s(r)):o(r),e.includes("r")?(log$1.debug("add right border"),s(n)):o(n),e.includes("b")?(log$1.debug("add bottom border"),s(r)):o(r),e.includes("l")?(log$1.debug("add left border"),s(n)):o(n),t.attr("stroke-dasharray",a.join(" "))}const rectWithTitle=(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),a=n.insert("rect",":first-child"),s=n.insert("line"),o=n.insert("g").attr("class","label"),l=e.labelText.flat?e.labelText.flat():e.labelText;let u="";typeof l=="object"?u=l[0]:u=l,log$1.info("Label text abc79",u,l,typeof l=="object");const h=o.node().appendChild(createLabel$1(u,e.labelStyle,!0,!0));let d={width:0,height:0};if(evaluate(getConfig$1().flowchart.htmlLabels)){const I=h.children[0],A=select(h);d=I.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}log$1.info("Text 2",l);const p=l.slice(1,l.length);let g=h.getBBox();const m=o.node().appendChild(createLabel$1(p.join?p.join("<br/>"):p,e.labelStyle,!0,!0));if(evaluate(getConfig$1().flowchart.htmlLabels)){const I=m.children[0],A=select(m);d=I.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}const T=e.padding/2;return select(m).attr("transform","translate( "+(d.width>g.width?0:(g.width-d.width)/2)+", "+(g.height+T+5)+")"),select(h).attr("transform","translate( "+(d.width<g.width?0:-(g.width-d.width)/2)+", "+0+")"),d=o.node().getBBox(),o.attr("transform","translate("+-d.width/2+", "+(-d.height/2-T+3)+")"),a.attr("class","outer title-state").attr("x",-d.width/2-T).attr("y",-d.height/2-T).attr("width",d.width+e.padding).attr("height",d.height+e.padding),s.attr("class","divider").attr("x1",-d.width/2-T).attr("x2",d.width/2+T).attr("y1",-d.height/2-T+g.height+T).attr("y2",-d.height/2-T+g.height+T),updateNodeBounds(e,a),e.intersect=function(I){return intersect.rect(e,I)},n},stadium$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.height+e.padding,s=n.width+a/4+e.padding,o=r.insert("rect",":first-child").attr("style",e.style).attr("rx",a/2).attr("ry",a/2).attr("x",-s/2).attr("y",-a/2).attr("width",s).attr("height",a);return updateNodeBounds(e,o),e.intersect=function(l){return intersect.rect(e,l)},r},circle=(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:a}=labelHelper(t,e,void 0,!0),s=r.insert("circle",":first-child");return s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+a).attr("width",n.width+e.padding).attr("height",n.height+e.padding),log$1.info("Circle main"),updateNodeBounds(e,s),e.intersect=function(o){return log$1.info("Circle intersect",e,n.width/2+a,o),intersect.circle(e,n.width/2+a,o)},r},doublecircle=(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:a}=labelHelper(t,e,void 0,!0),s=5,o=r.insert("g",":first-child"),l=o.insert("circle"),u=o.insert("circle");return l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+a+s).attr("width",n.width+e.padding+s*2).attr("height",n.height+e.padding+s*2),u.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+a).attr("width",n.width+e.padding).attr("height",n.height+e.padding),log$1.info("DoubleCircle main"),updateNodeBounds(e,l),e.intersect=function(h){return log$1.info("DoubleCircle intersect",e,n.width/2+a+s,h),intersect.circle(e,n.width/2+a+s,h)},r},subroutine$1=(t,e)=>{const{shapeSvg:r,bbox:n}=labelHelper(t,e,void 0,!0),a=n.width+e.padding,s=n.height+e.padding,o=[{x:0,y:0},{x:a,y:0},{x:a,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],l=insertPolygonShape$1(r,a,s,o);return l.attr("style",e.style),updateNodeBounds(e,l),e.intersect=function(u){return intersect.polygon(e,o,u)},r},start=(t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),updateNodeBounds(e,n),e.intersect=function(a){return intersect.circle(e,7,a)},r},forkJoin=(t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a=70,s=10;r==="LR"&&(a=10,s=70);const o=n.append("rect").attr("x",-1*a/2).attr("y",-1*s/2).attr("width",a).attr("height",s).attr("class","fork-join");return updateNodeBounds(e,o),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(l){return intersect.rect(e,l)},n},end=(t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),a=r.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),updateNodeBounds(e,a),e.intersect=function(s){return intersect.circle(e,7,s)},r},class_box=(t,e)=>{const r=e.padding/2,n=4,a=8;let s;e.classes?s="node "+e.classes:s="node default";const o=t.insert("g").attr("class",s).attr("id",e.domId||e.id),l=o.insert("rect",":first-child"),u=o.insert("line"),h=o.insert("line");let d=0,p=n;const g=o.insert("g").attr("class","label");let m=0;const T=e.classData.annotations&&e.classData.annotations[0],I=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",A=g.node().appendChild(createLabel$1(I,e.labelStyle,!0,!0));let C=A.getBBox();if(evaluate(getConfig$1().flowchart.htmlLabels)){const z=A.children[0],R=select(A);C=z.getBoundingClientRect(),R.attr("width",C.width),R.attr("height",C.height)}e.classData.annotations[0]&&(p+=C.height+n,d+=C.width);let L=e.classData.id;e.classData.type!==void 0&&e.classData.type!==""&&(getConfig$1().flowchart.htmlLabels?L+="&lt;"+e.classData.type+"&gt;":L+="<"+e.classData.type+">");const M=g.node().appendChild(createLabel$1(L,e.labelStyle,!0,!0));select(M).attr("class","classTitle");let F=M.getBBox();if(evaluate(getConfig$1().flowchart.htmlLabels)){const z=M.children[0],R=select(M);F=z.getBoundingClientRect(),R.attr("width",F.width),R.attr("height",F.height)}p+=F.height+n,F.width>d&&(d=F.width);const H=[];e.classData.members.forEach(z=>{const R=parseMember(z);let $=R.displayText;getConfig$1().flowchart.htmlLabels&&($=$.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const D=g.node().appendChild(createLabel$1($,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0));let k=D.getBBox();if(evaluate(getConfig$1().flowchart.htmlLabels)){const B=D.children[0],v=select(D);k=B.getBoundingClientRect(),v.attr("width",k.width),v.attr("height",k.height)}k.width>d&&(d=k.width),p+=k.height+n,H.push(D)}),p+=a;const q=[];if(e.classData.methods.forEach(z=>{const R=parseMember(z);let $=R.displayText;getConfig$1().flowchart.htmlLabels&&($=$.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const D=g.node().appendChild(createLabel$1($,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0));let k=D.getBBox();if(evaluate(getConfig$1().flowchart.htmlLabels)){const B=D.children[0],v=select(D);k=B.getBoundingClientRect(),v.attr("width",k.width),v.attr("height",k.height)}k.width>d&&(d=k.width),p+=k.height+n,q.push(D)}),p+=a,T){let z=(d-C.width)/2;select(A).attr("transform","translate( "+(-1*d/2+z)+", "+-1*p/2+")"),m=C.height+n}let U=(d-F.width)/2;return select(M).attr("transform","translate( "+(-1*d/2+U)+", "+(-1*p/2+m)+")"),m+=F.height+n,u.attr("class","divider").attr("x1",-d/2-r).attr("x2",d/2+r).attr("y1",-p/2-r+a+m).attr("y2",-p/2-r+a+m),m+=a,H.forEach(z=>{select(z).attr("transform","translate( "+-d/2+", "+(-1*p/2+m+a/2)+")"),m+=F.height+n}),m+=a,h.attr("class","divider").attr("x1",-d/2-r).attr("x2",d/2+r).attr("y1",-p/2-r+a+m).attr("y2",-p/2-r+a+m),m+=a,q.forEach(z=>{select(z).attr("transform","translate( "+-d/2+", "+(-1*p/2+m)+")"),m+=F.height+n}),l.attr("class","outer title-state").attr("x",-d/2-r).attr("y",-(p/2)-r).attr("width",d+e.padding).attr("height",p+e.padding),updateNodeBounds(e,l),e.intersect=function(z){return intersect.rect(e,z)},o},shapes$1={question:question$1,rect:rect$1,labelRect,rectWithTitle,choice,circle,doublecircle,stadium:stadium$1,hexagon:hexagon$1,rect_left_inv_arrow:rect_left_inv_arrow$1,lean_right:lean_right$1,lean_left:lean_left$1,trapezoid:trapezoid$1,inv_trapezoid:inv_trapezoid$1,rect_right_inv_arrow:rect_right_inv_arrow$1,cylinder:cylinder$1,start,end,note:note$1,subroutine:subroutine$1,fork:forkJoin,join:forkJoin,class_box};let nodeElems={};const insertNode=(t,e,r)=>{let n,a;if(e.link){let s;getConfig$1().securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),a=shapes$1[e.shape](n,e,r)}else a=shapes$1[e.shape](t,e,r),n=a;e.tooltip&&a.attr("title",e.tooltip),e.class&&a.attr("class","node default "+e.class),nodeElems[e.id]=n,e.haveCallback&&nodeElems[e.id].attr("class",nodeElems[e.id].attr("class")+" clickable")},setNodeElem=(t,e)=>{nodeElems[e.id]=t},clear$a=()=>{nodeElems={}},positionNode=t=>{const e=nodeElems[t.id];log$1.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},rect=(t,e)=>{log$1.trace("Creating subgraph rect for ",e.id,e);const r=t.insert("g").attr("class","cluster"+(e.class?" "+e.class:"")).attr("id",e.id),n=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),s=a.node().appendChild(createLabel$1(e.labelText,e.labelStyle,void 0,!0));let o=s.getBBox();if(evaluate(getConfig$1().flowchart.htmlLabels)){const p=s.children[0],g=select(s);o=p.getBoundingClientRect(),g.attr("width",o.width),g.attr("height",o.height)}const l=0*e.padding,u=l/2,h=e.width<=o.width+l?o.width+l:e.width;e.width<=o.width+l?e.diff=(o.width-e.width)/2-e.padding/2:e.diff=-e.padding/2,log$1.trace("Data ",e,JSON.stringify(e)),n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-h/2).attr("y",e.y-e.height/2-u).attr("width",h).attr("height",e.height+l),a.attr("transform","translate("+(e.x-o.width/2)+", "+(e.y-e.height/2)+")");const d=n.node().getBBox();return e.width=d.width,e.height=d.height,e.intersect=function(p){return intersectRect$1(e,p)},r},noteGroup=(t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),a=0*e.padding,s=a/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2-s).attr("width",e.width+a).attr("height",e.height+a).attr("fill","none");const o=n.node().getBBox();return e.width=o.width,e.height=o.height,e.intersect=function(l){return intersectRect$1(e,l)},r},roundedWithTitle=(t,e)=>{const r=t.insert("g").attr("class",e.classes).attr("id",e.id),n=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),s=r.append("rect"),o=a.node().appendChild(createLabel$1(e.labelText,e.labelStyle,void 0,!0));let l=o.getBBox();if(evaluate(getConfig$1().flowchart.htmlLabels)){const g=o.children[0],m=select(o);l=g.getBoundingClientRect(),m.attr("width",l.width),m.attr("height",l.height)}l=o.getBBox();const u=0*e.padding,h=u/2,d=e.width<=l.width+e.padding?l.width+e.padding:e.width;e.width<=l.width+e.padding?e.diff=(l.width+e.padding*0-e.width)/2:e.diff=-e.padding/2,n.attr("class","outer").attr("x",e.x-d/2-h).attr("y",e.y-e.height/2-h).attr("width",d+u).attr("height",e.height+u),s.attr("class","inner").attr("x",e.x-d/2-h).attr("y",e.y-e.height/2-h+l.height-1).attr("width",d+u).attr("height",e.height+u-l.height-3),a.attr("transform","translate("+(e.x-l.width/2)+", "+(e.y-e.height/2-e.padding/3+(evaluate(getConfig$1().flowchart.htmlLabels)?5:3))+")");const p=n.node().getBBox();return e.height=p.height,e.intersect=function(g){return intersectRect$1(e,g)},r},divider=(t,e)=>{const r=t.insert("g").attr("class",e.classes).attr("id",e.id),n=r.insert("rect",":first-child"),a=0*e.padding,s=a/2;n.attr("class","divider").attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2).attr("width",e.width+a).attr("height",e.height+a);const o=n.node().getBBox();return e.width=o.width,e.height=o.height,e.diff=-e.padding/2,e.intersect=function(l){return intersectRect$1(e,l)},r},shapes={rect,roundedWithTitle,noteGroup,divider};let clusterElems={};const insertCluster=(t,e)=>{log$1.trace("Inserting cluster");const r=e.shape||"rect";clusterElems[e.id]=shapes[r](t,e)},clear$9=()=>{clusterElems={}};let edgeLabels={},terminalLabels={};const clear$8=()=>{edgeLabels={},terminalLabels={}},insertEdgeLabel=(t,e)=>{const r=createLabel$1(e.label,e.labelStyle),n=t.insert("g").attr("class","edgeLabel"),a=n.insert("g").attr("class","label");a.node().appendChild(r);let s=r.getBBox();if(evaluate(getConfig$1().flowchart.htmlLabels)){const l=r.children[0],u=select(r);s=l.getBoundingClientRect(),u.attr("width",s.width),u.attr("height",s.height)}a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),edgeLabels[e.id]=n,e.width=s.width,e.height=s.height;let o;if(e.startLabelLeft){const l=createLabel$1(e.startLabelLeft,e.labelStyle),u=t.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");o=h.node().appendChild(l);const d=l.getBBox();h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),terminalLabels[e.id]||(terminalLabels[e.id]={}),terminalLabels[e.id].startLeft=u,setTerminalWidth(o,e.startLabelLeft)}if(e.startLabelRight){const l=createLabel$1(e.startLabelRight,e.labelStyle),u=t.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");o=u.node().appendChild(l),h.node().appendChild(l);const d=l.getBBox();h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),terminalLabels[e.id]||(terminalLabels[e.id]={}),terminalLabels[e.id].startRight=u,setTerminalWidth(o,e.startLabelRight)}if(e.endLabelLeft){const l=createLabel$1(e.endLabelLeft,e.labelStyle),u=t.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");o=h.node().appendChild(l);const d=l.getBBox();h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),u.node().appendChild(l),terminalLabels[e.id]||(terminalLabels[e.id]={}),terminalLabels[e.id].endLeft=u,setTerminalWidth(o,e.endLabelLeft)}if(e.endLabelRight){const l=createLabel$1(e.endLabelRight,e.labelStyle),u=t.insert("g").attr("class","edgeTerminals"),h=u.insert("g").attr("class","inner");o=h.node().appendChild(l);const d=l.getBBox();h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),u.node().appendChild(l),terminalLabels[e.id]||(terminalLabels[e.id]={}),terminalLabels[e.id].endRight=u,setTerminalWidth(o,e.endLabelRight)}};function setTerminalWidth(t,e){getConfig$1().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}const positionEdgeLabel=(t,e)=>{log$1.info("Moving label abc78 ",t.id,t.label,edgeLabels[t.id]);let r=e.updatedPath?e.updatedPath:e.originalPath;if(t.label){const n=edgeLabels[t.id];let a=t.x,s=t.y;if(r){const o=utils.calcLabelPosition(r);log$1.info("Moving label "+t.label+" from (",a,",",s,") to (",o.x,",",o.y,") abc78"),e.updatedPath&&(a=o.x,s=o.y)}n.attr("transform","translate("+a+", "+s+")")}if(t.startLabelLeft){const n=terminalLabels[t.id].startLeft;let a=t.x,s=t.y;if(r){const o=utils.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=o.x,s=o.y}n.attr("transform","translate("+a+", "+s+")")}if(t.startLabelRight){const n=terminalLabels[t.id].startRight;let a=t.x,s=t.y;if(r){const o=utils.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=o.x,s=o.y}n.attr("transform","translate("+a+", "+s+")")}if(t.endLabelLeft){const n=terminalLabels[t.id].endLeft;let a=t.x,s=t.y;if(r){const o=utils.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=o.x,s=o.y}n.attr("transform","translate("+a+", "+s+")")}if(t.endLabelRight){const n=terminalLabels[t.id].endRight;let a=t.x,s=t.y;if(r){const o=utils.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=o.x,s=o.y}n.attr("transform","translate("+a+", "+s+")")}},outsideNode=(t,e)=>{const r=t.x,n=t.y,a=Math.abs(e.x-r),s=Math.abs(e.y-n),o=t.width/2,l=t.height/2;return a>=o||s>=l},intersection=(t,e,r)=>{log$1.warn(`intersection calc abc89:
outsidePoint: ${JSON.stringify(e)}
insidePoint : ${JSON.stringify(r)}
node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,a=t.y,s=Math.abs(n-r.x),o=t.width/2;let l=r.x<e.x?o-s:o+s;const u=t.height/2,h=Math.abs(e.y-r.y),d=Math.abs(e.x-r.x);if(Math.abs(a-e.y)*o>Math.abs(n-e.x)*u){let p=r.y<e.y?e.y-u-a:a-u-e.y;l=d*p/h;const g={x:r.x<e.x?r.x+l:r.x-d+l,y:r.y<e.y?r.y+h-p:r.y-h+p};return l===0&&(g.x=e.x,g.y=e.y),d===0&&(g.x=e.x),h===0&&(g.y=e.y),log$1.warn(`abc89 topp/bott calc, Q ${h}, q ${p}, R ${d}, r ${l}`,g),g}else{r.x<e.x?l=e.x-o-n:l=n-o-e.x;let p=h*l/d,g=r.x<e.x?r.x+d-l:r.x-d+l,m=r.y<e.y?r.y+p:r.y-p;return log$1.warn(`sides calc abc89, Q ${h}, q ${p}, R ${d}, r ${l}`,{_x:g,_y:m}),l===0&&(g=e.x,m=e.y),d===0&&(g=e.x),h===0&&(m=e.y),{x:g,y:m}}},cutPathAtIntersect=(t,e)=>{log$1.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],a=!1;return t.forEach(s=>{if(log$1.info("abc88 checking point",s,e),!outsideNode(e,s)&&!a){const o=intersection(e,n,s);log$1.warn("abc88 inside",s,n,o),log$1.warn("abc88 intersection",o);let l=!1;r.forEach(u=>{l=l||u.x===o.x&&u.y===o.y}),r.some(u=>u.x===o.x&&u.y===o.y)?log$1.warn("abc88 no intersect",o,r):r.push(o),a=!0}else log$1.warn("abc88 outside",s,n),n=s,a||r.push(s)}),log$1.warn("abc88 returning points",r),r},insertEdge=function(t,e,r,n,a,s){let o=r.points,l=!1;const u=s.node(e.v);var h=s.node(e.w);log$1.info("abc88 InsertEdge: ",r),h.intersect&&u.intersect&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),log$1.info("Last point",o[o.length-1],h,h.intersect(o[o.length-1])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(log$1.info("to cluster abc88",n[r.toCluster]),o=cutPathAtIntersect(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(log$1.info("from cluster abc88",n[r.fromCluster]),o=cutPathAtIntersect(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(C=>!Number.isNaN(C.y));let p;a==="graph"||a==="flowchart"?p=r.curve||curveBasis:p=curveBasis;const g=line$1().x(function(C){return C.x}).y(function(C){return C.y}).curve(p);let m;switch(r.thickness){case"normal":m="edge-thickness-normal";break;case"thick":m="edge-thickness-thick";break;default:m=""}switch(r.pattern){case"solid":m+=" edge-pattern-solid";break;case"dotted":m+=" edge-pattern-dotted";break;case"dashed":m+=" edge-pattern-dashed";break}const T=t.append("path").attr("d",g(d)).attr("id",r.id).attr("class"," "+m+(r.classes?" "+r.classes:"")).attr("style",r.style);let I="";switch((getConfig$1().flowchart.arrowMarkerAbsolute||getConfig$1().state.arrowMarkerAbsolute)&&(I=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,I=I.replace(/\(/g,"\\("),I=I.replace(/\)/g,"\\)")),log$1.info("arrowTypeStart",r.arrowTypeStart),log$1.info("arrowTypeEnd",r.arrowTypeEnd),r.arrowTypeStart){case"arrow_cross":T.attr("marker-start","url("+I+"#"+a+"-crossStart)");break;case"arrow_point":T.attr("marker-start","url("+I+"#"+a+"-pointStart)");break;case"arrow_barb":T.attr("marker-start","url("+I+"#"+a+"-barbStart)");break;case"arrow_circle":T.attr("marker-start","url("+I+"#"+a+"-circleStart)");break;case"aggregation":T.attr("marker-start","url("+I+"#"+a+"-aggregationStart)");break;case"extension":T.attr("marker-start","url("+I+"#"+a+"-extensionStart)");break;case"composition":T.attr("marker-start","url("+I+"#"+a+"-compositionStart)");break;case"dependency":T.attr("marker-start","url("+I+"#"+a+"-dependencyStart)");break;case"lollipop":T.attr("marker-start","url("+I+"#"+a+"-lollipopStart)");break}switch(r.arrowTypeEnd){case"arrow_cross":T.attr("marker-end","url("+I+"#"+a+"-crossEnd)");break;case"arrow_point":T.attr("marker-end","url("+I+"#"+a+"-pointEnd)");break;case"arrow_barb":T.attr("marker-end","url("+I+"#"+a+"-barbEnd)");break;case"arrow_circle":T.attr("marker-end","url("+I+"#"+a+"-circleEnd)");break;case"aggregation":T.attr("marker-end","url("+I+"#"+a+"-aggregationEnd)");break;case"extension":T.attr("marker-end","url("+I+"#"+a+"-extensionEnd)");break;case"composition":T.attr("marker-end","url("+I+"#"+a+"-compositionEnd)");break;case"dependency":T.attr("marker-end","url("+I+"#"+a+"-dependencyEnd)");break;case"lollipop":T.attr("marker-end","url("+I+"#"+a+"-lollipopEnd)");break}let A={};return l&&(A.updatedPath=o),A.originalPath=r.points,A},recursiveRender=(t,e,r,n)=>{log$1.info("Graph in recursive render: XXX",write(e),n);const a=e.graph().rankdir;log$1.trace("Dir in recursive render - dir:",a);const s=t.insert("g").attr("class","root");e.nodes()?log$1.info("Recursive render XXX",e.nodes()):log$1.info("No nodes found for",e),e.edges().length>0&&log$1.trace("Recursive edges",e.edge(e.edges()[0]));const o=s.insert("g").attr("class","clusters"),l=s.insert("g").attr("class","edgePaths"),u=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes");e.nodes().forEach(function(p){const g=e.node(p);if(n!==void 0){const m=JSON.parse(JSON.stringify(n.clusterData));log$1.info("Setting data for cluster XXX (",p,") ",m,n),e.setNode(n.id,m),e.parent(p)||(log$1.trace("Setting parent",p,n.id),e.setParent(p,n.id,m))}if(log$1.info("(Insert) Node XXX"+p+": "+JSON.stringify(e.node(p))),g&&g.clusterNode){log$1.info("Cluster identified",p,g.width,e.node(p));const m=recursiveRender(h,g.graph,r,e.node(p)),T=m.elem;updateNodeBounds(g,T),g.diff=m.diff||0,log$1.info("Node bounds (abc123)",p,g,g.width,g.x,g.y),setNodeElem(T,g),log$1.warn("Recursive render complete ",T,g)}else e.children(p).length>0?(log$1.info("Cluster - the non recursive path XXX",p,g.id,g,e),log$1.info(findNonClusterChild(g.id,e)),clusterDb[g.id]={id:findNonClusterChild(g.id,e),node:g}):(log$1.info("Node - the non recursive path",p,g.id,g),insertNode(h,e.node(p),a))}),e.edges().forEach(function(p){const g=e.edge(p.v,p.w,p.name);log$1.info("Edge "+p.v+" -> "+p.w+": "+JSON.stringify(p)),log$1.info("Edge "+p.v+" -> "+p.w+": ",p," ",JSON.stringify(e.edge(p))),log$1.info("Fix",clusterDb,"ids:",p.v,p.w,"Translateing: ",clusterDb[p.v],clusterDb[p.w]),insertEdgeLabel(u,g)}),e.edges().forEach(function(p){log$1.info("Edge "+p.v+" -> "+p.w+": "+JSON.stringify(p))}),log$1.info("#############################################"),log$1.info("### Layout ###"),log$1.info("#############################################"),log$1.info(e),layout(e),log$1.info("Graph after layout:",write(e));let d=0;return sortNodesByHierarchy(e).forEach(function(p){const g=e.node(p);log$1.info("Position "+p+": "+JSON.stringify(e.node(p))),log$1.info("Position "+p+": ("+g.x,","+g.y,") width: ",g.width," height: ",g.height),g&&g.clusterNode?positionNode(g):e.children(p).length>0?(insertCluster(o,g),clusterDb[g.id].node=g):positionNode(g)}),e.edges().forEach(function(p){const g=e.edge(p);log$1.info("Edge "+p.v+" -> "+p.w+": "+JSON.stringify(g),g);const m=insertEdge(l,p,g,clusterDb,r,e);positionEdgeLabel(g,m)}),e.nodes().forEach(function(p){const g=e.node(p);log$1.info(p,g.type,g.diff),g.type==="group"&&(d=g.diff)}),{elem:s,diff:d}},render$1=(t,e,r,n,a)=>{insertMarkers$3(t,r,n,a),clear$a(),clear$8(),clear$9(),clear$b(),log$1.warn("Graph at first:",write(e)),adjustClustersAndEdges(e),log$1.warn("Graph after:",write(e)),recursiveRender(t,e,n)},sanitizeText$1=t=>common$1.sanitizeText(t,getConfig$1());let conf$9={dividerMargin:10,padding:5,textHeight:10};const addClasses=function(t,e,r,n){const a=Object.keys(t);log$1.info("keys:",a),log$1.info(t),a.forEach(function(s){const o=t[s];let l="";o.cssClasses.length>0&&(l=l+" "+o.cssClasses.join(" "));const u={labelStyle:""};let h=o.text!==void 0?o.text:o.id,d=0,p="";switch(o.type){case"class":p="class_box";break;default:p="class_box"}e.setNode(o.id,{labelStyle:u.labelStyle,shape:p,labelText:sanitizeText$1(h),classData:o,rx:d,ry:d,class:l,style:u.style,id:o.id,domId:o.domId,tooltip:n.db.getTooltip(o.id)||"",haveCallback:o.haveCallback,link:o.link,width:o.type==="group"?500:void 0,type:o.type,padding:getConfig$1().flowchart.padding}),log$1.info("setNode",{labelStyle:u.labelStyle,shape:p,labelText:h,rx:d,ry:d,class:l,style:u.style,id:o.id,width:o.type==="group"?500:void 0,type:o.type,padding:getConfig$1().flowchart.padding})})},addNotes=function(t,e,r,n){log$1.info(t),t.forEach(function(a,s){const o=a;let l="";const u={labelStyle:"",style:""};let h=o.text,d=0,p="note";if(e.setNode(o.id,{labelStyle:u.labelStyle,shape:p,labelText:sanitizeText$1(h),noteData:o,rx:d,ry:d,class:l,style:u.style,id:o.id,domId:o.id,tooltip:"",type:"note",padding:getConfig$1().flowchart.padding}),log$1.info("setNode",{labelStyle:u.labelStyle,shape:p,labelText:h,rx:d,ry:d,style:u.style,id:o.id,type:"note",padding:getConfig$1().flowchart.padding}),!o.class||!(o.class in n))return;const g=r+s,m={};m.classes="relation",m.pattern="dotted",m.id=`edgeNote${g}`,m.arrowhead="none",log$1.info(`Note edge: ${JSON.stringify(m)}, ${JSON.stringify(o)}`),m.startLabelRight="",m.endLabelLeft="",m.arrowTypeStart="none",m.arrowTypeEnd="none";let T="fill:none",I="";m.style=T,m.labelStyle=I,m.curve=interpolateToCurve(conf$9.curve,curveLinear),e.setEdge(o.id,o.class,m,g)})},addRelations=function(t,e){const r=getConfig$1().flowchart;let n=0;t.forEach(function(a){n++;const s={};s.classes="relation",s.pattern=a.relation.lineType==1?"dashed":"solid",s.id="id"+n,a.type==="arrow_open"?s.arrowhead="none":s.arrowhead="normal",log$1.info(s,a),s.startLabelRight=a.relationTitle1==="none"?"":a.relationTitle1,s.endLabelLeft=a.relationTitle2==="none"?"":a.relationTitle2,s.arrowTypeStart=getArrowMarker(a.relation.type1),s.arrowTypeEnd=getArrowMarker(a.relation.type2);let o="",l="";if(a.style!==void 0){const u=getStylesFromArray(a.style);o=u.style,l=u.labelStyle}else o="fill:none";s.style=o,s.labelStyle=l,a.interpolate!==void 0?s.curve=interpolateToCurve(a.interpolate,curveLinear):t.defaultInterpolate!==void 0?s.curve=interpolateToCurve(t.defaultInterpolate,curveLinear):s.curve=interpolateToCurve(r.curve,curveLinear),a.text=a.title,a.text===void 0?a.style!==void 0&&(s.arrowheadStyle="fill: #333"):(s.arrowheadStyle="fill: #333",s.labelpos="c",getConfig$1().flowchart.htmlLabels?(s.labelType="html",s.label='<span class="edgeLabel">'+a.text+"</span>"):(s.labelType="text",s.label=a.text.replace(common$1.lineBreakRegex,`
`),a.style===void 0&&(s.style=s.style||"stroke: #333; stroke-width: 1.5px;fill:none"),s.labelStyle=s.labelStyle.replace("color:","fill:"))),e.setEdge(a.id1,a.id2,s,n)})},setConf$9=function(t){Object.keys(t).forEach(function(r){conf$9[r]=t[r]})},draw$c=function(t,e,r,n){log$1.info("Drawing class - ",e);const a=getConfig$1().flowchart,s=getConfig$1().securityLevel;log$1.info("config:",a);const o=a.nodeSpacing||50,l=a.rankSpacing||50,u=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:n.db.getDirection(),nodesep:o,ranksep:l,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),h=n.db.getClasses(),d=n.db.getRelations(),p=n.db.getNotes();log$1.info(d),addClasses(h,u,e,n),addRelations(d,u),addNotes(p,u,d.length+1,h);let g;s==="sandbox"&&(g=select("#i"+e));const m=s==="sandbox"?select(g.nodes()[0].contentDocument.body):select("body"),T=m.select(`[id="${e}"]`),I=m.select("#"+e+" g");if(render$1(I,u,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",e),utils.insertTitle(T,"classTitleText",a.titleTopMargin,n.db.getDiagramTitle()),setupGraphViewbox$1(u,T,a.diagramPadding,a.useMaxWidth),!a.htmlLabels){const A=s==="sandbox"?g.nodes()[0].contentDocument:document,C=A.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const L of C){const M=L.getBBox(),F=A.createElementNS("http://www.w3.org/2000/svg","rect");F.setAttribute("rx",0),F.setAttribute("ry",0),F.setAttribute("width",M.width),F.setAttribute("height",M.height),L.insertBefore(F,L.firstChild)}}};function getArrowMarker(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 classRendererV2={setConf:setConf$9,draw:draw$c};var parser$8=function(){var t=function(R,$,D,k){for(D=D||{},k=R.length;k--;D[R[k]]=$);return D},e=[1,2],r=[1,5],n=[6,9,11,23,25,27,29,30,31,49],a=[1,17],s=[1,18],o=[1,19],l=[1,20],u=[1,21],h=[1,22],d=[1,25],p=[1,30],g=[1,31],m=[1,32],T=[1,33],I=[6,9,11,15,20,23,25,27,29,30,31,42,43,44,45,49],A=[1,45],C=[30,31,46,47],L=[4,6,9,11,23,25,27,29,30,31,49],M=[42,43,44,45],F=[22,37],H=[1,64],q={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($,D,k,B,v,J,E){var ft=J.length-1;switch(v){case 1:break;case 3:this.$=[];break;case 4:J[ft-1].push(J[ft]),this.$=J[ft-1];break;case 5:case 6:this.$=J[ft];break;case 7:case 8:this.$=[];break;case 12:B.addEntity(J[ft-4]),B.addEntity(J[ft-2]),B.addRelationship(J[ft-4],J[ft],J[ft-2],J[ft-3]);break;case 13:B.addEntity(J[ft-3]),B.addAttributes(J[ft-3],J[ft-1]);break;case 14:B.addEntity(J[ft-2]);break;case 15:B.addEntity(J[ft]);break;case 16:case 17:this.$=J[ft].trim(),B.setAccTitle(this.$);break;case 18:case 19:this.$=J[ft].trim(),B.setAccDescription(this.$);break;case 20:case 41:this.$=J[ft];break;case 21:case 39:case 40:this.$=J[ft].replace(/"/g,"");break;case 22:this.$=[J[ft]];break;case 23:J[ft].push(J[ft-1]),this.$=J[ft];break;case 24:this.$={attributeType:J[ft-1],attributeName:J[ft]};break;case 25:this.$={attributeType:J[ft-2],attributeName:J[ft-1],attributeKeyType:J[ft]};break;case 26:this.$={attributeType:J[ft-2],attributeName:J[ft-1],attributeComment:J[ft]};break;case 27:this.$={attributeType:J[ft-3],attributeName:J[ft-2],attributeKeyType:J[ft-1],attributeComment:J[ft]};break;case 28:case 29:case 30:this.$=J[ft];break;case 31:this.$=J[ft].replace(/"/g,"");break;case 32:this.$={cardA:J[ft],relType:J[ft-1],cardB:J[ft-2]};break;case 33:this.$=B.Cardinality.ZERO_OR_ONE;break;case 34:this.$=B.Cardinality.ZERO_OR_MORE;break;case 35:this.$=B.Cardinality.ONE_OR_MORE;break;case 36:this.$=B.Cardinality.ONLY_ONE;break;case 37:this.$=B.Identification.NON_IDENTIFYING;break;case 38:this.$=B.Identification.IDENTIFYING;break;case 42:B.parseDirective("%%{","open_directive");break;case 43:B.parseDirective(J[ft],"type_directive");break;case 44:J[ft]=J[ft].trim().replace(/'/g,'"'),B.parseDirective(J[ft],"arg_directive");break;case 45:B.parseDirective("}%%","close_directive","er");break}},table:[{3:1,4:e,7:3,12:4,49:r},{1:[3]},t(n,[2,3],{5:6}),{3:7,4:e,7:3,12:4,49:r},{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:u,31:h,49:r},{1:[2,2]},{14:23,15:[1,24],52:d},t([15,52],[2,43]),t(n,[2,8],{1:[2,1]}),t(n,[2,4]),{7:15,10:26,12:4,17:16,23:a,25:s,27:o,29:l,30:u,31:h,49:r},t(n,[2,6]),t(n,[2,7]),t(n,[2,11]),t(n,[2,15],{18:27,40:29,20:[1,28],42:p,43:g,44:m,45:T}),{24:[1,34]},{26:[1,35]},{28:[1,36]},t(n,[2,19]),t(I,[2,20]),t(I,[2,21]),{11:[1,37]},{16:38,51:[1,39]},{11:[2,45]},t(n,[2,5]),{17:40,30:u,31:h},{21:41,22:[1,42],32:43,33:44,37:A},{41:46,46:[1,47],47:[1,48]},t(C,[2,33]),t(C,[2,34]),t(C,[2,35]),t(C,[2,36]),t(n,[2,16]),t(n,[2,17]),t(n,[2,18]),t(L,[2,9]),{14:49,52:d},{52:[2,44]},{15:[1,50]},{22:[1,51]},t(n,[2,14]),{21:52,22:[2,22],32:43,33:44,37:A},{34:53,37:[1,54]},{37:[2,28]},{40:55,42:p,43:g,44:m,45:T},t(M,[2,37]),t(M,[2,38]),{11:[1,56]},{19:57,30:[1,60],31:[1,59],48:[1,58]},t(n,[2,13]),{22:[2,23]},t(F,[2,24],{35:61,36:62,38:[1,63],39:H}),t([22,37,38,39],[2,29]),t([30,31],[2,32]),t(L,[2,10]),t(n,[2,12]),t(n,[2,39]),t(n,[2,40]),t(n,[2,41]),t(F,[2,25],{36:65,39:H}),t(F,[2,26]),t([22,37,39],[2,30]),t(F,[2,31]),t(F,[2,27])],defaultActions:{5:[2,42],7:[2,2],25:[2,45],39:[2,44],45:[2,28],52:[2,23]},parseError:function($,D){if(D.recoverable)this.trace($);else{var k=new Error($);throw k.hash=D,k}},parse:function($){var D=this,k=[0],B=[],v=[null],J=[],E=this.table,ft="",Lt=0,Tt=0,Q=2,ut=1,st=J.slice.call(arguments,1),ot=Object.create(this.lexer),dt={yy:{}};for(var xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xt)&&(dt.yy[xt]=this.yy[xt]);ot.setInput($,dt.yy),dt.yy.lexer=ot,dt.yy.parser=this,typeof ot.yylloc>"u"&&(ot.yylloc={});var et=ot.yylloc;J.push(et);var Nt=ot.options&&ot.options.ranges;typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(){var at;return at=B.pop()||ot.lex()||ut,typeof at!="number"&&(at instanceof Array&&(B=at,at=B.pop()),at=D.symbols_[at]||at),at}for(var Z,tt,W,Y,P={},it,N,gt,j;;){if(tt=k[k.length-1],this.defaultActions[tt]?W=this.defaultActions[tt]:((Z===null||typeof Z>"u")&&(Z=G()),W=E[tt]&&E[tt][Z]),typeof W>"u"||!W.length||!W[0]){var Ft="";j=[];for(it in E[tt])this.terminals_[it]&&it>Q&&j.push("'"+this.terminals_[it]+"'");ot.showPosition?Ft="Parse error on line "+(Lt+1)+`:
`+ot.showPosition()+`
Expecting `+j.join(", ")+", got '"+(this.terminals_[Z]||Z)+"'":Ft="Parse error on line "+(Lt+1)+": Unexpected "+(Z==ut?"end of input":"'"+(this.terminals_[Z]||Z)+"'"),this.parseError(Ft,{text:ot.match,token:this.terminals_[Z]||Z,line:ot.yylineno,loc:et,expected:j})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+tt+", token: "+Z);switch(W[0]){case 1:k.push(Z),v.push(ot.yytext),J.push(ot.yylloc),k.push(W[1]),Z=null,Tt=ot.yyleng,ft=ot.yytext,Lt=ot.yylineno,et=ot.yylloc;break;case 2:if(N=this.productions_[W[1]][1],P.$=v[v.length-N],P._$={first_line:J[J.length-(N||1)].first_line,last_line:J[J.length-1].last_line,first_column:J[J.length-(N||1)].first_column,last_column:J[J.length-1].last_column},Nt&&(P._$.range=[J[J.length-(N||1)].range[0],J[J.length-1].range[1]]),Y=this.performAction.apply(P,[ft,Tt,Lt,dt.yy,W[1],v,J].concat(st)),typeof Y<"u")return Y;N&&(k=k.slice(0,-1*N*2),v=v.slice(0,-1*N),J=J.slice(0,-1*N)),k.push(this.productions_[W[1]][0]),v.push(P.$),J.push(P._$),gt=E[k[k.length-2]][k[k.length-1]],k.push(gt);break;case 3:return!0}}return!0}},U=function(){var R={EOF:1,parseError:function(D,k){if(this.yy.parser)this.yy.parser.parseError(D,k);else throw new Error(D)},setInput:function($,D){return this.yy=D||this.yy||{},this._input=$,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 $=this._input[0];this.yytext+=$,this.yyleng++,this.offset++,this.match+=$,this.matched+=$;var D=$.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),$},unput:function($){var D=$.length,k=$.split(/(?:\r\n?|\n)/g);this._input=$+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var B=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),k.length-1&&(this.yylineno-=k.length-1);var v=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:k?(k.length===B.length?this.yylloc.first_column:0)+B[B.length-k.length].length-k[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-D]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function($){this.unput(this.match.slice($))},pastInput:function(){var $=this.matched.substr(0,this.matched.length-this.match.length);return($.length>20?"...":"")+$.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var $=this.match;return $.length<20&&($+=this._input.substr(0,20-$.length)),($.substr(0,20)+($.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var $=this.pastInput(),D=new Array($.length+1).join("-");return $+this.upcomingInput()+`
`+D+"^"},test_match:function($,D){var k,B,v;if(this.options.backtrack_lexer&&(v={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&&(v.yylloc.range=this.yylloc.range.slice(0))),B=$[0].match(/(?:\r\n?|\n).*/g),B&&(this.yylineno+=B.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:B?B[B.length-1].length-B[B.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+$[0].length},this.yytext+=$[0],this.match+=$[0],this.matches=$,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($[0].length),this.matched+=$[0],k=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var J in v)this[J]=v[J];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var $,D,k,B;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),J=0;J<v.length;J++)if(k=this._input.match(this.rules[v[J]]),k&&(!D||k[0].length>D[0].length)){if(D=k,B=J,this.options.backtrack_lexer){if($=this.test_match(k,v[J]),$!==!1)return $;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?($=this.test_match(D,v[B]),$!==!1?$:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var D=this.next();return D||this.lex()},begin:function(D){this.conditionStack.push(D)},popState:function(){var D=this.conditionStack.length-1;return D>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(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},pushState:function(D){this.begin(D)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(D,k,B,v){switch(B){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:break;case 13:break;case 14:return 11;case 15:break;case 16:return 9;case 17:return 31;case 18:return 48;case 19:return 4;case 20:return this.begin("block"),20;case 21:break;case 22:return 38;case 23:return 37;case 24:return 37;case 25:return 39;case 26:break;case 27:return this.popState(),22;case 28:return k.yytext[0];case 29:return 42;case 30:return 44;case 31:return 44;case 32:return 44;case 33:return 42;case 34:return 42;case 35:return 43;case 36:return 43;case 37:return 43;case 38:return 43;case 39:return 43;case 40:return 44;case 41:return 43;case 42:return 44;case 43:return 45;case 44:return 45;case 45:return 45;case 46:return 45;case 47:return 42;case 48:return 43;case 49:return 44;case 50:return 46;case 51:return 47;case 52:return 47;case 53:return 46;case 54:return 46;case 55:return 46;case 56:return 30;case 57:return k.yytext[0];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}}};return R}();q.lexer=U;function z(){this.yy={}}return z.prototype=q,q.Parser=z,new z}();parser$8.parser=parser$8;const erParser=parser$8,erDetector=t=>t.match(/^\s*erDiagram/)!==null;let entities={},relationships=[];const 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$8=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},addEntity=function(t){return entities[t]===void 0&&(entities[t]={attributes:[]},log$1.info("Added new entity :",t)),entities[t]},getEntities=()=>entities,addAttributes=function(t,e){let r=addEntity(t),n;for(n=e.length-1;n>=0;n--)r.attributes.push(e[n]),log$1.debug("Added attribute ",e[n].attributeName)},addRelationship$1=function(t,e,r,n){let a={entityA:t,roleA:e,entityB:r,relSpec:n};relationships.push(a),log$1.debug("Added new relationship :",a)},getRelationships$1=()=>relationships,clear$7=function(){entities={},relationships=[],clear$g()},erDb={Cardinality,Identification,parseDirective:parseDirective$8,getConfig:()=>getConfig$1().er,addEntity,addAttributes,getEntities,addRelationship:addRelationship$1,getRelationships:getRelationships$1,clear:clear$7,setAccTitle,getAccTitle,setAccDescription,getAccDescription,setDiagramTitle,getDiagramTitle},ERMarkers={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"},insertMarkers$1=function(t,e){let r;t.append("defs").append("marker").attr("id",ERMarkers.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",ERMarkers.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"),r=t.append("defs").append("marker").attr("id",ERMarkers.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),r=t.append("defs").append("marker").attr("id",ERMarkers.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",ERMarkers.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",ERMarkers.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"),r=t.append("defs").append("marker").attr("id",ERMarkers.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),r=t.append("defs").append("marker").attr("id",ERMarkers.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},erMarkers={ERMarkers,insertMarkers:insertMarkers$1},BAD_ID_CHARS_REGEXP=/[^\dA-Za-z](\W)*/g;let conf$8={},entityNameIds=new Map;const setConf$8=function(t){const e=Object.keys(t);for(const r of e)conf$8[r]=t[r]},drawAttributes=(t,e,r)=>{const n=conf$8.entityPadding/3,a=conf$8.entityPadding/3,s=conf$8.fontSize*.85,o=e.node().getBBox(),l=[];let u=!1,h=!1,d=0,p=0,g=0,m=0,T=o.height+n*2,I=1;r.forEach(M=>{M.attributeKeyType!==void 0&&(u=!0),M.attributeComment!==void 0&&(h=!0)}),r.forEach(M=>{const F=`${e.node().id}-attr-${I}`;let H=0;const q=parseGenericTypes(M.attributeType),U=t.append("text").classed("er entityLabel",!0).attr("id",`${F}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",getConfig$1().fontFamily).style("font-size",s+"px").text(q),z=t.append("text").classed("er entityLabel",!0).attr("id",`${F}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",getConfig$1().fontFamily).style("font-size",s+"px").text(M.attributeName),R={};R.tn=U,R.nn=z;const $=U.node().getBBox(),D=z.node().getBBox();if(d=Math.max(d,$.width),p=Math.max(p,D.width),H=Math.max($.height,D.height),u){const k=t.append("text").classed("er entityLabel",!0).attr("id",`${F}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",getConfig$1().fontFamily).style("font-size",s+"px").text(M.attributeKeyType||"");R.kn=k;const B=k.node().getBBox();g=Math.max(g,B.width),H=Math.max(H,B.height)}if(h){const k=t.append("text").classed("er entityLabel",!0).attr("id",`${F}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",getConfig$1().fontFamily).style("font-size",s+"px").text(M.attributeComment||"");R.cn=k;const B=k.node().getBBox();m=Math.max(m,B.width),H=Math.max(H,B.height)}R.height=H,l.push(R),T+=H+n*2,I+=1});let A=4;u&&(A+=2),h&&(A+=2);const C=d+p+g+m,L={width:Math.max(conf$8.minEntityWidth,Math.max(o.width+conf$8.entityPadding*2,C+a*A)),height:r.length>0?T:Math.max(conf$8.minEntityHeight,o.height+conf$8.entityPadding*2)};if(r.length>0){const M=Math.max(0,(L.width-C-a*A)/(A/2));e.attr("transform","translate("+L.width/2+","+(n+o.height/2)+")");let F=o.height+n*2,H="attributeBoxOdd";l.forEach(q=>{const U=F+n+q.height/2;q.tn.attr("transform","translate("+a+","+U+")");const z=t.insert("rect","#"+q.tn.node().id).classed(`er ${H}`,!0).attr("x",0).attr("y",F).attr("width",d+a*2+M).attr("height",q.height+n*2),R=parseFloat(z.attr("x"))+parseFloat(z.attr("width"));q.nn.attr("transform","translate("+(R+a)+","+U+")");const $=t.insert("rect","#"+q.nn.node().id).classed(`er ${H}`,!0).attr("x",R).attr("y",F).attr("width",p+a*2+M).attr("height",q.height+n*2);let D=parseFloat($.attr("x"))+parseFloat($.attr("width"));if(u){q.kn.attr("transform","translate("+(D+a)+","+U+")");const k=t.insert("rect","#"+q.kn.node().id).classed(`er ${H}`,!0).attr("x",D).attr("y",F).attr("width",g+a*2+M).attr("height",q.height+n*2);D=parseFloat(k.attr("x"))+parseFloat(k.attr("width"))}h&&(q.cn.attr("transform","translate("+(D+a)+","+U+")"),t.insert("rect","#"+q.cn.node().id).classed(`er ${H}`,"true").attr("x",D).attr("y",F).attr("width",m+a*2+M).attr("height",q.height+n*2)),F+=q.height+n*2,H=H==="attributeBoxOdd"?"attributeBoxEven":"attributeBoxOdd"})}else L.height=Math.max(conf$8.minEntityHeight,T),e.attr("transform","translate("+L.width/2+","+L.height/2+")");return L},drawEntities=function(t,e,r){const n=Object.keys(e);let a;return n.forEach(function(s){const o=generateId(s,"entity");entityNameIds.set(s,o);const l=t.append("g").attr("id",o);a=a===void 0?o:a;const u="text-"+o,h=l.append("text").classed("er entityLabel",!0).attr("id",u).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",getConfig$1().fontFamily).style("font-size",conf$8.fontSize+"px").text(s),{width:d,height:p}=drawAttributes(l,h,e[s].attributes),m=l.insert("rect","#"+u).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",d).attr("height",p).node().getBBox();r.setNode(o,{width:m.width,height:m.height,shape:"rect",id:o})}),a},adjustEntities$1=function(t,e){e.nodes().forEach(function(r){r!==void 0&&e.node(r)!==void 0&&t.select("#"+r).attr("transform","translate("+(e.node(r).x-e.node(r).width/2)+","+(e.node(r).y-e.node(r).height/2)+" )")})},getEdgeName=function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")},addRelationships$1=function(t,e){return t.forEach(function(r){e.setEdge(entityNameIds.get(r.entityA),entityNameIds.get(r.entityB),{relationship:r},getEdgeName(r))}),t};let relCnt$1=0;const drawRelationshipFromLayout$1=function(t,e,r,n,a){relCnt$1++;const s=r.edge(entityNameIds.get(e.entityA),entityNameIds.get(e.entityB),getEdgeName(e)),o=line$1().x(function(T){return T.x}).y(function(T){return T.y}).curve(curveBasis),l=t.insert("path","#"+n).classed("er relationshipLine",!0).attr("d",o(s.points)).style("stroke",conf$8.stroke).style("fill","none");e.relSpec.relType===a.db.Identification.NON_IDENTIFYING&&l.attr("stroke-dasharray","8,8");let u="";switch(conf$8.arrowMarkerAbsolute&&(u=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,u=u.replace(/\(/g,"\\("),u=u.replace(/\)/g,"\\)")),e.relSpec.cardA){case a.db.Cardinality.ZERO_OR_ONE:l.attr("marker-end","url("+u+"#"+erMarkers.ERMarkers.ZERO_OR_ONE_END+")");break;case a.db.Cardinality.ZERO_OR_MORE:l.attr("marker-end","url("+u+"#"+erMarkers.ERMarkers.ZERO_OR_MORE_END+")");break;case a.db.Cardinality.ONE_OR_MORE:l.attr("marker-end","url("+u+"#"+erMarkers.ERMarkers.ONE_OR_MORE_END+")");break;case a.db.Cardinality.ONLY_ONE:l.attr("marker-end","url("+u+"#"+erMarkers.ERMarkers.ONLY_ONE_END+")");break}switch(e.relSpec.cardB){case a.db.Cardinality.ZERO_OR_ONE:l.attr("marker-start","url("+u+"#"+erMarkers.ERMarkers.ZERO_OR_ONE_START+")");break;case a.db.Cardinality.ZERO_OR_MORE:l.attr("marker-start","url("+u+"#"+erMarkers.ERMarkers.ZERO_OR_MORE_START+")");break;case a.db.Cardinality.ONE_OR_MORE:l.attr("marker-start","url("+u+"#"+erMarkers.ERMarkers.ONE_OR_MORE_START+")");break;case a.db.Cardinality.ONLY_ONE:l.attr("marker-start","url("+u+"#"+erMarkers.ERMarkers.ONLY_ONE_START+")");break}const h=l.node().getTotalLength(),d=l.node().getPointAtLength(h*.5),p="rel"+relCnt$1,m=t.append("text").classed("er relationshipLabel",!0).attr("id",p).attr("x",d.x).attr("y",d.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",getConfig$1().fontFamily).style("font-size",conf$8.fontSize+"px").text(e.roleA).node().getBBox();t.insert("rect","#"+p).classed("er relationshipLabelBox",!0).attr("x",d.x-m.width/2).attr("y",d.y-m.height/2).attr("width",m.width).attr("height",m.height)},draw$b=function(t,e,r,n){conf$8=getConfig$1().er,log$1.info("Drawing ER diagram");const a=getConfig$1().securityLevel;let s;a==="sandbox"&&(s=select("#i"+e));const l=(a==="sandbox"?select(s.nodes()[0].contentDocument.body):select("body")).select(`[id='${e}']`);erMarkers.insertMarkers(l,conf$8);let u;u=new Graph({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:conf$8.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}});const h=drawEntities(l,n.db.getEntities(),u),d=addRelationships$1(n.db.getRelationships(),u);layout(u),adjustEntities$1(l,u),d.forEach(function(I){drawRelationshipFromLayout$1(l,I,u,h,n)});const p=conf$8.diagramPadding;utils.insertTitle(l,"entityTitleText",conf$8.titleTopMargin,n.db.getDiagramTitle());const g=l.node().getBBox(),m=g.width+p*2,T=g.height+p*2;configureSvgSize(l,T,m,conf$8.useMaxWidth),l.attr("viewBox",`${g.x-p} ${g.y-p} ${m} ${T}`)};function generateId(t="",e=""){const r=t.replace(BAD_ID_CHARS_REGEXP,"");return`${strWithHyphen(e)}${strWithHyphen(r)}${v4()}`}function strWithHyphen(t=""){return t.length>0?`${t}-`:""}const erRenderer={setConf:setConf$8,draw:draw$b};var parser$7=function(){var t=function(Me,Vt,Xt,ie){for(Xt=Xt||{},ie=Me.length;ie--;Xt[Me[ie]]=Vt);return Xt},e=[1,9],r=[1,7],n=[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],u=[1,21],h=[1,22],d=[1,23],p=[1,30],g=[1,32],m=[1,33],T=[1,34],I=[1,62],A=[1,48],C=[1,52],L=[1,36],M=[1,37],F=[1,38],H=[1,39],q=[1,40],U=[1,56],z=[1,63],R=[1,51],$=[1,53],D=[1,55],k=[1,59],B=[1,60],v=[1,41],J=[1,42],E=[1,43],ft=[1,44],Lt=[1,61],Tt=[1,50],Q=[1,54],ut=[1,57],st=[1,58],ot=[1,49],dt=[1,66],xt=[1,71],et=[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],Nt=[1,75],G=[1,74],Z=[1,76],tt=[20,21,23,81,82],W=[1,99],Y=[1,104],P=[1,107],it=[1,108],N=[1,101],gt=[1,106],j=[1,109],Ft=[1,102],at=[1,114],Dt=[1,113],kt=[1,103],_t=[1,105],St=[1,110],Et=[1,111],yt=[1,112],ct=[1,115],ne=[20,21,22,23,81,82],jt=[20,21,22,23,53,81,82],Wt=[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],qt=[20,21,23],Ht=[20,21,23,52,66,67,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],ge=[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],zt=[52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],Pt=[1,149],Mt=[1,157],wt=[1,158],mt=[1,159],It=[1,160],vt=[1,144],Ut=[1,145],ht=[1,141],Jt=[1,152],pt=[1,153],Kt=[1,154],oe=[1,155],ue=[1,156],he=[1,161],fe=[1,162],Gt=[1,147],te=[1,150],ce=[1,146],Zt=[1,143],Ue=[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],Be=[1,165],_e=[20,21,22,23,26,52,66,67,91,105,106,109,111,112,122,123,124,125,126,127],ee=[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],Te=[12,21,22,24],we=[22,106],Ee=[1,250],ke=[1,245],xe=[1,246],Le=[1,254],Ie=[1,251],Yt=[1,248],rt=[1,247],At=[1,249],Rt=[1,252],le=[1,253],be=[1,255],ye=[1,273],Ce=[20,21,23,106],de=[20,21,22,23,66,67,86,102,105,106,109,110,111,112,113],ve={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(Vt,Xt,ie,Ot,Se,X,ir){var nt=X.length-1;switch(Se){case 5:Ot.parseDirective("%%{","open_directive");break;case 6:Ot.parseDirective(X[nt],"type_directive");break;case 7:X[nt]=X[nt].trim().replace(/'/g,'"'),Ot.parseDirective(X[nt],"arg_directive");break;case 8:Ot.parseDirective("}%%","close_directive","flowchart");break;case 10:this.$=[];break;case 11:(!Array.isArray(X[nt])||X[nt].length>0)&&X[nt-1].push(X[nt]),this.$=X[nt-1];break;case 12:case 82:case 84:case 96:case 152:case 154:case 155:this.$=X[nt];break;case 19:Ot.setDirection("TB"),this.$="TB";break;case 20:Ot.setDirection(X[nt-1]),this.$=X[nt-1];break;case 35:this.$=X[nt-1].nodes;break;case 36:case 37:case 38:case 39:case 40:this.$=[];break;case 41:this.$=Ot.addSubGraph(X[nt-6],X[nt-1],X[nt-4]);break;case 42:this.$=Ot.addSubGraph(X[nt-3],X[nt-1],X[nt-3]);break;case 43:this.$=Ot.addSubGraph(void 0,X[nt-1],void 0);break;case 45:this.$=X[nt].trim(),Ot.setAccTitle(this.$);break;case 46:case 47:this.$=X[nt].trim(),Ot.setAccDescription(this.$);break;case 51:Ot.addLink(X[nt-2].stmt,X[nt],X[nt-1]),this.$={stmt:X[nt],nodes:X[nt].concat(X[nt-2].nodes)};break;case 52:Ot.addLink(X[nt-3].stmt,X[nt-1],X[nt-2]),this.$={stmt:X[nt-1],nodes:X[nt-1].concat(X[nt-3].nodes)};break;case 53:this.$={stmt:X[nt-1],nodes:X[nt-1]};break;case 54:this.$={stmt:X[nt],nodes:X[nt]};break;case 55:this.$=[X[nt]];break;case 56:this.$=X[nt-4].concat(X[nt]);break;case 57:this.$=[X[nt-2]],Ot.setClass(X[nt-2],X[nt]);break;case 58:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"square");break;case 59:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"doublecircle");break;case 60:this.$=X[nt-5],Ot.addVertex(X[nt-5],X[nt-2],"circle");break;case 61:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"ellipse");break;case 62:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"stadium");break;case 63:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"subroutine");break;case 64:this.$=X[nt-7],Ot.addVertex(X[nt-7],X[nt-1],"rect",void 0,void 0,void 0,Object.fromEntries([[X[nt-5],X[nt-3]]]));break;case 65:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"cylinder");break;case 66:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"round");break;case 67:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"diamond");break;case 68:this.$=X[nt-5],Ot.addVertex(X[nt-5],X[nt-2],"hexagon");break;case 69:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"odd");break;case 70:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"trapezoid");break;case 71:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"inv_trapezoid");break;case 72:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"lean_right");break;case 73:this.$=X[nt-3],Ot.addVertex(X[nt-3],X[nt-1],"lean_left");break;case 74:this.$=X[nt],Ot.addVertex(X[nt]);break;case 75:X[nt-1].text=X[nt],this.$=X[nt-1];break;case 76:case 77:X[nt-2].text=X[nt-1],this.$=X[nt-2];break;case 78:this.$=X[nt];break;case 79:var Ne=Ot.destructLink(X[nt],X[nt-2]);this.$={type:Ne.type,stroke:Ne.stroke,length:Ne.length,text:X[nt-1]};break;case 80:var Ne=Ot.destructLink(X[nt]);this.$={type:Ne.type,stroke:Ne.stroke,length:Ne.length};break;case 81:this.$=X[nt-1];break;case 83:case 97:case 153:this.$=X[nt-1]+""+X[nt];break;case 98:case 99:this.$=X[nt-4],Ot.addClass(X[nt-2],X[nt]);break;case 100:this.$=X[nt-4],Ot.setClass(X[nt-2],X[nt]);break;case 101:case 109:this.$=X[nt-1],Ot.setClickEvent(X[nt-1],X[nt]);break;case 102:case 110:this.$=X[nt-3],Ot.setClickEvent(X[nt-3],X[nt-2]),Ot.setTooltip(X[nt-3],X[nt]);break;case 103:this.$=X[nt-2],Ot.setClickEvent(X[nt-2],X[nt-1],X[nt]);break;case 104:this.$=X[nt-4],Ot.setClickEvent(X[nt-4],X[nt-3],X[nt-2]),Ot.setTooltip(X[nt-4],X[nt]);break;case 105:case 111:this.$=X[nt-1],Ot.setLink(X[nt-1],X[nt]);break;case 106:case 112:this.$=X[nt-3],Ot.setLink(X[nt-3],X[nt-2]),Ot.setTooltip(X[nt-3],X[nt]);break;case 107:case 113:this.$=X[nt-3],Ot.setLink(X[nt-3],X[nt-2],X[nt]);break;case 108:case 114:this.$=X[nt-5],Ot.setLink(X[nt-5],X[nt-4],X[nt]),Ot.setTooltip(X[nt-5],X[nt-2]);break;case 115:this.$=X[nt-4],Ot.addVertex(X[nt-2],void 0,void 0,X[nt]);break;case 116:case 118:this.$=X[nt-4],Ot.updateLink(X[nt-2],X[nt]);break;case 117:this.$=X[nt-4],Ot.updateLink([X[nt-2]],X[nt]);break;case 119:this.$=X[nt-8],Ot.updateLinkInterpolate([X[nt-6]],X[nt-2]),Ot.updateLink([X[nt-6]],X[nt]);break;case 120:this.$=X[nt-8],Ot.updateLinkInterpolate(X[nt-6],X[nt-2]),Ot.updateLink(X[nt-6],X[nt]);break;case 121:this.$=X[nt-6],Ot.updateLinkInterpolate([X[nt-4]],X[nt]);break;case 122:this.$=X[nt-6],Ot.updateLinkInterpolate(X[nt-4],X[nt]);break;case 123:case 125:this.$=[X[nt]];break;case 124:case 126:X[nt-2].push(X[nt]),this.$=X[nt-2];break;case 128:this.$=X[nt-1]+X[nt];break;case 150:this.$=X[nt];break;case 151:this.$=X[nt-1]+""+X[nt];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"};break}},table:[{3:1,4:2,5:3,6:5,12:e,16:4,21:r,22:n,24:a},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:e,16:4,21:r,22:n,24:a},t(s,o,{17:11}),{7:12,13:[1,13]},{16:14,21:r,22:n,24:a},{16:15,21:r,22:n,24:a},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:l,21:u,22:h,23:d,32:24,33:25,34:26,35:27,36:28,37:29,38:p,43:31,44:g,46:m,48:T,50:35,51:45,52:I,54:46,66:A,67:C,86:L,87:M,88:F,89:H,90:q,91:U,95:z,105:R,106:$,109:D,111:k,112:B,116:47,118:v,119:J,120:E,121:ft,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot},{8:64,10:[1,65],15:dt},t([10,15],[2,6]),t(s,[2,17]),t(s,[2,18]),t(s,[2,19]),{20:[1,68],21:[1,69],22:xt,27:67,30:70},t(et,[2,11]),t(et,[2,12]),t(et,[2,13]),t(et,[2,14]),t(et,[2,15]),t(et,[2,16]),{9:72,20:Nt,21:G,23:Z,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:Nt,21:G,23:Z},{9:81,20:Nt,21:G,23:Z},{9:82,20:Nt,21:G,23:Z},{9:83,20:Nt,21:G,23:Z},{9:84,20:Nt,21:G,23:Z},{9:86,20:Nt,21:G,22:[1,85],23:Z},t(et,[2,44]),{45:[1,87]},{47:[1,88]},t(et,[2,47]),t(tt,[2,54],{30:89,22:xt}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:W,52:Y,66:P,67:it,84:[1,97],91:N,97:96,98:[1,94],100:[1,95],105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:98,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(et,[2,158]),t(et,[2,159]),t(et,[2,160]),t(et,[2,161]),t(ne,[2,55],{53:[1,116]}),t(jt,[2,74],{116:129,40:[1,117],52:I,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:A,67:C,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],91:U,95:z,105:R,106:$,109:D,111:k,112:B,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot}),t(Wt,[2,150]),t(Wt,[2,175]),t(Wt,[2,176]),t(Wt,[2,177]),t(Wt,[2,178]),t(Wt,[2,179]),t(Wt,[2,180]),t(Wt,[2,181]),t(Wt,[2,182]),t(Wt,[2,183]),t(Wt,[2,184]),t(Wt,[2,185]),t(Wt,[2,186]),t(Wt,[2,187]),t(Wt,[2,188]),t(Wt,[2,189]),t(Wt,[2,190]),{9:130,20:Nt,21:G,23:Z},{11:131,14:[1,132]},t(qt,[2,8]),t(s,[2,20]),t(s,[2,26]),t(s,[2,27]),{21:[1,133]},t(Ht,[2,34],{30:134,22:xt}),t(et,[2,35]),{50:135,51:45,52:I,54:46,66:A,67:C,91:U,95:z,105:R,106:$,109:D,111:k,112:B,116:47,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot},t(ge,[2,48]),t(ge,[2,49]),t(ge,[2,50]),t(zt,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:Pt,24:Mt,26:wt,38:mt,39:139,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t([52,66,67,68,80,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,80]),t(et,[2,36]),t(et,[2,37]),t(et,[2,38]),t(et,[2,39]),t(et,[2,40]),{22:Pt,24:Mt,26:wt,38:mt,39:163,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(Ue,o,{17:164}),t(et,[2,45]),t(et,[2,46]),t(tt,[2,53],{52:Be}),{26:W,52:Y,66:P,67:it,91:N,97:166,102:[1,167],105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:98,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{95:[1,168],103:169,105:[1,170]},{26:W,52:Y,66:P,67:it,91:N,95:[1,171],97:172,105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:98,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{26:W,52:Y,66:P,67:it,91:N,97:173,105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:98,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(qt,[2,101],{22:[1,174],99:[1,175]}),t(qt,[2,105],{22:[1,176]}),t(qt,[2,109],{115:100,117:178,22:[1,177],26:W,52:Y,66:P,67:it,91:N,105:gt,106:j,109:Ft,111:at,112:Dt,122:kt,123:_t,124:St,125:Et,126:yt,127:ct}),t(qt,[2,111],{22:[1,179]}),t(_e,[2,152]),t(_e,[2,154]),t(_e,[2,155]),t(_e,[2,156]),t(_e,[2,157]),t(ee,[2,162]),t(ee,[2,163]),t(ee,[2,164]),t(ee,[2,165]),t(ee,[2,166]),t(ee,[2,167]),t(ee,[2,168]),t(ee,[2,169]),t(ee,[2,170]),t(ee,[2,171]),t(ee,[2,172]),t(ee,[2,173]),t(ee,[2,174]),{52:I,54:180,66:A,67:C,91:U,95:z,105:R,106:$,109:D,111:k,112:B,116:47,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot},{22:Pt,24:Mt,26:wt,38:mt,39:181,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:182,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:184,42:It,52:Y,57:[1,183],66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:185,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:186,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:187,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{66:[1,188]},{22:Pt,24:Mt,26:wt,38:mt,39:189,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:190,42:It,52:Y,66:P,67:it,71:[1,191],73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:192,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:193,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:194,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(Wt,[2,151]),t(Te,[2,3]),{8:195,15:dt},{15:[2,7]},t(s,[2,28]),t(Ht,[2,33]),t(tt,[2,51],{30:196,22:xt}),t(zt,[2,75],{22:[1,197]}),{22:[1,198]},{22:Pt,24:Mt,26:wt,38:mt,39:199,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,66:P,67:it,73:vt,81:Ut,82:[1,200],83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(ee,[2,82]),t(ee,[2,84]),t(ee,[2,140]),t(ee,[2,141]),t(ee,[2,142]),t(ee,[2,143]),t(ee,[2,144]),t(ee,[2,145]),t(ee,[2,146]),t(ee,[2,147]),t(ee,[2,148]),t(ee,[2,149]),t(ee,[2,85]),t(ee,[2,86]),t(ee,[2,87]),t(ee,[2,88]),t(ee,[2,89]),t(ee,[2,90]),t(ee,[2,91]),t(ee,[2,92]),t(ee,[2,93]),t(ee,[2,94]),t(ee,[2,95]),{9:203,20:Nt,21:G,22:Pt,23:Z,24:Mt,26:wt,38:mt,40:[1,202],42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{18:18,19:19,20:l,21:u,22:h,23:d,32:24,33:25,34:26,35:27,36:28,37:29,38:p,42:[1,204],43:31,44:g,46:m,48:T,50:35,51:45,52:I,54:46,66:A,67:C,86:L,87:M,88:F,89:H,90:q,91:U,95:z,105:R,106:$,109:D,111:k,112:B,116:47,118:v,119:J,120:E,121:ft,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot},{22:xt,30:205},{22:[1,206],26:W,52:Y,66:P,67:it,91:N,105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:178,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:[1,207]},{22:[1,208]},{22:[1,209],106:[1,210]},t(we,[2,123]),{22:[1,211]},{22:[1,212],26:W,52:Y,66:P,67:it,91:N,105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:178,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:[1,213],26:W,52:Y,66:P,67:it,91:N,105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:178,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{84:[1,214]},t(qt,[2,103],{22:[1,215]}),{84:[1,216],101:[1,217]},{84:[1,218]},t(_e,[2,153]),{84:[1,219],101:[1,220]},t(ne,[2,57],{116:129,52:I,66:A,67:C,91:U,95:z,105:R,106:$,109:D,111:k,112:B,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot}),{22:Pt,24:Mt,26:wt,38:mt,41:[1,221],42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,56:[1,222],66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:223,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,58:[1,224],66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,60:[1,225],66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,62:[1,226],66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,64:[1,227],66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{67:[1,228]},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,66:P,67:it,70:[1,229],73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,66:P,67:it,72:[1,230],73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,39:231,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,41:[1,232],42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,66:P,67:it,73:vt,75:[1,233],77:[1,234],81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,66:P,67:it,73:vt,75:[1,236],77:[1,235],81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{9:237,20:Nt,21:G,23:Z},t(tt,[2,52],{52:Be}),t(zt,[2,77]),t(zt,[2,76]),{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,66:P,67:it,68:[1,238],73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(zt,[2,79]),t(ee,[2,83]),{22:Pt,24:Mt,26:wt,38:mt,39:239,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(Ue,o,{17:240}),t(et,[2,43]),{51:241,52:I,54:46,66:A,67:C,91:U,95:z,105:R,106:$,109:D,111:k,112:B,116:47,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot},{22:Ee,66:ke,67:xe,86:Le,96:242,102:Ie,105:Yt,107:243,108:244,109:rt,110:At,111:Rt,112:le,113:be},{22:Ee,66:ke,67:xe,86:Le,96:256,102:Ie,105:Yt,107:243,108:244,109:rt,110:At,111:Rt,112:le,113:be},{22:Ee,66:ke,67:xe,86:Le,96:257,102:Ie,104:[1,258],105:Yt,107:243,108:244,109:rt,110:At,111:Rt,112:le,113:be},{22:Ee,66:ke,67:xe,86:Le,96:259,102:Ie,104:[1,260],105:Yt,107:243,108:244,109:rt,110:At,111:Rt,112:le,113:be},{105:[1,261]},{22:Ee,66:ke,67:xe,86:Le,96:262,102:Ie,105:Yt,107:243,108:244,109:rt,110:At,111:Rt,112:le,113:be},{22:Ee,66:ke,67:xe,86:Le,96:263,102:Ie,105:Yt,107:243,108:244,109:rt,110:At,111:Rt,112:le,113:be},{26:W,52:Y,66:P,67:it,91:N,97:264,105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:98,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(qt,[2,102]),{84:[1,265]},t(qt,[2,106],{22:[1,266]}),t(qt,[2,107]),t(qt,[2,110]),t(qt,[2,112],{22:[1,267]}),t(qt,[2,113]),t(jt,[2,58]),t(jt,[2,59]),{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,58:[1,268],66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(jt,[2,66]),t(jt,[2,61]),t(jt,[2,62]),t(jt,[2,63]),{66:[1,269]},t(jt,[2,65]),t(jt,[2,67]),{22:Pt,24:Mt,26:wt,38:mt,42:It,52:Y,66:P,67:it,72:[1,270],73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(jt,[2,69]),t(jt,[2,70]),t(jt,[2,72]),t(jt,[2,71]),t(jt,[2,73]),t(Te,[2,4]),t([22,52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,81]),{22:Pt,24:Mt,26:wt,38:mt,41:[1,271],42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{18:18,19:19,20:l,21:u,22:h,23:d,32:24,33:25,34:26,35:27,36:28,37:29,38:p,42:[1,272],43:31,44:g,46:m,48:T,50:35,51:45,52:I,54:46,66:A,67:C,86:L,87:M,88:F,89:H,90:q,91:U,95:z,105:R,106:$,109:D,111:k,112:B,116:47,118:v,119:J,120:E,121:ft,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot},t(ne,[2,56]),t(qt,[2,115],{106:ye}),t(Ce,[2,125],{108:274,22:Ee,66:ke,67:xe,86:Le,102:Ie,105:Yt,109:rt,110:At,111:Rt,112:le,113:be}),t(de,[2,127]),t(de,[2,129]),t(de,[2,130]),t(de,[2,131]),t(de,[2,132]),t(de,[2,133]),t(de,[2,134]),t(de,[2,135]),t(de,[2,136]),t(de,[2,137]),t(de,[2,138]),t(de,[2,139]),t(qt,[2,116],{106:ye}),t(qt,[2,117],{106:ye}),{22:[1,275]},t(qt,[2,118],{106:ye}),{22:[1,276]},t(we,[2,124]),t(qt,[2,98],{106:ye}),t(qt,[2,99],{106:ye}),t(qt,[2,100],{115:100,117:178,26:W,52:Y,66:P,67:it,91:N,105:gt,106:j,109:Ft,111:at,112:Dt,122:kt,123:_t,124:St,125:Et,126:yt,127:ct}),t(qt,[2,104]),{101:[1,277]},{101:[1,278]},{58:[1,279]},{68:[1,280]},{72:[1,281]},{9:282,20:Nt,21:G,23:Z},t(et,[2,42]),{22:Ee,66:ke,67:xe,86:Le,102:Ie,105:Yt,107:283,108:244,109:rt,110:At,111:Rt,112:le,113:be},t(de,[2,128]),{26:W,52:Y,66:P,67:it,91:N,97:284,105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:98,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{26:W,52:Y,66:P,67:it,91:N,97:285,105:gt,106:j,109:Ft,111:at,112:Dt,115:100,117:98,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(qt,[2,108]),t(qt,[2,114]),t(jt,[2,60]),{22:Pt,24:Mt,26:wt,38:mt,39:286,42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:140,84:ht,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},t(jt,[2,68]),t(Ue,o,{17:287}),t(Ce,[2,126],{108:274,22:Ee,66:ke,67:xe,86:Le,102:Ie,105:Yt,109:rt,110:At,111:Rt,112:le,113:be}),t(qt,[2,121],{115:100,117:178,22:[1,288],26:W,52:Y,66:P,67:it,91:N,105:gt,106:j,109:Ft,111:at,112:Dt,122:kt,123:_t,124:St,125:Et,126:yt,127:ct}),t(qt,[2,122],{115:100,117:178,22:[1,289],26:W,52:Y,66:P,67:it,91:N,105:gt,106:j,109:Ft,111:at,112:Dt,122:kt,123:_t,124:St,125:Et,126:yt,127:ct}),{22:Pt,24:Mt,26:wt,38:mt,41:[1,290],42:It,52:Y,66:P,67:it,73:vt,81:Ut,83:201,85:151,86:Jt,87:pt,88:Kt,89:oe,90:ue,91:he,92:fe,94:142,95:Gt,105:gt,106:j,109:te,111:at,112:Dt,113:ce,114:Zt,115:148,122:kt,123:_t,124:St,125:Et,126:yt,127:ct},{18:18,19:19,20:l,21:u,22:h,23:d,32:24,33:25,34:26,35:27,36:28,37:29,38:p,42:[1,291],43:31,44:g,46:m,48:T,50:35,51:45,52:I,54:46,66:A,67:C,86:L,87:M,88:F,89:H,90:q,91:U,95:z,105:R,106:$,109:D,111:k,112:B,116:47,118:v,119:J,120:E,121:ft,122:Lt,123:Tt,124:Q,125:ut,126:st,127:ot},{22:Ee,66:ke,67:xe,86:Le,96:292,102:Ie,105:Yt,107:243,108:244,109:rt,110:At,111:Rt,112:le,113:be},{22:Ee,66:ke,67:xe,86:Le,96:293,102:Ie,105:Yt,107:243,108:244,109:rt,110:At,111:Rt,112:le,113:be},t(jt,[2,64]),t(et,[2,41]),t(qt,[2,119],{106:ye}),t(qt,[2,120],{106:ye})],defaultActions:{2:[2,1],9:[2,5],10:[2,2],132:[2,7]},parseError:function(Vt,Xt){if(Xt.recoverable)this.trace(Vt);else{var ie=new Error(Vt);throw ie.hash=Xt,ie}},parse:function(Vt){var Xt=this,ie=[0],Ot=[],Se=[null],X=[],ir=this.table,nt="",Ne=0,pr=0,Er=2,mr=1,yr=X.slice.call(arguments,1),De=Object.create(this.lexer),Ve={yy:{}};for(var We in this.yy)Object.prototype.hasOwnProperty.call(this.yy,We)&&(Ve.yy[We]=this.yy[We]);De.setInput(Vt,Ve.yy),Ve.yy.lexer=De,Ve.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var nr=De.yylloc;X.push(nr);var fr=De.options&&De.options.ranges;typeof Ve.yy.parseError=="function"?this.parseError=Ve.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _r(){var Pe;return Pe=Ot.pop()||De.lex()||mr,typeof Pe!="number"&&(Pe instanceof Array&&(Ot=Pe,Pe=Ot.pop()),Pe=Xt.symbols_[Pe]||Pe),Pe}for(var $e,me,Oe,Ge,Ye={},je,Fe,gr,cr;;){if(me=ie[ie.length-1],this.defaultActions[me]?Oe=this.defaultActions[me]:(($e===null||typeof $e>"u")&&($e=_r()),Oe=ir[me]&&ir[me][$e]),typeof Oe>"u"||!Oe.length||!Oe[0]){var ar="";cr=[];for(je in ir[me])this.terminals_[je]&&je>Er&&cr.push("'"+this.terminals_[je]+"'");De.showPosition?ar="Parse error on line "+(Ne+1)+`:
`+De.showPosition()+`
Expecting `+cr.join(", ")+", got '"+(this.terminals_[$e]||$e)+"'":ar="Parse error on line "+(Ne+1)+": Unexpected "+($e==mr?"end of input":"'"+(this.terminals_[$e]||$e)+"'"),this.parseError(ar,{text:De.match,token:this.terminals_[$e]||$e,line:De.yylineno,loc:nr,expected:cr})}if(Oe[0]instanceof Array&&Oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+me+", token: "+$e);switch(Oe[0]){case 1:ie.push($e),Se.push(De.yytext),X.push(De.yylloc),ie.push(Oe[1]),$e=null,pr=De.yyleng,nt=De.yytext,Ne=De.yylineno,nr=De.yylloc;break;case 2:if(Fe=this.productions_[Oe[1]][1],Ye.$=Se[Se.length-Fe],Ye._$={first_line:X[X.length-(Fe||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(Fe||1)].first_column,last_column:X[X.length-1].last_column},fr&&(Ye._$.range=[X[X.length-(Fe||1)].range[0],X[X.length-1].range[1]]),Ge=this.performAction.apply(Ye,[nt,pr,Ne,Ve.yy,Oe[1],Se,X].concat(yr)),typeof Ge<"u")return Ge;Fe&&(ie=ie.slice(0,-1*Fe*2),Se=Se.slice(0,-1*Fe),X=X.slice(0,-1*Fe)),ie.push(this.productions_[Oe[1]][0]),Se.push(Ye.$),X.push(Ye._$),gr=ir[ie[ie.length-2]][ie[ie.length-1]],ie.push(gr);break;case 3:return!0}}return!0}},Ke=function(){var Me={EOF:1,parseError:function(Xt,ie){if(this.yy.parser)this.yy.parser.parseError(Xt,ie);else throw new Error(Xt)},setInput:function(Vt,Xt){return this.yy=Xt||this.yy||{},this._input=Vt,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 Vt=this._input[0];this.yytext+=Vt,this.yyleng++,this.offset++,this.match+=Vt,this.matched+=Vt;var Xt=Vt.match(/(?:\r\n?|\n).*/g);return Xt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Vt},unput:function(Vt){var Xt=Vt.length,ie=Vt.split(/(?:\r\n?|\n)/g);this._input=Vt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Xt),this.offset-=Xt;var Ot=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),ie.length-1&&(this.yylineno-=ie.length-1);var Se=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:ie?(ie.length===Ot.length?this.yylloc.first_column:0)+Ot[Ot.length-ie.length].length-ie[0].length:this.yylloc.first_column-Xt},this.options.ranges&&(this.yylloc.range=[Se[0],Se[0]+this.yyleng-Xt]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(Vt){this.unput(this.match.slice(Vt))},pastInput:function(){var Vt=this.matched.substr(0,this.matched.length-this.match.length);return(Vt.length>20?"...":"")+Vt.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Vt=this.match;return Vt.length<20&&(Vt+=this._input.substr(0,20-Vt.length)),(Vt.substr(0,20)+(Vt.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Vt=this.pastInput(),Xt=new Array(Vt.length+1).join("-");return Vt+this.upcomingInput()+`
`+Xt+"^"},test_match:function(Vt,Xt){var ie,Ot,Se;if(this.options.backtrack_lexer&&(Se={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&&(Se.yylloc.range=this.yylloc.range.slice(0))),Ot=Vt[0].match(/(?:\r\n?|\n).*/g),Ot&&(this.yylineno+=Ot.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ot?Ot[Ot.length-1].length-Ot[Ot.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Vt[0].length},this.yytext+=Vt[0],this.match+=Vt[0],this.matches=Vt,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(Vt[0].length),this.matched+=Vt[0],ie=this.performAction.call(this,this.yy,this,Xt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ie)return ie;if(this._backtrack){for(var X in Se)this[X]=Se[X];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Vt,Xt,ie,Ot;this._more||(this.yytext="",this.match="");for(var Se=this._currentRules(),X=0;X<Se.length;X++)if(ie=this._input.match(this.rules[Se[X]]),ie&&(!Xt||ie[0].length>Xt[0].length)){if(Xt=ie,Ot=X,this.options.backtrack_lexer){if(Vt=this.test_match(ie,Se[X]),Vt!==!1)return Vt;if(this._backtrack){Xt=!1;continue}else return!1}else if(!this.options.flex)break}return Xt?(Vt=this.test_match(Xt,Se[Ot]),Vt!==!1?Vt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Xt=this.next();return Xt||this.lex()},begin:function(Xt){this.conditionStack.push(Xt)},popState:function(){var Xt=this.conditionStack.length-1;return Xt>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(Xt){return Xt=this.conditionStack.length-1-Math.abs(Xt||0),Xt>=0?this.conditionStack[Xt]:"INITIAL"},pushState:function(Xt){this.begin(Xt)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(Xt,ie,Ot,Se){switch(Ot){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:break;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:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:this.begin("string");break;case 15:this.popState();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 24:this.popState();break;case 25:return 100;case 26:this.begin("callbackname");break;case 27:this.popState();break;case 28:this.popState(),this.begin("callbackargs");break;case 29:return 98;case 30:this.popState();break;case 31:return 99;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 90;case 35:return Xt.lex.firstGraph()&&this.begin("dir"),24;case 36:return Xt.lex.firstGraph()&&this.begin("dir"),24;case 37:return 38;case 38:return 42;case 39:return 101;case 40:return 101;case 41:return 101;case 42:return 101;case 43:return this.popState(),25;case 44:return this.popState(),26;case 45:return this.popState(),26;case 46:return this.popState(),26;case 47:return this.popState(),26;case 48:return this.popState(),26;case 49:return this.popState(),26;case 50:return this.popState(),26;case 51:return this.popState(),26;case 52:return this.popState(),26;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:return 82;case 67:return 82;case 68:return 82;case 69:return 81;case 70:return 81;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:return 125;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}}};return Me}();ve.lexer=Ke;function Qe(){this.yy={}}return Qe.prototype=ve,ve.Parser=Qe,new Qe}();parser$7.parser=parser$7;const flowParser=parser$7,flowDetector=(t,e)=>{var r;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:t.match(/^\s*graph/)!==null},flowDetectorV2=(t,e)=>{var r;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"&&t.match(/^\s*graph/)!==null?!0:t.match(/^\s*flowchart/)!==null},MERMAID_DOM_ID_PREFIX="flowchart-";let vertexCounter=0,config=getConfig$1(),vertices={},edges=[],classes$1={},subGraphs=[],subGraphLookup={},tooltips={},subCount=0,firstGraphFlag=!0,direction$1,version,funs$1=[];const sanitizeText=t=>common$1.sanitizeText(t,config),parseDirective$7=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},lookUpDomId=function(t){const e=Object.keys(vertices);for(const r of e)if(vertices[r].id===t)return vertices[r].domId;return t},addVertex=function(t,e,r,n,a,s,o={}){let l,u=t;u!==void 0&&u.trim().length!==0&&(vertices[u]===void 0&&(vertices[u]={id:u,domId:MERMAID_DOM_ID_PREFIX+u+"-"+vertexCounter,styles:[],classes:[]}),vertexCounter++,e!==void 0?(config=getConfig$1(),l=sanitizeText(e.trim()),l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substring(1,l.length-1)),vertices[u].text=l):vertices[u].text===void 0&&(vertices[u].text=t),r!==void 0&&(vertices[u].type=r),n!=null&&n.forEach(function(h){vertices[u].styles.push(h)}),a!=null&&a.forEach(function(h){vertices[u].classes.push(h)}),s!==void 0&&(vertices[u].dir=s),vertices[u].props===void 0?vertices[u].props=o:o!==void 0&&Object.assign(vertices[u].props,o))},addSingleLink=function(t,e,r,n){const o={start:t,end:e,type:void 0,text:""};n=r.text,n!==void 0&&(o.text=sanitizeText(n.trim()),o.text[0]==='"'&&o.text[o.text.length-1]==='"'&&(o.text=o.text.substring(1,o.text.length-1))),r!==void 0&&(o.type=r.type,o.stroke=r.stroke,o.length=r.length),edges.push(o)},addLink=function(t,e,r,n){let a,s;for(a=0;a<t.length;a++)for(s=0;s<e.length;s++)addSingleLink(t[a],e[s],r,n)},updateLinkInterpolate=function(t,e){t.forEach(function(r){r==="default"?edges.defaultInterpolate=e:edges[r].interpolate=e})},updateLink=function(t,e){t.forEach(function(r){r==="default"?edges.defaultStyle=e:(utils.isSubstringInArray("fill",e)===-1&&e.push("fill:none"),edges[r].style=e)})},addClass=function(t,e){classes$1[t]===void 0&&(classes$1[t]={id:t,styles:[],textStyles:[]}),e!=null&&e.forEach(function(r){if(r.match("color")){const a=r.replace("fill","bgFill").replace("color","fill");classes$1[t].textStyles.push(a)}classes$1[t].styles.push(r)})},setDirection$1=function(t){direction$1=t,direction$1.match(/.*</)&&(direction$1="RL"),direction$1.match(/.*\^/)&&(direction$1="BT"),direction$1.match(/.*>/)&&(direction$1="LR"),direction$1.match(/.*v/)&&(direction$1="TB")},setClass$1=function(t,e){t.split(",").forEach(function(r){let n=r;vertices[n]!==void 0&&vertices[n].classes.push(e),subGraphLookup[n]!==void 0&&subGraphLookup[n].classes.push(e)})},setTooltip=function(t,e){t.split(",").forEach(function(r){e!==void 0&&(tooltips[version==="gen-1"?lookUpDomId(r):r]=sanitizeText(e))})},setClickFun$1=function(t,e,r){let n=lookUpDomId(t);if(getConfig$1().securityLevel!=="loose"||e===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s<a.length;s++){let o=a[s].trim();o.charAt(0)==='"'&&o.charAt(o.length-1)==='"'&&(o=o.substr(1,o.length-2)),a[s]=o}}a.length===0&&a.push(t),vertices[t]!==void 0&&(vertices[t].haveCallback=!0,funs$1.push(function(){const s=document.querySelector(`[id="${n}"]`);s!==null&&s.addEventListener("click",function(){utils.runFunc(e,...a)},!1)}))},setLink$1=function(t,e,r){t.split(",").forEach(function(n){vertices[n]!==void 0&&(vertices[n].link=utils.formatUrl(e,config),vertices[n].linkTarget=r)}),setClass$1(t,"clickable")},getTooltip=function(t){return tooltips[t]},setClickEvent$1=function(t,e,r){t.split(",").forEach(function(n){setClickFun$1(n,e,r)}),setClass$1(t,"clickable")},bindFunctions$1=function(t){funs$1.forEach(function(e){e(t)})},getDirection$1=function(){return direction$1.trim()},getVertices=function(){return vertices},getEdges=function(){return edges},getClasses$4=function(){return classes$1},setupToolTips=function(t){let e=select(".mermaidTooltip");(e._groups||e)[0][0]===null&&(e=select("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),select(t).select("svg").selectAll("g.node").on("mouseover",function(){const a=select(this);if(a.attr("title")===null)return;const o=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(a.attr("title")).style("left",window.scrollX+o.left+(o.right-o.left)/2+"px").style("top",window.scrollY+o.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),a.classed("hover",!0)}).on("mouseout",function(){e.transition().duration(500).style("opacity",0),select(this).classed("hover",!1)})};funs$1.push(setupToolTips);const clear$6=function(t="gen-1"){vertices={},classes$1={},edges=[],funs$1=[setupToolTips],subGraphs=[],subGraphLookup={},subCount=0,tooltips=[],firstGraphFlag=!0,version=t,clear$g()},setGen=t=>{version=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,r){let n=t.trim(),a=r;t===r&&r.match(/\s/)&&(n=void 0);function s(d){const p={boolean:{},number:{},string:{}},g=[];let m;return{nodeList:d.filter(function(I){const A=typeof I;return I.stmt&&I.stmt==="dir"?(m=I.value,!1):I.trim()===""?!1:A in p?p[A].hasOwnProperty(I)?!1:p[A][I]=!0:g.includes(I)?!1:g.push(I)}),dir:m}}let o=[];const{nodeList:l,dir:u}=s(o.concat.apply(o,e));if(o=l,version==="gen-1")for(let d=0;d<o.length;d++)o[d]=lookUpDomId(o[d]);n=n||"subGraph"+subCount,a=a||"",a=sanitizeText(a),subCount=subCount+1;const h={id:n,nodes:o,title:a.trim(),classes:[],dir:u};return log$1.info("Adding",h.id,h.nodes,h.dir),h.nodes=makeUniq(h,subGraphs).nodes,subGraphs.push(h),subGraphLookup[n]=h,n},getPosForId=function(t){for(const[e,r]of subGraphs.entries())if(r.id===t)return e;return-1};let secCount=-1;const posCrossRef=[],indexNodes2=function(t,e){const r=subGraphs[e].nodes;if(secCount=secCount+1,secCount>2e3)return;if(posCrossRef[secCount]=e,subGraphs[e].id===t)return{result:!0,count:0};let n=0,a=1;for(;n<r.length;){const s=getPosForId(r[n]);if(s>=0){const o=indexNodes2(t,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}n=n+1}return{result:!1,count:a}},getDepthFirstPos=function(t){return posCrossRef[t]},indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes2("none",subGraphs.length-1)},getSubGraphs=function(){return subGraphs},firstGraph=()=>firstGraphFlag?(firstGraphFlag=!1,!0):!1,destructStartLink=t=>{let e=t.trim(),r="arrow_open";switch(e[0]){case"<":r="arrow_point",e=e.slice(1);break;case"x":r="arrow_cross",e=e.slice(1);break;case"o":r="arrow_circle",e=e.slice(1);break}let n="normal";return e.includes("=")&&(n="thick"),e.includes(".")&&(n="dotted"),{type:r,stroke:n}},countChar=(t,e)=>{const r=e.length;let n=0;for(let a=0;a<r;++a)e[a]===t&&++n;return n},destructEndLink=t=>{const e=t.trim();let r=e.slice(0,-1),n="arrow_open";switch(e.slice(-1)){case"x":n="arrow_cross",e[0]==="x"&&(n="double_"+n,r=r.slice(1));break;case">":n="arrow_point",e[0]==="<"&&(n="double_"+n,r=r.slice(1));break;case"o":n="arrow_circle",e[0]==="o"&&(n="double_"+n,r=r.slice(1));break}let a="normal",s=r.length-1;r[0]==="="&&(a="thick");let o=countChar(".",r);return o&&(a="dotted",s=o),{type:n,stroke:a,length:s}},destructLink=(t,e)=>{const r=destructEndLink(t);let n;if(e){if(n=destructStartLink(e),n.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=r.type;else{if(n.type!==r.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return n.type==="double_arrow"&&(n.type="double_arrow_point"),n.length=r.length,n}return r},exists=(t,e)=>{let r=!1;return t.forEach(n=>{n.nodes.indexOf(e)>=0&&(r=!0)}),r},makeUniq=(t,e)=>{const r=[];return t.nodes.forEach((n,a)=>{exists(e,n)||r.push(t.nodes[a])}),{nodes:r}},flowDb={parseDirective:parseDirective$7,defaultConfig:()=>defaultConfig.flowchart,setAccTitle,getAccTitle,getAccDescription,setAccDescription,addVertex,lookUpDomId,addLink,updateLinkInterpolate,updateLink,addClass,setDirection:setDirection$1,setClass:setClass$1,setTooltip,getTooltip,setClickEvent:setClickEvent$1,setLink:setLink$1,bindFunctions:bindFunctions$1,getDirection:getDirection$1,getVertices,getEdges,getClasses:getClasses$4,clear:clear$6,setGen,defaultStyle,addSubGraph,getDepthFirstPos,indexNodes,getSubGraphs,destructLink,lex:{firstGraph},exists,makeUniq,setDiagramTitle,getDiagramTitle};function question(t,e,r){const n=e.width,a=e.height,s=(n+a)*.9,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}],l=insertPolygonShape(t,s,s,o);return r.intersect=function(u){return intersectPolygon$1(r,o,u)},l}function hexagon(t,e,r){const a=e.height,s=a/4,o=e.width+2*s,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=insertPolygonShape(t,o,a,l);return r.intersect=function(h){return intersectPolygon$1(r,l,h)},u}function rect_left_inv_arrow(t,e,r){const n=e.width,a=e.height,s=[{x:-a/2,y:0},{x:n,y:0},{x:n,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}],o=insertPolygonShape(t,n,a,s);return r.intersect=function(l){return intersectPolygon$1(r,s,l)},o}function lean_right(t,e,r){const n=e.width,a=e.height,s=[{x:-2*a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:a/6,y:-a}],o=insertPolygonShape(t,n,a,s);return r.intersect=function(l){return intersectPolygon$1(r,s,l)},o}function lean_left(t,e,r){const n=e.width,a=e.height,s=[{x:2*a/6,y:0},{x:n+a/6,y:0},{x:n-2*a/6,y:-a},{x:-a/6,y:-a}],o=insertPolygonShape(t,n,a,s);return r.intersect=function(l){return intersectPolygon$1(r,s,l)},o}function trapezoid(t,e,r){const n=e.width,a=e.height,s=[{x:-2*a/6,y:0},{x:n+2*a/6,y:0},{x:n-a/6,y:-a},{x:a/6,y:-a}],o=insertPolygonShape(t,n,a,s);return r.intersect=function(l){return intersectPolygon$1(r,s,l)},o}function inv_trapezoid(t,e,r){const n=e.width,a=e.height,s=[{x:a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=insertPolygonShape(t,n,a,s);return r.intersect=function(l){return intersectPolygon$1(r,s,l)},o}function rect_right_inv_arrow(t,e,r){const n=e.width,a=e.height,s=[{x:0,y:0},{x:n+a/2,y:0},{x:n,y:-a/2},{x:n+a/2,y:-a},{x:0,y:-a}],o=insertPolygonShape(t,n,a,s);return r.intersect=function(l){return intersectPolygon$1(r,s,l)},o}function stadium(t,e,r){const n=e.height,a=e.width+n/4,s=t.insert("rect",":first-child").attr("rx",n/2).attr("ry",n/2).attr("x",-a/2).attr("y",-n/2).attr("width",a).attr("height",n);return r.intersect=function(o){return intersectRect$2(r,o)},s}function subroutine(t,e,r){const n=e.width,a=e.height,s=[{x:0,y:0},{x:n,y:0},{x:n,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:n+8,y:0},{x:n+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=insertPolygonShape(t,n,a,s);return r.intersect=function(l){return intersectPolygon$1(r,s,l)},o}function cylinder(t,e,r){const n=e.width,a=n/2,s=a/(2.5+n/50),o=e.height+s,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+n+" 0 a "+a+","+s+" 0,0,0 "+-n+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+n+" 0 l 0,"+-o,u=t.attr("label-offset-y",s).insert("path",":first-child").attr("d",l).attr("transform","translate("+-n/2+","+-(o/2+s)+")");return r.intersect=function(h){const d=intersectRect$2(r,h),p=d.x-r.x;if(a!=0&&(Math.abs(p)<r.width/2||Math.abs(p)==r.width/2&&Math.abs(d.y-r.y)>r.height/2-s)){let g=s*s*(1-p*p/(a*a));g!=0&&(g=Math.sqrt(g)),g=s-g,h.y-r.y>0&&(g=-g),d.y+=g}return d},u}function addToRender(t){t.shapes().question=question,t.shapes().hexagon=hexagon,t.shapes().stadium=stadium,t.shapes().subroutine=subroutine,t.shapes().cylinder=cylinder,t.shapes().rect_left_inv_arrow=rect_left_inv_arrow,t.shapes().lean_right=lean_right,t.shapes().lean_left=lean_left,t.shapes().trapezoid=trapezoid,t.shapes().inv_trapezoid=inv_trapezoid,t.shapes().rect_right_inv_arrow=rect_right_inv_arrow}function addToRenderV2(t){t({question}),t({hexagon}),t({stadium}),t({subroutine}),t({cylinder}),t({rect_left_inv_arrow}),t({lean_right}),t({lean_left}),t({trapezoid}),t({inv_trapezoid}),t({rect_right_inv_arrow})}function insertPolygonShape(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(a){return a.x+","+a.y}).join(" ")).attr("transform","translate("+-e/2+","+r/2+")")}const flowChartShapes={addToRender,addToRenderV2},conf$7={},setConf$7=function(t){const e=Object.keys(t);for(const r of e)conf$7[r]=t[r]},addVertices$1=function(t,e,r,n,a,s){const o=n?n.select(`[id="${r}"]`):select(`[id="${r}"]`),l=a||document;Object.keys(t).forEach(function(h){const d=t[h];let p="default";d.classes.length>0&&(p=d.classes.join(" "));const g=getStylesFromArray(d.styles);let m=d.text!==void 0?d.text:d.id,T;if(evaluate(getConfig$1().flowchart.htmlLabels)){const C={label:m.replace(/fa[blrs]?:fa-[\w-]+/g,L=>`<i class='${L.replace(":"," ")}'></i>`)};T=addHtmlLabel$1(o,C).node(),T.parentNode.removeChild(T)}else{const C=l.createElementNS("http://www.w3.org/2000/svg","text");C.setAttribute("style",g.labelStyle.replace("color:","fill:"));const L=m.split(common$1.lineBreakRegex);for(const M of L){const F=l.createElementNS("http://www.w3.org/2000/svg","tspan");F.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),F.setAttribute("dy","1em"),F.setAttribute("x","1"),F.textContent=M,C.appendChild(F)}T=C}let I=0,A="";switch(d.type){case"round":I=5,A="rect";break;case"square":A="rect";break;case"diamond":A="question";break;case"hexagon":A="hexagon";break;case"odd":A="rect_left_inv_arrow";break;case"lean_right":A="lean_right";break;case"lean_left":A="lean_left";break;case"trapezoid":A="trapezoid";break;case"inv_trapezoid":A="inv_trapezoid";break;case"odd_right":A="rect_left_inv_arrow";break;case"circle":A="circle";break;case"ellipse":A="ellipse";break;case"stadium":A="stadium";break;case"subroutine":A="subroutine";break;case"cylinder":A="cylinder";break;case"group":A="rect";break;default:A="rect"}log$1.warn("Adding node",d.id,d.domId),e.setNode(s.db.lookUpDomId(d.id),{labelType:"svg",labelStyle:g.labelStyle,shape:A,label:T,rx:I,ry:I,class:p,style:g.style,id:s.db.lookUpDomId(d.id)})})},addEdges$1=function(t,e,r){let n=0,a,s;if(t.defaultStyle!==void 0){const o=getStylesFromArray(t.defaultStyle);a=o.style,s=o.labelStyle}t.forEach(function(o){n++;var l="L-"+o.start+"-"+o.end,u="LS-"+o.start,h="LE-"+o.end;const d={};o.type==="arrow_open"?d.arrowhead="none":d.arrowhead="normal";let p="",g="";if(o.style!==void 0){const m=getStylesFromArray(o.style);p=m.style,g=m.labelStyle}else switch(o.stroke){case"normal":p="fill:none",a!==void 0&&(p=a),s!==void 0&&(g=s);break;case"dotted":p="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":p=" stroke-width: 3.5px;fill:none";break}d.style=p,d.labelStyle=g,o.interpolate!==void 0?d.curve=interpolateToCurve(o.interpolate,curveLinear):t.defaultInterpolate!==void 0?d.curve=interpolateToCurve(t.defaultInterpolate,curveLinear):d.curve=interpolateToCurve(conf$7.curve,curveLinear),o.text===void 0?o.style!==void 0&&(d.arrowheadStyle="fill: #333"):(d.arrowheadStyle="fill: #333",d.labelpos="c",evaluate(getConfig$1().flowchart.htmlLabels)?(d.labelType="html",d.label=`<span id="L-${l}" class="edgeLabel L-${u}' L-${h}" style="${d.labelStyle}">${o.text.replace(/fa[blrs]?:fa-[\w-]+/g,m=>`<i class='${m.replace(":"," ")}'></i>`)}</span>`):(d.labelType="text",d.label=o.text.replace(common$1.lineBreakRegex,`
`),o.style===void 0&&(d.style=d.style||"stroke: #333; stroke-width: 1.5px;fill:none"),d.labelStyle=d.labelStyle.replace("color:","fill:"))),d.id=l,d.class=u+" "+h,d.minlen=o.length||1,e.setEdge(r.db.lookUpDomId(o.start),r.db.lookUpDomId(o.end),d,n)})},getClasses$3=function(t,e){log$1.info("Extracting classes"),e.db.clear();try{return e.parse(t),e.db.getClasses()}catch(r){return log$1.error(r),{}}},draw$a=function(t,e,r,n){log$1.info("Drawing flowchart"),n.db.clear();const{securityLevel:a,flowchart:s}=getConfig$1();let o;a==="sandbox"&&(o=select("#i"+e));const l=a==="sandbox"?select(o.nodes()[0].contentDocument.body):select("body"),u=a==="sandbox"?o.nodes()[0].contentDocument:document;try{n.parser.parse(t)}catch{log$1.debug("Parsing failed")}let h=n.db.getDirection();h===void 0&&(h="TD");const d=s.nodeSpacing||50,p=s.rankSpacing||50,g=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:d,ranksep:p,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});let m;const T=n.db.getSubGraphs();for(let q=T.length-1;q>=0;q--)m=T[q],n.db.addVertex(m.id,m.title,"group",void 0,m.classes);const I=n.db.getVertices();log$1.warn("Get vertices",I);const A=n.db.getEdges();let C=0;for(C=T.length-1;C>=0;C--){m=T[C],selectAll("cluster").append("text");for(let q=0;q<m.nodes.length;q++)log$1.warn("Setting subgraph",m.nodes[q],n.db.lookUpDomId(m.nodes[q]),n.db.lookUpDomId(m.id)),g.setParent(n.db.lookUpDomId(m.nodes[q]),n.db.lookUpDomId(m.id))}addVertices$1(I,g,e,l,u,n),addEdges$1(A,g,n);const L=new render$3;flowChartShapes.addToRender(L),L.arrows().none=function(U,z,R,$){const k=U.append("marker").attr("id",z).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 0 0 L 0 0 z");applyStyle$1(k,R[$+"Style"])},L.arrows().normal=function(U,z){U.append("marker").attr("id",z).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowheadPath").style("stroke-width",1).style("stroke-dasharray","1,0")};const M=l.select(`[id="${e}"]`),F=l.select("#"+e+" g");for(L(F,g),F.selectAll("g.node").attr("title",function(){return n.db.getTooltip(this.id)}),n.db.indexNodes("subGraph"+C),C=0;C<T.length;C++)if(m=T[C],m.title!=="undefined"){const q=u.querySelectorAll("#"+e+' [id="'+n.db.lookUpDomId(m.id)+'"] rect'),U=u.querySelectorAll("#"+e+' [id="'+n.db.lookUpDomId(m.id)+'"]'),z=q[0].x.baseVal.value,R=q[0].y.baseVal.value,$=q[0].width.baseVal.value,k=select(U[0]).select(".label");k.attr("transform",`translate(${z+$/2}, ${R+14})`),k.attr("id",e+"Text");for(let B=0;B<m.classes.length;B++)U[0].classList.add(m.classes[B])}if(!s.htmlLabels){const q=u.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const U of q){const z=U.getBBox(),R=u.createElementNS("http://www.w3.org/2000/svg","rect");R.setAttribute("rx",0),R.setAttribute("ry",0),R.setAttribute("width",z.width),R.setAttribute("height",z.height),U.insertBefore(R,U.firstChild)}}setupGraphViewbox$1(g,M,s.diagramPadding,s.useMaxWidth),Object.keys(I).forEach(function(q){const U=I[q];if(U.link){const z=l.select("#"+e+' [id="'+n.db.lookUpDomId(q)+'"]');if(z){const R=u.createElementNS("http://www.w3.org/2000/svg","a");R.setAttributeNS("http://www.w3.org/2000/svg","class",U.classes.join(" ")),R.setAttributeNS("http://www.w3.org/2000/svg","href",U.link),R.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),a==="sandbox"?R.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):U.linkTarget&&R.setAttributeNS("http://www.w3.org/2000/svg","target",U.linkTarget);const $=z.insert(function(){return R},":first-child"),D=z.select(".label-container");D&&$.append(function(){return D.node()});const k=z.select(".label");k&&$.append(function(){return k.node()})}}})},flowRenderer={setConf:setConf$7,addVertices:addVertices$1,addEdges:addEdges$1,getClasses:getClasses$3,draw:draw$a},conf$6={},setConf$6=function(t){const e=Object.keys(t);for(const r of e)conf$6[r]=t[r]},addVertices=function(t,e,r,n,a,s){const o=n.select(`[id="${r}"]`);Object.keys(t).forEach(function(u){const h=t[u];let d="default";h.classes.length>0&&(d=h.classes.join(" "));const p=getStylesFromArray(h.styles);let g=h.text!==void 0?h.text:h.id,m;if(evaluate(getConfig$1().flowchart.htmlLabels)){const A={label:g.replace(/fa[blrs]?:fa-[\w-]+/g,C=>`<i class='${C.replace(":"," ")}'></i>`)};m=addHtmlLabel$1(o,A).node(),m.parentNode.removeChild(m)}else{const A=a.createElementNS("http://www.w3.org/2000/svg","text");A.setAttribute("style",p.labelStyle.replace("color:","fill:"));const C=g.split(common$1.lineBreakRegex);for(const L of C){const M=a.createElementNS("http://www.w3.org/2000/svg","tspan");M.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),M.setAttribute("dy","1em"),M.setAttribute("x","1"),M.textContent=L,A.appendChild(M)}m=A}let T=0,I="";switch(h.type){case"round":T=5,I="rect";break;case"square":I="rect";break;case"diamond":I="question";break;case"hexagon":I="hexagon";break;case"odd":I="rect_left_inv_arrow";break;case"lean_right":I="lean_right";break;case"lean_left":I="lean_left";break;case"trapezoid":I="trapezoid";break;case"inv_trapezoid":I="inv_trapezoid";break;case"odd_right":I="rect_left_inv_arrow";break;case"circle":I="circle";break;case"ellipse":I="ellipse";break;case"stadium":I="stadium";break;case"subroutine":I="subroutine";break;case"cylinder":I="cylinder";break;case"group":I="rect";break;case"doublecircle":I="doublecircle";break;default:I="rect"}e.setNode(h.id,{labelStyle:p.labelStyle,shape:I,labelText:g,rx:T,ry:T,class:d,style:p.style,id:h.id,link:h.link,linkTarget:h.linkTarget,tooltip:s.db.getTooltip(h.id)||"",domId:s.db.lookUpDomId(h.id),haveCallback:h.haveCallback,width:h.type==="group"?500:void 0,dir:h.dir,type:h.type,props:h.props,padding:getConfig$1().flowchart.padding}),log$1.info("setNode",{labelStyle:p.labelStyle,shape:I,labelText:g,rx:T,ry:T,class:d,style:p.style,id:h.id,domId:s.db.lookUpDomId(h.id),width:h.type==="group"?500:void 0,type:h.type,dir:h.dir,props:h.props,padding:getConfig$1().flowchart.padding})})},addEdges=function(t,e,r){log$1.info("abc78 edges = ",t);let n=0,a={},s,o;if(t.defaultStyle!==void 0){const l=getStylesFromArray(t.defaultStyle);s=l.style,o=l.labelStyle}t.forEach(function(l){n++;var u="L-"+l.start+"-"+l.end;a[u]===void 0?(a[u]=0,log$1.info("abc78 new entry",u,a[u])):(a[u]++,log$1.info("abc78 new entry",u,a[u]));let h=u+"-"+a[u];log$1.info("abc78 new link id to be used is",u,h,a[u]);var d="LS-"+l.start,p="LE-"+l.end;const g={style:"",labelStyle:""};switch(g.minlen=l.length||1,l.type==="arrow_open"?g.arrowhead="none":g.arrowhead="normal",g.arrowTypeStart="arrow_open",g.arrowTypeEnd="arrow_open",l.type){case"double_arrow_cross":g.arrowTypeStart="arrow_cross";case"arrow_cross":g.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":g.arrowTypeStart="arrow_point";case"arrow_point":g.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":g.arrowTypeStart="arrow_circle";case"arrow_circle":g.arrowTypeEnd="arrow_circle";break}let m="",T="";switch(l.stroke){case"normal":m="fill:none;",s!==void 0&&(m=s),o!==void 0&&(T=o),g.thickness="normal",g.pattern="solid";break;case"dotted":g.thickness="normal",g.pattern="dotted",g.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":g.thickness="thick",g.pattern="solid",g.style="stroke-width: 3.5px;fill:none;";break}if(l.style!==void 0){const I=getStylesFromArray(l.style);m=I.style,T=I.labelStyle}g.style=g.style+=m,g.labelStyle=g.labelStyle+=T,l.interpolate!==void 0?g.curve=interpolateToCurve(l.interpolate,curveLinear):t.defaultInterpolate!==void 0?g.curve=interpolateToCurve(t.defaultInterpolate,curveLinear):g.curve=interpolateToCurve(conf$6.curve,curveLinear),l.text===void 0?l.style!==void 0&&(g.arrowheadStyle="fill: #333"):(g.arrowheadStyle="fill: #333",g.labelpos="c"),g.labelType="text",g.label=l.text.replace(common$1.lineBreakRegex,`
`),l.style===void 0&&(g.style=g.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),g.labelStyle=g.labelStyle.replace("color:","fill:"),g.id=h,g.classes="flowchart-link "+d+" "+p,e.setEdge(l.start,l.end,g,n)})},getClasses$2=function(t,e){log$1.info("Extracting classes"),e.db.clear();try{return e.parse(t),e.db.getClasses()}catch{return}},draw$9=function(t,e,r,n){log$1.info("Drawing flowchart"),n.db.clear(),flowDb.setGen("gen-2"),n.parser.parse(t);let a=n.db.getDirection();a===void 0&&(a="TD");const{securityLevel:s,flowchart:o}=getConfig$1(),l=o.nodeSpacing||50,u=o.rankSpacing||50;let h;s==="sandbox"&&(h=select("#i"+e));const d=s==="sandbox"?select(h.nodes()[0].contentDocument.body):select("body"),p=s==="sandbox"?h.nodes()[0].contentDocument:document,g=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:a,nodesep:l,ranksep:u,marginx:0,marginy:0}).setDefaultEdgeLabel(function(){return{}});let m;const T=n.db.getSubGraphs();log$1.info("Subgraphs - ",T);for(let H=T.length-1;H>=0;H--)m=T[H],log$1.info("Subgraph - ",m),n.db.addVertex(m.id,m.title,"group",void 0,m.classes,m.dir);const I=n.db.getVertices(),A=n.db.getEdges();log$1.info(A);let C=0;for(C=T.length-1;C>=0;C--){m=T[C],selectAll("cluster").append("text");for(let H=0;H<m.nodes.length;H++)log$1.info("Setting up subgraphs",m.nodes[H],m.id),g.setParent(m.nodes[H],m.id)}addVertices(I,g,e,d,p,n),addEdges(A,g);const L=d.select(`[id="${e}"]`),M=d.select("#"+e+" g");if(render$1(M,g,["point","circle","cross"],"flowchart",e),utils.insertTitle(L,"flowchartTitleText",o.titleTopMargin,n.db.getDiagramTitle()),setupGraphViewbox$1(g,L,o.diagramPadding,o.useMaxWidth),n.db.indexNodes("subGraph"+C),!o.htmlLabels){const H=p.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const q of H){const U=q.getBBox(),z=p.createElementNS("http://www.w3.org/2000/svg","rect");z.setAttribute("rx",0),z.setAttribute("ry",0),z.setAttribute("width",U.width),z.setAttribute("height",U.height),q.insertBefore(z,q.firstChild)}}Object.keys(I).forEach(function(H){const q=I[H];if(q.link){const U=select("#"+e+' [id="'+H+'"]');if(U){const z=p.createElementNS("http://www.w3.org/2000/svg","a");z.setAttributeNS("http://www.w3.org/2000/svg","class",q.classes.join(" ")),z.setAttributeNS("http://www.w3.org/2000/svg","href",q.link),z.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),s==="sandbox"?z.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):q.linkTarget&&z.setAttributeNS("http://www.w3.org/2000/svg","target",q.linkTarget);const R=U.insert(function(){return z},":first-child"),$=U.select(".label-container");$&&R.append(function(){return $.node()});const D=U.select(".label");D&&R.append(function(){return D.node()})}}})},flowRendererV2={setConf:setConf$6,addVertices,addEdges,getClasses:getClasses$2,draw:draw$9};var parser$6=function(){var t=function(z,R,$,D){for($=$||{},D=z.length;D--;$[z[D]]=R);return $},e=[1,3],r=[1,5],n=[7,9,11,12,13,14,15,16,17,18,19,20,21,23,25,26,28,35,40],a=[1,15],s=[1,16],o=[1,17],l=[1,18],u=[1,19],h=[1,20],d=[1,21],p=[1,22],g=[1,23],m=[1,24],T=[1,25],I=[1,26],A=[1,27],C=[1,29],L=[1,31],M=[1,34],F=[5,7,9,11,12,13,14,15,16,17,18,19,20,21,23,25,26,28,35,40],H={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,gantt:5,document:6,EOF:7,line:8,SPACE:9,statement:10,NL:11,dateFormat:12,inclusiveEndDates:13,topAxis:14,axisFormat:15,tickInterval:16,excludes:17,includes:18,todayMarker:19,title:20,acc_title:21,acc_title_value:22,acc_descr:23,acc_descr_value:24,acc_descr_multiline_value:25,section:26,clickStatement:27,taskTxt:28,taskData:29,openDirective:30,typeDirective:31,closeDirective:32,":":33,argDirective:34,click:35,callbackname:36,callbackargs:37,href:38,clickStatementDebug:39,open_directive:40,type_directive:41,arg_directive:42,close_directive:43,$accept:0,$end:1},terminals_:{2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"topAxis",15:"axisFormat",16:"tickInterval",17:"excludes",18:"includes",19:"todayMarker",20:"title",21:"acc_title",22:"acc_title_value",23:"acc_descr",24:"acc_descr_value",25:"acc_descr_multiline_value",26:"section",28:"taskTxt",29:"taskData",33:":",35:"click",36:"callbackname",37:"callbackargs",38:"href",40:"open_directive",41:"type_directive",42:"arg_directive",43:"close_directive"},productions_:[0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[27,2],[27,3],[27,3],[27,4],[27,3],[27,4],[27,2],[39,2],[39,3],[39,3],[39,4],[39,3],[39,4],[39,2],[30,1],[31,1],[34,1],[32,1]],performAction:function(R,$,D,k,B,v,J){var E=v.length-1;switch(B){case 2:return v[E-1];case 3:this.$=[];break;case 4:v[E-1].push(v[E]),this.$=v[E-1];break;case 5:case 6:this.$=v[E];break;case 7:case 8:this.$=[];break;case 9:k.setDateFormat(v[E].substr(11)),this.$=v[E].substr(11);break;case 10:k.enableInclusiveEndDates(),this.$=v[E].substr(18);break;case 11:k.TopAxis(),this.$=v[E].substr(8);break;case 12:k.setAxisFormat(v[E].substr(11)),this.$=v[E].substr(11);break;case 13:k.setTickInterval(v[E].substr(13)),this.$=v[E].substr(13);break;case 14:k.setExcludes(v[E].substr(9)),this.$=v[E].substr(9);break;case 15:k.setIncludes(v[E].substr(9)),this.$=v[E].substr(9);break;case 16:k.setTodayMarker(v[E].substr(12)),this.$=v[E].substr(12);break;case 17:k.setDiagramTitle(v[E].substr(6)),this.$=v[E].substr(6);break;case 18:this.$=v[E].trim(),k.setAccTitle(this.$);break;case 19:case 20:this.$=v[E].trim(),k.setAccDescription(this.$);break;case 21:k.addSection(v[E].substr(8)),this.$=v[E].substr(8);break;case 23:k.addTask(v[E-1],v[E]),this.$="task";break;case 27:this.$=v[E-1],k.setClickEvent(v[E-1],v[E],null);break;case 28:this.$=v[E-2],k.setClickEvent(v[E-2],v[E-1],v[E]);break;case 29:this.$=v[E-2],k.setClickEvent(v[E-2],v[E-1],null),k.setLink(v[E-2],v[E]);break;case 30:this.$=v[E-3],k.setClickEvent(v[E-3],v[E-2],v[E-1]),k.setLink(v[E-3],v[E]);break;case 31:this.$=v[E-2],k.setClickEvent(v[E-2],v[E],null),k.setLink(v[E-2],v[E-1]);break;case 32:this.$=v[E-3],k.setClickEvent(v[E-3],v[E-1],v[E]),k.setLink(v[E-3],v[E-2]);break;case 33:this.$=v[E-1],k.setLink(v[E-1],v[E]);break;case 34:case 40:this.$=v[E-1]+" "+v[E];break;case 35:case 36:case 38:this.$=v[E-2]+" "+v[E-1]+" "+v[E];break;case 37:case 39:this.$=v[E-3]+" "+v[E-2]+" "+v[E-1]+" "+v[E];break;case 41:k.parseDirective("%%{","open_directive");break;case 42:k.parseDirective(v[E],"type_directive");break;case 43:v[E]=v[E].trim().replace(/'/g,'"'),k.parseDirective(v[E],"arg_directive");break;case 44:k.parseDirective("}%%","close_directive","gantt");break}},table:[{3:1,4:2,5:e,30:4,40:r},{1:[3]},{3:6,4:2,5:e,30:4,40:r},t(n,[2,3],{6:7}),{31:8,41:[1,9]},{41:[2,41]},{1:[2,1]},{4:30,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:a,13:s,14:o,15:l,16:u,17:h,18:d,19:p,20:g,21:m,23:T,25:I,26:A,27:28,28:C,30:4,35:L,40:r},{32:32,33:[1,33],43:M},t([33,43],[2,42]),t(n,[2,8],{1:[2,2]}),t(n,[2,4]),{4:30,10:35,12:a,13:s,14:o,15:l,16:u,17:h,18:d,19:p,20:g,21:m,23:T,25:I,26:A,27:28,28:C,30:4,35:L,40:r},t(n,[2,6]),t(n,[2,7]),t(n,[2,9]),t(n,[2,10]),t(n,[2,11]),t(n,[2,12]),t(n,[2,13]),t(n,[2,14]),t(n,[2,15]),t(n,[2,16]),t(n,[2,17]),{22:[1,36]},{24:[1,37]},t(n,[2,20]),t(n,[2,21]),t(n,[2,22]),{29:[1,38]},t(n,[2,24]),{36:[1,39],38:[1,40]},{11:[1,41]},{34:42,42:[1,43]},{11:[2,44]},t(n,[2,5]),t(n,[2,18]),t(n,[2,19]),t(n,[2,23]),t(n,[2,27],{37:[1,44],38:[1,45]}),t(n,[2,33],{36:[1,46]}),t(F,[2,25]),{32:47,43:M},{43:[2,43]},t(n,[2,28],{38:[1,48]}),t(n,[2,29]),t(n,[2,31],{37:[1,49]}),{11:[1,50]},t(n,[2,30]),t(n,[2,32]),t(F,[2,26])],defaultActions:{5:[2,41],6:[2,1],34:[2,44],43:[2,43]},parseError:function(R,$){if($.recoverable)this.trace(R);else{var D=new Error(R);throw D.hash=$,D}},parse:function(R){var $=this,D=[0],k=[],B=[null],v=[],J=this.table,E="",ft=0,Lt=0,Tt=2,Q=1,ut=v.slice.call(arguments,1),st=Object.create(this.lexer),ot={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(ot.yy[dt]=this.yy[dt]);st.setInput(R,ot.yy),ot.yy.lexer=st,ot.yy.parser=this,typeof st.yylloc>"u"&&(st.yylloc={});var xt=st.yylloc;v.push(xt);var et=st.options&&st.options.ranges;typeof ot.yy.parseError=="function"?this.parseError=ot.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Nt(){var Ft;return Ft=k.pop()||st.lex()||Q,typeof Ft!="number"&&(Ft instanceof Array&&(k=Ft,Ft=k.pop()),Ft=$.symbols_[Ft]||Ft),Ft}for(var G,Z,tt,W,Y={},P,it,N,gt;;){if(Z=D[D.length-1],this.defaultActions[Z]?tt=this.defaultActions[Z]:((G===null||typeof G>"u")&&(G=Nt()),tt=J[Z]&&J[Z][G]),typeof tt>"u"||!tt.length||!tt[0]){var j="";gt=[];for(P in J[Z])this.terminals_[P]&&P>Tt&&gt.push("'"+this.terminals_[P]+"'");st.showPosition?j="Parse error on line "+(ft+1)+`:
`+st.showPosition()+`
Expecting `+gt.join(", ")+", got '"+(this.terminals_[G]||G)+"'":j="Parse error on line "+(ft+1)+": Unexpected "+(G==Q?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(j,{text:st.match,token:this.terminals_[G]||G,line:st.yylineno,loc:xt,expected:gt})}if(tt[0]instanceof Array&&tt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+G);switch(tt[0]){case 1:D.push(G),B.push(st.yytext),v.push(st.yylloc),D.push(tt[1]),G=null,Lt=st.yyleng,E=st.yytext,ft=st.yylineno,xt=st.yylloc;break;case 2:if(it=this.productions_[tt[1]][1],Y.$=B[B.length-it],Y._$={first_line:v[v.length-(it||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(it||1)].first_column,last_column:v[v.length-1].last_column},et&&(Y._$.range=[v[v.length-(it||1)].range[0],v[v.length-1].range[1]]),W=this.performAction.apply(Y,[E,Lt,ft,ot.yy,tt[1],B,v].concat(ut)),typeof W<"u")return W;it&&(D=D.slice(0,-1*it*2),B=B.slice(0,-1*it),v=v.slice(0,-1*it)),D.push(this.productions_[tt[1]][0]),B.push(Y.$),v.push(Y._$),N=J[D[D.length-2]][D[D.length-1]],D.push(N);break;case 3:return!0}}return!0}},q=function(){var z={EOF:1,parseError:function($,D){if(this.yy.parser)this.yy.parser.parseError($,D);else throw new Error($)},setInput:function(R,$){return this.yy=$||this.yy||{},this._input=R,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 R=this._input[0];this.yytext+=R,this.yyleng++,this.offset++,this.match+=R,this.matched+=R;var $=R.match(/(?:\r\n?|\n).*/g);return $?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),R},unput:function(R){var $=R.length,D=R.split(/(?:\r\n?|\n)/g);this._input=R+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-$),this.offset-=$;var k=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),D.length-1&&(this.yylineno-=D.length-1);var B=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:D?(D.length===k.length?this.yylloc.first_column:0)+k[k.length-D.length].length-D[0].length:this.yylloc.first_column-$},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-$]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(R){this.unput(this.match.slice(R))},pastInput:function(){var R=this.matched.substr(0,this.matched.length-this.match.length);return(R.length>20?"...":"")+R.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var R=this.match;return R.length<20&&(R+=this._input.substr(0,20-R.length)),(R.substr(0,20)+(R.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var R=this.pastInput(),$=new Array(R.length+1).join("-");return R+this.upcomingInput()+`
`+$+"^"},test_match:function(R,$){var D,k,B;if(this.options.backtrack_lexer&&(B={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&&(B.yylloc.range=this.yylloc.range.slice(0))),k=R[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+R[0].length},this.yytext+=R[0],this.match+=R[0],this.matches=R,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(R[0].length),this.matched+=R[0],D=this.performAction.call(this,this.yy,this,$,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),D)return D;if(this._backtrack){for(var v in B)this[v]=B[v];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var R,$,D,k;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),v=0;v<B.length;v++)if(D=this._input.match(this.rules[B[v]]),D&&(!$||D[0].length>$[0].length)){if($=D,k=v,this.options.backtrack_lexer){if(R=this.test_match(D,B[v]),R!==!1)return R;if(this._backtrack){$=!1;continue}else return!1}else if(!this.options.flex)break}return $?(R=this.test_match($,B[k]),R!==!1?R:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var $=this.next();return $||this.lex()},begin:function($){this.conditionStack.push($)},popState:function(){var $=this.conditionStack.length-1;return $>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($){return $=this.conditionStack.length-1-Math.abs($||0),$>=0?this.conditionStack[$]:"INITIAL"},pushState:function($){this.begin($)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function($,D,k,B){switch(k){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:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:break;case 13:break;case 14:break;case 15:return 11;case 16:break;case 17:break;case 18:break;case 19:this.begin("href");break;case 20:this.popState();break;case 21:return 38;case 22:this.begin("callbackname");break;case 23:this.popState();break;case 24:this.popState(),this.begin("callbackargs");break;case 25:return 36;case 26:this.popState();break;case 27:return 37;case 28:this.begin("click");break;case 29:this.popState();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}}};return z}();H.lexer=q;function U(){this.yy={}}return U.prototype=H,H.Parser=U,new U}();parser$6.parser=parser$6;const ganttParser=parser$6,ganttDetector=t=>t.match(/^\s*gantt/)!==null;let dateFormat="",axisFormat="",tickInterval,todayMarker="",includes=[],excludes=[],links={},sections$2=[],tasks$1=[],currentSection$1="";const tags=["active","done","crit","milestone"];let funs=[],inclusiveEndDates=!1,topAxis=!1,lastOrder=0;const parseDirective$6=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},clear$5=function(){sections$2=[],tasks$1=[],currentSection$1="",funs=[],taskCnt=0,lastTask=void 0,lastTaskID=void 0,rawTasks$1=[],dateFormat="",axisFormat="",tickInterval=void 0,todayMarker="",includes=[],excludes=[],inclusiveEndDates=!1,topAxis=!1,lastOrder=0,links={},clear$g()},setAxisFormat=function(t){axisFormat=t},getAxisFormat=function(){return axisFormat},setTickInterval=function(t){tickInterval=t},getTickInterval=function(){return tickInterval},setTodayMarker=function(t){todayMarker=t},getTodayMarker=function(){return todayMarker},setDateFormat=function(t){dateFormat=t},enableInclusiveEndDates=function(){inclusiveEndDates=!0},endDatesAreInclusive=function(){return inclusiveEndDates},enableTopAxis=function(){topAxis=!0},topAxisEnabled=function(){return topAxis},getDateFormat=function(){return dateFormat},setIncludes=function(t){includes=t.toLowerCase().split(/[\s,]+/)},getIncludes=function(){return includes},setExcludes=function(t){excludes=t.toLowerCase().split(/[\s,]+/)},getExcludes=function(){return excludes},getLinks=function(){return links},addSection$2=function(t){currentSection$1=t,sections$2.push(t)},getSections$2=function(){return sections$2},getTasks$1=function(){let t=compileTasks$1();const e=10;let r=0;for(;!t&&r<e;)t=compileTasks$1(),r++;return tasks$1=rawTasks$1,tasks$1},isInvalidDate=function(t,e,r,n){return n.includes(t.format(e.trim()))?!1:t.isoWeekday()>=6&&r.includes("weekends")||r.includes(t.format("dddd").toLowerCase())?!0:r.includes(t.format(e.trim()))},checkTaskDates=function(t,e,r,n){if(!r.length||t.manualEndTime)return;let a=moment(t.startTime,e,!0);a.add(1,"d");let s=moment(t.endTime,e,!0),o=fixTaskDates(a,s,e,r,n);t.endTime=s.toDate(),t.renderEndTime=o},fixTaskDates=function(t,e,r,n,a){let s=!1,o=null;for(;t<=e;)s||(o=e.toDate()),s=isInvalidDate(t,r,n,a),s&&e.add(1,"d"),t.add(1,"d");return o},getStartDate=function(t,e,r){r=r.trim();const a=/^after\s+([\d\w- ]+)/.exec(r.trim());if(a!==null){let o=null;if(a[1].split(" ").forEach(function(l){let u=findTaskById(l);u!==void 0&&(o?u.endTime>o.endTime&&(o=u):o=u)}),o)return o.endTime;{const l=new Date;return l.setHours(0,0,0,0),l}}let s=moment(r,e.trim(),!0);if(s.isValid())return s.toDate();{log$1.debug("Invalid date:"+r),log$1.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime()))throw new Error("Invalid date:"+r);return o}},parseDuration=function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?moment.duration(Number.parseFloat(e[1]),e[2]):moment.duration.invalid()},getEndDate=function(t,e,r,n=!1){r=r.trim();let a=moment(r,e.trim(),!0);if(a.isValid())return n&&a.add(1,"d"),a.toDate();const s=moment(t),o=parseDuration(r);return o.isValid()&&s.add(o),s.toDate()};let taskCnt=0;const parseId=function(t){return t===void 0?(taskCnt=taskCnt+1,"task"+taskCnt):t},compileData=function(t,e){let r;e.substr(0,1)===":"?r=e.substr(1,e.length):r=e;const n=r.split(","),a={};getTaskTags(n,a,tags);for(let o=0;o<n.length;o++)n[o]=n[o].trim();let s="";switch(n.length){case 1:a.id=parseId(),a.startTime=t.endTime,s=n[0];break;case 2:a.id=parseId(),a.startTime=getStartDate(void 0,dateFormat,n[0]),s=n[1];break;case 3:a.id=parseId(n[0]),a.startTime=getStartDate(void 0,dateFormat,n[1]),s=n[2];break}return s&&(a.endTime=getEndDate(a.startTime,dateFormat,s,inclusiveEndDates),a.manualEndTime=moment(s,"YYYY-MM-DD",!0).isValid(),checkTaskDates(a,dateFormat,excludes,includes)),a},parseData=function(t,e){let r;e.substr(0,1)===":"?r=e.substr(1,e.length):r=e;const n=r.split(","),a={};getTaskTags(n,a,tags);for(let s=0;s<n.length;s++)n[s]=n[s].trim();switch(n.length){case 1:a.id=parseId(),a.startTime={type:"prevTaskEnd",id:t},a.endTime={data:n[0]};break;case 2:a.id=parseId(),a.startTime={type:"getStartDate",startData:n[0]},a.endTime={data:n[1]};break;case 3:a.id=parseId(n[0]),a.startTime={type:"getStartDate",startData:n[1]},a.endTime={data:n[2]};break}return a};let lastTask,lastTaskID,rawTasks$1=[];const taskDb={},addTask$1=function(t,e){const r={section:currentSection$1,type:currentSection$1,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},n=parseData(lastTaskID,e);r.raw.startTime=n.startTime,r.raw.endTime=n.endTime,r.id=n.id,r.prevTaskId=lastTaskID,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,r.order=lastOrder,lastOrder++;const a=rawTasks$1.push(r);lastTaskID=r.id,taskDb[r.id]=a-1},findTaskById=function(t){const e=taskDb[t];return rawTasks$1[e]},addTaskOrg$1=function(t,e){const r={section:currentSection$1,type:currentSection$1,description:t,task:t,classes:[]},n=compileData(lastTask,e);r.startTime=n.startTime,r.endTime=n.endTime,r.id=n.id,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,lastTask=r,tasks$1.push(r)},compileTasks$1=function(){const t=function(r){const n=rawTasks$1[r];let a="";switch(rawTasks$1[r].raw.startTime.type){case"prevTaskEnd":{const s=findTaskById(n.prevTaskId);n.startTime=s.endTime;break}case"getStartDate":a=getStartDate(void 0,dateFormat,rawTasks$1[r].raw.startTime.startData),a&&(rawTasks$1[r].startTime=a);break}return rawTasks$1[r].startTime&&(rawTasks$1[r].endTime=getEndDate(rawTasks$1[r].startTime,dateFormat,rawTasks$1[r].raw.endTime.data,inclusiveEndDates),rawTasks$1[r].endTime&&(rawTasks$1[r].processed=!0,rawTasks$1[r].manualEndTime=moment(rawTasks$1[r].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),checkTaskDates(rawTasks$1[r],dateFormat,excludes,includes))),rawTasks$1[r].processed};let e=!0;for(const[r,n]of rawTasks$1.entries())t(r),e=e&&n.processed;return e},setLink=function(t,e){let r=e;getConfig$1().securityLevel!=="loose"&&(r=sanitizeUrl_1(e)),t.split(",").forEach(function(n){findTaskById(n)!==void 0&&(pushFun(n,()=>{window.open(r,"_self")}),links[n]=r)}),setClass(t,"clickable")},setClass=function(t,e){t.split(",").forEach(function(r){let n=findTaskById(r);n!==void 0&&n.classes.push(e)})},setClickFun=function(t,e,r){if(getConfig$1().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s<n.length;s++){let o=n[s].trim();o.charAt(0)==='"'&&o.charAt(o.length-1)==='"'&&(o=o.substr(1,o.length-2)),n[s]=o}}n.length===0&&n.push(t),findTaskById(t)!==void 0&&pushFun(t,()=>{utils.runFunc(e,...n)})},pushFun=function(t,e){funs.push(function(){const r=document.querySelector(`[id="${t}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const r=document.querySelector(`[id="${t}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},setClickEvent=function(t,e,r){t.split(",").forEach(function(n){setClickFun(n,e,r)}),setClass(t,"clickable")},bindFunctions=function(t){funs.forEach(function(e){e(t)})},ganttDb={parseDirective:parseDirective$6,getConfig:()=>getConfig$1().gantt,clear:clear$5,setDateFormat,getDateFormat,enableInclusiveEndDates,endDatesAreInclusive,enableTopAxis,topAxisEnabled,setAxisFormat,getAxisFormat,setTickInterval,getTickInterval,setTodayMarker,getTodayMarker,setAccTitle,getAccTitle,setDiagramTitle,getDiagramTitle,setAccDescription,getAccDescription,addSection:addSection$2,getSections:getSections$2,getTasks:getTasks$1,addTask:addTask$1,findTaskById,addTaskOrg:addTaskOrg$1,setIncludes,getIncludes,setExcludes,getExcludes,setClickEvent,setLink,getLinks,bindFunctions,parseDuration,isInvalidDate};function getTaskTags(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(a){const s="^\\s*"+a+"\\s*$",o=new RegExp(s);t[0].match(o)&&(e[a]=!0,t.shift(1),n=!0)})}const setConf$5=function(){log$1.debug("Something is calling, setConf, remove the call")};let w;const draw$8=function(t,e,r,n){const a=getConfig$1().gantt,s=getConfig$1().securityLevel;let o;s==="sandbox"&&(o=select("#i"+e));const l=s==="sandbox"?select(o.nodes()[0].contentDocument.body):select("body"),u=s==="sandbox"?o.nodes()[0].contentDocument:document,h=u.getElementById(e);w=h.parentElement.offsetWidth,w===void 0&&(w=1200),a.useWidth!==void 0&&(w=a.useWidth);const d=n.db.getTasks(),p=d.length*(a.barHeight+a.barGap)+2*a.topPadding;h.setAttribute("viewBox","0 0 "+w+" "+p);const g=l.select(`[id="${e}"]`),m=time$1().domain([min$2(d,function($){return $.startTime}),max$2(d,function($){return $.endTime})]).rangeRound([0,w-a.leftPadding-a.rightPadding]);let T=[];for(const $ of d)T.push($.type);const I=T;T=U(T);function A($,D){const k=$.startTime,B=D.startTime;let v=0;return k>B?v=1:k<B&&(v=-1),v}d.sort(A),C(d,w,p),configureSvgSize(g,p,w,a.useMaxWidth),g.append("text").text(n.db.getDiagramTitle()).attr("x",w/2).attr("y",a.titleTopMargin).attr("class","titleText");function C($,D,k){const B=a.barHeight,v=B+a.barGap,J=a.topPadding,E=a.leftPadding,ft=linear().domain([0,T.length]).range(["#00B9FA","#F95002"]).interpolate(interpolateHcl);M(v,J,E,D,k,$,n.db.getExcludes(),n.db.getIncludes()),F(E,J,D,k),L($,v,J,E,B,ft,D),H(v,J),q(E,J,D,k)}function L($,D,k,B,v,J,E){g.append("g").selectAll("rect").data($).enter().append("rect").attr("x",0).attr("y",function(Q,ut){return ut=Q.order,ut*D+k-2}).attr("width",function(){return E-a.rightPadding/2}).attr("height",D).attr("class",function(Q){for(const[ut,st]of T.entries())if(Q.type===st)return"section section"+ut%a.numberSectionStyles;return"section section0"});const ft=g.append("g").selectAll("rect").data($).enter(),Lt=n.db.getLinks();if(ft.append("rect").attr("id",function(Q){return Q.id}).attr("rx",3).attr("ry",3).attr("x",function(Q){return Q.milestone?m(Q.startTime)+B+.5*(m(Q.endTime)-m(Q.startTime))-.5*v:m(Q.startTime)+B}).attr("y",function(Q,ut){return ut=Q.order,ut*D+k}).attr("width",function(Q){return Q.milestone?v:m(Q.renderEndTime||Q.endTime)-m(Q.startTime)}).attr("height",v).attr("transform-origin",function(Q,ut){return ut=Q.order,(m(Q.startTime)+B+.5*(m(Q.endTime)-m(Q.startTime))).toString()+"px "+(ut*D+k+.5*v).toString()+"px"}).attr("class",function(Q){const ut="task";let st="";Q.classes.length>0&&(st=Q.classes.join(" "));let ot=0;for(const[xt,et]of T.entries())Q.type===et&&(ot=xt%a.numberSectionStyles);let dt="";return Q.active?Q.crit?dt+=" activeCrit":dt=" active":Q.done?Q.crit?dt=" doneCrit":dt=" done":Q.crit&&(dt+=" crit"),dt.length===0&&(dt=" task"),Q.milestone&&(dt=" milestone "+dt),dt+=ot,dt+=" "+st,ut+dt}),ft.append("text").attr("id",function(Q){return Q.id+"-text"}).text(function(Q){return Q.task}).attr("font-size",a.fontSize).attr("x",function(Q){let ut=m(Q.startTime),st=m(Q.renderEndTime||Q.endTime);Q.milestone&&(ut+=.5*(m(Q.endTime)-m(Q.startTime))-.5*v),Q.milestone&&(st=ut+v);const ot=this.getBBox().width;return ot>st-ut?st+ot+1.5*a.leftPadding>E?ut+B-5:st+B+5:(st-ut)/2+ut+B}).attr("y",function(Q,ut){return ut=Q.order,ut*D+a.barHeight/2+(a.fontSize/2-2)+k}).attr("text-height",v).attr("class",function(Q){const ut=m(Q.startTime);let st=m(Q.endTime);Q.milestone&&(st=ut+v);const ot=this.getBBox().width;let dt="";Q.classes.length>0&&(dt=Q.classes.join(" "));let xt=0;for(const[Nt,G]of T.entries())Q.type===G&&(xt=Nt%a.numberSectionStyles);let et="";return Q.active&&(Q.crit?et="activeCritText"+xt:et="activeText"+xt),Q.done?Q.crit?et=et+" doneCritText"+xt:et=et+" doneText"+xt:Q.crit&&(et=et+" critText"+xt),Q.milestone&&(et+=" milestoneText"),ot>st-ut?st+ot+1.5*a.leftPadding>E?dt+" taskTextOutsideLeft taskTextOutside"+xt+" "+et:dt+" taskTextOutsideRight taskTextOutside"+xt+" "+et+" width-"+ot:dt+" taskText taskText"+xt+" "+et+" width-"+ot}),getConfig$1().securityLevel==="sandbox"){let Q;Q=select("#i"+e);const ut=Q.nodes()[0].contentDocument;ft.filter(function(st){return Lt[st.id]!==void 0}).each(function(st){var ot=ut.querySelector("#"+st.id),dt=ut.querySelector("#"+st.id+"-text");const xt=ot.parentNode;var et=ut.createElement("a");et.setAttribute("xlink:href",Lt[st.id]),et.setAttribute("target","_top"),xt.appendChild(et),et.appendChild(ot),et.appendChild(dt)})}}function M($,D,k,B,v,J,E,ft){const Lt=J.reduce((xt,{startTime:et})=>xt?Math.min(xt,et):et,0),Tt=J.reduce((xt,{endTime:et})=>xt?Math.max(xt,et):et,0),Q=n.db.getDateFormat();if(!Lt||!Tt)return;const ut=[];let st=null,ot=moment(Lt);for(;ot.valueOf()<=Tt;)n.db.isInvalidDate(ot,Q,E,ft)?st?st.end=ot.clone():st={start:ot.clone(),end:ot.clone()}:st&&(ut.push(st),st=null),ot.add(1,"d");g.append("g").selectAll("rect").data(ut).enter().append("rect").attr("id",function(xt){return"exclude-"+xt.start.format("YYYY-MM-DD")}).attr("x",function(xt){return m(xt.start)+k}).attr("y",a.gridLineStartPadding).attr("width",function(xt){const et=xt.end.clone().add(1,"day");return m(et)-m(xt.start)}).attr("height",v-D-a.gridLineStartPadding).attr("transform-origin",function(xt,et){return(m(xt.start)+k+.5*(m(xt.end)-m(xt.start))).toString()+"px "+(et*$+.5*v).toString()+"px"}).attr("class","exclude-range")}function F($,D,k,B){let v=axisBottom(m).tickSize(-B+D+a.gridLineStartPadding).tickFormat(timeFormat(n.db.getAxisFormat()||a.axisFormat||"%Y-%m-%d"));const E=/^([1-9]\d*)(minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||a.tickInterval);if(E!==null){const ft=E[1];switch(E[2]){case"minute":v.ticks(timeMinute.every(ft));break;case"hour":v.ticks(timeHour.every(ft));break;case"day":v.ticks(timeDay.every(ft));break;case"week":v.ticks(sunday.every(ft));break;case"month":v.ticks(timeMonth.every(ft));break}}if(g.append("g").attr("class","grid").attr("transform","translate("+$+", "+(B-50)+")").call(v).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||a.topAxis){let ft=axisTop(m).tickSize(-B+D+a.gridLineStartPadding).tickFormat(timeFormat(n.db.getAxisFormat()||a.axisFormat||"%Y-%m-%d"));if(E!==null){const Lt=E[1];switch(E[2]){case"minute":ft.ticks(timeMinute.every(Lt));break;case"hour":ft.ticks(timeHour.every(Lt));break;case"day":ft.ticks(timeDay.every(Lt));break;case"week":ft.ticks(sunday.every(Lt));break;case"month":ft.ticks(timeMonth.every(Lt));break}}g.append("g").attr("class","grid").attr("transform","translate("+$+", "+D+")").call(ft).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}function H($,D){const k=[];let B=0;for(const[v,J]of T.entries())k[v]=[J,R(J,I)];g.append("g").selectAll("text").data(k).enter().append(function(v){const J=v[0].split(common$1.lineBreakRegex),E=-(J.length-1)/2,ft=u.createElementNS("http://www.w3.org/2000/svg","text");ft.setAttribute("dy",E+"em");for(const[Lt,Tt]of J.entries()){const Q=u.createElementNS("http://www.w3.org/2000/svg","tspan");Q.setAttribute("alignment-baseline","central"),Q.setAttribute("x","10"),Lt>0&&Q.setAttribute("dy","1em"),Q.textContent=Tt,ft.appendChild(Q)}return ft}).attr("x",10).attr("y",function(v,J){if(J>0)for(let E=0;E<J;E++)return B+=k[J-1][1],v[1]*$/2+B*$+D;else return v[1]*$/2+D}).attr("font-size",a.sectionFontSize).attr("font-size",a.sectionFontSize).attr("class",function(v){for(const[J,E]of T.entries())if(v[0]===E)return"sectionTitle sectionTitle"+J%a.numberSectionStyles;return"sectionTitle"})}function q($,D,k,B){const v=n.db.getTodayMarker();if(v==="off")return;const J=g.append("g").attr("class","today"),E=new Date,ft=J.append("line");ft.attr("x1",m(E)+$).attr("x2",m(E)+$).attr("y1",a.titleTopMargin).attr("y2",B-a.titleTopMargin).attr("class","today"),v!==""&&ft.attr("style",v.replace(/,/g,";"))}function U($){const D={},k=[];for(let B=0,v=$.length;B<v;++B)Object.prototype.hasOwnProperty.call(D,$[B])||(D[$[B]]=!0,k.push($[B]));return k}function z($){let D=$.length;const k={};for(;D;)k[$[--D]]=(k[$[D]]||0)+1;return k}function R($,D){return z(D)[$]||0}},ganttRenderer={setConf:setConf$5,draw:draw$8};var parser$5=function(){var t=function(s,o,l,u){for(l=l||{},u=s.length;u--;l[s[u]]=o);return l},e=[6,9,10],r={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],performAction:function(o,l,u,h,d,p,g){switch(p.length-1,d){case 1:return h;case 4:break;case 6:h.setInfo(!0);break}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},t(e,[2,3]),t(e,[2,4]),t(e,[2,5]),t(e,[2,6])],defaultActions:{4:[2,1]},parseError:function(o,l){if(l.recoverable)this.trace(o);else{var u=new Error(o);throw u.hash=l,u}},parse:function(o){var l=this,u=[0],h=[],d=[null],p=[],g=this.table,m="",T=0,I=0,A=2,C=1,L=p.slice.call(arguments,1),M=Object.create(this.lexer),F={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(F.yy[H]=this.yy[H]);M.setInput(o,F.yy),F.yy.lexer=M,F.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var q=M.yylloc;p.push(q);var U=M.options&&M.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(){var Tt;return Tt=h.pop()||M.lex()||C,typeof Tt!="number"&&(Tt instanceof Array&&(h=Tt,Tt=h.pop()),Tt=l.symbols_[Tt]||Tt),Tt}for(var R,$,D,k,B={},v,J,E,ft;;){if($=u[u.length-1],this.defaultActions[$]?D=this.defaultActions[$]:((R===null||typeof R>"u")&&(R=z()),D=g[$]&&g[$][R]),typeof D>"u"||!D.length||!D[0]){var Lt="";ft=[];for(v in g[$])this.terminals_[v]&&v>A&&ft.push("'"+this.terminals_[v]+"'");M.showPosition?Lt="Parse error on line "+(T+1)+`:
`+M.showPosition()+`
Expecting `+ft.join(", ")+", got '"+(this.terminals_[R]||R)+"'":Lt="Parse error on line "+(T+1)+": Unexpected "+(R==C?"end of input":"'"+(this.terminals_[R]||R)+"'"),this.parseError(Lt,{text:M.match,token:this.terminals_[R]||R,line:M.yylineno,loc:q,expected:ft})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+R);switch(D[0]){case 1:u.push(R),d.push(M.yytext),p.push(M.yylloc),u.push(D[1]),R=null,I=M.yyleng,m=M.yytext,T=M.yylineno,q=M.yylloc;break;case 2:if(J=this.productions_[D[1]][1],B.$=d[d.length-J],B._$={first_line:p[p.length-(J||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(J||1)].first_column,last_column:p[p.length-1].last_column},U&&(B._$.range=[p[p.length-(J||1)].range[0],p[p.length-1].range[1]]),k=this.performAction.apply(B,[m,I,T,F.yy,D[1],d,p].concat(L)),typeof k<"u")return k;J&&(u=u.slice(0,-1*J*2),d=d.slice(0,-1*J),p=p.slice(0,-1*J)),u.push(this.productions_[D[1]][0]),d.push(B.$),p.push(B._$),E=g[u[u.length-2]][u[u.length-1]],u.push(E);break;case 3:return!0}}return!0}},n=function(){var s={EOF:1,parseError:function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},setInput:function(o,l){return this.yy=l||this.yy||{},this._input=o,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 o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var l=o.length,u=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===h.length?this.yylloc.first_column:0)+h[h.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(o){this.unput(this.match.slice(o))},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
`+l+"^"},test_match:function(o,l){var u,h,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),h=o[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,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(o[0].length),this.matched+=o[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var p in d)this[p]=d[p];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,u,h;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),p=0;p<d.length;p++)if(u=this._input.match(this.rules[d[p]]),u&&(!l||u[0].length>l[0].length)){if(l=u,h=p,this.options.backtrack_lexer){if(o=this.test_match(u,d[p]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,d[h]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var l=this.next();return l||this.lex()},begin:function(l){this.conditionStack.push(l)},popState:function(){var l=this.conditionStack.length-1;return l>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(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},pushState:function(l){this.begin(l)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(l,u,h,d){switch(h){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}}};return s}();r.lexer=n;function a(){this.yy={}}return a.prototype=r,r.Parser=a,new a}();parser$5.parser=parser$5;const infoParser=parser$5;var message="",info=!1;const setMessage=t=>{log$1.debug("Setting message to: "+t),message=t},getMessage=()=>message,setInfo=t=>{info=t},getInfo=()=>info,infoDb={setMessage,getMessage,setInfo,getInfo,clear:clear$g},draw$7=(t,e,r)=>{try{log$1.debug(`Rendering info diagram
`+t);const n=getConfig$1().securityLevel;let a;n==="sandbox"&&(a=select("#i"+e));const o=(n==="sandbox"?select(a.nodes()[0].contentDocument.body):select("body")).select("#"+e);o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("v "+r),o.attr("height",100),o.attr("width",400)}catch(n){log$1.error("Error while rendering info diagram"),log$1.error(n.message)}},infoRenderer={draw:draw$7},infoDetector=t=>t.match(/^\s*info/)!==null;var parser$4=function(){var t=function(q,U,z,R){for(z=z||{},R=q.length;R--;z[q[R]]=U);return z},e=[1,4],r=[1,5],n=[1,6],a=[1,7],s=[1,9],o=[1,11,13,15,17,19,20,26,27,28,29],l=[2,5],u=[1,6,11,13,15,17,19,20,26,27,28,29],h=[26,27,28],d=[2,8],p=[1,18],g=[1,19],m=[1,20],T=[1,21],I=[1,22],A=[1,23],C=[1,28],L=[6,26,27,28,29],M={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(U,z,R,$,D,k,B){var v=k.length-1;switch(D){case 4:$.setShowData(!0);break;case 7:this.$=k[v-1];break;case 9:$.addSection(k[v-1],$.cleanupValue(k[v]));break;case 10:this.$=k[v].trim(),$.setDiagramTitle(this.$);break;case 11:this.$=k[v].trim(),$.setAccTitle(this.$);break;case 12:case 13:this.$=k[v].trim(),$.setAccDescription(this.$);break;case 14:$.addSection(k[v].substr(8)),this.$=k[v].substr(8);break;case 21:$.parseDirective("%%{","open_directive");break;case 22:$.parseDirective(k[v],"type_directive");break;case 23:k[v]=k[v].trim().replace(/'/g,'"'),$.parseDirective(k[v],"arg_directive");break;case 24:$.parseDirective("}%%","close_directive","pie");break}},table:[{3:1,4:2,5:3,6:e,21:8,26:r,27:n,28:a,29:s},{1:[3]},{3:10,4:2,5:3,6:e,21:8,26:r,27:n,28:a,29:s},{3:11,4:2,5:3,6:e,21:8,26:r,27:n,28:a,29:s},t(o,l,{7:12,8:[1,13]}),t(u,[2,18]),t(u,[2,19]),t(u,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},t(h,d,{21:8,9:16,10:17,5:24,1:[2,3],11:p,13:g,15:m,17:T,19:I,20:A,29:s}),t(o,l,{7:25}),{23:26,24:[1,27],32:C},t([24,32],[2,22]),t(o,[2,6]),{4:29,26:r,27:n,28:a},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},t(h,[2,13]),t(h,[2,14]),t(h,[2,15]),t(h,d,{21:8,9:16,10:17,5:24,1:[2,4],11:p,13:g,15:m,17:T,19:I,20:A,29:s}),t(L,[2,16]),{25:34,31:[1,35]},t(L,[2,24]),t(o,[2,7]),t(h,[2,9]),t(h,[2,10]),t(h,[2,11]),t(h,[2,12]),{23:36,32:C},{32:[2,23]},t(L,[2,17])],defaultActions:{9:[2,21],10:[2,1],11:[2,2],35:[2,23]},parseError:function(U,z){if(z.recoverable)this.trace(U);else{var R=new Error(U);throw R.hash=z,R}},parse:function(U){var z=this,R=[0],$=[],D=[null],k=[],B=this.table,v="",J=0,E=0,ft=2,Lt=1,Tt=k.slice.call(arguments,1),Q=Object.create(this.lexer),ut={yy:{}};for(var st in this.yy)Object.prototype.hasOwnProperty.call(this.yy,st)&&(ut.yy[st]=this.yy[st]);Q.setInput(U,ut.yy),ut.yy.lexer=Q,ut.yy.parser=this,typeof Q.yylloc>"u"&&(Q.yylloc={});var ot=Q.yylloc;k.push(ot);var dt=Q.options&&Q.options.ranges;typeof ut.yy.parseError=="function"?this.parseError=ut.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xt(){var gt;return gt=$.pop()||Q.lex()||Lt,typeof gt!="number"&&(gt instanceof Array&&($=gt,gt=$.pop()),gt=z.symbols_[gt]||gt),gt}for(var et,Nt,G,Z,tt={},W,Y,P,it;;){if(Nt=R[R.length-1],this.defaultActions[Nt]?G=this.defaultActions[Nt]:((et===null||typeof et>"u")&&(et=xt()),G=B[Nt]&&B[Nt][et]),typeof G>"u"||!G.length||!G[0]){var N="";it=[];for(W in B[Nt])this.terminals_[W]&&W>ft&&it.push("'"+this.terminals_[W]+"'");Q.showPosition?N="Parse error on line "+(J+1)+`:
`+Q.showPosition()+`
Expecting `+it.join(", ")+", got '"+(this.terminals_[et]||et)+"'":N="Parse error on line "+(J+1)+": Unexpected "+(et==Lt?"end of input":"'"+(this.terminals_[et]||et)+"'"),this.parseError(N,{text:Q.match,token:this.terminals_[et]||et,line:Q.yylineno,loc:ot,expected:it})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Nt+", token: "+et);switch(G[0]){case 1:R.push(et),D.push(Q.yytext),k.push(Q.yylloc),R.push(G[1]),et=null,E=Q.yyleng,v=Q.yytext,J=Q.yylineno,ot=Q.yylloc;break;case 2:if(Y=this.productions_[G[1]][1],tt.$=D[D.length-Y],tt._$={first_line:k[k.length-(Y||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(Y||1)].first_column,last_column:k[k.length-1].last_column},dt&&(tt._$.range=[k[k.length-(Y||1)].range[0],k[k.length-1].range[1]]),Z=this.performAction.apply(tt,[v,E,J,ut.yy,G[1],D,k].concat(Tt)),typeof Z<"u")return Z;Y&&(R=R.slice(0,-1*Y*2),D=D.slice(0,-1*Y),k=k.slice(0,-1*Y)),R.push(this.productions_[G[1]][0]),D.push(tt.$),k.push(tt._$),P=B[R[R.length-2]][R[R.length-1]],R.push(P);break;case 3:return!0}}return!0}},F=function(){var q={EOF:1,parseError:function(z,R){if(this.yy.parser)this.yy.parser.parseError(z,R);else throw new Error(z)},setInput:function(U,z){return this.yy=z||this.yy||{},this._input=U,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 U=this._input[0];this.yytext+=U,this.yyleng++,this.offset++,this.match+=U,this.matched+=U;var z=U.match(/(?:\r\n?|\n).*/g);return z?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),U},unput:function(U){var z=U.length,R=U.split(/(?:\r\n?|\n)/g);this._input=U+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-z),this.offset-=z;var $=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),R.length-1&&(this.yylineno-=R.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:R?(R.length===$.length?this.yylloc.first_column:0)+$[$.length-R.length].length-R[0].length:this.yylloc.first_column-z},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-z]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(U){this.unput(this.match.slice(U))},pastInput:function(){var U=this.matched.substr(0,this.matched.length-this.match.length);return(U.length>20?"...":"")+U.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var U=this.match;return U.length<20&&(U+=this._input.substr(0,20-U.length)),(U.substr(0,20)+(U.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var U=this.pastInput(),z=new Array(U.length+1).join("-");return U+this.upcomingInput()+`
`+z+"^"},test_match:function(U,z){var R,$,D;if(this.options.backtrack_lexer&&(D={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&&(D.yylloc.range=this.yylloc.range.slice(0))),$=U[0].match(/(?:\r\n?|\n).*/g),$&&(this.yylineno+=$.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:$?$[$.length-1].length-$[$.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+U[0].length},this.yytext+=U[0],this.match+=U[0],this.matches=U,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(U[0].length),this.matched+=U[0],R=this.performAction.call(this,this.yy,this,z,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),R)return R;if(this._backtrack){for(var k in D)this[k]=D[k];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var U,z,R,$;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),k=0;k<D.length;k++)if(R=this._input.match(this.rules[D[k]]),R&&(!z||R[0].length>z[0].length)){if(z=R,$=k,this.options.backtrack_lexer){if(U=this.test_match(R,D[k]),U!==!1)return U;if(this._backtrack){z=!1;continue}else return!1}else if(!this.options.flex)break}return z?(U=this.test_match(z,D[$]),U!==!1?U:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var z=this.next();return z||this.lex()},begin:function(z){this.conditionStack.push(z)},popState:function(){var z=this.conditionStack.length-1;return z>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(z){return z=this.conditionStack.length-1-Math.abs(z||0),z>=0?this.conditionStack[z]:"INITIAL"},pushState:function(z){this.begin(z)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(z,R,$,D){switch($){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:break;case 6:break;case 7:return 26;case 8:break;case 9:break;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:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:this.begin("string");break;case 20:this.popState();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}}};return q}();M.lexer=F;function H(){this.yy={}}return H.prototype=M,M.Parser=H,new H}();parser$4.parser=parser$4;const pieParser=parser$4,pieDetector=t=>t.match(/^\s*pie/)!==null||t.match(/^\s*bar/)!==null;let sections$1={},showData=!1;const parseDirective$5=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},addSection$1=function(t,e){t=common$1.sanitizeText(t,getConfig$1()),sections$1[t]===void 0&&(sections$1[t]=e,log$1.debug("Added new section :",t))},getSections$1=()=>sections$1,setShowData=function(t){showData=t},getShowData=function(){return showData},cleanupValue=function(t){return t.substring(0,1)===":"&&(t=t.substring(1).trim()),Number(t.trim())},clear$4=function(){sections$1={},showData=!1,clear$g()},pieDb={parseDirective:parseDirective$5,getConfig:()=>getConfig$1().pie,addSection:addSection$1,getSections:getSections$1,cleanupValue,clear:clear$4,setAccTitle,getAccTitle,setDiagramTitle,getDiagramTitle,setShowData,getShowData,getAccDescription,setAccDescription};let conf$5=getConfig$1(),width;const height=450,draw$6=(t,e,r,n)=>{try{conf$5=getConfig$1(),log$1.debug(`Rendering info diagram
`+t);const L=getConfig$1().securityLevel;let M;L==="sandbox"&&(M=select("#i"+e));const F=L==="sandbox"?select(M.nodes()[0].contentDocument.body):select("body"),H=L==="sandbox"?M.nodes()[0].contentDocument:document;n.db.clear(),n.parser.parse(t),log$1.debug("Parsed info diagram");const q=H.getElementById(e);width=q.parentElement.offsetWidth,width===void 0&&(width=1200),conf$5.useWidth!==void 0&&(width=conf$5.useWidth),conf$5.pie.useWidth!==void 0&&(width=conf$5.pie.useWidth);const U=F.select("#"+e);configureSvgSize(U,height,width,conf$5.pie.useMaxWidth),q.setAttribute("viewBox","0 0 "+width+" "+height);var a=40,s=18,o=4,l=Math.min(width,height)/2-a,u=U.append("g").attr("transform","translate("+width/2+","+height/2+")"),h=n.db.getSections(),d=0;Object.keys(h).forEach(function(R){d+=h[R]});const z=conf$5.themeVariables;var p=[z.pie1,z.pie2,z.pie3,z.pie4,z.pie5,z.pie6,z.pie7,z.pie8,z.pie9,z.pie10,z.pie11,z.pie12],g=ordinal().range(p),m=Object.entries(h).map(function(R,$){return{order:$,name:R[0],value:R[1]}}),T=pie().value(function(R){return R.value}).sort(function(R,$){return R.order-$.order}),I=T(m),A=arc().innerRadius(0).outerRadius(l);u.selectAll("mySlices").data(I).enter().append("path").attr("d",A).attr("fill",function(R){return g(R.data.name)}).attr("class","pieCircle"),u.selectAll("mySlices").data(I).enter().append("text").text(function(R){return(R.data.value/d*100).toFixed(0)+"%"}).attr("transform",function(R){return"translate("+A.centroid(R)+")"}).style("text-anchor","middle").attr("class","slice"),u.append("text").text(n.db.getDiagramTitle()).attr("x",0).attr("y",-(height-50)/2).attr("class","pieTitleText");var C=u.selectAll(".legend").data(g.domain()).enter().append("g").attr("class","legend").attr("transform",function(R,$){const D=s+o,k=D*g.domain().length/2,B=12*s,v=$*D-k;return"translate("+B+","+v+")"});C.append("rect").attr("width",s).attr("height",s).style("fill",g).style("stroke",g),C.data(I).append("text").attr("x",s+o).attr("y",s-o).text(function(R){return n.db.getShowData()||conf$5.showData||conf$5.pie.showData?R.data.name+" ["+R.data.value+"]":R.data.name})}catch(L){log$1.error("Error while rendering info diagram"),log$1.error(L)}},pieRenderer={draw:draw$6};var parser$3=function(){var t=function(Nt,G,Z,tt){for(Z=Z||{},tt=Nt.length;tt--;Z[Nt[tt]]=G);return Z},e=[1,3],r=[1,5],n=[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],u=[2,13],h=[1,26],d=[1,27],p=[1,28],g=[1,29],m=[1,30],T=[1,31],I=[1,24],A=[1,32],C=[1,33],L=[1,36],M=[71,72],F=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],H=[1,56],q=[1,57],U=[1,58],z=[1,59],R=[1,60],$=[1,61],D=[1,62],k=[62,63],B=[1,74],v=[1,70],J=[1,71],E=[1,72],ft=[1,73],Lt=[1,75],Tt=[1,79],Q=[1,80],ut=[1,77],st=[1,78],ot=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72],dt={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(G,Z,tt,W,Y,P,it){var N=P.length-1;switch(Y){case 6:this.$=P[N].trim(),W.setAccTitle(this.$);break;case 7:case 8:this.$=P[N].trim(),W.setAccDescription(this.$);break;case 9:W.parseDirective("%%{","open_directive");break;case 10:W.parseDirective(P[N],"type_directive");break;case 11:P[N]=P[N].trim().replace(/'/g,'"'),W.parseDirective(P[N],"arg_directive");break;case 12:W.parseDirective("}%%","close_directive","pie");break;case 13:this.$=[];break;case 19:W.addRequirement(P[N-3],P[N-4]);break;case 20:W.setNewReqId(P[N-2]);break;case 21:W.setNewReqText(P[N-2]);break;case 22:W.setNewReqRisk(P[N-2]);break;case 23:W.setNewReqVerifyMethod(P[N-2]);break;case 26:this.$=W.RequirementType.REQUIREMENT;break;case 27:this.$=W.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 28:this.$=W.RequirementType.INTERFACE_REQUIREMENT;break;case 29:this.$=W.RequirementType.PERFORMANCE_REQUIREMENT;break;case 30:this.$=W.RequirementType.PHYSICAL_REQUIREMENT;break;case 31:this.$=W.RequirementType.DESIGN_CONSTRAINT;break;case 32:this.$=W.RiskLevel.LOW_RISK;break;case 33:this.$=W.RiskLevel.MED_RISK;break;case 34:this.$=W.RiskLevel.HIGH_RISK;break;case 35:this.$=W.VerifyType.VERIFY_ANALYSIS;break;case 36:this.$=W.VerifyType.VERIFY_DEMONSTRATION;break;case 37:this.$=W.VerifyType.VERIFY_INSPECTION;break;case 38:this.$=W.VerifyType.VERIFY_TEST;break;case 39:W.addElement(P[N-3]);break;case 40:W.setNewElementType(P[N-2]);break;case 41:W.setNewElementDocRef(P[N-2]);break;case 44:W.addRelationship(P[N-2],P[N],P[N-4]);break;case 45:W.addRelationship(P[N-2],P[N-4],P[N]);break;case 46:this.$=W.Relationships.CONTAINS;break;case 47:this.$=W.Relationships.COPIES;break;case 48:this.$=W.Relationships.DERIVES;break;case 49:this.$=W.Relationships.SATISFIES;break;case 50:this.$=W.Relationships.VERIFIES;break;case 51:this.$=W.Relationships.REFINES;break;case 52:this.$=W.Relationships.TRACES;break}},table:[{3:1,4:2,6:e,9:4,14:r,16:n,18:a,19:s},{1:[3]},{3:10,4:2,5:[1,9],6:e,9:4,14:r,16:n,18:a,19:s},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},t(o,[2,8]),{20:[2,9]},{3:16,4:2,6:e,9:4,14:r,16:n,18:a,19:s},{1:[2,2]},{4:21,5:l,7:17,8:u,9:4,14:r,16:n,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:d,42:p,43:g,44:m,45:T,53:I,71:A,72:C},{11:34,12:[1,35],22:L},t([12,22],[2,10]),t(o,[2,6]),t(o,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:l,7:38,8:u,9:4,14:r,16:n,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:d,42:p,43:g,44:m,45:T,53:I,71:A,72:C},{4:21,5:l,7:39,8:u,9:4,14:r,16:n,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:d,42:p,43:g,44:m,45:T,53:I,71:A,72:C},{4:21,5:l,7:40,8:u,9:4,14:r,16:n,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:d,42:p,43:g,44:m,45:T,53:I,71:A,72:C},{4:21,5:l,7:41,8:u,9:4,14:r,16:n,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:d,42:p,43:g,44:m,45:T,53:I,71:A,72:C},{4:21,5:l,7:42,8:u,9:4,14:r,16:n,18:a,19:s,23:18,24:19,25:20,26:23,32:25,40:h,41:d,42:p,43:g,44:m,45:T,53:I,71:A,72:C},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},t(M,[2,26]),t(M,[2,27]),t(M,[2,28]),t(M,[2,29]),t(M,[2,30]),t(M,[2,31]),t(F,[2,55]),t(F,[2,56]),t(o,[2,4]),{13:51,21:[1,52]},t(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:H,65:q,66:U,67:z,68:R,69:$,70:D},{61:63,64:H,65:q,66:U,67:z,68:R,69:$,70:D},{11:64,22:L},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},t(k,[2,46]),t(k,[2,47]),t(k,[2,48]),t(k,[2,49]),t(k,[2,50]),t(k,[2,51]),t(k,[2,52]),{63:[1,68]},t(o,[2,5]),{5:B,29:69,30:v,33:J,35:E,37:ft,39:Lt},{5:Tt,39:Q,55:76,56:ut,58:st},{32:81,71:A,72:C},{32:82,71:A,72:C},t(ot,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:B,29:87,30:v,33:J,35:E,37:ft,39:Lt},t(ot,[2,25]),t(ot,[2,39]),{31:[1,88]},{31:[1,89]},{5:Tt,39:Q,55:90,56:ut,58:st},t(ot,[2,43]),t(ot,[2,44]),t(ot,[2,45]),{32:91,71:A,72:C},{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]},t(ot,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},t(ot,[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:B,29:116,30:v,33:J,35:E,37:ft,39:Lt},{5:B,29:117,30:v,33:J,35:E,37:ft,39:Lt},{5:B,29:118,30:v,33:J,35:E,37:ft,39:Lt},{5:B,29:119,30:v,33:J,35:E,37:ft,39:Lt},{5:Tt,39:Q,55:120,56:ut,58:st},{5:Tt,39:Q,55:121,56:ut,58:st},t(ot,[2,20]),t(ot,[2,21]),t(ot,[2,22]),t(ot,[2,23]),t(ot,[2,40]),t(ot,[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(G,Z){if(Z.recoverable)this.trace(G);else{var tt=new Error(G);throw tt.hash=Z,tt}},parse:function(G){var Z=this,tt=[0],W=[],Y=[null],P=[],it=this.table,N="",gt=0,j=0,Ft=2,at=1,Dt=P.slice.call(arguments,1),kt=Object.create(this.lexer),_t={yy:{}};for(var St in this.yy)Object.prototype.hasOwnProperty.call(this.yy,St)&&(_t.yy[St]=this.yy[St]);kt.setInput(G,_t.yy),_t.yy.lexer=kt,_t.yy.parser=this,typeof kt.yylloc>"u"&&(kt.yylloc={});var Et=kt.yylloc;P.push(Et);var yt=kt.options&&kt.options.ranges;typeof _t.yy.parseError=="function"?this.parseError=_t.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ct(){var mt;return mt=W.pop()||kt.lex()||at,typeof mt!="number"&&(mt instanceof Array&&(W=mt,mt=W.pop()),mt=Z.symbols_[mt]||mt),mt}for(var ne,jt,Wt,qt,Ht={},ge,zt,Pt,Mt;;){if(jt=tt[tt.length-1],this.defaultActions[jt]?Wt=this.defaultActions[jt]:((ne===null||typeof ne>"u")&&(ne=ct()),Wt=it[jt]&&it[jt][ne]),typeof Wt>"u"||!Wt.length||!Wt[0]){var wt="";Mt=[];for(ge in it[jt])this.terminals_[ge]&&ge>Ft&&Mt.push("'"+this.terminals_[ge]+"'");kt.showPosition?wt="Parse error on line "+(gt+1)+`:
`+kt.showPosition()+`
Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ne]||ne)+"'":wt="Parse error on line "+(gt+1)+": Unexpected "+(ne==at?"end of input":"'"+(this.terminals_[ne]||ne)+"'"),this.parseError(wt,{text:kt.match,token:this.terminals_[ne]||ne,line:kt.yylineno,loc:Et,expected:Mt})}if(Wt[0]instanceof Array&&Wt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+jt+", token: "+ne);switch(Wt[0]){case 1:tt.push(ne),Y.push(kt.yytext),P.push(kt.yylloc),tt.push(Wt[1]),ne=null,j=kt.yyleng,N=kt.yytext,gt=kt.yylineno,Et=kt.yylloc;break;case 2:if(zt=this.productions_[Wt[1]][1],Ht.$=Y[Y.length-zt],Ht._$={first_line:P[P.length-(zt||1)].first_line,last_line:P[P.length-1].last_line,first_column:P[P.length-(zt||1)].first_column,last_column:P[P.length-1].last_column},yt&&(Ht._$.range=[P[P.length-(zt||1)].range[0],P[P.length-1].range[1]]),qt=this.performAction.apply(Ht,[N,j,gt,_t.yy,Wt[1],Y,P].concat(Dt)),typeof qt<"u")return qt;zt&&(tt=tt.slice(0,-1*zt*2),Y=Y.slice(0,-1*zt),P=P.slice(0,-1*zt)),tt.push(this.productions_[Wt[1]][0]),Y.push(Ht.$),P.push(Ht._$),Pt=it[tt[tt.length-2]][tt[tt.length-1]],tt.push(Pt);break;case 3:return!0}}return!0}},xt=function(){var Nt={EOF:1,parseError:function(Z,tt){if(this.yy.parser)this.yy.parser.parseError(Z,tt);else throw new Error(Z)},setInput:function(G,Z){return this.yy=Z||this.yy||{},this._input=G,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 G=this._input[0];this.yytext+=G,this.yyleng++,this.offset++,this.match+=G,this.matched+=G;var Z=G.match(/(?:\r\n?|\n).*/g);return Z?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),G},unput:function(G){var Z=G.length,tt=G.split(/(?:\r\n?|\n)/g);this._input=G+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Z),this.offset-=Z;var W=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),tt.length-1&&(this.yylineno-=tt.length-1);var Y=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:tt?(tt.length===W.length?this.yylloc.first_column:0)+W[W.length-tt.length].length-tt[0].length:this.yylloc.first_column-Z},this.options.ranges&&(this.yylloc.range=[Y[0],Y[0]+this.yyleng-Z]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(G){this.unput(this.match.slice(G))},pastInput:function(){var G=this.matched.substr(0,this.matched.length-this.match.length);return(G.length>20?"...":"")+G.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var G=this.match;return G.length<20&&(G+=this._input.substr(0,20-G.length)),(G.substr(0,20)+(G.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var G=this.pastInput(),Z=new Array(G.length+1).join("-");return G+this.upcomingInput()+`
`+Z+"^"},test_match:function(G,Z){var tt,W,Y;if(this.options.backtrack_lexer&&(Y={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&&(Y.yylloc.range=this.yylloc.range.slice(0))),W=G[0].match(/(?:\r\n?|\n).*/g),W&&(this.yylineno+=W.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+G[0].length},this.yytext+=G[0],this.match+=G[0],this.matches=G,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(G[0].length),this.matched+=G[0],tt=this.performAction.call(this,this.yy,this,Z,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),tt)return tt;if(this._backtrack){for(var P in Y)this[P]=Y[P];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var G,Z,tt,W;this._more||(this.yytext="",this.match="");for(var Y=this._currentRules(),P=0;P<Y.length;P++)if(tt=this._input.match(this.rules[Y[P]]),tt&&(!Z||tt[0].length>Z[0].length)){if(Z=tt,W=P,this.options.backtrack_lexer){if(G=this.test_match(tt,Y[P]),G!==!1)return G;if(this._backtrack){Z=!1;continue}else return!1}else if(!this.options.flex)break}return Z?(G=this.test_match(Z,Y[W]),G!==!1?G:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Z=this.next();return Z||this.lex()},begin:function(Z){this.conditionStack.push(Z)},popState:function(){var Z=this.conditionStack.length-1;return Z>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(Z){return Z=this.conditionStack.length-1-Math.abs(Z||0),Z>=0?this.conditionStack[Z]:"INITIAL"},pushState:function(Z){this.begin(Z)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(Z,tt,W,Y){switch(W){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:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 5;case 14:break;case 15:break;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 53:this.popState();break;case 54:return"qString";case 55:return tt.yytext=tt.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}}};return Nt}();dt.lexer=xt;function et(){this.yy={}}return et.prototype=dt,dt.Parser=et,new et}();parser$3.parser=parser$3;const requirementParser=parser$3,requirementDetector=t=>t.match(/^\s*requirement(Diagram)?/)!==null;let relations=[],latestRequirement={},requirements={},latestElement={},elements={};const 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$4=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},addRequirement=(t,e)=>(requirements[t]===void 0&&(requirements[t]={name:t,type:e,id:latestRequirement.id,text:latestRequirement.text,risk:latestRequirement.risk,verifyMethod:latestRequirement.verifyMethod}),latestRequirement={},requirements[t]),getRequirements=()=>requirements,setNewReqId=t=>{latestRequirement!==void 0&&(latestRequirement.id=t)},setNewReqText=t=>{latestRequirement!==void 0&&(latestRequirement.text=t)},setNewReqRisk=t=>{latestRequirement!==void 0&&(latestRequirement.risk=t)},setNewReqVerifyMethod=t=>{latestRequirement!==void 0&&(latestRequirement.verifyMethod=t)},addElement=t=>(elements[t]===void 0&&(elements[t]={name:t,type:latestElement.type,docRef:latestElement.docRef},log$1.info("Added new requirement: ",t)),latestElement={},elements[t]),getElements=()=>elements,setNewElementType=t=>{latestElement!==void 0&&(latestElement.type=t)},setNewElementDocRef=t=>{latestElement!==void 0&&(latestElement.docRef=t)},addRelationship=(t,e,r)=>{relations.push({type:t,src:e,dst:r})},getRelationships=()=>relations,clear$3=()=>{relations=[],latestRequirement={},requirements={},latestElement={},elements={},clear$g()},requirementDb={RequirementType,RiskLevel,VerifyType,Relationships,parseDirective:parseDirective$4,getConfig:()=>getConfig$1().req,addRequirement,getRequirements,setNewReqId,setNewReqText,setNewReqRisk,setNewReqVerifyMethod,setAccTitle,getAccTitle,setAccDescription,getAccDescription,addElement,getElements,setNewElementType,setNewElementDocRef,addRelationship,getRelationships,clear:clear$3},ReqMarkers={CONTAINS:"contains",ARROW:"arrow"},insertLineEndings=(t,e)=>{let r=t.append("defs").append("marker").attr("id",ReqMarkers.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");r.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),r.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),r.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",ReqMarkers.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
L${e.line_height},${e.line_height/2}
M${e.line_height},${e.line_height/2}
L0,${e.line_height}`).attr("stroke-width",1)},markers={ReqMarkers,insertLineEndings};let conf$4={},relCnt=0;const newRectNode=(t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",conf$4.rect_min_width+"px").attr("height",conf$4.rect_min_height+"px"),newTitleNode=(t,e,r)=>{let n=conf$4.rect_min_width/2,a=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",conf$4.rect_padding).attr("dominant-baseline","hanging"),s=0;r.forEach(h=>{s==0?a.append("tspan").attr("text-anchor","middle").attr("x",conf$4.rect_min_width/2).attr("dy",0).text(h):a.append("tspan").attr("text-anchor","middle").attr("x",conf$4.rect_min_width/2).attr("dy",conf$4.line_height*.75).text(h),s++});let o=1.5*conf$4.rect_padding,l=s*conf$4.line_height*.75,u=o+l;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",conf$4.rect_min_width).attr("y1",u).attr("y2",u),{titleNode:a,y:u}},newBodyNode=(t,e,r,n)=>{let a=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",conf$4.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),s=0;const o=30;let l=[];return r.forEach(u=>{let h=u.length;for(;h>o&&s<3;){let d=u.substring(0,o);u=u.substring(o,u.length),h=u.length,l[l.length]=d,s++}if(s==3){let d=l[l.length-1];l[l.length-1]=d.substring(0,d.length-4)+"..."}else l[l.length]=u;s=0}),l.forEach(u=>{a.append("tspan").attr("x",conf$4.rect_padding).attr("dy",conf$4.line_height).text(u)}),a},addEdgeLabel=(t,e,r,n)=>{const a=e.node().getTotalLength(),s=e.node().getPointAtLength(a*.5),o="rel"+relCnt;relCnt++;const u=t.append("text").attr("class","req relationshipLabel").attr("id",o).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+o).attr("class","req reqLabelBox").attr("x",s.x-u.width/2).attr("y",s.y-u.height/2).attr("width",u.width).attr("height",u.height).attr("fill","white").attr("fill-opacity","85%")},drawRelationshipFromLayout=function(t,e,r,n,a){const s=r.edge(elementString(e.src),elementString(e.dst)),o=line$1().x(function(u){return u.x}).y(function(u){return u.y}),l=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",o(s.points)).attr("fill","none");e.type==a.db.Relationships.CONTAINS?l.attr("marker-start","url("+common$1.getUrl(conf$4.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(l.attr("stroke-dasharray","10,7"),l.attr("marker-end","url("+common$1.getUrl(conf$4.arrowMarkerAbsolute)+"#"+markers.ReqMarkers.ARROW+"_line_ending)")),addEdgeLabel(t,l,conf$4,`<<${e.type}>>`)},drawReqs=(t,e,r)=>{Object.keys(t).forEach(n=>{let a=t[n];n=elementString(n),log$1.info("Added new requirement: ",n);const s=r.append("g").attr("id",n),o="req-"+n,l=newRectNode(s,o);let u=newTitleNode(s,n+"_title",[`<<${a.type}>>`,`${a.name}`]);newBodyNode(s,n+"_body",[`Id: ${a.id}`,`Text: ${a.text}`,`Risk: ${a.risk}`,`Verification: ${a.verifyMethod}`],u.y);const h=l.node().getBBox();e.setNode(n,{width:h.width,height:h.height,shape:"rect",id:n})})},drawElements=(t,e,r)=>{Object.keys(t).forEach(n=>{let a=t[n];const s=elementString(n),o=r.append("g").attr("id",s),l="element-"+s,u=newRectNode(o,l);let h=newTitleNode(o,l+"_title",["<<Element>>",`${n}`]);newBodyNode(o,l+"_body",[`Type: ${a.type||"Not Specified"}`,`Doc Ref: ${a.docRef||"None"}`],h.y);const d=u.node().getBBox();e.setNode(s,{width:d.width,height:d.height,shape:"rect",id:s})})},addRelationships=(t,e)=>(t.forEach(function(r){let n=elementString(r.src),a=elementString(r.dst);e.setEdge(n,a,{relationship:r})}),t),adjustEntities=function(t,e){e.nodes().forEach(function(r){r!==void 0&&e.node(r)!==void 0&&(t.select("#"+r),t.select("#"+r).attr("transform","translate("+(e.node(r).x-e.node(r).width/2)+","+(e.node(r).y-e.node(r).height/2)+" )"))})},elementString=t=>t.replace(/\s/g,"").replace(/\./g,"_"),draw$5=(t,e,r,n)=>{conf$4=getConfig$1().requirement,n.db.clear(),n.parser.parse(t);const a=conf$4.securityLevel;let s;a==="sandbox"&&(s=select("#i"+e));const l=(a==="sandbox"?select(s.nodes()[0].contentDocument.body):select("body")).select(`[id='${e}']`);markers.insertLineEndings(l,conf$4);const u=new Graph({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:conf$4.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}});let h=n.db.getRequirements(),d=n.db.getElements(),p=n.db.getRelationships();drawReqs(h,u,l),drawElements(d,u,l),addRelationships(p,u),layout(u),adjustEntities(l,u),p.forEach(function(A){drawRelationshipFromLayout(l,A,u,e,n)});const g=conf$4.rect_padding,m=l.node().getBBox(),T=m.width+g*2,I=m.height+g*2;configureSvgSize(l,I,T,conf$4.useMaxWidth),l.attr("viewBox",`${m.x-g} ${m.y-g} ${T} ${I}`)},requirementRenderer={draw:draw$5};var parser$2=function(){var t=function(Nt,G,Z,tt){for(Z=Z||{},tt=Nt.length;tt--;Z[Nt[tt]]=G);return Z},e=[1,2],r=[1,3],n=[1,5],a=[1,7],s=[2,5],o=[1,15],l=[1,17],u=[1,18],h=[1,19],d=[1,21],p=[1,22],g=[1,23],m=[1,29],T=[1,30],I=[1,31],A=[1,32],C=[1,33],L=[1,34],M=[1,35],F=[1,36],H=[1,37],q=[1,38],U=[1,39],z=[1,40],R=[1,43],$=[1,44],D=[1,45],k=[1,46],B=[1,47],v=[1,48],J=[1,51],E=[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],ft=[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],Lt=[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],Tt=[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],Q=[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],ut=[67,68,69],st=[1,121],ot=[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],dt={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(G,Z,tt,W,Y,P,it){var N=P.length-1;switch(Y){case 4:return W.apply(P[N]),P[N];case 5:this.$=[];break;case 6:P[N-1].push(P[N]),this.$=P[N-1];break;case 7:case 8:this.$=P[N];break;case 9:this.$=[];break;case 12:P[N-3].type="addParticipant",P[N-3].description=W.parseMessage(P[N-1]),this.$=P[N-3];break;case 13:P[N-1].type="addParticipant",this.$=P[N-1];break;case 14:P[N-3].type="addActor",P[N-3].description=W.parseMessage(P[N-1]),this.$=P[N-3];break;case 15:P[N-1].type="addActor",this.$=P[N-1];break;case 17:this.$={type:"sequenceIndex",sequenceIndex:Number(P[N-2]),sequenceIndexStep:Number(P[N-1]),sequenceVisible:!0,signalType:W.LINETYPE.AUTONUMBER};break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(P[N-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:W.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:W.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:W.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"activeStart",signalType:W.LINETYPE.ACTIVE_START,actor:P[N-1]};break;case 22:this.$={type:"activeEnd",signalType:W.LINETYPE.ACTIVE_END,actor:P[N-1]};break;case 28:W.setDiagramTitle(P[N].substring(6)),this.$=P[N].substring(6);break;case 29:W.setDiagramTitle(P[N].substring(7)),this.$=P[N].substring(7);break;case 30:this.$=P[N].trim(),W.setAccTitle(this.$);break;case 31:case 32:this.$=P[N].trim(),W.setAccDescription(this.$);break;case 33:P[N-1].unshift({type:"loopStart",loopText:W.parseMessage(P[N-2]),signalType:W.LINETYPE.LOOP_START}),P[N-1].push({type:"loopEnd",loopText:P[N-2],signalType:W.LINETYPE.LOOP_END}),this.$=P[N-1];break;case 34:P[N-1].unshift({type:"rectStart",color:W.parseMessage(P[N-2]),signalType:W.LINETYPE.RECT_START}),P[N-1].push({type:"rectEnd",color:W.parseMessage(P[N-2]),signalType:W.LINETYPE.RECT_END}),this.$=P[N-1];break;case 35:P[N-1].unshift({type:"optStart",optText:W.parseMessage(P[N-2]),signalType:W.LINETYPE.OPT_START}),P[N-1].push({type:"optEnd",optText:W.parseMessage(P[N-2]),signalType:W.LINETYPE.OPT_END}),this.$=P[N-1];break;case 36:P[N-1].unshift({type:"altStart",altText:W.parseMessage(P[N-2]),signalType:W.LINETYPE.ALT_START}),P[N-1].push({type:"altEnd",signalType:W.LINETYPE.ALT_END}),this.$=P[N-1];break;case 37:P[N-1].unshift({type:"parStart",parText:W.parseMessage(P[N-2]),signalType:W.LINETYPE.PAR_START}),P[N-1].push({type:"parEnd",signalType:W.LINETYPE.PAR_END}),this.$=P[N-1];break;case 38:P[N-1].unshift({type:"criticalStart",criticalText:W.parseMessage(P[N-2]),signalType:W.LINETYPE.CRITICAL_START}),P[N-1].push({type:"criticalEnd",signalType:W.LINETYPE.CRITICAL_END}),this.$=P[N-1];break;case 39:P[N-1].unshift({type:"breakStart",breakText:W.parseMessage(P[N-2]),signalType:W.LINETYPE.BREAK_START}),P[N-1].push({type:"breakEnd",optText:W.parseMessage(P[N-2]),signalType:W.LINETYPE.BREAK_END}),this.$=P[N-1];break;case 42:this.$=P[N-3].concat([{type:"option",optionText:W.parseMessage(P[N-1]),signalType:W.LINETYPE.CRITICAL_OPTION},P[N]]);break;case 44:this.$=P[N-3].concat([{type:"and",parText:W.parseMessage(P[N-1]),signalType:W.LINETYPE.PAR_AND},P[N]]);break;case 46:this.$=P[N-3].concat([{type:"else",altText:W.parseMessage(P[N-1]),signalType:W.LINETYPE.ALT_ELSE},P[N]]);break;case 47:this.$=[P[N-1],{type:"addNote",placement:P[N-2],actor:P[N-1].actor,text:P[N]}];break;case 48:P[N-2]=[].concat(P[N-1],P[N-1]).slice(0,2),P[N-2][0]=P[N-2][0].actor,P[N-2][1]=P[N-2][1].actor,this.$=[P[N-1],{type:"addNote",placement:W.PLACEMENT.OVER,actor:P[N-2].slice(0,2),text:P[N]}];break;case 49:this.$=[P[N-1],{type:"addLinks",actor:P[N-1].actor,text:P[N]}];break;case 50:this.$=[P[N-1],{type:"addALink",actor:P[N-1].actor,text:P[N]}];break;case 51:this.$=[P[N-1],{type:"addProperties",actor:P[N-1].actor,text:P[N]}];break;case 52:this.$=[P[N-1],{type:"addDetails",actor:P[N-1].actor,text:P[N]}];break;case 55:this.$=[P[N-2],P[N]];break;case 56:this.$=P[N];break;case 57:this.$=W.PLACEMENT.LEFTOF;break;case 58:this.$=W.PLACEMENT.RIGHTOF;break;case 59:this.$=[P[N-4],P[N-1],{type:"addMessage",from:P[N-4].actor,to:P[N-1].actor,signalType:P[N-3],msg:P[N]},{type:"activeStart",signalType:W.LINETYPE.ACTIVE_START,actor:P[N-1]}];break;case 60:this.$=[P[N-4],P[N-1],{type:"addMessage",from:P[N-4].actor,to:P[N-1].actor,signalType:P[N-3],msg:P[N]},{type:"activeEnd",signalType:W.LINETYPE.ACTIVE_END,actor:P[N-4]}];break;case 61:this.$=[P[N-3],P[N-1],{type:"addMessage",from:P[N-3].actor,to:P[N-1].actor,signalType:P[N-2],msg:P[N]}];break;case 62:this.$={type:"addParticipant",actor:P[N]};break;case 63:this.$=W.LINETYPE.SOLID_OPEN;break;case 64:this.$=W.LINETYPE.DOTTED_OPEN;break;case 65:this.$=W.LINETYPE.SOLID;break;case 66:this.$=W.LINETYPE.DOTTED;break;case 67:this.$=W.LINETYPE.SOLID_CROSS;break;case 68:this.$=W.LINETYPE.DOTTED_CROSS;break;case 69:this.$=W.LINETYPE.SOLID_POINT;break;case 70:this.$=W.LINETYPE.DOTTED_POINT;break;case 71:this.$=W.parseMessage(P[N].trim().substring(1));break;case 72:W.parseDirective("%%{","open_directive");break;case 73:W.parseDirective(P[N],"type_directive");break;case 74:P[N]=P[N].trim().replace(/'/g,'"'),W.parseDirective(P[N],"arg_directive");break;case 75:W.parseDirective("}%%","close_directive","sequence");break}},table:[{3:1,4:e,5:r,6:4,7:n,11:6,79:a},{1:[3]},{3:8,4:e,5:r,6:4,7:n,11:6,79:a},{3:9,4:e,5:r,6:4,7:n,11:6,79:a},{3:10,4:e,5:r,6:4,7:n,11:6,79:a},t([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:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,41:M,42:F,43:H,45:q,47:U,49:z,53:R,58:$,59:D,60:k,61:B,69:v,79:a},{13:49,14:[1,50],82:J},t([14,82],[2,73]),t(E,[2,6]),{6:41,10:52,11:6,16:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,41:M,42:F,43:H,45:q,47:U,49:z,53:R,58:$,59:D,60:k,61:B,69:v,79:a},t(E,[2,8]),t(E,[2,9]),{17:53,69:v},{17:54,69:v},{5:[1,55]},{5:[1,58],23:[1,56],24:[1,57]},{17:59,69:v},{17:60,69:v},{5:[1,61]},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},t(E,[2,28]),t(E,[2,29]),{35:[1,66]},{37:[1,67]},t(E,[2,32]),{19:[1,68]},{19:[1,69]},{19:[1,70]},{19:[1,71]},{19:[1,72]},{19:[1,73]},{19:[1,74]},t(E,[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:v},{17:89,69:v},{17:90,69:v},{17:91,69:v},t([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]},t(E,[2,7]),{5:[1,96],18:[1,95]},{5:[1,98],18:[1,97]},t(E,[2,16]),{5:[1,100],23:[1,99]},{5:[1,101]},t(E,[2,20]),{5:[1,102]},{5:[1,103]},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,27]),t(E,[2,30]),t(E,[2,31]),t(ft,s,{8:104}),t(ft,s,{8:105}),t(ft,s,{8:106}),t(Lt,s,{44:107,8:108}),t(Tt,s,{46:109,8:110}),t(Q,s,{48:111,8:112}),t(ft,s,{8:113}),{17:116,67:[1,114],68:[1,115],69:v},t(ut,[2,63]),t(ut,[2,64]),t(ut,[2,65]),t(ut,[2,66]),t(ut,[2,67]),t(ut,[2,68]),t(ut,[2,69]),t(ut,[2,70]),{17:117,69:v},{17:119,57:118,69:v},{69:[2,57]},{69:[2,58]},{55:120,78:st},{55:122,78:st},{55:123,78:st},{55:124,78:st},t(ot,[2,10]),{13:125,82:J},{82:[2,74]},{19:[1,126]},t(E,[2,13]),{19:[1,127]},t(E,[2,15]),{5:[1,128]},t(E,[2,18]),t(E,[2,19]),t(E,[2,21]),t(E,[2,22]),{4:o,5:l,6:41,9:14,10:16,11:6,16:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,40:[1,129],41:M,42:F,43:H,45:q,47:U,49:z,53:R,58:$,59:D,60:k,61:B,69:v,79:a},{4:o,5:l,6:41,9:14,10:16,11:6,16:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,40:[1,130],41:M,42:F,43:H,45:q,47:U,49:z,53:R,58:$,59:D,60:k,61:B,69:v,79:a},{4:o,5:l,6:41,9:14,10:16,11:6,16:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,40:[1,131],41:M,42:F,43:H,45:q,47:U,49:z,53:R,58:$,59:D,60:k,61:B,69:v,79:a},{40:[1,132]},{4:o,5:l,6:41,9:14,10:16,11:6,16:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,40:[2,45],41:M,42:F,43:H,45:q,47:U,49:z,52:[1,133],53:R,58:$,59:D,60:k,61:B,69:v,79:a},{40:[1,134]},{4:o,5:l,6:41,9:14,10:16,11:6,16:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,40:[2,43],41:M,42:F,43:H,45:q,47:U,49:z,51:[1,135],53:R,58:$,59:D,60:k,61:B,69:v,79:a},{40:[1,136]},{4:o,5:l,6:41,9:14,10:16,11:6,16:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,40:[2,41],41:M,42:F,43:H,45:q,47:U,49:z,50:[1,137],53:R,58:$,59:D,60:k,61:B,69:v,79:a},{4:o,5:l,6:41,9:14,10:16,11:6,16:u,17:42,20:h,21:20,22:d,25:p,26:g,27:24,28:25,29:26,30:27,31:28,32:m,33:T,34:I,36:A,38:C,39:L,40:[1,138],41:M,42:F,43:H,45:q,47:U,49:z,53:R,58:$,59:D,60:k,61:B,69:v,79:a},{17:139,69:v},{17:140,69:v},{55:141,78:st},{55:142,78:st},{55:143,78:st},{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]},t(E,[2,17]),t(E,[2,33]),t(E,[2,34]),t(E,[2,35]),t(E,[2,36]),{19:[1,148]},t(E,[2,37]),{19:[1,149]},t(E,[2,38]),{19:[1,150]},t(E,[2,39]),{55:151,78:st},{55:152,78:st},{5:[2,61]},{5:[2,47]},{5:[2,48]},{17:153,69:v},t(ot,[2,11]),t(E,[2,12]),t(E,[2,14]),t(Lt,s,{8:108,44:154}),t(Tt,s,{8:110,46:155}),t(Q,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(G,Z){if(Z.recoverable)this.trace(G);else{var tt=new Error(G);throw tt.hash=Z,tt}},parse:function(G){var Z=this,tt=[0],W=[],Y=[null],P=[],it=this.table,N="",gt=0,j=0,Ft=2,at=1,Dt=P.slice.call(arguments,1),kt=Object.create(this.lexer),_t={yy:{}};for(var St in this.yy)Object.prototype.hasOwnProperty.call(this.yy,St)&&(_t.yy[St]=this.yy[St]);kt.setInput(G,_t.yy),_t.yy.lexer=kt,_t.yy.parser=this,typeof kt.yylloc>"u"&&(kt.yylloc={});var Et=kt.yylloc;P.push(Et);var yt=kt.options&&kt.options.ranges;typeof _t.yy.parseError=="function"?this.parseError=_t.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ct(){var mt;return mt=W.pop()||kt.lex()||at,typeof mt!="number"&&(mt instanceof Array&&(W=mt,mt=W.pop()),mt=Z.symbols_[mt]||mt),mt}for(var ne,jt,Wt,qt,Ht={},ge,zt,Pt,Mt;;){if(jt=tt[tt.length-1],this.defaultActions[jt]?Wt=this.defaultActions[jt]:((ne===null||typeof ne>"u")&&(ne=ct()),Wt=it[jt]&&it[jt][ne]),typeof Wt>"u"||!Wt.length||!Wt[0]){var wt="";Mt=[];for(ge in it[jt])this.terminals_[ge]&&ge>Ft&&Mt.push("'"+this.terminals_[ge]+"'");kt.showPosition?wt="Parse error on line "+(gt+1)+`:
`+kt.showPosition()+`
Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ne]||ne)+"'":wt="Parse error on line "+(gt+1)+": Unexpected "+(ne==at?"end of input":"'"+(this.terminals_[ne]||ne)+"'"),this.parseError(wt,{text:kt.match,token:this.terminals_[ne]||ne,line:kt.yylineno,loc:Et,expected:Mt})}if(Wt[0]instanceof Array&&Wt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+jt+", token: "+ne);switch(Wt[0]){case 1:tt.push(ne),Y.push(kt.yytext),P.push(kt.yylloc),tt.push(Wt[1]),ne=null,j=kt.yyleng,N=kt.yytext,gt=kt.yylineno,Et=kt.yylloc;break;case 2:if(zt=this.productions_[Wt[1]][1],Ht.$=Y[Y.length-zt],Ht._$={first_line:P[P.length-(zt||1)].first_line,last_line:P[P.length-1].last_line,first_column:P[P.length-(zt||1)].first_column,last_column:P[P.length-1].last_column},yt&&(Ht._$.range=[P[P.length-(zt||1)].range[0],P[P.length-1].range[1]]),qt=this.performAction.apply(Ht,[N,j,gt,_t.yy,Wt[1],Y,P].concat(Dt)),typeof qt<"u")return qt;zt&&(tt=tt.slice(0,-1*zt*2),Y=Y.slice(0,-1*zt),P=P.slice(0,-1*zt)),tt.push(this.productions_[Wt[1]][0]),Y.push(Ht.$),P.push(Ht._$),Pt=it[tt[tt.length-2]][tt[tt.length-1]],tt.push(Pt);break;case 3:return!0}}return!0}},xt=function(){var Nt={EOF:1,parseError:function(Z,tt){if(this.yy.parser)this.yy.parser.parseError(Z,tt);else throw new Error(Z)},setInput:function(G,Z){return this.yy=Z||this.yy||{},this._input=G,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 G=this._input[0];this.yytext+=G,this.yyleng++,this.offset++,this.match+=G,this.matched+=G;var Z=G.match(/(?:\r\n?|\n).*/g);return Z?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),G},unput:function(G){var Z=G.length,tt=G.split(/(?:\r\n?|\n)/g);this._input=G+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Z),this.offset-=Z;var W=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),tt.length-1&&(this.yylineno-=tt.length-1);var Y=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:tt?(tt.length===W.length?this.yylloc.first_column:0)+W[W.length-tt.length].length-tt[0].length:this.yylloc.first_column-Z},this.options.ranges&&(this.yylloc.range=[Y[0],Y[0]+this.yyleng-Z]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(G){this.unput(this.match.slice(G))},pastInput:function(){var G=this.matched.substr(0,this.matched.length-this.match.length);return(G.length>20?"...":"")+G.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var G=this.match;return G.length<20&&(G+=this._input.substr(0,20-G.length)),(G.substr(0,20)+(G.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var G=this.pastInput(),Z=new Array(G.length+1).join("-");return G+this.upcomingInput()+`
`+Z+"^"},test_match:function(G,Z){var tt,W,Y;if(this.options.backtrack_lexer&&(Y={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&&(Y.yylloc.range=this.yylloc.range.slice(0))),W=G[0].match(/(?:\r\n?|\n).*/g),W&&(this.yylineno+=W.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+G[0].length},this.yytext+=G[0],this.match+=G[0],this.matches=G,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(G[0].length),this.matched+=G[0],tt=this.performAction.call(this,this.yy,this,Z,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),tt)return tt;if(this._backtrack){for(var P in Y)this[P]=Y[P];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var G,Z,tt,W;this._more||(this.yytext="",this.match="");for(var Y=this._currentRules(),P=0;P<Y.length;P++)if(tt=this._input.match(this.rules[Y[P]]),tt&&(!Z||tt[0].length>Z[0].length)){if(Z=tt,W=P,this.options.backtrack_lexer){if(G=this.test_match(tt,Y[P]),G!==!1)return G;if(this._backtrack){Z=!1;continue}else return!1}else if(!this.options.flex)break}return Z?(G=this.test_match(Z,Y[W]),G!==!1?G:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Z=this.next();return Z||this.lex()},begin:function(Z){this.conditionStack.push(Z)},popState:function(){var Z=this.conditionStack.length-1;return Z>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(Z){return Z=this.conditionStack.length-1-Math.abs(Z||0),Z>=0?this.conditionStack[Z]:"INITIAL"},pushState:function(Z){this.begin(Z)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(Z,tt,W,Y){switch(W){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:return 5;case 6:break;case 7:break;case 8:break;case 9:break;case 10:break;case 11:return 23;case 12:return this.begin("ID"),16;case 13:return this.begin("ID"),20;case 14:return tt.yytext=tt.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 52:return 5;case 53:return tt.yytext=tt.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 65:return 5;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}}};return Nt}();dt.lexer=xt;function et(){this.yy={}}return et.prototype=dt,dt.Parser=et,new et}();parser$2.parser=parser$2;const sequenceParser=parser$2,sequenceDetector=t=>t.match(/^\s*sequenceDiagram/)!==null;let prevActor,actors$1={},messages=[],sequenceNumbersEnabled=!1,wrapEnabled;const parseDirective$3=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},addActor=function(t,e,r,n){const a=actors$1[t];a&&e===a.name&&r==null||((r==null||r.text==null)&&(r={text:e,wrap:null,type:n}),(n==null||r.text==null)&&(r={text:e,wrap:null,type:n}),actors$1[t]={name:e,description:r.text,wrap:r.wrap===void 0&&autoWrap()||!!r.wrap,prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n||"participant"},prevActor&&actors$1[prevActor]&&(actors$1[prevActor].nextActor=t),prevActor=t)},activationCount=t=>{let e,r=0;for(e=0;e<messages.length;e++)messages[e].type===LINETYPE.ACTIVE_START&&messages[e].from.actor===t&&r++,messages[e].type===LINETYPE.ACTIVE_END&&messages[e].from.actor===t&&r--;return r},addMessage=function(t,e,r,n){messages.push({from:t,to:e,message:r.text,wrap:r.wrap===void 0&&autoWrap()||!!r.wrap,answer:n})},addSignal=function(t,e,r={text:void 0,wrap:void 0},n){if(n===LINETYPE.ACTIVE_END&&activationCount(t.actor)<1){let s=new Error("Trying to inactivate an inactive participant ("+t.actor+")");throw s.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},s}return messages.push({from:t,to:e,message:r.text,wrap:r.wrap===void 0&&autoWrap()||!!r.wrap,type:n}),!0},getMessages=function(){return messages},getActors$1=function(){return actors$1},getActor=function(t){return actors$1[t]},getActorKeys=function(){return Object.keys(actors$1)},enableSequenceNumbers=function(){sequenceNumbersEnabled=!0},disableSequenceNumbers=function(){sequenceNumbersEnabled=!1},showSequenceNumbers=()=>sequenceNumbersEnabled,setWrap=function(t){wrapEnabled=t},autoWrap=()=>wrapEnabled!==void 0?wrapEnabled:getConfig$1().sequence.wrap,clear$2=function(){actors$1={},messages=[],sequenceNumbersEnabled=!1,clear$g()},parseMessage=function(t){const e=t.trim(),r={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:e.match(/^:?wrap:/)!==null?!0:e.match(/^:?nowrap:/)!==null?!1:void 0};return log$1.debug("parseMessage:",r),r},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,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31},ARROWTYPE={FILLED:0,OPEN:1},PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},addNote=function(t,e,r){r.text,r.wrap===void 0&&autoWrap()||r.wrap;const n=[].concat(t,t);messages.push({from:n[0],to:n[1],message:r.text,wrap:r.wrap===void 0&&autoWrap()||!!r.wrap,type:LINETYPE.NOTE,placement:e})},addLinks=function(t,e){const r=getActor(t);try{let n=sanitizeText$5(e.text,getConfig$1());n=n.replace(/&amp;/g,"&"),n=n.replace(/&equals;/g,"=");const a=JSON.parse(n);insertLinks(r,a)}catch(n){log$1.error("error while parsing actor link text",n)}},addALink=function(t,e){const r=getActor(t);try{const o={};let l=sanitizeText$5(e.text,getConfig$1());var n=l.indexOf("@");l=l.replace(/&amp;/g,"&"),l=l.replace(/&equals;/g,"=");var a=l.slice(0,n-1).trim(),s=l.slice(n+1).trim();o[a]=s,insertLinks(r,o)}catch(o){log$1.error("error while parsing actor link text",o)}};function insertLinks(t,e){if(t.links==null)t.links=e;else for(let r in e)t.links[r]=e[r]}const addProperties=function(t,e){const r=getActor(t);try{let n=sanitizeText$5(e.text,getConfig$1());const a=JSON.parse(n);insertProperties(r,a)}catch(n){log$1.error("error while parsing actor properties text",n)}};function insertProperties(t,e){if(t.properties==null)t.properties=e;else for(let r in e)t.properties[r]=e[r]}const addDetails=function(t,e){const r=getActor(t),n=document.getElementById(e.text);try{const a=n.innerHTML,s=JSON.parse(a);s.properties&&insertProperties(r,s.properties),s.links&&insertLinks(r,s.links)}catch(a){log$1.error("error while parsing actor details text",a)}},getActorProperty=function(t,e){if(t!==void 0&&t.properties!==void 0)return t.properties[e]},apply=function(t){if(Array.isArray(t))t.forEach(function(e){apply(e)});else switch(t.type){case"sequenceIndex":messages.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":addActor(t.actor,t.actor,t.description,"participant");break;case"addActor":addActor(t.actor,t.actor,t.description,"actor");break;case"activeStart":addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":addNote(t.actor,t.placement,t.text);break;case"addLinks":addLinks(t.actor,t.text);break;case"addALink":addALink(t.actor,t.text);break;case"addProperties":addProperties(t.actor,t.text);break;case"addDetails":addDetails(t.actor,t.text);break;case"addMessage":addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":addSignal(void 0,void 0,t.color,t.signalType);break;case"rectEnd":addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":setAccTitle(t.text);break;case"parStart":addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":addSignal(void 0,void 0,void 0,t.signalType);break;case"criticalStart":addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":addSignal(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":addSignal(void 0,void 0,void 0,t.signalType);break}},sequenceDb={addActor,addMessage,addSignal,addLinks,addDetails,addProperties,autoWrap,setWrap,enableSequenceNumbers,disableSequenceNumbers,showSequenceNumbers,getMessages,getActors:getActors$1,getActor,getActorKeys,getActorProperty,getAccTitle,getDiagramTitle,setDiagramTitle,parseDirective:parseDirective$3,getConfig:()=>getConfig$1().sequence,clear:clear$2,parseMessage,LINETYPE,ARROWTYPE,PLACEMENT,addNote,setAccTitle,apply,setAccDescription,getAccDescription};let interactionFunctions=[];const addFunction=t=>{interactionFunctions.push(t)},attachFunctions=()=>{interactionFunctions.forEach(t=>{t()}),interactionFunctions=[]},drawRect$1=function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},addPopupInteraction=(t,e)=>{addFunction(()=>{const r=document.querySelectorAll(t);r.length!==0&&(r[0].addEventListener("mouseover",function(){popupMenuUpFunc("actor"+e+"_popup")}),r[0].addEventListener("mouseout",function(){popupMenuDownFunc("actor"+e+"_popup")}))})},drawPopup=function(t,e,r,n,a){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const s=e.links,o=e.actorCnt,l=e.rectData;var u="none";a&&(u="block !important");const h=t.append("g");h.attr("id","actor"+o+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",u),addPopupInteraction("#actor"+o+"_popup",o);var d="";l.class!==void 0&&(d=" "+l.class);let p=l.width>r?l.width:r;const g=h.append("rect");if(g.attr("class","actorPopupMenuPanel"+d),g.attr("x",l.x),g.attr("y",l.height),g.attr("fill",l.fill),g.attr("stroke",l.stroke),g.attr("width",p),g.attr("height",l.height),g.attr("rx",l.rx),g.attr("ry",l.ry),s!=null){var m=20;for(let A in s){var T=h.append("a"),I=sanitizeUrl_1(s[A]);T.attr("xlink:href",I),T.attr("target","_blank"),_drawMenuItemTextCandidateFunc(n)(A,T,l.x+10,l.height+m,p,20,{class:"actor"},n),m+=30}}return g.attr("height",m),{height:l.height+m,width:p}},drawImage=function(t,e,r,n){const a=t.append("image");a.attr("x",e),a.attr("y",r);var s=sanitizeUrl_1(n);a.attr("xlink:href",s)},drawEmbeddedImage=function(t,e,r,n){const a=t.append("use");a.attr("x",e),a.attr("y",r);var s=sanitizeUrl_1(n);a.attr("xlink:href","#"+s)},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'; }"},popupMenuUpFunc=function(t){var e=document.getElementById(t);e!=null&&(e.style.display="block")},popupMenuDownFunc=function(t){var e=document.getElementById(t);e!=null&&(e.style.display="none")},drawText$1=function(t,e){let r=0,n=0;const a=e.text.split(common$1.lineBreakRegex);let s=[],o=0,l=()=>e.y;if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":l=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":l=()=>Math.round(e.y+(r+n+e.textMargin)/2);break;case"bottom":case"end":l=()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin);break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)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";break}for(let[u,h]of a.entries()){e.textMargin!==void 0&&e.textMargin===0&&e.fontSize!==void 0&&(o=u*e.fontSize);const d=t.append("text");if(d.attr("x",e.x),d.attr("y",l()),e.anchor!==void 0&&d.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&d.style("font-family",e.fontFamily),e.fontSize!==void 0&&d.style("font-size",e.fontSize),e.fontWeight!==void 0&&d.style("font-weight",e.fontWeight),e.fill!==void 0&&d.attr("fill",e.fill),e.class!==void 0&&d.attr("class",e.class),e.dy!==void 0?d.attr("dy",e.dy):o!==0&&d.attr("dy",o),e.tspan){const p=d.append("tspan");p.attr("x",e.x),e.fill!==void 0&&p.attr("fill",e.fill),p.text(h)}else d.text(h);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(d._groups||d)[0][0].getBBox().height,r=n),s.push(d)}return s},drawLabel$1=function(t,e){function r(a,s,o,l,u){return a+","+s+" "+(a+o)+","+s+" "+(a+o)+","+(s+l-u)+" "+(a+o-u*1.2)+","+(s+l)+" "+a+","+(s+l)}const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,drawText$1(t,e),n};let actorCnt=-1;const fixLifeLineHeights=(t,e)=>{t.selectAll&&t.selectAll(".actor-line").attr("class","200").attr("y2",e-55)},drawActorTypeParticipant=function(t,e,r){const n=e.x+e.width/2,a=t.append("g");var s=a;e.y===0&&(actorCnt++,s.append("line").attr("id","actor"+actorCnt).attr("x1",n).attr("y1",5).attr("x2",n).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"),s=a.append("g"),e.actorCnt=actorCnt,e.links!=null&&(s.attr("id","root-"+actorCnt),addPopupInteraction("#root-"+actorCnt,actorCnt)));const o=getNoteRect$1();var l="actor";e.properties!=null&&e.properties.class?l=e.properties.class:o.fill="#eaeaea",o.x=e.x,o.y=e.y,o.width=e.width,o.height=e.height,o.class=l,o.rx=3,o.ry=3;const u=drawRect$1(s,o);if(e.rectData=o,e.properties!=null&&e.properties.icon){const d=e.properties.icon.trim();d.charAt(0)==="@"?drawEmbeddedImage(s,o.x+o.width-20,o.y+10,d.substr(1)):drawImage(s,o.x+o.width-20,o.y+10,d)}_drawTextCandidateFunc$1(r)(e.description,s,o.x,o.y,o.width,o.height,{class:"actor"},r);let h=e.height;if(u.node){const d=u.node().getBBox();e.height=d.height,h=d.height}return h},drawActorTypeActor=function(t,e,r){const n=e.x+e.width/2;e.y===0&&(actorCnt++,t.append("line").attr("id","actor"+actorCnt).attr("x1",n).attr("y1",80).attr("x2",n).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));const a=t.append("g");a.attr("class","actor-man");const s=getNoteRect$1();s.x=e.x,s.y=e.y,s.fill="#eaeaea",s.width=e.width,s.height=e.height,s.class="actor",s.rx=3,s.ry=3,a.append("line").attr("id","actor-man-torso"+actorCnt).attr("x1",n).attr("y1",e.y+25).attr("x2",n).attr("y2",e.y+45),a.append("line").attr("id","actor-man-arms"+actorCnt).attr("x1",n-18).attr("y1",e.y+33).attr("x2",n+18).attr("y2",e.y+33),a.append("line").attr("x1",n-18).attr("y1",e.y+60).attr("x2",n).attr("y2",e.y+45),a.append("line").attr("x1",n).attr("y1",e.y+45).attr("x2",n+16).attr("y2",e.y+60);const o=a.append("circle");o.attr("cx",e.x+e.width/2),o.attr("cy",e.y+10),o.attr("r",15),o.attr("width",e.width),o.attr("height",e.height);const l=a.node().getBBox();return e.height=l.height,_drawTextCandidateFunc$1(r)(e.description,a,s.x,s.y+35,s.width,s.height,{class:"actor"},r),e.height},drawActor=function(t,e,r){switch(e.type){case"actor":return drawActorTypeActor(t,e,r);case"participant":return drawActorTypeParticipant(t,e,r)}},anchorElement=function(t){return t.append("g")},drawActivation=function(t,e,r,n,a){const s=getNoteRect$1(),o=e.anchored;s.x=e.startx,s.y=e.starty,s.class="activation"+a%3,s.width=e.stopx-e.startx,s.height=r-e.starty,drawRect$1(o,s)},drawLoop=function(t,e,r,n){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,p=t.append("g"),g=function(I,A,C,L){return p.append("line").attr("x1",I).attr("y1",A).attr("x2",C).attr("y2",L).attr("class","loopLine")};g(e.startx,e.starty,e.stopx,e.starty),g(e.stopx,e.starty,e.stopx,e.stopy),g(e.startx,e.stopy,e.stopx,e.stopy),g(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(I){g(e.startx,I.y,e.stopx,I.y).style("stroke-dasharray","3, 3")});let m=getTextObj$1();m.text=r,m.x=e.startx,m.y=e.starty,m.fontFamily=u,m.fontSize=h,m.fontWeight=d,m.anchor="middle",m.valign="middle",m.tspan=!1,m.width=l||50,m.height=o||20,m.textMargin=s,m.class="labelText",drawLabel$1(p,m),m=getTextObj$1(),m.text=e.title,m.x=e.startx+l/2+(e.stopx-e.startx)/2,m.y=e.starty+a+s,m.anchor="middle",m.valign="middle",m.textMargin=s,m.class="loopText",m.fontFamily=u,m.fontSize=h,m.fontWeight=d,m.wrap=!0;let T=drawText$1(p,m);return e.sectionTitles!==void 0&&e.sectionTitles.forEach(function(I,A){if(I.message){m.text=I.message,m.x=e.startx+(e.stopx-e.startx)/2,m.y=e.sections[A].y+a+s,m.class="loopText",m.anchor="middle",m.valign="middle",m.tspan=!1,m.fontFamily=u,m.fontSize=h,m.fontWeight=d,m.wrap=e.wrap,T=drawText$1(p,m);let C=Math.round(T.map(L=>(L._groups||L)[0][0].getBBox().height).reduce((L,M)=>L+M));e.sections[A].height+=C-(a+s)}}),e.height=Math.round(e.stopy-e.starty),p},drawBackgroundRect$1=function(t,e){drawRect$1(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},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")},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")},getTextObj$1=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}},getNoteRect$1=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},_drawTextCandidateFunc$1=function(){function t(a,s,o,l,u,h,d){const p=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);n(p,d)}function e(a,s,o,l,u,h,d,p){const{actorFontSize:g,actorFontFamily:m,actorFontWeight:T}=p;let I=g&&g.replace?g.replace("px",""):g;const A=a.split(common$1.lineBreakRegex);for(let C=0;C<A.length;C++){const L=C*I-I*(A.length-1)/2,M=s.append("text").attr("x",o+u/2).attr("y",l).style("text-anchor","middle").style("font-size",g).style("font-weight",T).style("font-family",m);M.append("tspan").attr("x",o+u/2).attr("dy",L).text(A[C]),M.attr("y",l+h/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(M,d)}}function r(a,s,o,l,u,h,d,p){const g=s.append("switch"),T=g.append("foreignObject").attr("x",o).attr("y",l).attr("width",u).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");T.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),e(a,g,o,l,u,h,d,p),n(T,d)}function n(a,s){for(const o in s)s.hasOwnProperty(o)&&a.attr(o,s[o])}return function(a){return a.textPlacement==="fo"?r:a.textPlacement==="old"?t:e}}(),_drawMenuItemTextCandidateFunc=function(){function t(a,s,o,l,u,h,d){const p=s.append("text").attr("x",o).attr("y",l).style("text-anchor","start").text(a);n(p,d)}function e(a,s,o,l,u,h,d,p){const{actorFontSize:g,actorFontFamily:m,actorFontWeight:T}=p,I=a.split(common$1.lineBreakRegex);for(let A=0;A<I.length;A++){const C=A*g-g*(I.length-1)/2,L=s.append("text").attr("x",o).attr("y",l).style("text-anchor","start").style("font-size",g).style("font-weight",T).style("font-family",m);L.append("tspan").attr("x",o).attr("dy",C).text(I[A]),L.attr("y",l+h/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(L,d)}}function r(a,s,o,l,u,h,d,p){const g=s.append("switch"),T=g.append("foreignObject").attr("x",o).attr("y",l).attr("width",u).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");T.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),e(a,g,o,l,u,h,d,p),n(T,d)}function n(a,s){for(const o in s)s.hasOwnProperty(o)&&a.attr(o,s[o])}return function(a){return a.textPlacement==="fo"?r:a.textPlacement==="old"?t:e}}(),svgDraw$1={drawRect:drawRect$1,drawText:drawText$1,drawLabel:drawLabel$1,drawActor,drawPopup,drawImage,drawEmbeddedImage,anchorElement,drawActivation,drawLoop,drawBackgroundRect:drawBackgroundRect$1,insertArrowHead,insertArrowFilledHead,insertSequenceNumber,insertArrowCrossHead,insertDatabaseIcon,insertComputerIcon,insertClockIcon,getTextObj:getTextObj$1,getNoteRect:getNoteRect$1,popupMenu,popdownMenu,fixLifeLineHeights,sanitizeUrl:sanitizeUrl_1};let conf$3={};const bounds$1={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,this.actors.length===0?[0]:this.actors.map(t=>t.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?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,setConf$4(getConfig$1())},updateVal:function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},updateBounds:function(t,e,r,n){const a=this;let s=0;function o(l){return function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*conf$3.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*conf$3.boxMargin,Math.max),a.updateVal(bounds$1.data,"startx",t-d*conf$3.boxMargin,Math.min),a.updateVal(bounds$1.data,"stopx",r+d*conf$3.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*conf$3.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*conf$3.boxMargin,Math.max),a.updateVal(bounds$1.data,"starty",e-d*conf$3.boxMargin,Math.min),a.updateVal(bounds$1.data,"stopy",n+d*conf$3.boxMargin,Math.max))}}this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},insert:function(t,e,r,n){const a=Math.min(t,r),s=Math.max(t,r),o=Math.min(e,n),l=Math.max(e,n);this.updateVal(bounds$1.data,"startx",a,Math.min),this.updateVal(bounds$1.data,"starty",o,Math.min),this.updateVal(bounds$1.data,"stopx",s,Math.max),this.updateVal(bounds$1.data,"stopy",l,Math.max),this.updateBounds(a,o,s,l)},newActivation:function(t,e,r){const n=r[t.from.actor],a=actorActivations(t.from.actor).length||0,s=n.x+n.width/2+(a-1)*conf$3.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+conf$3.activationWidth,stopy:void 0,actor:t.from.actor,anchored:svgDraw$1.anchorElement(e)})},endActivation:function(t){const e=this.activations.map(function(r){return r.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:bounds$1.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}}},drawNote$1=function(t,e){bounds$1.bumpVerticalPos(conf$3.boxMargin),e.height=conf$3.boxMargin,e.starty=bounds$1.getVerticalPos();const r=svgDraw$1.getNoteRect();r.x=e.startx,r.y=e.starty,r.width=e.width||conf$3.width,r.class="note";const n=t.append("g"),a=svgDraw$1.drawRect(n,r),s=svgDraw$1.getTextObj();s.x=e.startx,s.y=e.starty,s.width=r.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=conf$3.noteFontFamily,s.fontSize=conf$3.noteFontSize,s.fontWeight=conf$3.noteFontWeight,s.anchor=conf$3.noteAlign,s.textMargin=conf$3.noteMargin,s.valign="center";const o=drawText$1(n,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*conf$3.noteMargin),e.height+=l+2*conf$3.noteMargin,bounds$1.bumpVerticalPos(l+2*conf$3.noteMargin),e.stopy=e.starty+l+2*conf$3.noteMargin,e.stopx=e.startx+r.width,bounds$1.insert(e.startx,e.starty,e.stopx,e.stopy),bounds$1.models.addNote(e)},messageFont=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),noteFont=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),actorFont=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});function boundMessage(t,e){bounds$1.bumpVerticalPos(10);const{startx:r,stopx:n,message:a}=e,s=common$1.splitBreaks(a).length,o=utils.calculateTextDimensions(a,messageFont(conf$3)),l=o.height/s;e.height+=l,bounds$1.bumpVerticalPos(l);let u,h=o.height-10;const d=o.width;if(r===n){u=bounds$1.getVerticalPos()+h,conf$3.rightAngles||(h+=conf$3.boxMargin,u=bounds$1.getVerticalPos()+h),h+=30;const p=Math.max(d/2,conf$3.width/2);bounds$1.insert(r-p,bounds$1.getVerticalPos()-10+h,n+p,bounds$1.getVerticalPos()+30+h)}else h+=conf$3.boxMargin,u=bounds$1.getVerticalPos()+h,bounds$1.insert(r,u-10,n,u);return bounds$1.bumpVerticalPos(h),e.height+=h,e.stopy=e.starty+e.height,bounds$1.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),u}const drawMessage=function(t,e,r,n){const{startx:a,stopx:s,starty:o,message:l,type:u,sequenceIndex:h,sequenceVisible:d}=e,p=utils.calculateTextDimensions(l,messageFont(conf$3)),g=svgDraw$1.getTextObj();g.x=a,g.y=o+10,g.width=s-a,g.class="messageText",g.dy="1em",g.text=l,g.fontFamily=conf$3.messageFontFamily,g.fontSize=conf$3.messageFontSize,g.fontWeight=conf$3.messageFontWeight,g.anchor=conf$3.messageAlign,g.valign="center",g.textMargin=conf$3.wrapPadding,g.tspan=!1,drawText$1(t,g);const m=p.width;let T;a===s?conf$3.rightAngles?T=t.append("path").attr("d",`M ${a},${r} H ${a+Math.max(conf$3.width/2,m/2)} V ${r+25} H ${a}`):T=t.append("path").attr("d","M "+a+","+r+" C "+(a+60)+","+(r-10)+" "+(a+60)+","+(r+30)+" "+a+","+(r+20)):(T=t.append("line"),T.attr("x1",a),T.attr("y1",r),T.attr("x2",s),T.attr("y2",r)),u===n.db.LINETYPE.DOTTED||u===n.db.LINETYPE.DOTTED_CROSS||u===n.db.LINETYPE.DOTTED_POINT||u===n.db.LINETYPE.DOTTED_OPEN?(T.style("stroke-dasharray","3, 3"),T.attr("class","messageLine1")):T.attr("class","messageLine0");let I="";conf$3.arrowMarkerAbsolute&&(I=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,I=I.replace(/\(/g,"\\("),I=I.replace(/\)/g,"\\)")),T.attr("stroke-width",2),T.attr("stroke","none"),T.style("fill","none"),(u===n.db.LINETYPE.SOLID||u===n.db.LINETYPE.DOTTED)&&T.attr("marker-end","url("+I+"#arrowhead)"),(u===n.db.LINETYPE.SOLID_POINT||u===n.db.LINETYPE.DOTTED_POINT)&&T.attr("marker-end","url("+I+"#filled-head)"),(u===n.db.LINETYPE.SOLID_CROSS||u===n.db.LINETYPE.DOTTED_CROSS)&&T.attr("marker-end","url("+I+"#crosshead)"),(d||conf$3.showSequenceNumbers)&&(T.attr("marker-start","url("+I+"#sequencenumber)"),t.append("text").attr("x",a).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(h))},drawActors=function(t,e,r,n,a,s){if(a.hideUnusedParticipants===!0){const h=new Set;s.forEach(d=>{h.add(d.from),h.add(d.to)}),r=r.filter(d=>h.has(d))}let o=0,l=0,u=0;for(const h of r){const d=e[h];d.width=d.width||conf$3.width,d.height=Math.max(d.height||conf$3.height,conf$3.height),d.margin=d.margin||conf$3.actorMargin,d.x=o+l,d.y=n;const p=svgDraw$1.drawActor(t,d,conf$3);u=Math.max(u,p),bounds$1.insert(d.x,n,d.x+d.width,d.height),o+=d.width,l+=d.margin,bounds$1.models.addActor(d)}bounds$1.bumpVerticalPos(u)},drawActorsPopup=function(t,e,r,n){let a=0,s=0;for(const o of r){const l=e[o],u=getRequiredPopupWidth(l),h=svgDraw$1.drawPopup(t,l,u,conf$3,conf$3.forceMenus,n);h.height>a&&(a=h.height),h.width+l.x>s&&(s=h.width+l.x)}return{maxHeight:a,maxWidth:s}},setConf$4=function(t){assignWithDepth$1(conf$3,t),t.fontFamily&&(conf$3.actorFontFamily=conf$3.noteFontFamily=conf$3.messageFontFamily=t.fontFamily),t.fontSize&&(conf$3.actorFontSize=conf$3.noteFontSize=conf$3.messageFontSize=t.fontSize),t.fontWeight&&(conf$3.actorFontWeight=conf$3.noteFontWeight=conf$3.messageFontWeight=t.fontWeight)},actorActivations=function(t){return bounds$1.activations.filter(function(e){return e.actor===t})},activationBounds=function(t,e){const r=e[t],n=actorActivations(t),a=n.reduce(function(o,l){return Math.min(o,l.startx)},r.x+r.width/2),s=n.reduce(function(o,l){return Math.max(o,l.stopx)},r.x+r.width/2);return[a,s]};function adjustLoopHeightForWrap(t,e,r,n,a){bounds$1.bumpVerticalPos(r);let s=n;if(e.id&&e.message&&t[e.id]){const o=t[e.id].width,l=messageFont(conf$3);e.message=utils.wrapLabel(`[${e.message}]`,o-2*conf$3.wrapPadding,l),e.width=o,e.wrap=!0;const u=utils.calculateTextDimensions(e.message,l),h=Math.max(u.height,conf$3.labelBoxHeight);s=n+h,log$1.debug(`${h} - ${e.message}`)}a(e),bounds$1.bumpVerticalPos(s)}const draw$4=function(t,e,r,n){const{securityLevel:a,sequence:s}=getConfig$1();conf$3=s;let o;a==="sandbox"&&(o=select("#i"+e));const l=a==="sandbox"?select(o.nodes()[0].contentDocument.body):select("body"),u=a==="sandbox"?o.nodes()[0].contentDocument:document;bounds$1.init(),log$1.debug(n.db);const h=a==="sandbox"?l.select(`[id="${e}"]`):select(`[id="${e}"]`),d=n.db.getActors(),p=n.db.getActorKeys(),g=n.db.getMessages(),m=n.db.getDiagramTitle(),T=getMaxMessageWidthPerActor(d,g,n);conf$3.height=calculateActorMargins(d,T),svgDraw$1.insertComputerIcon(h),svgDraw$1.insertDatabaseIcon(h),svgDraw$1.insertClockIcon(h),drawActors(h,d,p,0,conf$3,g);const I=calculateLoopBounds(g,d,T,n);svgDraw$1.insertArrowHead(h),svgDraw$1.insertArrowCrossHead(h),svgDraw$1.insertArrowFilledHead(h),svgDraw$1.insertSequenceNumber(h);function A(k,B){const v=bounds$1.endActivation(k);v.starty+18>B&&(v.starty=B-6,B+=12),svgDraw$1.drawActivation(h,v,B,conf$3,actorActivations(k.from.actor).length),bounds$1.insert(v.startx,B-10,v.stopx,B)}let C=1,L=1;const M=[];g.forEach(function(k){let B,v,J;switch(k.type){case n.db.LINETYPE.NOTE:v=k.noteModel,drawNote$1(h,v);break;case n.db.LINETYPE.ACTIVE_START:bounds$1.newActivation(k,h,d);break;case n.db.LINETYPE.ACTIVE_END:A(k,bounds$1.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:adjustLoopHeightForWrap(I,k,conf$3.boxMargin,conf$3.boxMargin+conf$3.boxTextMargin,E=>bounds$1.newLoop(E));break;case n.db.LINETYPE.LOOP_END:B=bounds$1.endLoop(),svgDraw$1.drawLoop(h,B,"loop",conf$3),bounds$1.bumpVerticalPos(B.stopy-bounds$1.getVerticalPos()),bounds$1.models.addLoop(B);break;case n.db.LINETYPE.RECT_START:adjustLoopHeightForWrap(I,k,conf$3.boxMargin,conf$3.boxMargin,E=>bounds$1.newLoop(void 0,E.message));break;case n.db.LINETYPE.RECT_END:B=bounds$1.endLoop(),svgDraw$1.drawBackgroundRect(h,B),bounds$1.models.addLoop(B),bounds$1.bumpVerticalPos(B.stopy-bounds$1.getVerticalPos());break;case n.db.LINETYPE.OPT_START:adjustLoopHeightForWrap(I,k,conf$3.boxMargin,conf$3.boxMargin+conf$3.boxTextMargin,E=>bounds$1.newLoop(E));break;case n.db.LINETYPE.OPT_END:B=bounds$1.endLoop(),svgDraw$1.drawLoop(h,B,"opt",conf$3),bounds$1.bumpVerticalPos(B.stopy-bounds$1.getVerticalPos()),bounds$1.models.addLoop(B);break;case n.db.LINETYPE.ALT_START:adjustLoopHeightForWrap(I,k,conf$3.boxMargin,conf$3.boxMargin+conf$3.boxTextMargin,E=>bounds$1.newLoop(E));break;case n.db.LINETYPE.ALT_ELSE:adjustLoopHeightForWrap(I,k,conf$3.boxMargin+conf$3.boxTextMargin,conf$3.boxMargin,E=>bounds$1.addSectionToLoop(E));break;case n.db.LINETYPE.ALT_END:B=bounds$1.endLoop(),svgDraw$1.drawLoop(h,B,"alt",conf$3),bounds$1.bumpVerticalPos(B.stopy-bounds$1.getVerticalPos()),bounds$1.models.addLoop(B);break;case n.db.LINETYPE.PAR_START:adjustLoopHeightForWrap(I,k,conf$3.boxMargin,conf$3.boxMargin+conf$3.boxTextMargin,E=>bounds$1.newLoop(E));break;case n.db.LINETYPE.PAR_AND:adjustLoopHeightForWrap(I,k,conf$3.boxMargin+conf$3.boxTextMargin,conf$3.boxMargin,E=>bounds$1.addSectionToLoop(E));break;case n.db.LINETYPE.PAR_END:B=bounds$1.endLoop(),svgDraw$1.drawLoop(h,B,"par",conf$3),bounds$1.bumpVerticalPos(B.stopy-bounds$1.getVerticalPos()),bounds$1.models.addLoop(B);break;case n.db.LINETYPE.AUTONUMBER:C=k.message.start||C,L=k.message.step||L,k.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:adjustLoopHeightForWrap(I,k,conf$3.boxMargin,conf$3.boxMargin+conf$3.boxTextMargin,E=>bounds$1.newLoop(E));break;case n.db.LINETYPE.CRITICAL_OPTION:adjustLoopHeightForWrap(I,k,conf$3.boxMargin+conf$3.boxTextMargin,conf$3.boxMargin,E=>bounds$1.addSectionToLoop(E));break;case n.db.LINETYPE.CRITICAL_END:B=bounds$1.endLoop(),svgDraw$1.drawLoop(h,B,"critical",conf$3),bounds$1.bumpVerticalPos(B.stopy-bounds$1.getVerticalPos()),bounds$1.models.addLoop(B);break;case n.db.LINETYPE.BREAK_START:adjustLoopHeightForWrap(I,k,conf$3.boxMargin,conf$3.boxMargin+conf$3.boxTextMargin,E=>bounds$1.newLoop(E));break;case n.db.LINETYPE.BREAK_END:B=bounds$1.endLoop(),svgDraw$1.drawLoop(h,B,"break",conf$3),bounds$1.bumpVerticalPos(B.stopy-bounds$1.getVerticalPos()),bounds$1.models.addLoop(B);break;default:try{J=k.msgModel,J.starty=bounds$1.getVerticalPos(),J.sequenceIndex=C,J.sequenceVisible=n.db.showSequenceNumbers();const E=boundMessage(h,J);M.push({messageModel:J,lineStartY:E}),bounds$1.models.addMessage(J)}catch(E){log$1.error("error while drawing message",E)}}[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(k.type)&&(C=C+L)}),M.forEach(k=>drawMessage(h,k.messageModel,k.lineStartY,n)),conf$3.mirrorActors&&(bounds$1.bumpVerticalPos(conf$3.boxMargin*2),drawActors(h,d,p,bounds$1.getVerticalPos(),conf$3,g),bounds$1.bumpVerticalPos(conf$3.boxMargin),fixLifeLineHeights(h,bounds$1.getVerticalPos()));const F=drawActorsPopup(h,d,p,u),{bounds:H}=bounds$1.getBounds();log$1.debug("For line height fix Querying: #"+e+" .actor-line"),selectAll("#"+e+" .actor-line").attr("y2",H.stopy);let U=H.stopy-H.starty;U<F.maxHeight&&(U=F.maxHeight);let z=U+2*conf$3.diagramMarginY;conf$3.mirrorActors&&(z=z-conf$3.boxMargin+conf$3.bottomMarginAdj);let R=H.stopx-H.startx;R<F.maxWidth&&(R=F.maxWidth);const $=R+2*conf$3.diagramMarginX;m&&h.append("text").text(m).attr("x",(H.stopx-H.startx)/2-2*conf$3.diagramMarginX).attr("y",-25),configureSvgSize(h,z,$,conf$3.useMaxWidth);const D=m?40:0;h.attr("viewBox",H.startx-conf$3.diagramMarginX+" -"+(conf$3.diagramMarginY+D)+" "+$+" "+(z+D)),log$1.debug("models:",bounds$1.models)};function getMaxMessageWidthPerActor(t,e,r){const n={};return e.forEach(function(a){if(t[a.to]&&t[a.from]){const s=t[a.to];if(a.placement===r.db.PLACEMENT.LEFTOF&&!s.prevActor||a.placement===r.db.PLACEMENT.RIGHTOF&&!s.nextActor)return;const o=a.placement!==void 0,l=!o,u=o?noteFont(conf$3):messageFont(conf$3),h=a.wrap?utils.wrapLabel(a.message,conf$3.width-2*conf$3.wrapPadding,u):a.message,p=utils.calculateTextDimensions(h,u).width+2*conf$3.wrapPadding;l&&a.from===s.nextActor?n[a.to]=Math.max(n[a.to]||0,p):l&&a.from===s.prevActor?n[a.from]=Math.max(n[a.from]||0,p):l&&a.from===a.to?(n[a.from]=Math.max(n[a.from]||0,p/2),n[a.to]=Math.max(n[a.to]||0,p/2)):a.placement===r.db.PLACEMENT.RIGHTOF?n[a.from]=Math.max(n[a.from]||0,p):a.placement===r.db.PLACEMENT.LEFTOF?n[s.prevActor]=Math.max(n[s.prevActor]||0,p):a.placement===r.db.PLACEMENT.OVER&&(s.prevActor&&(n[s.prevActor]=Math.max(n[s.prevActor]||0,p/2)),s.nextActor&&(n[a.from]=Math.max(n[a.from]||0,p/2)))}}),log$1.debug("maxMessageWidthPerActor:",n),n}const getRequiredPopupWidth=function(t){let e=0;const r=actorFont(conf$3);for(const n in t.links){const s=utils.calculateTextDimensions(n,r).width+2*conf$3.wrapPadding+2*conf$3.boxMargin;e<s&&(e=s)}return e};function calculateActorMargins(t,e){let r=0;Object.keys(t).forEach(n=>{const a=t[n];a.wrap&&(a.description=utils.wrapLabel(a.description,conf$3.width-2*conf$3.wrapPadding,actorFont(conf$3)));const s=utils.calculateTextDimensions(a.description,actorFont(conf$3));a.width=a.wrap?conf$3.width:Math.max(conf$3.width,s.width+2*conf$3.wrapPadding),a.height=a.wrap?Math.max(s.height,conf$3.height):conf$3.height,r=Math.max(r,a.height)});for(const n in e){const a=t[n];if(!a)continue;const s=t[a.nextActor];if(!s)continue;const l=e[n]+conf$3.actorMargin-a.width/2-s.width/2;a.margin=Math.max(l,conf$3.actorMargin)}return Math.max(r,conf$3.height)}const buildNoteModel=function(t,e,r){const n=e[t.from].x,a=e[t.to].x,s=t.wrap&&t.message;let o=utils.calculateTextDimensions(s?utils.wrapLabel(t.message,conf$3.width,noteFont(conf$3)):t.message,noteFont(conf$3));const l={width:s?conf$3.width:Math.max(conf$3.width,o.width+2*conf$3.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(l.width=s?Math.max(conf$3.width,o.width):Math.max(e[t.from].width/2+e[t.to].width/2,o.width+2*conf$3.noteMargin),l.startx=n+(e[t.from].width+conf$3.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(l.width=Math.max(s?conf$3.width:e[t.from].width/2+e[t.to].width/2,o.width+2*conf$3.noteMargin),l.startx=n-l.width+(e[t.from].width-conf$3.actorMargin)/2):t.to===t.from?(o=utils.calculateTextDimensions(s?utils.wrapLabel(t.message,Math.max(conf$3.width,e[t.from].width),noteFont(conf$3)):t.message,noteFont(conf$3)),l.width=s?Math.max(conf$3.width,e[t.from].width):Math.max(e[t.from].width,conf$3.width,o.width+2*conf$3.noteMargin),l.startx=n+(e[t.from].width-l.width)/2):(l.width=Math.abs(n+e[t.from].width/2-(a+e[t.to].width/2))+conf$3.actorMargin,l.startx=n<a?n+e[t.from].width/2-conf$3.actorMargin/2:a+e[t.to].width/2-conf$3.actorMargin/2),s&&(l.message=utils.wrapLabel(t.message,l.width-2*conf$3.wrapPadding,noteFont(conf$3))),log$1.debug(`NM:[${l.startx},${l.stopx},${l.starty},${l.stopy}:${l.width},${l.height}=${t.message}]`),l},buildMessageModel=function(t,e,r){let n=!1;if([r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(n=!0),!n)return{};const a=activationBounds(t.from,e),s=activationBounds(t.to,e),o=a[0]<=s[0]?1:0,l=a[0]<s[0]?0:1,u=[...a,...s],h=Math.abs(s[l]-a[o]);t.wrap&&t.message&&(t.message=utils.wrapLabel(t.message,Math.max(h+2*conf$3.wrapPadding,conf$3.width),messageFont(conf$3)));const d=utils.calculateTextDimensions(t.message,messageFont(conf$3));return{width:Math.max(t.wrap?0:d.width+2*conf$3.wrapPadding,h+2*conf$3.wrapPadding,conf$3.width),height:0,startx:a[o],stopx:s[l],starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}},calculateLoopBounds=function(t,e,r,n){const a={},s=[];let o,l,u;return t.forEach(function(h){switch(h.id=utils.random({length:10}),h.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:s.push({id:h.id,msg:h.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:h.message&&(o=s.pop(),a[o.id]=o,a[h.id]=o,s.push(o));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:o=s.pop(),a[o.id]=o;break;case n.db.LINETYPE.ACTIVE_START:{const p=e[h.from?h.from.actor:h.to.actor],g=actorActivations(h.from?h.from.actor:h.to.actor).length,m=p.x+p.width/2+(g-1)*conf$3.activationWidth/2,T={startx:m,stopx:m+conf$3.activationWidth,actor:h.from.actor,enabled:!0};bounds$1.activations.push(T)}break;case n.db.LINETYPE.ACTIVE_END:{const p=bounds$1.activations.map(g=>g.actor).lastIndexOf(h.from.actor);delete bounds$1.activations.splice(p,1)[0]}break}h.placement!==void 0?(l=buildNoteModel(h,e,n),h.noteModel=l,s.forEach(p=>{o=p,o.from=Math.min(o.from,l.startx),o.to=Math.max(o.to,l.startx+l.width),o.width=Math.max(o.width,Math.abs(o.from-o.to))-conf$3.labelBoxWidth})):(u=buildMessageModel(h,e,n),h.msgModel=u,u.startx&&u.stopx&&s.length>0&&s.forEach(p=>{if(o=p,u.startx===u.stopx){const g=e[h.from],m=e[h.to];o.from=Math.min(g.x-u.width/2,g.x-g.width/2,o.from),o.to=Math.max(m.x+u.width/2,m.x+g.width/2,o.to),o.width=Math.max(o.width,Math.abs(o.to-o.from))-conf$3.labelBoxWidth}else o.from=Math.min(u.startx,o.from),o.to=Math.max(u.stopx,o.to),o.width=Math.max(o.width,u.width)-conf$3.labelBoxWidth}))}),bounds$1.activations=[],log$1.debug("Loop type widths:",a),a},sequenceRenderer={bounds:bounds$1,drawActors,drawActorsPopup,setConf:setConf$4,draw:draw$4};var parser$1=function(){var t=function(Q,ut,st,ot){for(st=st||{},ot=Q.length;ot--;st[Q[ot]]=ut);return st},e=[1,2],r=[1,3],n=[1,5],a=[1,7],s=[2,5],o=[1,15],l=[1,17],u=[1,21],h=[1,22],d=[1,23],p=[1,24],g=[1,37],m=[1,25],T=[1,26],I=[1,27],A=[1,28],C=[1,29],L=[1,32],M=[1,33],F=[1,34],H=[1,35],q=[1,36],U=[1,39],z=[1,40],R=[1,41],$=[1,42],D=[1,38],k=[1,45],B=[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],v=[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],J=[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],E=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],ft={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,"-->":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:"-->",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(ut,st,ot,dt,xt,et,Nt){var G=et.length-1;switch(xt){case 4:return dt.setRootDoc(et[G]),et[G];case 5:this.$=[];break;case 6:et[G]!="nl"&&(et[G-1].push(et[G]),this.$=et[G-1]);break;case 7:case 8:this.$=et[G];break;case 9:this.$="nl";break;case 12:this.$=et[G];break;case 13:const Y=et[G-1];Y.description=dt.trimColon(et[G]),this.$=Y;break;case 14:this.$={stmt:"relation",state1:et[G-2],state2:et[G]};break;case 15:const P=dt.trimColon(et[G]);this.$={stmt:"relation",state1:et[G-3],state2:et[G-1],description:P};break;case 19:this.$={stmt:"state",id:et[G-3],type:"default",description:"",doc:et[G-1]};break;case 20:var Z=et[G],tt=et[G-2].trim();if(et[G].match(":")){var W=et[G].split(":");Z=W[0],tt=[tt,W[1]]}this.$={stmt:"state",id:Z,type:"default",description:tt};break;case 21:this.$={stmt:"state",id:et[G-3],type:"default",description:et[G-5],doc:et[G-1]};break;case 22:this.$={stmt:"state",id:et[G],type:"fork"};break;case 23:this.$={stmt:"state",id:et[G],type:"join"};break;case 24:this.$={stmt:"state",id:et[G],type:"choice"};break;case 25:this.$={stmt:"state",id:dt.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:et[G-1].trim(),note:{position:et[G-2].trim(),text:et[G].trim()}};break;case 30:this.$=et[G].trim(),dt.setAccTitle(this.$);break;case 31:case 32:this.$=et[G].trim(),dt.setAccDescription(this.$);break;case 33:case 34:this.$={stmt:"classDef",id:et[G-1].trim(),classes:et[G].trim()};break;case 35:this.$={stmt:"applyClass",id:et[G-1].trim(),styleClass:et[G].trim()};break;case 38:dt.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:dt.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:dt.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:dt.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:et[G].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:et[G-2].trim(),classes:[et[G].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:et[G-2].trim(),classes:[et[G].trim()],type:"default",description:""};break;case 50:dt.parseDirective("%%{","open_directive");break;case 51:dt.parseDirective(et[G],"type_directive");break;case 52:et[G]=et[G].trim().replace(/'/g,'"'),dt.parseDirective(et[G],"arg_directive");break;case 53:dt.parseDirective("}%%","close_directive","state");break}},table:[{3:1,4:e,5:r,6:4,7:n,45:6,60:a},{1:[3]},{3:8,4:e,5:r,6:4,7:n,45:6,60:a},{3:9,4:e,5:r,6:4,7:n,45:6,60:a},{3:10,4:e,5:r,6:4,7:n,45:6,60:a},t([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:u,17:h,19:d,22:p,24:g,25:m,26:T,27:I,28:A,29:C,32:31,33:L,35:M,37:F,38:H,42:q,45:6,50:U,51:z,52:R,53:$,56:D,60:a},{47:43,48:[1,44],63:k},t([48,63],[2,51]),t(B,[2,6]),{6:30,10:46,11:18,12:19,13:20,16:u,17:h,19:d,22:p,24:g,25:m,26:T,27:I,28:A,29:C,32:31,33:L,35:M,37:F,38:H,42:q,45:6,50:U,51:z,52:R,53:$,56:D,60:a},t(B,[2,8]),t(B,[2,9]),t(B,[2,10]),t(B,[2,11]),t(B,[2,12],{14:[1,47],15:[1,48]}),t(B,[2,16]),{18:[1,49]},t(B,[2,18],{20:[1,50]}),{23:[1,51]},t(B,[2,22]),t(B,[2,23]),t(B,[2,24]),t(B,[2,25]),{30:52,31:[1,53],58:[1,54],59:[1,55]},t(B,[2,28]),t(B,[2,29]),{34:[1,56]},{36:[1,57]},t(B,[2,32]),{39:[1,58],41:[1,59]},{43:[1,60]},t(v,[2,44],{57:[1,61]}),t(v,[2,45],{57:[1,62]}),t(B,[2,38]),t(B,[2,39]),t(B,[2,40]),t(B,[2,41]),t(J,[2,36]),{49:63,62:[1,64]},t(J,[2,53]),t(B,[2,7]),t(B,[2,13]),{13:65,24:g,56:D},t(B,[2,17]),t(E,s,{8:66}),{24:[1,67]},{24:[1,68]},{23:[1,69]},{24:[2,48]},{24:[2,49]},t(B,[2,30]),t(B,[2,31]),{40:[1,70]},{40:[1,71]},{44:[1,72]},{24:[1,73]},{24:[1,74]},{47:75,63:k},{63:[2,52]},t(B,[2,14],{14:[1,76]}),{4:o,5:l,6:30,9:14,10:16,11:18,12:19,13:20,16:u,17:h,19:d,21:[1,77],22:p,24:g,25:m,26:T,27:I,28:A,29:C,32:31,33:L,35:M,37:F,38:H,42:q,45:6,50:U,51:z,52:R,53:$,56:D,60:a},t(B,[2,20],{20:[1,78]}),{31:[1,79]},{24:[1,80]},t(B,[2,33]),t(B,[2,34]),t(B,[2,35]),t(v,[2,46]),t(v,[2,47]),t(J,[2,37]),t(B,[2,15]),t(B,[2,19]),t(E,s,{8:81}),t(B,[2,26]),t(B,[2,27]),{4:o,5:l,6:30,9:14,10:16,11:18,12:19,13:20,16:u,17:h,19:d,21:[1,82],22:p,24:g,25:m,26:T,27:I,28:A,29:C,32:31,33:L,35:M,37:F,38:H,42:q,45:6,50:U,51:z,52:R,53:$,56:D,60:a},t(B,[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(ut,st){if(st.recoverable)this.trace(ut);else{var ot=new Error(ut);throw ot.hash=st,ot}},parse:function(ut){var st=this,ot=[0],dt=[],xt=[null],et=[],Nt=this.table,G="",Z=0,tt=0,W=2,Y=1,P=et.slice.call(arguments,1),it=Object.create(this.lexer),N={yy:{}};for(var gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gt)&&(N.yy[gt]=this.yy[gt]);it.setInput(ut,N.yy),N.yy.lexer=it,N.yy.parser=this,typeof it.yylloc>"u"&&(it.yylloc={});var j=it.yylloc;et.push(j);var Ft=it.options&&it.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function at(){var qt;return qt=dt.pop()||it.lex()||Y,typeof qt!="number"&&(qt instanceof Array&&(dt=qt,qt=dt.pop()),qt=st.symbols_[qt]||qt),qt}for(var Dt,kt,_t,St,Et={},yt,ct,ne,jt;;){if(kt=ot[ot.length-1],this.defaultActions[kt]?_t=this.defaultActions[kt]:((Dt===null||typeof Dt>"u")&&(Dt=at()),_t=Nt[kt]&&Nt[kt][Dt]),typeof _t>"u"||!_t.length||!_t[0]){var Wt="";jt=[];for(yt in Nt[kt])this.terminals_[yt]&&yt>W&&jt.push("'"+this.terminals_[yt]+"'");it.showPosition?Wt="Parse error on line "+(Z+1)+`:
`+it.showPosition()+`
Expecting `+jt.join(", ")+", got '"+(this.terminals_[Dt]||Dt)+"'":Wt="Parse error on line "+(Z+1)+": Unexpected "+(Dt==Y?"end of input":"'"+(this.terminals_[Dt]||Dt)+"'"),this.parseError(Wt,{text:it.match,token:this.terminals_[Dt]||Dt,line:it.yylineno,loc:j,expected:jt})}if(_t[0]instanceof Array&&_t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+Dt);switch(_t[0]){case 1:ot.push(Dt),xt.push(it.yytext),et.push(it.yylloc),ot.push(_t[1]),Dt=null,tt=it.yyleng,G=it.yytext,Z=it.yylineno,j=it.yylloc;break;case 2:if(ct=this.productions_[_t[1]][1],Et.$=xt[xt.length-ct],Et._$={first_line:et[et.length-(ct||1)].first_line,last_line:et[et.length-1].last_line,first_column:et[et.length-(ct||1)].first_column,last_column:et[et.length-1].last_column},Ft&&(Et._$.range=[et[et.length-(ct||1)].range[0],et[et.length-1].range[1]]),St=this.performAction.apply(Et,[G,tt,Z,N.yy,_t[1],xt,et].concat(P)),typeof St<"u")return St;ct&&(ot=ot.slice(0,-1*ct*2),xt=xt.slice(0,-1*ct),et=et.slice(0,-1*ct)),ot.push(this.productions_[_t[1]][0]),xt.push(Et.$),et.push(Et._$),ne=Nt[ot[ot.length-2]][ot[ot.length-1]],ot.push(ne);break;case 3:return!0}}return!0}},Lt=function(){var Q={EOF:1,parseError:function(st,ot){if(this.yy.parser)this.yy.parser.parseError(st,ot);else throw new Error(st)},setInput:function(ut,st){return this.yy=st||this.yy||{},this._input=ut,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 ut=this._input[0];this.yytext+=ut,this.yyleng++,this.offset++,this.match+=ut,this.matched+=ut;var st=ut.match(/(?:\r\n?|\n).*/g);return st?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ut},unput:function(ut){var st=ut.length,ot=ut.split(/(?:\r\n?|\n)/g);this._input=ut+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-st),this.offset-=st;var dt=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),ot.length-1&&(this.yylineno-=ot.length-1);var xt=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:ot?(ot.length===dt.length?this.yylloc.first_column:0)+dt[dt.length-ot.length].length-ot[0].length:this.yylloc.first_column-st},this.options.ranges&&(this.yylloc.range=[xt[0],xt[0]+this.yyleng-st]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(ut){this.unput(this.match.slice(ut))},pastInput:function(){var ut=this.matched.substr(0,this.matched.length-this.match.length);return(ut.length>20?"...":"")+ut.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var ut=this.match;return ut.length<20&&(ut+=this._input.substr(0,20-ut.length)),(ut.substr(0,20)+(ut.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var ut=this.pastInput(),st=new Array(ut.length+1).join("-");return ut+this.upcomingInput()+`
`+st+"^"},test_match:function(ut,st){var ot,dt,xt;if(this.options.backtrack_lexer&&(xt={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&&(xt.yylloc.range=this.yylloc.range.slice(0))),dt=ut[0].match(/(?:\r\n?|\n).*/g),dt&&(this.yylineno+=dt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:dt?dt[dt.length-1].length-dt[dt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ut[0].length},this.yytext+=ut[0],this.match+=ut[0],this.matches=ut,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(ut[0].length),this.matched+=ut[0],ot=this.performAction.call(this,this.yy,this,st,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ot)return ot;if(this._backtrack){for(var et in xt)this[et]=xt[et];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ut,st,ot,dt;this._more||(this.yytext="",this.match="");for(var xt=this._currentRules(),et=0;et<xt.length;et++)if(ot=this._input.match(this.rules[xt[et]]),ot&&(!st||ot[0].length>st[0].length)){if(st=ot,dt=et,this.options.backtrack_lexer){if(ut=this.test_match(ot,xt[et]),ut!==!1)return ut;if(this._backtrack){st=!1;continue}else return!1}else if(!this.options.flex)break}return st?(ut=this.test_match(st,xt[dt]),ut!==!1?ut:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var st=this.next();return st||this.lex()},begin:function(st){this.conditionStack.push(st)},popState:function(){var st=this.conditionStack.length-1;return st>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(st){return st=this.conditionStack.length-1-Math.abs(st||0),st>=0?this.conditionStack[st]:"INITIAL"},pushState:function(st){this.begin(st)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(st,ot,dt,xt){switch(dt){case 0:return 41;case 1:return 50;case 2:return 51;case 3:return 52;case 4: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:break;case 11:break;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:break;case 17:return this.pushState("SCALE"),17;case 18:return 18;case 19: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 25:this.popState();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 34:return this.pushState("SCALE"),17;case 35:return 18;case 36:this.popState();break;case 37:this.pushState("STATE");break;case 38:return this.popState(),ot.yytext=ot.yytext.slice(0,-8).trim(),25;case 39:return this.popState(),ot.yytext=ot.yytext.slice(0,-8).trim(),26;case 40:return this.popState(),ot.yytext=ot.yytext.slice(0,-10).trim(),27;case 41:return this.popState(),ot.yytext=ot.yytext.slice(0,-8).trim(),25;case 42:return this.popState(),ot.yytext=ot.yytext.slice(0,-8).trim(),26;case 43:return this.popState(),ot.yytext=ot.yytext.slice(0,-10).trim(),27;case 44:return 50;case 45:return 51;case 46:return 52;case 47:return 53;case 48:this.begin("STATE_STRING");break;case 49:return this.popState(),this.pushState("STATE_ID"),"AS";case 50:return this.popState(),"ID";case 51:this.popState();break;case 52:return"STATE_DESCR";case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:break;case 57:return this.popState(),21;case 58:break;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 64:break;case 65:return"NOTE_TEXT";case 66:return this.popState(),"ID";case 67:return this.popState(),this.pushState("NOTE_TEXT"),24;case 68:return this.popState(),ot.yytext=ot.yytext.substr(2).trim(),31;case 69:return this.popState(),ot.yytext=ot.yytext.slice(0,-8).trim(),31;case 70:return 7;case 71:return 7;case 72:return 16;case 73:return 56;case 74:return 24;case 75:return ot.yytext=ot.yytext.trim(),14;case 76:return 15;case 77:return 28;case 78:return 57;case 79:return 5;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,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/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}}};return Q}();ft.lexer=Lt;function Tt(){this.yy={}}return Tt.prototype=ft,ft.Parser=Tt,new Tt}();parser$1.parser=parser$1;const stateParser=parser$1,stateDetector=(t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:t.match(/^\s*stateDiagram/)!==null},stateDetectorV2=(t,e)=>{var r;return!!(t.match(/^\s*stateDiagram-v2/)!==null||t.match(/^\s*stateDiagram/)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},DEFAULT_DIAGRAM_DIRECTION="LR",DEFAULT_NESTED_DOC_DIR="TB",STMT_STATE="state",STMT_RELATION="relation",STMT_CLASSDEF="classDef",STMT_APPLYCLASS="applyClass",DEFAULT_STATE_TYPE="default",DIVIDER_TYPE="divider",START_NODE="[*]",START_TYPE="start",END_NODE=START_NODE,END_TYPE="end",COLOR_KEYWORD="color",FILL_KEYWORD="fill",BG_FILL="bgFill",STYLECLASS_SEP=",";function newClassesList(){return{}}let direction=DEFAULT_DIAGRAM_DIRECTION,rootDoc=[],classes=newClassesList();const newDoc=()=>({relations:[],states:{},documents:{}});let documents={root:newDoc()},currentDocument=documents.root,startEndCount=0,dividerCnt=0;const lineType={LINE:0,DOTTED_LINE:1},relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},clone=t=>JSON.parse(JSON.stringify(t)),parseDirective$2=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},setRootDoc=t=>{log$1.info("Setting root doc",t),rootDoc=t},getRootDoc=()=>rootDoc,docTranslator=(t,e,r)=>{if(e.stmt===STMT_RELATION)docTranslator(t,e.state1,!0),docTranslator(t,e.state2,!1);else if(e.stmt===STMT_STATE&&e.id==="[*]"&&(e.id=r?t.id+"_start":t.id+"_end",e.start=r),e.doc){const n=[];let a=[],s;for(s=0;s<e.doc.length;s++)if(e.doc[s].type===DIVIDER_TYPE){const o=clone(e.doc[s]);o.doc=clone(a),n.push(o),a=[]}else a.push(e.doc[s]);if(n.length>0&&a.length>0){const o={stmt:STMT_STATE,id:generateId$1(),type:"divider",doc:clone(a)};n.push(clone(o)),e.doc=n}e.doc.forEach(o=>docTranslator(e,o,!0))}},getRootDocV2=()=>(docTranslator({id:"root"},{id:"root",doc:rootDoc},!0),{id:"root",doc:rootDoc}),extract=t=>{let e;t.doc?e=t.doc:e=t,log$1.info(e),clear$1(!0),log$1.info("Extract",e),e.forEach(r=>{switch(r.stmt){case STMT_STATE:addState(r.id,r.type,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles);break;case STMT_RELATION:addRelation(r.state1,r.state2,r.description);break;case STMT_CLASSDEF:addStyleClass(r.id,r.classes);break;case STMT_APPLYCLASS:setCssClass(r.id,r.styleClass);break}})},addState=function(t,e=DEFAULT_STATE_TYPE,r=null,n=null,a=null,s=null,o=null,l=null){currentDocument.states[t]===void 0?(log$1.info("Adding state ",t,n),currentDocument.states[t]={id:t,descriptions:[],type:e,doc:r,note:a,classes:[],styles:[],textStyles:[]}):(currentDocument.states[t].doc||(currentDocument.states[t].doc=r),currentDocument.states[t].type||(currentDocument.states[t].type=e)),n&&(log$1.info("Setting state description",t,n),typeof n=="string"&&addDescription(t,n.trim()),typeof n=="object"&&n.forEach(u=>addDescription(t,u.trim()))),a&&(currentDocument.states[t].note=a,currentDocument.states[t].note.text=common$1.sanitizeText(currentDocument.states[t].note.text,getConfig$1())),s&&(log$1.info("Setting state classes",t,s),(typeof s=="string"?[s]:s).forEach(h=>setCssClass(t,h.trim()))),o&&(log$1.info("Setting state styles",t,o),(typeof o=="string"?[o]:o).forEach(h=>setStyle(t,h.trim()))),l&&(log$1.info("Setting state styles",t,o),(typeof l=="string"?[l]:l).forEach(h=>setTextStyle(t,h.trim())))},clear$1=function(t){documents={root:newDoc()},currentDocument=documents.root,startEndCount=0,classes=newClassesList(),t||clear$g()},getState=function(t){return currentDocument.states[t]},getStates=function(){return currentDocument.states},logDocuments=function(){log$1.info("Documents = ",documents)},getRelations=function(){return currentDocument.relations};function startIdIfNeeded(t=""){let e=t;return t===START_NODE&&(startEndCount++,e=`${START_TYPE}${startEndCount}`),e}function startTypeIfNeeded(t="",e=DEFAULT_STATE_TYPE){return t===START_NODE?START_TYPE:e}function endIdIfNeeded(t=""){let e=t;return t===END_NODE&&(startEndCount++,e=`${END_TYPE}${startEndCount}`),e}function endTypeIfNeeded(t="",e=DEFAULT_STATE_TYPE){return t===END_NODE?END_TYPE:e}function addRelationObjs(t,e,r){let n=startIdIfNeeded(t.id),a=startTypeIfNeeded(t.id,t.type),s=startIdIfNeeded(e.id),o=startTypeIfNeeded(e.id,e.type);addState(n,a,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),addState(s,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),currentDocument.relations.push({id1:n,id2:s,relationTitle:common$1.sanitizeText(r,getConfig$1())})}const addRelation=function(t,e,r){if(typeof t=="object")addRelationObjs(t,e,r);else{const n=startIdIfNeeded(t),a=startTypeIfNeeded(t),s=endIdIfNeeded(e),o=endTypeIfNeeded(e);addState(n,a),addState(s,o),currentDocument.relations.push({id1:n,id2:s,title:common$1.sanitizeText(r,getConfig$1())})}},addDescription=function(t,e){const r=currentDocument.states[t],n=e.startsWith(":")?e.replace(":","").trim():e;r.descriptions.push(common$1.sanitizeText(n,getConfig$1()))},cleanupLabel=function(t){return t.substring(0,1)===":"?t.substr(2).trim():t.trim()},getDividerId=()=>(dividerCnt++,"divider-id-"+dividerCnt),addStyleClass=function(t,e=""){classes[t]===void 0&&(classes[t]={id:t,styles:[],textStyles:[]});const r=classes[t];e!=null&&e.split(STYLECLASS_SEP).forEach(n=>{const a=n.replace(/([^;]*);/,"$1").trim();if(n.match(COLOR_KEYWORD)){const o=a.replace(FILL_KEYWORD,BG_FILL).replace(COLOR_KEYWORD,FILL_KEYWORD);r.textStyles.push(o)}r.styles.push(a)})},getClasses$1=function(){return classes},setCssClass=function(t,e){t.split(",").forEach(function(r){let n=getState(r);if(n===void 0){const a=r.trim();addState(a),n=getState(a)}n.classes.push(e)})},setStyle=function(t,e){const r=getState(t);r!==void 0&&r.textStyles.push(e)},setTextStyle=function(t,e){const r=getState(t);r!==void 0&&r.textStyles.push(e)},getDirection=()=>direction,setDirection=t=>{direction=t},trimColon=t=>t&&t[0]===":"?t.substr(1).trim():t.trim(),stateDb={parseDirective:parseDirective$2,getConfig:()=>getConfig$1().state,addState,clear:clear$1,getState,getStates,getRelations,getClasses:getClasses$1,getDirection,addRelation,getDividerId,setDirection,cleanupLabel,lineType,relationType,logDocuments,getRootDoc,setRootDoc,getRootDocV2,extract,trimColon,getAccTitle,setAccTitle,getAccDescription,setAccDescription,addStyleClass,setCssClass,addDescription,setDiagramTitle,getDiagramTitle},drawStartState=t=>t.append("circle").attr("class","start-state").attr("r",getConfig$1().state.sizeUnit).attr("cx",getConfig$1().state.padding+getConfig$1().state.sizeUnit).attr("cy",getConfig$1().state.padding+getConfig$1().state.sizeUnit),drawDivider=t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",getConfig$1().state.textHeight).attr("class","divider").attr("x2",getConfig$1().state.textHeight*2).attr("y1",0).attr("y2",0),drawSimpleState=(t,e)=>{const r=t.append("text").attr("x",2*getConfig$1().state.padding).attr("y",getConfig$1().state.textHeight+2*getConfig$1().state.padding).attr("font-size",getConfig$1().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",getConfig$1().state.padding).attr("y",getConfig$1().state.padding).attr("width",n.width+2*getConfig$1().state.padding).attr("height",n.height+2*getConfig$1().state.padding).attr("rx",getConfig$1().state.radius),r},drawDescrState=(t,e)=>{const r=function(g,m,T){const I=g.append("tspan").attr("x",2*getConfig$1().state.padding).text(m);T||I.attr("dy",getConfig$1().state.textHeight)},a=t.append("text").attr("x",2*getConfig$1().state.padding).attr("y",getConfig$1().state.textHeight+1.3*getConfig$1().state.padding).attr("font-size",getConfig$1().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),s=a.height,o=t.append("text").attr("x",getConfig$1().state.padding).attr("y",s+getConfig$1().state.padding*.4+getConfig$1().state.dividerMargin+getConfig$1().state.textHeight).attr("class","state-description");let l=!0,u=!0;e.descriptions.forEach(function(g){l||(r(o,g,u),u=!1),l=!1});const h=t.append("line").attr("x1",getConfig$1().state.padding).attr("y1",getConfig$1().state.padding+s+getConfig$1().state.dividerMargin/2).attr("y2",getConfig$1().state.padding+s+getConfig$1().state.dividerMargin/2).attr("class","descr-divider"),d=o.node().getBBox(),p=Math.max(d.width,a.width);return h.attr("x2",p+3*getConfig$1().state.padding),t.insert("rect",":first-child").attr("x",getConfig$1().state.padding).attr("y",getConfig$1().state.padding).attr("width",p+2*getConfig$1().state.padding).attr("height",d.height+s+2*getConfig$1().state.padding).attr("rx",getConfig$1().state.radius),t},addTitleAndBox=(t,e,r)=>{const n=getConfig$1().state.padding,a=2*getConfig$1().state.padding,s=t.node().getBBox(),o=s.width,l=s.x,u=t.append("text").attr("x",0).attr("y",getConfig$1().state.titleShift).attr("font-size",getConfig$1().state.fontSize).attr("class","state-title").text(e.id),d=u.node().getBBox().width+a;let p=Math.max(d,o);p===o&&(p=p+a);let g;const m=t.node().getBBox();e.doc,g=l-n,d>o&&(g=(o-p)/2+n),Math.abs(l-m.x)<n&&d>o&&(g=l-(d-o)/2);const T=1-getConfig$1().state.textHeight;return t.insert("rect",":first-child").attr("x",g).attr("y",T).attr("class",r?"alt-composit":"composit").attr("width",p).attr("height",m.height+getConfig$1().state.textHeight+getConfig$1().state.titleShift+1).attr("rx","0"),u.attr("x",g+n),d<=o&&u.attr("x",l+(p-a)/2-d/2+n),t.insert("rect",":first-child").attr("x",g).attr("y",getConfig$1().state.titleShift-getConfig$1().state.textHeight-getConfig$1().state.padding).attr("width",p).attr("height",getConfig$1().state.textHeight*3).attr("rx",getConfig$1().state.radius),t.insert("rect",":first-child").attr("x",g).attr("y",getConfig$1().state.titleShift-getConfig$1().state.textHeight-getConfig$1().state.padding).attr("width",p).attr("height",m.height+3+2*getConfig$1().state.textHeight).attr("rx",getConfig$1().state.radius),t},drawEndState=t=>(t.append("circle").attr("class","end-state-outer").attr("r",getConfig$1().state.sizeUnit+getConfig$1().state.miniPadding).attr("cx",getConfig$1().state.padding+getConfig$1().state.sizeUnit+getConfig$1().state.miniPadding).attr("cy",getConfig$1().state.padding+getConfig$1().state.sizeUnit+getConfig$1().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",getConfig$1().state.sizeUnit).attr("cx",getConfig$1().state.padding+getConfig$1().state.sizeUnit+2).attr("cy",getConfig$1().state.padding+getConfig$1().state.sizeUnit+2)),drawForkJoinState=(t,e)=>{let r=getConfig$1().state.forkWidth,n=getConfig$1().state.forkHeight;if(e.parentId){let a=r;r=n,n=a}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",getConfig$1().state.padding).attr("y",getConfig$1().state.padding)},_drawLongText=(t,e,r,n)=>{let a=0;const s=n.append("text");s.style("text-anchor","start"),s.attr("class","noteText");let o=t.replace(/\r\n/g,"<br/>");o=o.replace(/\n/g,"<br/>");const l=o.split(common$1.lineBreakRegex);let u=1.25*getConfig$1().state.noteMargin;for(const h of l){const d=h.trim();if(d.length>0){const p=s.append("tspan");if(p.text(d),u===0){const g=p.node().getBBox();u+=g.height}a+=u,p.attr("x",e+getConfig$1().state.noteMargin),p.attr("y",r+a+1.25*getConfig$1().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:a}},drawNote=(t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",getConfig$1().state.padding),n=e.append("g"),{textWidth:a,textHeight:s}=_drawLongText(t,0,0,n);return r.attr("height",s+2*getConfig$1().state.noteMargin),r.attr("width",a+getConfig$1().state.noteMargin*2),r},drawState=function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},a=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&drawStartState(a),e.type==="end"&&drawEndState(a),(e.type==="fork"||e.type==="join")&&drawForkJoinState(a,e),e.type==="note"&&drawNote(e.note.text,a),e.type==="divider"&&drawDivider(a),e.type==="default"&&e.descriptions.length===0&&drawSimpleState(a,e),e.type==="default"&&e.descriptions.length>0&&drawDescrState(a,e);const s=a.node().getBBox();return n.width=s.width+2*getConfig$1().state.padding,n.height=s.height+2*getConfig$1().state.padding,n};let edgeCount=0;const drawEdge=function(t,e,r){const n=function(u){switch(u){case stateDb.relationType.AGGREGATION:return"aggregation";case stateDb.relationType.EXTENSION:return"extension";case stateDb.relationType.COMPOSITION:return"composition";case stateDb.relationType.DEPENDENCY:return"dependency"}};e.points=e.points.filter(u=>!Number.isNaN(u.y));const a=e.points,s=line$1().x(function(u){return u.x}).y(function(u){return u.y}).curve(curveBasis),o=t.append("path").attr("d",s(a)).attr("id","edge"+edgeCount).attr("class","transition");let l="";if(getConfig$1().state.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),o.attr("marker-end","url("+l+"#"+n(stateDb.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const u=t.append("g").attr("class","stateLabel"),{x:h,y:d}=utils.calcLabelPosition(e.points),p=common$1.getRows(r.title);let g=0;const m=[];let T=0,I=0;for(let L=0;L<=p.length;L++){const M=u.append("text").attr("text-anchor","middle").text(p[L]).attr("x",h).attr("y",d+g),F=M.node().getBBox();T=Math.max(T,F.width),I=Math.min(I,F.x),log$1.info(F.x,h,d+g),g===0&&(g=M.node().getBBox().height,log$1.info("Title height",g,d)),m.push(M)}let A=g*p.length;if(p.length>1){const L=(p.length-1)*g*.5;m.forEach((M,F)=>M.attr("y",d+F*g-L)),A=g*p.length}const C=u.node().getBBox();u.insert("rect",":first-child").attr("class","box").attr("x",h-T/2-getConfig$1().state.padding/2).attr("y",d-A/2-getConfig$1().state.padding/2-3.5).attr("width",T+getConfig$1().state.padding).attr("height",A+getConfig$1().state.padding),log$1.info(C)}edgeCount++};let conf$2;const transformationLog={},setConf$3=function(){},insertMarkers=function(t){t.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")},draw$3=function(t,e,r,n){conf$2=getConfig$1().state;const a=getConfig$1().securityLevel;let s;a==="sandbox"&&(s=select("#i"+e));const o=a==="sandbox"?select(s.nodes()[0].contentDocument.body):select("body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document;log$1.debug("Rendering diagram "+t);const u=o.select(`[id='${e}']`);insertMarkers(u),new Graph({multigraph:!0,compound:!0,rankdir:"RL"}).setDefaultEdgeLabel(function(){return{}});const d=n.db.getRootDoc();renderDoc(d,u,void 0,!1,o,l,n);const p=conf$2.padding,g=u.node().getBBox(),m=g.width+p*2,T=g.height+p*2,I=m*1.75;configureSvgSize(u,T,I,conf$2.useMaxWidth),u.attr("viewBox",`${g.x-conf$2.padding} ${g.y-conf$2.padding} `+m+" "+T)},getLabelWidth=t=>t?t.length*conf$2.fontSizeFactor:1,renderDoc=(t,e,r,n,a,s,o)=>{const l=new Graph({compound:!0,multigraph:!0});let u,h=!0;for(u=0;u<t.length;u++)if(t[u].stmt==="relation"){h=!1;break}r?l.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:h?1:conf$2.edgeLengthFactor,nodeSep:h?1:50,isMultiGraph:!0}):l.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:h?1:conf$2.edgeLengthFactor,nodeSep:h?1:50,ranker:"tight-tree",isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}}),o.db.extract(t);const d=o.db.getStates(),p=o.db.getRelations(),g=Object.keys(d);for(const C of g){const L=d[C];r&&(L.parentId=r);let M;if(L.doc){let F=e.append("g").attr("id",L.id).attr("class","stateGroup");M=renderDoc(L.doc,F,L.id,!n,a,s,o);{F=addTitleAndBox(F,L,n);let H=F.node().getBBox();M.width=H.width,M.height=H.height+conf$2.padding/2,transformationLog[L.id]={y:conf$2.compositTitleSize}}}else M=drawState(e,L);if(L.note){const F={descriptions:[],id:L.id+"-note",note:L.note,type:"note"},H=drawState(e,F);L.note.position==="left of"?(l.setNode(M.id+"-note",H),l.setNode(M.id,M)):(l.setNode(M.id,M),l.setNode(M.id+"-note",H)),l.setParent(M.id,M.id+"-group"),l.setParent(M.id+"-note",M.id+"-group")}else l.setNode(M.id,M)}log$1.debug("Count=",l.nodeCount(),l);let m=0;p.forEach(function(C){m++,log$1.debug("Setting edge",C),l.setEdge(C.id1,C.id2,{relation:C,width:getLabelWidth(C.title),height:conf$2.labelHeight*common$1.getRows(C.title).length,labelpos:"c"},"id"+m)}),layout(l),log$1.debug("Graph after layout",l.nodes());const T=e.node();l.nodes().forEach(function(C){C!==void 0&&l.node(C)!==void 0?(log$1.warn("Node "+C+": "+JSON.stringify(l.node(C))),a.select("#"+T.id+" #"+C).attr("transform","translate("+(l.node(C).x-l.node(C).width/2)+","+(l.node(C).y+(transformationLog[C]?transformationLog[C].y:0)-l.node(C).height/2)+" )"),a.select("#"+T.id+" #"+C).attr("data-x-shift",l.node(C).x-l.node(C).width/2),s.querySelectorAll("#"+T.id+" #"+C+" .divider").forEach(M=>{const F=M.parentElement;let H=0,q=0;F&&(F.parentElement&&(H=F.parentElement.getBBox().width),q=parseInt(F.getAttribute("data-x-shift"),10),Number.isNaN(q)&&(q=0)),M.setAttribute("x1",0-q+8),M.setAttribute("x2",H-q-8)})):log$1.debug("No Node "+C+": "+JSON.stringify(l.node(C)))});let I=T.getBBox();l.edges().forEach(function(C){C!==void 0&&l.edge(C)!==void 0&&(log$1.debug("Edge "+C.v+" -> "+C.w+": "+JSON.stringify(l.edge(C))),drawEdge(e,l.edge(C),l.edge(C).relation))}),I=T.getBBox();const A={id:r||"root",label:r||"root",width:0,height:0};return A.width=I.width+2*conf$2.padding,A.height=I.height+2*conf$2.padding,log$1.debug("Doc rendered",A,l),A},stateRenderer={setConf:setConf$3,draw:draw$3},SHAPE_STATE="rect",SHAPE_STATE_WITH_DESC="rectWithTitle",SHAPE_START="start",SHAPE_END="end",SHAPE_DIVIDER="divider",SHAPE_GROUP="roundedWithTitle",SHAPE_NOTE="note",SHAPE_NOTEGROUP="noteGroup",CSS_DIAGRAM="statediagram",CSS_STATE="state",CSS_DIAGRAM_STATE=`${CSS_DIAGRAM}-${CSS_STATE}`,CSS_EDGE="transition",CSS_NOTE="note",CSS_NOTE_EDGE="note-edge",CSS_EDGE_NOTE_EDGE=`${CSS_EDGE} ${CSS_NOTE_EDGE}`,CSS_DIAGRAM_NOTE=`${CSS_DIAGRAM}-${CSS_NOTE}`,CSS_CLUSTER="cluster",CSS_DIAGRAM_CLUSTER=`${CSS_DIAGRAM}-${CSS_CLUSTER}`,CSS_CLUSTER_ALT="cluster-alt",CSS_DIAGRAM_CLUSTER_ALT=`${CSS_DIAGRAM}-${CSS_CLUSTER_ALT}`,PARENT="parent",NOTE="note",DOMID_STATE="state",DOMID_TYPE_SPACER="----",NOTE_ID=`${DOMID_TYPE_SPACER}${NOTE}`,PARENT_ID=`${DOMID_TYPE_SPACER}${PARENT}`,G_EDGE_STYLE="fill:none",G_EDGE_ARROWHEADSTYLE="fill: #333",G_EDGE_LABELPOS="c",G_EDGE_LABELTYPE="text",G_EDGE_THICKNESS="normal";let nodeDb={},graphItemCount=0;const setConf$2=function(t){const e=Object.keys(t);for(const r of e)t[r]},getClasses=function(t,e){log$1.trace("Extracting classes"),e.db.clear();try{return e.parser.parse(t),e.db.extract(e.db.getRootDocV2()),e.db.getClasses()}catch(r){return r}};function getClassesFromDbInfo(t){return t==null?"":t.classes?t.classes.join(" "):""}function stateDomId(t="",e=0,r="",n=DOMID_TYPE_SPACER){const a=r!==null&&r.length>0?`${n}${r}`:"";return`${DOMID_STATE}-${t}${a}-${e}`}const setupNode=(t,e,r,n,a,s)=>{const o=r.id,l=getClassesFromDbInfo(n[o]);if(o!=="root"){let u=SHAPE_STATE;r.start===!0&&(u=SHAPE_START),r.start===!1&&(u=SHAPE_END),r.type!==DEFAULT_STATE_TYPE&&(u=r.type),nodeDb[o]||(nodeDb[o]={id:o,shape:u,description:common$1.sanitizeText(o,getConfig$1()),classes:`${l} ${CSS_DIAGRAM_STATE}`});const h=nodeDb[o];r.description&&(Array.isArray(h.description)?(h.shape=SHAPE_STATE_WITH_DESC,h.description.push(r.description)):h.description.length>0?(h.shape=SHAPE_STATE_WITH_DESC,h.description===o?h.description=[r.description]:h.description=[h.description,r.description]):(h.shape=SHAPE_STATE,h.description=r.description),h.description=common$1.sanitizeTextOrArray(h.description,getConfig$1())),h.description.length===1&&h.shape===SHAPE_STATE_WITH_DESC&&(h.shape=SHAPE_STATE),!h.type&&r.doc&&(log$1.info("Setting cluster for ",o,getDir(r)),h.type="group",h.dir=getDir(r),h.shape=r.type===DIVIDER_TYPE?SHAPE_DIVIDER:SHAPE_GROUP,h.classes=h.classes+" "+CSS_DIAGRAM_CLUSTER+" "+(s?CSS_DIAGRAM_CLUSTER_ALT:""));const d={labelStyle:"",shape:h.shape,labelText:h.description,classes:h.classes,style:"",id:o,dir:h.dir,domId:stateDomId(o,graphItemCount),type:h.type,padding:15};if(r.note){const p={labelStyle:"",shape:SHAPE_NOTE,labelText:r.note.text,classes:CSS_DIAGRAM_NOTE,style:"",id:o+NOTE_ID+"-"+graphItemCount,domId:stateDomId(o,graphItemCount,NOTE),type:h.type,padding:15},g={labelStyle:"",shape:SHAPE_NOTEGROUP,labelText:r.note.text,classes:h.classes,style:"",id:o+PARENT_ID,domId:stateDomId(o,graphItemCount,PARENT),type:"group",padding:0};graphItemCount++;const m=o+PARENT_ID;t.setNode(m,g),t.setNode(p.id,p),t.setNode(o,d),t.setParent(o,m),t.setParent(p.id,m);let T=o,I=p.id;r.note.position==="left of"&&(T=p.id,I=o),t.setEdge(T,I,{arrowhead:"none",arrowType:"",style:G_EDGE_STYLE,labelStyle:"",classes:CSS_EDGE_NOTE_EDGE,arrowheadStyle:G_EDGE_ARROWHEADSTYLE,labelpos:G_EDGE_LABELPOS,labelType:G_EDGE_LABELTYPE,thickness:G_EDGE_THICKNESS})}else t.setNode(o,d)}e&&e.id!=="root"&&(log$1.trace("Setting node ",o," to be child of its parent ",e.id),t.setParent(o,e.id)),r.doc&&(log$1.trace("Adding nodes children "),setupDoc(t,r,r.doc,n,a,!s))},setupDoc=(t,e,r,n,a,s)=>{log$1.trace("items",r),r.forEach(o=>{switch(o.stmt){case STMT_STATE:setupNode(t,e,o,n,a,s);break;case DEFAULT_STATE_TYPE:setupNode(t,e,o,n,a,s);break;case STMT_RELATION:{setupNode(t,e,o.state1,n,a,s),setupNode(t,e,o.state2,n,a,s);const l={id:"edge"+graphItemCount,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:G_EDGE_STYLE,labelStyle:"",label:common$1.sanitizeText(o.description,getConfig$1()),arrowheadStyle:G_EDGE_ARROWHEADSTYLE,labelpos:G_EDGE_LABELPOS,labelType:G_EDGE_LABELTYPE,thickness:G_EDGE_THICKNESS,classes:CSS_EDGE};t.setEdge(o.state1.id,o.state2.id,l,graphItemCount),graphItemCount++}break}})},getDir=(t,e=DEFAULT_NESTED_DOC_DIR)=>{let r=e;if(t.doc)for(let n=0;n<t.doc.length;n++){const a=t.doc[n];a.stmt==="dir"&&(r=a.value)}return r},draw$2=function(t,e,r,n){log$1.info("Drawing state diagram (v2)",e),nodeDb={},n.db.getDirection();const{securityLevel:a,state:s}=getConfig$1(),o=s.nodeSpacing||50,l=s.rankSpacing||50;log$1.info(n.db.getRootDocV2()),n.db.extract(n.db.getRootDocV2()),log$1.info(n.db.getRootDocV2());const u=n.db.getStates(),h=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:getDir(n.db.getRootDocV2()),nodesep:o,ranksep:l,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});setupNode(h,void 0,n.db.getRootDocV2(),u,n.db,!0);let d;a==="sandbox"&&(d=select("#i"+e));const p=a==="sandbox"?select(d.nodes()[0].contentDocument.body):select("body"),g=p.select(`[id="${e}"]`),m=p.select("#"+e+" g");render$1(m,h,["barb"],CSS_DIAGRAM,e);const T=8;utils.insertTitle(g,"statediagramTitleText",s.titleTopMargin,n.db.getDiagramTitle());const I=g.node().getBBox(),A=I.width+T*2,C=I.height+T*2;g.attr("class",CSS_DIAGRAM);const L=g.node().getBBox();configureSvgSize(g,C,A,s.useMaxWidth);const M=`${L.x-T} ${L.y-T} ${A} ${C}`;log$1.debug(`viewBox ${M}`),g.attr("viewBox",M);const F=document.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const H of F){const q=H.getBBox(),U=document.createElementNS("http://www.w3.org/2000/svg",SHAPE_STATE);U.setAttribute("rx",0),U.setAttribute("ry",0),U.setAttribute("width",q.width),U.setAttribute("height",q.height),H.insertBefore(U,H.firstChild)}},stateRendererV2={setConf:setConf$2,getClasses,draw:draw$2};var parser=function(){var t=function(I,A,C,L){for(C=C||{},L=I.length;L--;C[I[L]]=A);return C},e=[1,2],r=[1,5],n=[6,9,11,17,18,20,22,23,24,26],a=[1,15],s=[1,16],o=[1,17],l=[1,18],u=[1,19],h=[1,20],d=[1,24],p=[4,6,9,11,17,18,20,22,23,24,26],g={trace:function(){},yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,acc_title:18,acc_title_value:19,acc_descr:20,acc_descr_value:21,acc_descr_multiline_value:22,section:23,taskName:24,taskData:25,open_directive:26,type_directive:27,arg_directive:28,close_directive:29,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",24:"taskName",25:"taskData",26:"open_directive",27:"type_directive",28:"arg_directive",29:"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,2],[10,2],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(A,C,L,M,F,H,q){var U=H.length-1;switch(F){case 1:return H[U-1];case 3:this.$=[];break;case 4:H[U-1].push(H[U]),this.$=H[U-1];break;case 5:case 6:this.$=H[U];break;case 7:case 8:this.$=[];break;case 11:M.setDiagramTitle(H[U].substr(6)),this.$=H[U].substr(6);break;case 12:this.$=H[U].trim(),M.setAccTitle(this.$);break;case 13:case 14:this.$=H[U].trim(),M.setAccDescription(this.$);break;case 15:M.addSection(H[U].substr(8)),this.$=H[U].substr(8);break;case 16:M.addTask(H[U-1],H[U]),this.$="task";break;case 18:M.parseDirective("%%{","open_directive");break;case 19:M.parseDirective(H[U],"type_directive");break;case 20:H[U]=H[U].trim().replace(/'/g,'"'),M.parseDirective(H[U],"arg_directive");break;case 21:M.parseDirective("}%%","close_directive","journey");break}},table:[{3:1,4:e,7:3,12:4,26:r},{1:[3]},t(n,[2,3],{5:6}),{3:7,4:e,7:3,12:4,26:r},{13:8,27:[1,9]},{27:[2,18]},{6:[1,10],7:21,8:11,9:[1,12],10:13,11:[1,14],12:4,17:a,18:s,20:o,22:l,23:u,24:h,26:r},{1:[2,2]},{14:22,15:[1,23],29:d},t([15,29],[2,19]),t(n,[2,8],{1:[2,1]}),t(n,[2,4]),{7:21,10:25,12:4,17:a,18:s,20:o,22:l,23:u,24:h,26:r},t(n,[2,6]),t(n,[2,7]),t(n,[2,11]),{19:[1,26]},{21:[1,27]},t(n,[2,14]),t(n,[2,15]),{25:[1,28]},t(n,[2,17]),{11:[1,29]},{16:30,28:[1,31]},{11:[2,21]},t(n,[2,5]),t(n,[2,12]),t(n,[2,13]),t(n,[2,16]),t(p,[2,9]),{14:32,29:d},{29:[2,20]},{11:[1,33]},t(p,[2,10])],defaultActions:{5:[2,18],7:[2,2],24:[2,21],31:[2,20]},parseError:function(A,C){if(C.recoverable)this.trace(A);else{var L=new Error(A);throw L.hash=C,L}},parse:function(A){var C=this,L=[0],M=[],F=[null],H=[],q=this.table,U="",z=0,R=0,$=2,D=1,k=H.slice.call(arguments,1),B=Object.create(this.lexer),v={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(v.yy[J]=this.yy[J]);B.setInput(A,v.yy),v.yy.lexer=B,v.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var E=B.yylloc;H.push(E);var ft=B.options&&B.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Lt(){var Z;return Z=M.pop()||B.lex()||D,typeof Z!="number"&&(Z instanceof Array&&(M=Z,Z=M.pop()),Z=C.symbols_[Z]||Z),Z}for(var Tt,Q,ut,st,ot={},dt,xt,et,Nt;;){if(Q=L[L.length-1],this.defaultActions[Q]?ut=this.defaultActions[Q]:((Tt===null||typeof Tt>"u")&&(Tt=Lt()),ut=q[Q]&&q[Q][Tt]),typeof ut>"u"||!ut.length||!ut[0]){var G="";Nt=[];for(dt in q[Q])this.terminals_[dt]&&dt>$&&Nt.push("'"+this.terminals_[dt]+"'");B.showPosition?G="Parse error on line "+(z+1)+`:
`+B.showPosition()+`
Expecting `+Nt.join(", ")+", got '"+(this.terminals_[Tt]||Tt)+"'":G="Parse error on line "+(z+1)+": Unexpected "+(Tt==D?"end of input":"'"+(this.terminals_[Tt]||Tt)+"'"),this.parseError(G,{text:B.match,token:this.terminals_[Tt]||Tt,line:B.yylineno,loc:E,expected:Nt})}if(ut[0]instanceof Array&&ut.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+Tt);switch(ut[0]){case 1:L.push(Tt),F.push(B.yytext),H.push(B.yylloc),L.push(ut[1]),Tt=null,R=B.yyleng,U=B.yytext,z=B.yylineno,E=B.yylloc;break;case 2:if(xt=this.productions_[ut[1]][1],ot.$=F[F.length-xt],ot._$={first_line:H[H.length-(xt||1)].first_line,last_line:H[H.length-1].last_line,first_column:H[H.length-(xt||1)].first_column,last_column:H[H.length-1].last_column},ft&&(ot._$.range=[H[H.length-(xt||1)].range[0],H[H.length-1].range[1]]),st=this.performAction.apply(ot,[U,R,z,v.yy,ut[1],F,H].concat(k)),typeof st<"u")return st;xt&&(L=L.slice(0,-1*xt*2),F=F.slice(0,-1*xt),H=H.slice(0,-1*xt)),L.push(this.productions_[ut[1]][0]),F.push(ot.$),H.push(ot._$),et=q[L[L.length-2]][L[L.length-1]],L.push(et);break;case 3:return!0}}return!0}},m=function(){var I={EOF:1,parseError:function(C,L){if(this.yy.parser)this.yy.parser.parseError(C,L);else throw new Error(C)},setInput:function(A,C){return this.yy=C||this.yy||{},this._input=A,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 A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var C=A.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},unput:function(A){var C=A.length,L=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var M=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),L.length-1&&(this.yylineno-=L.length-1);var F=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:L?(L.length===M.length?this.yylloc.first_column:0)+M[M.length-L.length].length-L[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(A){this.unput(this.match.slice(A))},pastInput:function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var A=this.pastInput(),C=new Array(A.length+1).join("-");return A+this.upcomingInput()+`
`+C+"^"},test_match:function(A,C){var L,M,F;if(this.options.backtrack_lexer&&(F={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&&(F.yylloc.range=this.yylloc.range.slice(0))),M=A[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,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(A[0].length),this.matched+=A[0],L=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),L)return L;if(this._backtrack){for(var H in F)this[H]=F[H];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,C,L,M;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),H=0;H<F.length;H++)if(L=this._input.match(this.rules[F[H]]),L&&(!C||L[0].length>C[0].length)){if(C=L,M=H,this.options.backtrack_lexer){if(A=this.test_match(L,F[H]),A!==!1)return A;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(A=this.test_match(C,F[M]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var C=this.next();return C||this.lex()},begin:function(C){this.conditionStack.push(C)},popState:function(){var C=this.conditionStack.length-1;return C>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(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},pushState:function(C){this.begin(C)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(C,L,M,F){switch(M){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:break;case 6:break;case 7:return 11;case 8:break;case 9:break;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}}};return I}();g.lexer=m;function T(){this.yy={}}return T.prototype=g,g.Parser=T,new T}();parser.parser=parser;const journeyParser=parser,journeyDetector=t=>t.match(/^\s*journey/)!==null;let currentSection="";const sections=[],tasks=[],rawTasks=[],parseDirective$1=function(t,e,r){mermaidAPI.parseDirective(this,t,e,r)},clear=function(){sections.length=0,tasks.length=0,currentSection="",rawTasks.length=0,clear$g()},addSection=function(t){currentSection=t,sections.push(t)},getSections=function(){return sections},getTasks=function(){let t=compileTasks();const e=100;let r=0;for(;!t&&r<e;)t=compileTasks(),r++;return tasks.push(...rawTasks),tasks},updateActors=function(){const t=[];return tasks.forEach(r=>{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},addTask=function(t,e){const r=e.substr(1).split(":");let n=0,a=[];r.length===1?(n=Number(r[0]),a=[]):(n=Number(r[0]),a=r[1].split(","));const s=a.map(l=>l.trim()),o={section:currentSection,type:currentSection,people:s,task:t,score:n};rawTasks.push(o)},addTaskOrg=function(t){const e={section:currentSection,type:currentSection,description:t,task:t,classes:[]};tasks.push(e)},compileTasks=function(){const t=function(r){return rawTasks[r].processed};let e=!0;for(const[r,n]of rawTasks.entries())t(r),e=e&&n.processed;return e},getActors=function(){return updateActors()},journeyDb={parseDirective:parseDirective$1,getConfig:()=>getConfig$1().journey,clear,setDiagramTitle,getDiagramTitle,setAccTitle,getAccTitle,setAccDescription,getAccDescription,addSection,getSections,getTasks,addTask,addTaskOrg,getActors},drawRect=function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},drawFace=function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),a=t.append("g");a.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),a.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function s(u){const h=arc().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",h).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(u){const h=arc().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",h).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function l(u){u.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")}return e.score>3?s(a):e.score<3?o(a):l(a),n},drawCircle=function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},drawText=function(t,e){const r=e.text.replace(/<br\s*\/?>/gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const a=n.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.text(r),n},drawLabel=function(t,e){function r(a,s,o,l,u){return a+","+s+" "+(a+o)+","+s+" "+(a+o)+","+(s+l-u)+" "+(a+o-u*1.2)+","+(s+l)+" "+a+","+(s+l)}const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,drawText(t,e)},drawSection=function(t,e,r){const n=t.append("g"),a=getNoteRect();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=r.width,a.height=r.height,a.class="journey-section section-type-"+e.num,a.rx=3,a.ry=3,drawRect(n,a),_drawTextCandidateFunc(r)(e.text,n,a.x,a.y,a.width,a.height,{class:"journey-section section-type-"+e.num},r,e.colour)};let taskCount=-1;const drawTask=function(t,e,r){const n=e.x+r.width/2,a=t.append("g");taskCount++;const s=300+5*30;a.append("line").attr("id","task"+taskCount).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",s).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),drawFace(a,{cx:n,cy:300+(5-e.score)*30,score:e.score});const o=getNoteRect();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,drawRect(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};drawCircle(a,d),l+=10}),_drawTextCandidateFunc(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},drawBackgroundRect=function(t,e){drawRect(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=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},_drawTextCandidateFunc=function(){function t(a,s,o,l,u,h,d,p){const g=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("font-color",p).style("text-anchor","middle").text(a);n(g,d)}function e(a,s,o,l,u,h,d,p,g){const{taskFontSize:m,taskFontFamily:T}=p,I=a.split(/<br\s*\/?>/gi);for(let A=0;A<I.length;A++){const C=A*m-m*(I.length-1)/2,L=s.append("text").attr("x",o+u/2).attr("y",l).attr("fill",g).style("text-anchor","middle").style("font-size",m).style("font-family",T);L.append("tspan").attr("x",o+u/2).attr("dy",C).text(I[A]),L.attr("y",l+h/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(L,d)}}function r(a,s,o,l,u,h,d,p){const g=s.append("switch"),T=g.append("foreignObject").attr("x",o).attr("y",l).attr("width",u).attr("height",h).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");T.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),e(a,g,o,l,u,h,d,p),n(T,d)}function n(a,s){for(const o in s)o in s&&a.attr(o,s[o])}return function(a){return a.textPlacement==="fo"?r:a.textPlacement==="old"?t:e}}(),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")},svgDraw={drawRect,drawCircle,drawSection,drawText,drawLabel,drawTask,drawBackgroundRect,getTextObj,getNoteRect,initGraphics},setConf$1=function(t){Object.keys(t).forEach(function(r){conf$1[r]=t[r]})},actors={};function drawActorLegend(t){const e=getConfig$1().journey;let r=60;Object.keys(actors).forEach(n=>{const a=actors[n].color,s={cx:20,cy:r,r:7,fill:a,stroke:"#000",pos:actors[n].position};svgDraw.drawCircle(t,s);const o={x:40,y:r+7,fill:"#666",text:n,textMargin:e.boxTextMargin|5};svgDraw.drawText(t,o),r+=20})}const conf$1=getConfig$1().journey,LEFT_MARGIN=conf$1.leftMargin,draw$1=function(t,e,r,n){const a=getConfig$1().journey;n.db.clear(),n.parser.parse(t+`
`);const s=getConfig$1().securityLevel;let o;s==="sandbox"&&(o=select("#i"+e));const l=s==="sandbox"?select(o.nodes()[0].contentDocument.body):select("body");bounds.init();const u=l.select("#"+e);svgDraw.initGraphics(u);const h=n.db.getTasks(),d=n.db.getDiagramTitle(),p=n.db.getActors();for(const C in actors)delete actors[C];let g=0;p.forEach(C=>{actors[C]={color:a.actorColours[g%a.actorColours.length],position:g},g++}),drawActorLegend(u),bounds.insert(0,0,LEFT_MARGIN,Object.keys(actors).length*50),drawTasks(u,h,0);const m=bounds.getBounds();d&&u.append("text").text(d).attr("x",LEFT_MARGIN).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const T=m.stopy-m.starty+2*a.diagramMarginY,I=LEFT_MARGIN+m.stopx+2*a.diagramMarginX;configureSvgSize(u,T,I,a.useMaxWidth),u.append("line").attr("x1",LEFT_MARGIN).attr("y1",a.height*4).attr("x2",I-LEFT_MARGIN-4).attr("y2",a.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const A=d?70:0;u.attr("viewBox",`${m.startx} -25 ${I} ${T+A}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",T+A+25)},bounds={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,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},updateBounds:function(t,e,r,n){const a=getConfig$1().journey,s=this;let o=0;function l(u){return function(d){o++;const p=s.sequenceItems.length-o+1;s.updateVal(d,"starty",e-p*a.boxMargin,Math.min),s.updateVal(d,"stopy",n+p*a.boxMargin,Math.max),s.updateVal(bounds.data,"startx",t-p*a.boxMargin,Math.min),s.updateVal(bounds.data,"stopx",r+p*a.boxMargin,Math.max),u!=="activation"&&(s.updateVal(d,"startx",t-p*a.boxMargin,Math.min),s.updateVal(d,"stopx",r+p*a.boxMargin,Math.max),s.updateVal(bounds.data,"starty",e-p*a.boxMargin,Math.min),s.updateVal(bounds.data,"stopy",n+p*a.boxMargin,Math.max))}}this.sequenceItems.forEach(l())},insert:function(t,e,r,n){const a=Math.min(t,r),s=Math.max(t,r),o=Math.min(e,n),l=Math.max(e,n);this.updateVal(bounds.data,"startx",a,Math.min),this.updateVal(bounds.data,"starty",o,Math.min),this.updateVal(bounds.data,"stopx",s,Math.max),this.updateVal(bounds.data,"stopy",l,Math.max),this.updateBounds(a,o,s,l)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},fills=conf$1.sectionFills,textColours=conf$1.sectionColours,drawTasks=function(t,e,r){const n=getConfig$1().journey;let a="";const s=n.height*2+n.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[p,g]of e.entries()){if(a!==g.section){u=fills[l%fills.length],d=l%fills.length,h=textColours[l%textColours.length];const T={x:p*n.taskMargin+p*n.width+LEFT_MARGIN,y:50,text:g.section,fill:u,num:d,colour:h};svgDraw.drawSection(t,T,n),a=g.section,l++}const m=g.people.reduce((T,I)=>(actors[I]&&(T[I]=actors[I]),T),{});g.x=p*n.taskMargin+p*n.width+LEFT_MARGIN,g.y=o,g.width=n.diagramMarginX,g.height=n.diagramMarginY,g.colour=h,g.fill=u,g.num=d,g.actors=m,svgDraw.drawTask(t,g,n),bounds.insert(g.x,g.y,g.x+g.width+n.taskMargin,300+5*30)}},journeyRenderer={setConf:setConf$1,draw:draw$1};let conf={};const setConf=function(t){conf={...conf,...t}},draw=(t,e,r)=>{try{log$1.debug(`Renering svg for syntax error
`);const n=select("#"+e),a=n.append("g");a.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"),a.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"),a.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"),a.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"),a.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"),a.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"),a.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"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text("mermaid version "+r),n.attr("height",100),n.attr("width",500),n.attr("viewBox","768 0 912 512")}catch(n){log$1.error("Error while rendering info diagram"),log$1.error(getErrorMessage(n))}},errorRenderer={setConf,draw};let hasLoadedDiagrams=!1;const addDiagrams=()=>{hasLoadedDiagrams||(hasLoadedDiagrams=!0,registerDiagram("error",{db:{clear:()=>{}},styles:errorStyles,renderer:errorRenderer,parser:{parser:{yy:{}},parse:()=>{}},init:()=>{}},t=>t.toLowerCase().trim()==="error"),registerDiagram("c4",{parser:c4Parser,db:c4Db,renderer:c4Renderer,styles:c4Styles,init:t=>{c4Renderer.setConf(t.c4)}},c4Detector),registerDiagram("class",{parser:classParser,db:classDb,renderer:classRenderer,styles:classStyles,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,classDb.clear()}},classDetector),registerDiagram("classDiagram",{parser:classParser,db:classDb,renderer:classRendererV2,styles:classStyles,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,classDb.clear()}},classDetectorV2),registerDiagram("er",{parser:erParser,db:erDb,renderer:erRenderer,styles:erStyles},erDetector),registerDiagram("gantt",{parser:ganttParser,db:ganttDb,renderer:ganttRenderer,styles:ganttStyles},ganttDetector),registerDiagram("info",{parser:infoParser,db:infoDb,renderer:infoRenderer,styles:infoStyles},infoDetector),registerDiagram("pie",{parser:pieParser,db:pieDb,renderer:pieRenderer,styles:pieStyles},pieDetector),registerDiagram("requirement",{parser:requirementParser,db:requirementDb,renderer:requirementRenderer,styles:requirementStyles},requirementDetector),registerDiagram("sequence",{parser:sequenceParser,db:sequenceDb,renderer:sequenceRenderer,styles:sequenceStyles,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.");sequenceDb.setWrap(t.wrap),sequenceRenderer.setConf(t.sequence)}},sequenceDetector),registerDiagram("state",{parser:stateParser,db:stateDb,renderer:stateRenderer,styles:stateStyles,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,stateDb.clear()}},stateDetector),registerDiagram("stateDiagram",{parser:stateParser,db:stateDb,renderer:stateRendererV2,styles:stateStyles,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,stateDb.clear()}},stateDetectorV2),registerDiagram("journey",{parser:journeyParser,db:journeyDb,renderer:journeyRenderer,styles:journeyStyles,init:t=>{journeyRenderer.setConf(t.journey),journeyDb.clear()}},journeyDetector),registerDiagram("flowchart",{parser:flowParser,db:flowDb,renderer:flowRendererV2,styles:flowStyles,init:t=>{t.flowchart||(t.flowchart={}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,flowRenderer.setConf(t.flowchart),flowDb.clear(),flowDb.setGen("gen-1")}},flowDetector),registerDiagram("flowchart-v2",{parser:flowParser,db:flowDb,renderer:flowRendererV2,styles:flowStyles,init:t=>{t.flowchart||(t.flowchart={}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,setConfig({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}}),flowRendererV2.setConf(t.flowchart),flowDb.clear(),flowDb.setGen("gen-2")}},flowDetectorV2),registerDiagram("gitGraph",{parser:gitGraphParser,db:gitGraphDb,renderer:gitGraphRenderer,styles:gitGraphStyles},gitGraphDetector))};class Diagram{constructor(e,r){__publicField(this,"type","graph"),__publicField(this,"parser"),__publicField(this,"renderer"),__publicField(this,"db"),__publicField(this,"detectTypeFailed",!1);var n,a;this.txt=e;const s=getConfig$1();this.txt=e;try{this.type=detectType(e,s)}catch(u){this.handleError(u,r),this.type="error",this.detectTypeFailed=!0}const o=getDiagram(this.type);log$1.debug("Type "+this.type),this.db=o.db,(a=(n=this.db).clear)==null||a.call(n),this.renderer=o.renderer,this.parser=o.parser;const l=this.parser.parse.bind(this.parser);this.parser.parse=u=>l(extractFrontMatter(u,this.db)),this.parser.parser.yy=this.db,o.init&&(o.init(s),log$1.debug("Initialized diagram "+this.type,s)),this.txt+=`
`,this.parse(this.txt,r)}parse(e,r){var n,a;if(this.detectTypeFailed)return!1;try{return e=e+`
`,(a=(n=this.db).clear)==null||a.call(n),this.parser.parse(e),!0}catch(s){this.handleError(s,r)}return!1}handleError(e,r){if(r===void 0)throw e;if(isDetailedError(e)){r(e.str,e.hash);return}r(e)}getParser(){return this.parser}getType(){return this.type}}const getDiagramFromText=(t,e)=>{const r=detectType(t,getConfig$1());try{getDiagram(r)}catch{const a=getDiagramLoader(r);if(!a)throw new Error(`Diagram ${r} not found.`);return a().then(({diagram:s})=>(registerDiagram(r,s,void 0),new Diagram(t,e)))}return new Diagram(t,e)},Diagram$1=Diagram;function setA11yDiagramInfo(t,e){isEmpty(e)||t.attr("aria-roledescription",e)}function addSVGa11yTitleDescription(t,e,r,n){if(t.insert!==void 0)if(e||r){if(r){const a="chart-desc-"+n;t.attr("aria-describedby",a),t.insert("desc",":first-child").attr("id",a).text(r)}if(e){const a="chart-title-"+n;t.attr("aria-labelledby",a),t.insert("title",":first-child").attr("id",a).text(e)}}else return}const CLASSDEF_DIAGRAMS=["graph","flowchart","flowchart-v2","stateDiagram","stateDiagram-v2"],MAX_TEXTLENGTH_EXCEEDED_MSG="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",SECURITY_LVL_SANDBOX="sandbox",SECURITY_LVL_LOOSE="loose",XMLNS_SVG_STD="http://www.w3.org/2000/svg",XMLNS_XLINK_STD="http://www.w3.org/1999/xlink",XMLNS_XHTML_STD="http://www.w3.org/1999/xhtml",IFRAME_WIDTH="100%",IFRAME_HEIGHT="100%",IFRAME_STYLES="border:0;margin:0;",IFRAME_BODY_STYLE="margin:0",IFRAME_SANDBOX_OPTS="allow-top-navigation-by-user-activation allow-popups",IFRAME_NOT_SUPPORTED_MSG='The "iframe" tag is not supported by your browser.',DOMPURIFY_TAGS=["foreignobject"],DOMPURIFY_ATTR=["dominant-baseline"];function parse$1(t,e){return addDiagrams(),new Diagram$1(t,e).parse(t,e)}async function parseAsync$1(t,e){return addDiagrams(),(await getDiagramFromText(t,e)).parse(t,e)}const encodeEntities=function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},decodeEntities=function(t){let e=t;return e=e.replace(/fl°°/g,"&#"),e=e.replace(/fl°/g,"&"),e=e.replace(/¶ß/g,";"),e},cssImportantStyles=(t,e,r=[])=>`
.${t} ${e} { ${r.join(" !important; ")} !important; }`,createCssStyles=(t,e,r={})=>{var n;let a="";if(t.themeCSS!==void 0&&(a+=`
${t.themeCSS}`),t.fontFamily!==void 0&&(a+=`
:root { --mermaid-font-family: ${t.fontFamily}}`),t.altFontFamily!==void 0&&(a+=`
:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),!isEmpty(r)&&CLASSDEF_DIAGRAMS.includes(e)){const u=t.htmlLabels||((n=t.flowchart)==null?void 0:n.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];for(const h in r){const d=r[h];isEmpty(d.styles)||u.forEach(p=>{a+=cssImportantStyles(d.id,p,d.styles)}),isEmpty(d.textStyles)||(a+=cssImportantStyles(d.id,"tspan",d.textStyles))}}return a},createUserStyles=(t,e,r,n)=>{const a=createCssStyles(t,e,r),s=getStyles$2(e,a,t.themeVariables);return serialize(compile(`${n}{${s}}`),stringify)},cleanUpSvgCode=(t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\(.*?#/g,'marker-end="url(#')),n=decodeEntities(n),n=n.replace(/<br>/g,"<br/>"),n},putIntoIFrame=(t="",e)=>{const r=e?e.viewBox.baseVal.height+"px":IFRAME_HEIGHT,n=btoa('<body style="'+IFRAME_BODY_STYLE+'">'+t+"</body>");return`<iframe style="width:${IFRAME_WIDTH};height:${r};${IFRAME_STYLES}" src="data:text/html;base64,${n}" sandbox="${IFRAME_SANDBOX_OPTS}">
${IFRAME_NOT_SUPPORTED_MSG}
</iframe>`},appendDivSvgG=(t,e,r,n,a)=>{const s=t.append("div");s.attr("id",r),n&&s.attr("style",n);const o=s.append("svg").attr("id",e).attr("width","100%").attr("xmlns",XMLNS_SVG_STD);return a&&o.attr("xmlns:xlink",a),o.append("g"),t};function sandboxedIframe(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}const removeExistingElements=(t,e,r,n)=>{var a,s,o;(a=t.getElementById(e))==null||a.remove(),(s=t.getElementById(r))==null||s.remove(),(o=t.getElementById(n))==null||o.remove()},render$2=function(t,e,r,n){var a,s,o,l,u;addDiagrams(),reset();const h=utils.detectInit(e);h&&(directiveSanitizer(h),addDirective(h));const d=getConfig$1();log$1.debug(d),e.length>((a=d==null?void 0:d.maxTextSize)!=null?a:5e4)&&(e=MAX_TEXTLENGTH_EXCEEDED_MSG),e=e.replace(/\r\n?/g,`
`);const p="#"+t,g="i"+t,m="#"+g,T="d"+t,I="#"+T;let A=select("body");const C=d.securityLevel===SECURITY_LVL_SANDBOX,L=d.securityLevel===SECURITY_LVL_LOOSE,M=d.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=""),C){const Tt=sandboxedIframe(select(n),g);A=select(Tt.nodes()[0].contentDocument.body),A.node().style.margin=0}else A=select(n);appendDivSvgG(A,t,T,`font-family: ${M}`,XMLNS_XLINK_STD)}else{if(removeExistingElements(document,t,T,g),C){const Tt=sandboxedIframe(select("body"),g);A=select(Tt.nodes()[0].contentDocument.body),A.node().style.margin=0}else A=select("body");appendDivSvgG(A,t,T)}e=encodeEntities(e);let F,H;try{if(F=getDiagramFromText(e),"then"in F)throw new Error("Diagram is a promise. Use renderAsync.")}catch(Tt){F=new Diagram$1("error"),H=Tt}const q=A.select(I).node(),U=F.type,z=q.firstChild,R=z.firstChild,$=CLASSDEF_DIAGRAMS.includes(U)?F.renderer.getClasses(e,F):{},D=createUserStyles(d,U,$,p),k=document.createElement("style");k.innerHTML=D,z.insertBefore(k,R);try{F.renderer.draw(e,t,pkg.version,F)}catch(Tt){throw errorRenderer.draw(e,t,pkg.version),Tt}const B=A.select(`${I} svg`),v=(o=(s=F.db).getAccTitle)==null?void 0:o.call(s),J=(u=(l=F.db).getAccDescription)==null?void 0:u.call(l);addA11yInfo(U,B,v,J),A.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",XMLNS_XHTML_STD);let E=A.select(I).node().innerHTML;if(log$1.debug("config.arrowMarkerAbsolute",d.arrowMarkerAbsolute),E=cleanUpSvgCode(E,C,evaluate(d.arrowMarkerAbsolute)),C){const Tt=A.select(I+" svg").node();E=putIntoIFrame(E,Tt)}else L||(E=purify.sanitize(E,{ADD_TAGS:DOMPURIFY_TAGS,ADD_ATTR:DOMPURIFY_ATTR}));if(r!==void 0)switch(U){case"flowchart":case"flowchart-v2":r(E,flowDb.bindFunctions);break;case"gantt":r(E,ganttDb.bindFunctions);break;case"class":case"classDiagram":r(E,classDb.bindFunctions);break;default:r(E)}else log$1.debug("CB = undefined!");attachFunctions();const Lt=select(C?m:I).node();if(Lt&&"remove"in Lt&&Lt.remove(),H)throw H;return E},renderAsync$1=async function(t,e,r,n){var a,s,o,l,u;addDiagrams(),reset();const h=utils.detectInit(e);h&&(directiveSanitizer(h),addDirective(h));const d=getConfig$1();log$1.debug(d),e.length>((a=d==null?void 0:d.maxTextSize)!=null?a:5e4)&&(e=MAX_TEXTLENGTH_EXCEEDED_MSG),e=e.replace(/\r\n?/g,`
`);const p="#"+t,g="i"+t,m="#"+g,T="d"+t,I="#"+T;let A=select("body");const C=d.securityLevel===SECURITY_LVL_SANDBOX,L=d.securityLevel===SECURITY_LVL_LOOSE,M=d.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=""),C){const Tt=sandboxedIframe(select(n),g);A=select(Tt.nodes()[0].contentDocument.body),A.node().style.margin=0}else A=select(n);appendDivSvgG(A,t,T,`font-family: ${M}`,XMLNS_XLINK_STD)}else{if(removeExistingElements(document,t,T,g),C){const Tt=sandboxedIframe(select("body"),g);A=select(Tt.nodes()[0].contentDocument.body),A.node().style.margin=0}else A=select("body");appendDivSvgG(A,t,T)}e=encodeEntities(e);let F,H;try{F=await getDiagramFromText(e)}catch(Tt){F=new Diagram$1("error"),H=Tt}const q=A.select(I).node(),U=F.type,z=q.firstChild,R=z.firstChild,$=CLASSDEF_DIAGRAMS.includes(U)?F.renderer.getClasses(e,F):{},D=createUserStyles(d,U,$,p),k=document.createElement("style");k.innerHTML=D,z.insertBefore(k,R);try{await F.renderer.draw(e,t,pkg.version,F)}catch(Tt){throw errorRenderer.draw(e,t,pkg.version),Tt}const B=A.select(`${I} svg`),v=(o=(s=F.db).getAccTitle)==null?void 0:o.call(s),J=(u=(l=F.db).getAccDescription)==null?void 0:u.call(l);addA11yInfo(U,B,v,J),A.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",XMLNS_XHTML_STD);let E=A.select(I).node().innerHTML;if(log$1.debug("config.arrowMarkerAbsolute",d.arrowMarkerAbsolute),E=cleanUpSvgCode(E,C,evaluate(d.arrowMarkerAbsolute)),C){const Tt=A.select(I+" svg").node();E=putIntoIFrame(E,Tt)}else L||(E=purify.sanitize(E,{ADD_TAGS:DOMPURIFY_TAGS,ADD_ATTR:DOMPURIFY_ATTR}));if(r!==void 0)switch(U){case"flowchart":case"flowchart-v2":r(E,flowDb.bindFunctions);break;case"gantt":r(E,ganttDb.bindFunctions);break;case"class":case"classDiagram":r(E,classDb.bindFunctions);break;default:r(E)}else log$1.debug("CB = undefined!");attachFunctions();const Lt=select(C?m:I).node();if(Lt&&"remove"in Lt&&Lt.remove(),H)throw H;return E};let currentDirective={};const parseDirective=function(t,e,r,n){try{if(e!==void 0)switch(e=e.trim(),r){case"open_directive":currentDirective={};break;case"type_directive":if(!currentDirective)throw new Error("currentDirective is undefined");currentDirective.type=e.toLowerCase();break;case"arg_directive":if(!currentDirective)throw new Error("currentDirective is undefined");currentDirective.args=JSON.parse(e);break;case"close_directive":handleDirective(t,currentDirective,n),currentDirective=void 0;break}}catch(a){log$1.error(`Error while rendering sequenceDiagram directive: ${e} jison context: ${r}`),log$1.error(a.message)}},handleDirective=function(t,e,r){switch(log$1.debug(`Directive type=${e.type} with args:`,e.args),e.type){case"init":case"initialize":{["config"].forEach(n=>{e.args[n]!==void 0&&(r==="flowchart-v2"&&(r="flowchart"),e.args[r]=e.args[n],delete e.args[n])}),log$1.debug("sanitize in handleDirective",e.args),directiveSanitizer(e.args),log$1.debug("sanitize in handleDirective (done)",e.args),addDirective(e.args);break}case"wrap":case"nowrap":t&&t.setWrap&&t.setWrap(e.type==="wrap");break;case"themeCss":log$1.warn("themeCss encountered");break;default:log$1.warn(`Unhandled directive: source: '%%{${e.type}: ${JSON.stringify(e.args?e.args:{})}}%%`,e);break}};function initialize$1(t={}){var e;t!=null&&t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={fontFamily:t.fontFamily}),saveConfigFromInitialize(t),t!=null&&t.theme&&t.theme in theme?t.themeVariables=theme[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=theme.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?setSiteConfig(t):getSiteConfig();setLogLevel$1(r.logLevel),addDiagrams()}function addA11yInfo(t,e,r,n){setA11yDiagramInfo(e,t),addSVGa11yTitleDescription(e,r,n,e.attr("id"))}const mermaidAPI=Object.freeze({render:render$2,renderAsync:renderAsync$1,parse:parse$1,parseAsync:parseAsync$1,parseDirective,initialize:initialize$1,getConfig:getConfig$1,setConfig,getSiteConfig,updateSiteConfig,reset:()=>{reset()},globalReset:()=>{reset(defaultConfig)},defaultConfig});setLogLevel$1(getConfig$1().logLevel);reset(getConfig$1());let externalDiagramsRegistered=!1;const init$1=async function(t,e,r){try{externalDiagramsRegistered?await initThrowsErrorsAsync(t,e,r):initThrowsErrors(t,e,r)}catch(n){log$1.warn("Syntax Error rendering"),isDetailedError(n)&&log$1.warn(n.str),mermaid.parseError&&mermaid.parseError(n)}},handleError=(t,e,r)=>{log$1.warn(t),isDetailedError(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},initThrowsErrors=function(t,e,r){const n=mermaidAPI.getConfig();t&&(mermaid.sequenceConfig=t),log$1.debug(`${r?"":"No "}Callback function found`);let a;if(e===void 0)a=document.querySelectorAll(".mermaid");else if(typeof e=="string")a=document.querySelectorAll(e);else if(e instanceof HTMLElement)a=[e];else if(e instanceof NodeList)a=e;else throw new Error("Invalid argument nodes for mermaid.init");log$1.debug(`Found ${a.length} diagrams`),(t==null?void 0:t.startOnLoad)!==void 0&&(log$1.debug("Start On Load: "+(t==null?void 0:t.startOnLoad)),mermaidAPI.updateSiteConfig({startOnLoad:t==null?void 0:t.startOnLoad}));const s=new utils.initIdGenerator(n.deterministicIds,n.deterministicIDSeed);let o;const l=[];for(const u of Array.from(a)){log$1.info("Rendering diagram: "+u.id);if(u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");const h=`mermaid-${s.next()}`;o=u.innerHTML,o=utils.entityDecode(o).trim().replace(/<br\s*\/?>/gi,"<br/>");const d=utils.detectInit(o);d&&log$1.debug("Detected early reinit: ",d);try{mermaidAPI.render(h,o,(p,g)=>{u.innerHTML=p,r!==void 0&&r(h),g&&g(u)},u)}catch(p){handleError(p,l,mermaid.parseError)}}if(l.length>0)throw l[0]},registerLazyLoadedDiagrams=t=>{for(const{id:e,detector:r,loader:n}of t)addDetector(e,r,n)},loadExternalDiagrams=async t=>{log$1.debug(`Loading ${t.length} external diagrams`);const r=(await Promise.allSettled(t.map(async({id:n,detector:a,loader:s})=>{const{diagram:o}=await s();registerDiagram(n,o,a)}))).filter(n=>n.status==="rejected");if(r.length>0){log$1.error(`Failed to load ${r.length} external diagrams`);for(const n of r)log$1.error(n);throw new Error(`Failed to load ${r.length} external diagrams`)}},initThrowsErrorsAsync=async function(t,e,r){const n=mermaidAPI.getConfig();t&&(mermaid.sequenceConfig=t),log$1.debug(`${r?"":"No "}Callback function found`);let a;if(e===void 0)a=document.querySelectorAll(".mermaid");else if(typeof e=="string")a=document.querySelectorAll(e);else if(e instanceof HTMLElement)a=[e];else if(e instanceof NodeList)a=e;else throw new Error("Invalid argument nodes for mermaid.init");log$1.debug(`Found ${a.length} diagrams`),(t==null?void 0:t.startOnLoad)!==void 0&&(log$1.debug("Start On Load: "+(t==null?void 0:t.startOnLoad)),mermaidAPI.updateSiteConfig({startOnLoad:t==null?void 0:t.startOnLoad}));const s=new utils.initIdGenerator(n.deterministicIds,n.deterministicIDSeed);let o;const l=[];for(const u of Array.from(a)){log$1.info("Rendering diagram: "+u.id);if(u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");const h=`mermaid-${s.next()}`;o=u.innerHTML,o=utils.entityDecode(o).trim().replace(/<br\s*\/?>/gi,"<br/>");const d=utils.detectInit(o);d&&log$1.debug("Detected early reinit: ",d);try{await mermaidAPI.renderAsync(h,o,(p,g)=>{u.innerHTML=p,r!==void 0&&r(h),g&&g(u)},u)}catch(p){handleError(p,l,mermaid.parseError)}}if(l.length>0)throw l[0]},initialize$2=function(t){mermaidAPI.initialize(t)},registerExternalDiagrams=async(t,{lazyLoad:e=!0}={})=>{e?registerLazyLoadedDiagrams(t):await loadExternalDiagrams(t),externalDiagramsRegistered=!0},contentLoaded=function(){if(mermaid.startOnLoad){const{startOnLoad:t}=mermaidAPI.getConfig();t&&mermaid.init()}};if(typeof document<"u"){window.addEventListener("load",contentLoaded,!1)}const setParseErrorHandler=function(t){mermaid.parseError=t},parse$2=t=>mermaidAPI.parse(t,mermaid.parseError),executionQueue=[];let executionQueueRunning=!1;const executeQueue=async()=>{if(!executionQueueRunning){for(executionQueueRunning=!0;executionQueue.length>0;){const t=executionQueue.shift();if(t)try{await t()}catch(e){log$1.error("Error executing queue",e)}}executionQueueRunning=!1}},parseAsync=t=>new Promise((e,r)=>{const n=()=>new Promise((a,s)=>{mermaidAPI.parseAsync(t,mermaid.parseError).then(o=>{a(o),e(o)},o=>{log$1.error("Error parsing",o),s(o),r(o)})});executionQueue.push(n),executeQueue()}),renderAsync=(t,e,r,n)=>new Promise((a,s)=>{const o=()=>new Promise((l,u)=>{mermaidAPI.renderAsync(t,e,r,n).then(h=>{l(h),a(h)},h=>{log$1.error("Error parsing",h),u(h),s(h)})});executionQueue.push(o),executeQueue()}),mermaid={startOnLoad:!0,diagrams:{},mermaidAPI,parse:parse$2,parseAsync,render:mermaidAPI.render,renderAsync,init:init$1,initThrowsErrors,initThrowsErrorsAsync,registerExternalDiagrams,initialize:initialize$2,parseError:void 0,contentLoaded,setParseErrorHandler},id="mindmap",detector=t=>t.match(/^\s*mindmap/)!==null,loader=async()=>{const{diagram:t}=await __vitePreload(()=>import("./diagram-definition.ae1f7a29-23a9d443.js"),["./diagram-definition.ae1f7a29-23a9d443.js","./darken-e9b93bc2.js","./_commonjsHelpers-35101cd5.js"],import.meta.url);return{id,diagram:t}},plugin={id,detector,loader},initialize=mermaid.registerExternalDiagrams([plugin]),init=async()=>{await initialize},render=async(t,e,r,n)=>{mermaid.initialize(t),await init(),await mermaid.mermaidAPI.renderAsync(r,e,n)},parse=async t=>(await init(),await mermaid.parseAsync(t)),loadStateFromURL=()=>{loadState(window.location.hash.slice(1))},syncDiagram=()=>{updateCodeStore({updateDiagram:!0})},initHandler=async()=>{applyMigrations(),await initLoading("Loading Mermaid...",init()),loadStateFromURL(),await initLoading("Loading Gist...",loadDataFromUrl().catch(console.error)),syncDiagram(),initURLSubscription(),await initAnalytics(),await(analytics==null?void 0:analytics.page())},isMac=navigator.platform.toUpperCase().includes("MAC"),cmdKey=isMac?"Cmd":"Ctrl";let count=0;const errorDebug=(t=100)=>{if(count+=1,count>t){console.log(count,t);debugger}},formatJSON=t=>JSON.stringify(t,void 0,2),fetchJSON=async t=>(await fetch(t)).json(),fetchText=async t=>(await fetch(t)).text(),defaultState={code:`flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
`,mermaid:formatJSON({theme:"default"}),autoSync:!0,updateDiagram:!0},urlParseFailedState=`flowchart TD
A[Loading URL failed. We can try to figure out why.] -->|Decode JSON| B(Please check the console to see the JSON and error details.)
B --> C{Is the JSON correct?}
C -->|Yes| D(Please Click here to Raise an issue in github.<br/>Including the broken link in the issue <br/> will speed up the fix.)
C -->|No| E{Did someone <br/>send you this link?}
E -->|Yes| F[Ask them to send <br/>you the complete link]
E -->|No| G{Did you copy <br/> the complete URL?}
G --> |Yes| D
G --> |"No :("| H(Try using the Timeline tab in History <br/>from same browser you used to create the diagram.)
click D href "https://github.com/mermaid-js/mermaid-live-editor/issues/new?assignees=&labels=bug&template=bug_report.md&title=Broken%20link" "Raise issue"`,inputStateStore=persist(writable(defaultState),localStorage(),"codeStore"),currentState=(()=>{const t=get_store_value(inputStateStore);return{...t,serialized:serializeState(t),errorMarkers:[],error:void 0,editorMode:t.editorMode??"code"}})(),processState=async t=>{const e={...t,serialized:"",errorMarkers:[],error:void 0,editorMode:t.editorMode??"code"};try{e.serialized=serializeState(t),await parse(t.code),JSON.parse(t.mermaid)}catch(r){if(e.error=r,errorDebug(),console.error(r),"hash"in r)try{const{loc:{first_line:n,last_line:a,first_column:s,last_column:o}}=r.hash,l={severity:8,startLineNumber:n,startColumn:s,endLineNumber:a,endColumn:o+1,message:r.str};e.errorMarkers=[l]}catch(n){console.error("Error without line helper",n)}}return e},stateStore=derived([inputStateStore],([t],e)=>{processState(t).then(e)},currentState),loadState=t=>{let e;console.log(`Loading '${t}'`);try{e=deserializeState(t);const r=typeof e.mermaid=="string"?JSON.parse(e.mermaid):e.mermaid;r.securityLevel&&r.securityLevel!=="strict"&&confirm(`Removing "securityLevel":"${r.securityLevel}" from the config for safety.
Click Cancel if you trust the source of this Diagram.`)&&delete r.securityLevel,e.mermaid=formatJSON(r)}catch(r){e=get_store_value(inputStateStore),t&&(console.error("Init error",r),e.code=urlParseFailedState,e.mermaid=defaultState.mermaid)}updateCodeStore(e)},updateCodeStore=t=>{inputStateStore.update(e=>({...e,...t}))};let prompted=!1;const updateCode=(t,{updateDiagram:e=!1,resetPanZoom:r=!1}={})=>{console.log("updateCode",t);const n=countLines(t);if(saveStatistics(t),errorDebug(),n>50&&!prompted&&get_store_value(stateStore).autoSync){const a=confirm(`Long diagram detected. Turn off Auto Sync? Use ${cmdKey} + Enter or click the sync logo to manually sync.`);prompted=!0,a&&updateCodeStore({autoSync:!1})}inputStateStore.update(a=>(r&&(a.pan=void 0,a.zoom=void 0),{...a,code:t,updateDiagram:e}))},updateConfig=t=>{console.log("updateConfig",t),inputStateStore.update(e=>({...e,mermaid:t}))},toggleDarkTheme=t=>{inputStateStore.update(e=>{const r=JSON.parse(e.mermaid);return(!r.theme||["dark","default"].includes(r.theme))&&(r.theme=t?"dark":"default"),{...e,mermaid:formatJSON(r)}})};let urlDebounce;const initURLSubscription=()=>{stateStore.subscribe(({serialized:t})=>{clearTimeout(urlDebounce),urlDebounce=window.setTimeout(()=>{history.replaceState(void 0,"",`#${t}`)},250)})},getStateString=()=>JSON.stringify(get_store_value(inputStateStore));export{localStorage as a,logEvent as b,syncDiagram as c,updateConfig as d,errorDebug as e,analytics as f,pakoSerde as g,encode as h,initHandler as i,inputStateStore as j,historyStore as k,loadingStateStore as l,historyModeStore as m,loaderHistoryStore as n,getStateString as o,persist as p,getPreviousState as q,restoreHistory as r,stateStore as s,toggleDarkTheme as t,updateCode as u,addHistoryEntry as v,clearHistoryData as w,updateCodeStore as x,cmdKey as y,render as z};