import{b as fr,e as re,m as mr}from"./chunk-GO66RM32.mjs";import{$ as ur,H as Ue,K as We,L as Ge,M as Ke,N as qe,O as Ve,P as Xe,Q as Qe,R as Je,S as Ze,T as er,U as rr,V as nr,W as ir,X as tr,Y as or,Z as lr,_ as ar,a as l,aa as cr,c as Kn,e as qn,g as x,h as Ye,ia as sr,ka as Ce,m as ze,ra as pr,sa as hr,va as dr}from"./chunk-3OFI44Y5.mjs";var an=Kn(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.sanitizeUrl=void 0;var yo=/^([^\w]*)(javascript|data|vbscript)/im,Co=/&#(\w+)(^\w|;)?/g,Ao=/&tab;/gi,bo=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,_o=/^.+(:|:)/gim,wo=[".","/"];function So(e){return wo.indexOf(e[0])>-1}l(So,"isRelativeUrlWithoutProtocol");function Eo(e){return e=e.replace(Ao," "),e.replace(Co,function(r,n){return String.fromCharCode(n)})}l(Eo,"decodeHtmlCharacters");function Fo(e){var r=Eo(e||"").replace(bo,"").trim();if(!r)return"about:blank";if(So(r))return r;var n=r.match(_o);if(!n)return r;var i=n[0];return yo.test(i)?"about:blank":r}l(Fo,"sanitizeUrl");ce.sanitizeUrl=Fo});function Lr(e){return typeof e>"u"||e===null}l(Lr,"isNothing");function Vn(e){return typeof e=="object"&&e!==null}l(Vn,"isObject");function Xn(e){return Array.isArray(e)?e:Lr(e)?[]:[e]}l(Xn,"toArray");function Qn(e,r){var n,i,t,a;if(r)for(a=Object.keys(r),n=0,i=a.length;nu&&(a=" ... ",r=i-u+a.length),n-i>u&&(o=" ...",n=i+u-o.length),{str:a+e.slice(r,n).replace(/\t/g,"\u2192")+o,pos:i-r+a.length}}l(Ae,"getLine");function be(e,r){return b.repeat(" ",r-e.length)+e}l(be,"padStart");function li(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],t=[],a,o=-1;a=n.exec(e.buffer);)t.push(a.index),i.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var u="",c,f,p=Math.min(e.line+r.linesAfter,t.length).toString().length,s=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(o-c<0);c++)f=Ae(e.buffer,i[o-c],t[o-c],e.position-(i[o]-i[o-c]),s),u=b.repeat(" ",r.indent)+be((e.line-c+1).toString(),p)+" | "+f.str+` `+u;for(f=Ae(e.buffer,i[o],t[o],e.position,s),u+=b.repeat(" ",r.indent)+be((e.line+1).toString(),p)+" | "+f.str+` `,u+=b.repeat("-",r.indent+p+3+f.pos)+`^ `,c=1;c<=r.linesAfter&&!(o+c>=t.length);c++)f=Ae(e.buffer,i[o+c],t[o+c],e.position-(i[o]-i[o+c]),s),u+=b.repeat(" ",r.indent)+be((e.line+c+1).toString(),p)+" | "+f.str+` `;return u.replace(/\n$/,"")}l(li,"makeSnippet");var ai=li,ui=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ci=["scalar","sequence","mapping"];function fi(e){var r={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){r[String(i)]=n})}),r}l(fi,"compileStyleAliases");function si(e,r){if(r=r||{},Object.keys(r).forEach(function(n){if(ui.indexOf(n)===-1)throw new E('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(n){return n},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=fi(r.styleAliases||null),ci.indexOf(this.kind)===-1)throw new E('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}l(si,"Type$1");var _=si;function gr(e,r){var n=[];return e[r].forEach(function(i){var t=n.length;n.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&a.multi===i.multi&&(t=o)}),n[t]=i}),n}l(gr,"compileList");function pi(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,n;function i(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(l(i,"collectType"),r=0,n=arguments.length;r=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ii=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Mi(e){return!(e===null||!Ii.test(e)||e[e.length-1]==="_")}l(Mi,"resolveYamlFloat");function Ni(e){var r,n;return r=e.replace(/_/g,"").toLowerCase(),n=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:n*parseFloat(r,10)}l(Ni,"constructYamlFloat");var Ri=/^[-+]?[0-9]+e/;function ki(e,r){var n;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(b.isNegativeZero(e))return"-0.0";return n=e.toString(10),Ri.test(n)?n.replace("e",".e"):n}l(ki,"representYamlFloat");function Pi(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||b.isNegativeZero(e))}l(Pi,"isFloat");var ji=new _("tag:yaml.org,2002:float",{kind:"scalar",resolve:Mi,construct:Ni,predicate:Pi,represent:ki,defaultStyle:"lowercase"}),Bi=Mr.extend({implicit:[Ci,wi,Li,ji]}),$i=Bi,Nr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Rr=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 Hi(e){return e===null?!1:Nr.exec(e)!==null||Rr.exec(e)!==null}l(Hi,"resolveYamlTimestamp");function Yi(e){var r,n,i,t,a,o,u,c=0,f=null,p,s,h;if(r=Nr.exec(e),r===null&&(r=Rr.exec(e)),r===null)throw new Error("Date resolve error");if(n=+r[1],i=+r[2]-1,t=+r[3],!r[4])return new Date(Date.UTC(n,i,t));if(a=+r[4],o=+r[5],u=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(p=+r[10],s=+(r[11]||0),f=(p*60+s)*6e4,r[9]==="-"&&(f=-f)),h=new Date(Date.UTC(n,i,t,a,o,u,c)),f&&h.setTime(h.getTime()-f),h}l(Yi,"constructYamlTimestamp");function zi(e){return e.toISOString()}l(zi,"representYamlTimestamp");var Ui=new _("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Hi,construct:Yi,instanceOf:Date,represent:zi});function Wi(e){return e==="<<"||e===null}l(Wi,"resolveYamlMerge");var Gi=new _("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Wi}),Oe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function Ki(e){if(e===null)return!1;var r,n,i=0,t=e.length,a=Oe;for(n=0;n64)){if(r<0)return!1;i+=6}return i%8===0}l(Ki,"resolveYamlBinary");function qi(e){var r,n,i=e.replace(/[\r\n=]/g,""),t=i.length,a=Oe,o=0,u=[];for(r=0;r>16&255),u.push(o>>8&255),u.push(o&255)),o=o<<6|a.indexOf(i.charAt(r));return n=t%4*6,n===0?(u.push(o>>16&255),u.push(o>>8&255),u.push(o&255)):n===18?(u.push(o>>10&255),u.push(o>>2&255)):n===12&&u.push(o>>4&255),new Uint8Array(u)}l(qi,"constructYamlBinary");function Vi(e){var r="",n=0,i,t,a=e.length,o=Oe;for(i=0;i>18&63],r+=o[n>>12&63],r+=o[n>>6&63],r+=o[n&63]),n=(n<<8)+e[i];return t=a%3,t===0?(r+=o[n>>18&63],r+=o[n>>12&63],r+=o[n>>6&63],r+=o[n&63]):t===2?(r+=o[n>>10&63],r+=o[n>>4&63],r+=o[n<<2&63],r+=o[64]):t===1&&(r+=o[n>>2&63],r+=o[n<<4&63],r+=o[64],r+=o[64]),r}l(Vi,"representYamlBinary");function Xi(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}l(Xi,"isBinary");var Qi=new _("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ki,construct:qi,predicate:Xi,represent:Vi}),Ji=Object.prototype.hasOwnProperty,Zi=Object.prototype.toString;function et(e){if(e===null)return!0;var r=[],n,i,t,a,o,u=e;for(n=0,i=u.length;n>10)+55296,(e-65536&1023)+56320)}l(vt,"charFromCodepoint");var Hr=new Array(256),Yr=new Array(256);for(R=0;R<256;R++)Hr[R]=yr(R)?1:0,Yr[R]=yr(R);var R;function yt(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||kr,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}l(yt,"State$1");function zr(e,r){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=ai(n),new E(r,n)}l(zr,"generateError");function m(e,r){throw zr(e,r)}l(m,"throwError");function te(e,r){e.onWarning&&e.onWarning.call(null,zr(e,r))}l(te,"throwWarning");var Cr={YAML:l(function(r,n,i){var t,a,o;r.version!==null&&m(r,"duplication of %YAML directive"),i.length!==1&&m(r,"YAML directive accepts exactly one argument"),t=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),t===null&&m(r,"ill-formed argument of the YAML directive"),a=parseInt(t[1],10),o=parseInt(t[2],10),a!==1&&m(r,"unacceptable YAML version of the document"),r.version=i[0],r.checkLineBreaks=o<2,o!==1&&o!==2&&te(r,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:l(function(r,n,i){var t,a;i.length!==2&&m(r,"TAG directive accepts exactly two arguments"),t=i[0],a=i[1],Br.test(t)||m(r,"ill-formed tag handle (first argument) of the TAG directive"),I.call(r.tagMap,t)&&m(r,'there is a previously declared suffix for "'+t+'" tag handle'),$r.test(a)||m(r,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{m(r,"tag prefix is malformed: "+a)}r.tagMap[t]=a},"handleTagDirective")};function L(e,r,n,i){var t,a,o,u;if(r1&&(e.result+=b.repeat(` `,r-1))}l(Le,"writeFoldedLines");function Ct(e,r,n){var i,t,a,o,u,c,f,p,s=e.kind,h=e.result,d;if(d=e.input.charCodeAt(e.position),F(d)||B(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(t=e.input.charCodeAt(e.position+1),F(t)||n&&B(t)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,u=!1;d!==0;){if(d===58){if(t=e.input.charCodeAt(e.position+1),F(t)||n&&B(t))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),F(i))break}else{if(e.position===e.lineStart&&ae(e)||n&&B(d))break;if(T(d))if(c=e.line,f=e.lineStart,p=e.lineIndent,A(e,!1,-1),e.lineIndent>=r){u=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=f,e.lineIndent=p;break}}u&&(L(e,a,o,!1),Le(e,e.line-c),a=o=e.position,u=!1),k(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return L(e,a,o,!1),e.result?!0:(e.kind=s,e.result=h,!1)}l(Ct,"readPlainScalar");function At(e,r){var n,i,t;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=t=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(L(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,t=e.position;else return!0;else T(n)?(L(e,i,t,!0),Le(e,A(e,!1,r)),i=t=e.position):e.position===e.lineStart&&ae(e)?m(e,"unexpected end of the document within a single quoted scalar"):(e.position++,t=e.position);m(e,"unexpected end of the stream within a single quoted scalar")}l(At,"readSingleQuotedScalar");function bt(e,r){var n,i,t,a,o,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return L(e,n,e.position,!0),e.position++,!0;if(u===92){if(L(e,n,e.position,!0),u=e.input.charCodeAt(++e.position),T(u))A(e,!1,r);else if(u<256&&Hr[u])e.result+=Yr[u],e.position++;else if((o=gt(u))>0){for(t=o,a=0;t>0;t--)u=e.input.charCodeAt(++e.position),(o=mt(u))>=0?a=(a<<4)+o:m(e,"expected hexadecimal character");e.result+=vt(a),e.position++}else m(e,"unknown escape sequence");n=i=e.position}else T(u)?(L(e,n,i,!0),Le(e,A(e,!1,r)),n=i=e.position):e.position===e.lineStart&&ae(e)?m(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}m(e,"unexpected end of the stream within a double quoted scalar")}l(bt,"readDoubleQuotedScalar");function _t(e,r){var n=!0,i,t,a,o=e.tag,u,c=e.anchor,f,p,s,h,d,g=Object.create(null),y,C,S,v;if(v=e.input.charCodeAt(e.position),v===91)p=93,d=!1,u=[];else if(v===123)p=125,d=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),v=e.input.charCodeAt(++e.position);v!==0;){if(A(e,!0,r),v=e.input.charCodeAt(e.position),v===p)return e.position++,e.tag=o,e.anchor=c,e.kind=d?"mapping":"sequence",e.result=u,!0;n?v===44&&m(e,"expected the node content, but found ','"):m(e,"missed comma between flow collection entries"),C=y=S=null,s=h=!1,v===63&&(f=e.input.charCodeAt(e.position+1),F(f)&&(s=h=!0,e.position++,A(e,!0,r))),i=e.line,t=e.lineStart,a=e.position,H(e,r,ne,!1,!0),C=e.tag,y=e.result,A(e,!0,r),v=e.input.charCodeAt(e.position),(h||e.line===i)&&v===58&&(s=!0,v=e.input.charCodeAt(++e.position),A(e,!0,r),H(e,r,ne,!1,!0),S=e.result),d?$(e,u,g,C,y,S,i,t,a):s?u.push($(e,null,g,C,y,S,i,t,a)):u.push(y),A(e,!0,r),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}m(e,"unexpected end of the stream within a flow collection")}l(_t,"readFlowCollection");function wt(e,r){var n,i,t=_e,a=!1,o=!1,u=r,c=0,f=!1,p,s;if(s=e.input.charCodeAt(e.position),s===124)i=!1;else if(s===62)i=!0;else return!1;for(e.kind="scalar",e.result="";s!==0;)if(s=e.input.charCodeAt(++e.position),s===43||s===45)_e===t?t=s===43?xr:st:m(e,"repeat of a chomping mode identifier");else if((p=xt(s))>=0)p===0?m(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?m(e,"repeat of an indentation width identifier"):(u=r+p-1,o=!0);else break;if(k(s)){do s=e.input.charCodeAt(++e.position);while(k(s));if(s===35)do s=e.input.charCodeAt(++e.position);while(!T(s)&&s!==0)}for(;s!==0;){for(De(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!o||e.lineIndentu&&(u=e.lineIndent),T(s)){c++;continue}if(e.lineIndentr)&&c!==0)m(e,"bad indentation of a sequence entry");else if(e.lineIndentr)&&(C&&(o=e.line,u=e.lineStart,c=e.position),H(e,r,ie,!0,t)&&(C?g=e.result:y=e.result),C||($(e,s,h,d,g,y,o,u,c),d=g=y=null),A(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>r)&&v!==0)m(e,"bad indentation of a mapping entry");else if(e.lineIndentr?c=1:e.lineIndent===r?c=0:e.lineIndentr?c=1:e.lineIndent===r?c=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),s=0,h=e.implicitTypes.length;s"),e.result!==null&&g.kind!==e.kind&&m(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}l(H,"composeNode");function Ot(e){var r=e.position,n,i,t,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(A(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!F(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),t=[],i.length<1&&m(e,"directive name must not be less than one character in length");o!==0;){for(;k(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!T(o));break}if(T(o))break;for(n=e.position;o!==0&&!F(o);)o=e.input.charCodeAt(++e.position);t.push(e.input.slice(n,e.position))}o!==0&&De(e),I.call(Cr,i)?Cr[i](e,i,t):te(e,'unknown document directive "'+i+'"')}if(A(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,A(e,!0,-1)):a&&m(e,"directives end mark is expected"),H(e,e.lineIndent-1,ie,!1,!0),A(e,!0,-1),e.checkLineBreaks&&ht.test(e.input.slice(r,e.position))&&te(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ae(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,A(e,!0,-1));return}if(e.position"u"&&(n=r,r=null);var i=Ur(e,n);if(typeof r!="function")return i;for(var t=0,a=i.length;t=55296&&n<=56319&&r+1=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}l(V,"codePointAt");function Zr(e){var r=/^\n* /;return r.test(e)}l(Zr,"needIndentIndicator");var en=1,Fe=2,rn=3,nn=4,j=5;function oo(e,r,n,i,t,a,o,u){var c,f=0,p=null,s=!1,h=!1,d=i!==-1,g=-1,y=io(V(e,0))&&to(V(e,e.length-1));if(r||o)for(c=0;c=65536?c+=2:c++){if(f=V(e,c),!Z(f))return j;y=y&&Sr(f,p,u),p=f}else{for(c=0;c=65536?c+=2:c++){if(f=V(e,c),f===Q)s=!0,d&&(h=h||c-g-1>i&&e[g+1]!==" ",g=c);else if(!Z(f))return j;y=y&&Sr(f,p,u),p=f}h=h||d&&c-g-1>i&&e[g+1]!==" "}return!s&&!h?y&&!o&&!t(e)?en:a===J?j:Fe:n>9&&Zr(e)?j:o?a===J?j:Fe:h?nn:rn}l(oo,"chooseScalarStyle");function lo(e,r,n,i,t){e.dump=function(){if(r.length===0)return e.quotingType===J?'""':"''";if(!e.noCompatMode&&(Xt.indexOf(r)!==-1||Qt.test(r)))return e.quotingType===J?'"'+r+'"':"'"+r+"'";var a=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),u=i||e.flowLevel>-1&&n>=e.flowLevel;function c(f){return no(e,f)}switch(l(c,"testAmbiguity"),oo(r,u,e.indent,o,c,e.quotingType,e.forceQuotes&&!i,t)){case en:return r;case Fe:return"'"+r.replace(/'/g,"''")+"'";case rn:return"|"+Er(r,e.indent)+Fr(_r(r,a));case nn:return">"+Er(r,e.indent)+Fr(_r(ao(r,o),a));case j:return'"'+uo(r)+'"';default:throw new E("impossible error: invalid scalar style")}}()}l(lo,"writeScalar");function Er(e,r){var n=Zr(e)?String(r):"",i=e[e.length-1]===` `,t=i&&(e[e.length-2]===` `||e===` `),a=t?"+":i?"":"-";return n+a+` `}l(Er,"blockHeader");function Fr(e){return e[e.length-1]===` `?e.slice(0,-1):e}l(Fr,"dropEndingNewline");function ao(e,r){for(var n=/(\n+)([^\n]*)/g,i=function(){var f=e.indexOf(` `);return f=f!==-1?f:e.length,n.lastIndex=f,Tr(e.slice(0,f),r)}(),t=e[0]===` `||e[0]===" ",a,o;o=n.exec(e);){var u=o[1],c=o[2];a=c[0]===" ",i+=u+(!t&&!a&&c!==""?` `:"")+Tr(c,r),t=a}return i}l(ao,"foldString");function Tr(e,r){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,t=0,a,o=0,u=0,c="";i=n.exec(e);)u=i.index,u-t>r&&(a=o>t?o:u,c+=` `+e.slice(t,a),t=a+1),o=u;return c+=` `,e.length-t>r&&o>t?c+=e.slice(t,o)+` `+e.slice(o+1):c+=e.slice(t),c.slice(1)}l(Tr,"foldLine");function uo(e){for(var r="",n=0,i,t=0;t=65536?t+=2:t++)n=V(e,t),i=w[n],!i&&Z(n)?(r+=e[t],n>=65536&&(r+=e[t+1])):r+=i||Zt(n);return r}l(uo,"escapeString");function co(e,r,n){var i="",t=e.tag,a,o,u;for(a=0,o=n.length;a"u"&&O(e,r,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=t,e.dump="["+i+"]"}l(co,"writeFlowSequence");function Or(e,r,n,i){var t="",a=e.tag,o,u,c;for(o=0,u=n.length;o"u"&&O(e,r+1,null,!0,!0,!1,!0))&&((!i||t!=="")&&(t+=Ee(e,r)),e.dump&&Q===e.dump.charCodeAt(0)?t+="-":t+="- ",t+=e.dump);e.tag=a,e.dump=t||"[]"}l(Or,"writeBlockSequence");function fo(e,r,n){var i="",t=e.tag,a=Object.keys(n),o,u,c,f,p;for(o=0,u=a.length;o1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),O(e,r,f,!1,!1)&&(p+=e.dump,i+=p));e.tag=t,e.dump="{"+i+"}"}l(fo,"writeFlowMapping");function so(e,r,n,i){var t="",a=e.tag,o=Object.keys(n),u,c,f,p,s,h;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new E("sortKeys must be a boolean or a function");for(u=0,c=o.length;u1024,s&&(e.dump&&Q===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,s&&(h+=Ee(e,r)),O(e,r+1,p,!0,s)&&(e.dump&&Q===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,t+=h));e.tag=a,e.dump=t||"{}"}l(so,"writeBlockMapping");function Dr(e,r,n){var i,t,a,o,u,c;for(t=n?e.explicitTypes:e.implicitTypes,a=0,o=t.length;a tag resolver accepts not "'+c+'" style');e.dump=i}return!0}return!1}l(Dr,"detectType");function O(e,r,n,i,t,a,o){e.tag=null,e.dump=n,Dr(e,n,!1)||Dr(e,n,!0);var u=Gr.call(e.dump),c=i,f;i&&(i=e.flowLevel<0||e.flowLevel>r);var p=u==="[object Object]"||u==="[object Array]",s,h;if(p&&(s=e.duplicates.indexOf(n),h=s!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&r>0)&&(t=!1),h&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(p&&h&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),u==="[object Object]")i&&Object.keys(e.dump).length!==0?(so(e,r,e.dump,t),h&&(e.dump="&ref_"+s+e.dump)):(fo(e,r,e.dump),h&&(e.dump="&ref_"+s+" "+e.dump));else if(u==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?Or(e,r-1,e.dump,t):Or(e,r,e.dump,t),h&&(e.dump="&ref_"+s+e.dump)):(co(e,r,e.dump),h&&(e.dump="&ref_"+s+" "+e.dump));else if(u==="[object String]")e.tag!=="?"&&lo(e,e.dump,r,a,c);else{if(u==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new E("unacceptable kind of an object to dump "+u)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}l(O,"writeNode");function po(e,r){var n=[],i=[],t,a;for(Te(e,n,i),t=0,a=i.length;t{let i="";return e in ue&&ue[e]?i=ue[e](n):x.warn(`No theme found for ${e}`),` & { font-family: ${n.fontFamily}; font-size: ${n.fontSize}; fill: ${n.textColor} } /* Classes common for multiple diagrams */ & .error-icon { fill: ${n.errorBkgColor}; } & .error-text { fill: ${n.errorTextColor}; stroke: ${n.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: ${n.lineColor}; stroke: ${n.lineColor}; } & .marker.cross { stroke: ${n.lineColor}; } & svg { font-family: ${n.fontFamily}; font-size: ${n.fontSize}; } ${i} ${r} `},"getStyles"),ln=l((e,r)=>{r!==void 0&&(ue[e]=r)},"addStylesForDiagram"),Fa=vo;var Hn=qn(an(),1);var To=typeof global=="object"&&global&&global.Object===Object&&global,un=To;var Oo=typeof self=="object"&&self&&self.Object===Object&&self,Do=un||Oo||Function("return this")(),Y=Do;var Lo=Y.Symbol,z=Lo;var cn=Object.prototype,Io=cn.hasOwnProperty,Mo=cn.toString,ee=z?z.toStringTag:void 0;function No(e){var r=Io.call(e,ee),n=e[ee];try{e[ee]=void 0;var i=!0}catch{}var t=Mo.call(e);return i&&(r?e[ee]=n:delete e[ee]),t}l(No,"getRawTag");var fn=No;var Ro=Object.prototype,ko=Ro.toString;function Po(e){return ko.call(e)}l(Po,"objectToString");var sn=Po;var jo="[object Null]",Bo="[object Undefined]",pn=z?z.toStringTag:void 0;function $o(e){return e==null?e===void 0?Bo:jo:pn&&pn in Object(e)?fn(e):sn(e)}l($o,"baseGetTag");var hn=$o;function Ho(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}l(Ho,"isObject");var fe=Ho;var Yo="[object AsyncFunction]",zo="[object Function]",Uo="[object GeneratorFunction]",Wo="[object Proxy]";function Go(e){if(!fe(e))return!1;var r=hn(e);return r==zo||r==Uo||r==Yo||r==Wo}l(Go,"isFunction");var dn=Go;var Ko=Y["__core-js_shared__"],se=Ko;var mn=function(){var e=/[^.]+$/.exec(se&&se.keys&&se.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function qo(e){return!!mn&&mn in e}l(qo,"isMasked");var gn=qo;var Vo=Function.prototype,Xo=Vo.toString;function Qo(e){if(e!=null){try{return Xo.call(e)}catch{}try{return e+""}catch{}}return""}l(Qo,"toSource");var xn=Qo;var Jo=/[\\^$.*+?()[\]{}|]/g,Zo=/^\[object .+?Constructor\]$/,el=Function.prototype,rl=Object.prototype,nl=el.toString,il=rl.hasOwnProperty,tl=RegExp("^"+nl.call(il).replace(Jo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ol(e){if(!fe(e)||gn(e))return!1;var r=dn(e)?tl:Zo;return r.test(xn(e))}l(ol,"baseIsNative");var vn=ol;function ll(e,r){return e?.[r]}l(ll,"getValue");var yn=ll;function al(e,r){var n=yn(e,r);return vn(n)?n:void 0}l(al,"getNative");var pe=al;var ul=pe(Object,"create"),D=ul;function cl(){this.__data__=D?D(null):{},this.size=0}l(cl,"hashClear");var Cn=cl;function fl(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}l(fl,"hashDelete");var An=fl;var sl="__lodash_hash_undefined__",pl=Object.prototype,hl=pl.hasOwnProperty;function dl(e){var r=this.__data__;if(D){var n=r[e];return n===sl?void 0:n}return hl.call(r,e)?r[e]:void 0}l(dl,"hashGet");var bn=dl;var ml=Object.prototype,gl=ml.hasOwnProperty;function xl(e){var r=this.__data__;return D?r[e]!==void 0:gl.call(r,e)}l(xl,"hashHas");var _n=xl;var vl="__lodash_hash_undefined__";function yl(e,r){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=D&&r===void 0?vl:r,this}l(yl,"hashSet");var wn=yl;function U(e){var r=-1,n=e==null?0:e.length;for(this.clear();++r-1}l(Fl,"listCacheHas");var On=Fl;function Tl(e,r){var n=this.__data__,i=M(n,e);return i<0?(++this.size,n.push([e,r])):n[i][1]=r,this}l(Tl,"listCacheSet");var Dn=Tl;function W(e){var r=-1,n=e==null?0:e.length;for(this.clear();++ra.args);K(t),i=Ce(i,[...t])}else i=n.args;if(i){let t=$n(e,r);["config"].forEach(a=>{i[a]!==void 0&&(t==="flowchart-v2"&&(t="flowchart"),i[t]=i[a],delete i[a])})}return i},"detectInit"),Yn=l(function(e,r=null){try{let n=new RegExp(`[%]{2}(?![{]${$l.source})(?=[}][%]{2}).* `,"ig");e=e.trim().replace(n,"").replace(/'/gm,'"'),x.debug(`Detecting diagram directive${r!==null?" type:"+r:""} based on the text:${e}`);let i,t=[];for(;(i=je.exec(e))!==null;)if(i.index===je.lastIndex&&je.lastIndex++,i&&!r||r&&i[1]&&i[1].match(r)||r&&i[2]&&i[2].match(r)){let a=i[1]?i[1]:i[2],o=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;t.push({type:a,args:o})}return t.length===0&&t.push({type:e,args:null}),t.length===1?t[0]:t}catch(n){return x.error(`ERROR: ${n.message} - Unable to parse directive ${r!==null?" type:"+r:""} based on the text:${e}`),{type:null,args:null}}},"detectDirective"),Yl=l(function(e,r){for(let[n,i]of r.entries())if(i.match(e))return n;return-1},"isSubstringInArray");function zl(e,r){if(!e)return r;let n=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return Bl[n]||r}l(zl,"interpolateToCurve");function Ul(e,r){let n=e.trim();if(n)return r.securityLevel!=="loose"?(0,Hn.sanitizeUrl)(n):n}l(Ul,"formatUrl");var Wl=l((e,...r)=>{let n=e.split("."),i=n.length-1,t=n[i],a=window;for(let o=0;o{n+=ge(a,r),r=a});let i=n/2,t;return r=void 0,e.forEach(a=>{if(r&&!t){let o=ge(a,r);if(o=1&&(t={x:a.x,y:a.y}),u>0&&u<1&&(t={x:(1-u)*r.x+u*a.x,y:(1-u)*r.y+u*a.y})}}r=a}),t}l(Gl,"traverseEdge");function Kl(e){return e.length===1?e[0]:Gl(e)}l(Kl,"calcLabelPosition");var ql=l((e,r,n)=>{let i;x.info(`our points ${JSON.stringify(r)}`),r[0]!==n&&(r=r.reverse());let a=25,o;i=void 0,r.forEach(p=>{if(i&&!o){let s=ge(p,i);if(s=1&&(o={x:p.x,y:p.y}),h>0&&h<1&&(o={x:(1-h)*i.x+h*p.x,y:(1-h)*i.y+h*p.y})}}i=p});let u=e?10:5,c=Math.atan2(r[0].y-o.y,r[0].x-o.x),f={x:0,y:0};return f.x=Math.sin(c)*u+(r[0].x+o.x)/2,f.y=-Math.cos(c)*u+(r[0].y+o.y)/2,f},"calcCardinalityPosition");function Vl(e,r,n){let i=JSON.parse(JSON.stringify(n)),t;x.info("our points",i),r!=="start_left"&&r!=="start_right"&&(i=i.reverse()),i.forEach(s=>{t=s});let o=25+e,u;t=void 0,i.forEach(s=>{if(t&&!u){let h=ge(s,t);if(h=1&&(u={x:s.x,y:s.y}),d>0&&d<1&&(u={x:(1-d)*t.x+d*s.x,y:(1-d)*t.y+d*s.y})}}t=s});let c=10+e*.5,f=Math.atan2(i[0].y-u.y,i[0].x-u.x),p={x:0,y:0};return p.x=Math.sin(f)*c+(i[0].x+u.x)/2,p.y=-Math.cos(f)*c+(i[0].y+u.y)/2,r==="start_left"&&(p.x=Math.sin(f+Math.PI)*c+(i[0].x+u.x)/2,p.y=-Math.cos(f+Math.PI)*c+(i[0].y+u.y)/2),r==="end_right"&&(p.x=Math.sin(f-Math.PI)*c+(i[0].x+u.x)/2-5,p.y=-Math.cos(f-Math.PI)*c+(i[0].y+u.y)/2-5),r==="end_left"&&(p.x=Math.sin(f)*c+(i[0].x+u.x)/2-5,p.y=-Math.cos(f)*c+(i[0].y+u.y)/2-5),p}l(Vl,"calcTerminalLabelPosition");function Xl(e){let r="",n="";for(let i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?n=n+i+";":r=r+i+";");return{style:r,labelStyle:n}}l(Xl,"getStylesFromArray");var Bn=0,Ql=l(()=>(Bn++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Bn),"generateId");function Jl(e){let r="",n="0123456789abcdef",i=n.length;for(let t=0;tJl(e.length),"random"),ea=l(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}},"getTextObj"),ra=l(function(e,r){let n=r.text.replace(re.lineBreakRegex," "),[,i]=$e(r.fontSize),t=e.append("text");t.attr("x",r.x),t.attr("y",r.y),t.style("text-anchor",r.anchor),t.style("font-family",r.fontFamily),t.style("font-size",i),t.style("font-weight",r.fontWeight),t.attr("fill",r.fill),r.class!==void 0&&t.attr("class",r.class);let a=t.append("tspan");return a.attr("x",r.x+r.textMargin*2),a.attr("fill",r.fill),a.text(n),t},"drawSimpleText"),na=he((e,r,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},n),re.lineBreakRegex.test(e)))return e;let i=e.split(" "),t=[],a="";return i.forEach((o,u)=>{let c=xe(`${o} `,n),f=xe(a,n);if(c>r){let{hyphenatedStrings:h,remainingWord:d}=ia(o,r,"-",n);t.push(a,...h),a=d}else f+c>=r?(t.push(a),a=o):a=[a,o].filter(Boolean).join(" ");u+1===i.length&&t.push(a)}),t.filter(o=>o!=="").join(n.joinWith)},(e,r,n)=>`${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),ia=he((e,r,n="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);let t=[...e],a=[],o="";return t.forEach((u,c)=>{let f=`${o}${u}`;if(xe(f,i)>=r){let s=c+1,h=t.length===s,d=`${f}${n}`;a.push(h?f:d),o=""}else o=f}),{hyphenatedStrings:a,remainingWord:o}},(e,r,n="-",i)=>`${e}${r}${n}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function ta(e,r){return r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:15},r),Be(e,r).height}l(ta,"calculateTextHeight");function xe(e,r){return r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},r),Be(e,r).width}l(xe,"calculateTextWidth");var Be=he((e,r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},r);let{fontSize:n,fontFamily:i,fontWeight:t}=r;if(!e)return{width:0,height:0};let[,a]=$e(n),o=["sans-serif",i],u=e.split(re.lineBreakRegex),c=[],f=ze("body");if(!f.remove)return{width:0,height:0,lineHeight:0};let p=f.append("svg");for(let h of o){let d=0,g={width:0,height:0,lineHeight:0};for(let y of u){let C=ea();C.text=y||jl;let S=ra(p,C).style("font-size",a).style("font-weight",t).style("font-family",h),v=(S._groups||S)[0][0].getBBox();if(v.width===0&&v.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,v.width)),d=Math.round(v.height),g.height+=d,g.lineHeight=Math.round(Math.max(g.lineHeight,d))}c.push(g)}p.remove();let s=isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1;return c[s]},(e,r)=>`${e}${r.fontSize}${r.fontWeight}${r.fontFamily}`),oa=class{static{l(this,"iterator")}constructor(r,n){this.deterministic=r,this.seed=n,this.count=n?n.length:0}next(){return this.deterministic?this.count++:Date.now()}},de,la=l(function(e){return de=de||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),de.innerHTML=e,unescape(de.textContent)},"entityDecode"),K=l(e=>{if(x.debug("directiveSanitizer called with",e),typeof e=="object"&&(e.length?e.forEach(r=>K(r)):Object.keys(e).forEach(r=>{x.debug("Checking key",r),r.startsWith("__")&&(x.debug("sanitize deleting __ option",r),delete e[r]),r.includes("proto")&&(x.debug("sanitize deleting proto option",r),delete e[r]),r.includes("constr")&&(x.debug("sanitize deleting constr option",r),delete e[r]),r.includes("themeCSS")&&(x.debug("sanitizing themeCss option"),e[r]=me(e[r])),r.includes("fontFamily")&&(x.debug("sanitizing fontFamily option"),e[r]=me(e[r])),r.includes("altFontFamily")&&(x.debug("sanitizing altFontFamily option"),e[r]=me(e[r])),sr.includes(r)?typeof e[r]=="object"&&(x.debug("sanitize deleting object",r),K(e[r])):(x.debug("sanitize deleting option",r),delete e[r])})),e.themeVariables){let r=Object.keys(e.themeVariables);for(let n of r){let i=e.themeVariables[n];i&&i.match&&!i.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[n]="")}}x.debug("After sanitization",e)},"directiveSanitizer"),me=l(e=>{let r=0,n=0;for(let i of e){if(r{if(!i)return;let t=e.node().getBBox();e.append("text").text(i).attr("x",t.x+t.width/2).attr("y",-n).attr("class",r)},"insertTitle"),$e=l(e=>{if(typeof e=="number")return[e,e+"px"];let r=parseInt(e,10);return Number.isNaN(r)?[void 0,void 0]:e===String(r)?[r,e+"px"]:[r,e]},"parseFontSize"),of={assignWithDepth:Ce,wrapLabel:na,calculateTextHeight:ta,calculateTextWidth:xe,calculateTextDimensions:Be,detectInit:Hl,detectDirective:Yn,isSubstringInArray:Yl,interpolateToCurve:zl,calcLabelPosition:Kl,calcCardinalityPosition:ql,calcTerminalLabelPosition:Vl,formatUrl:Ul,getStylesFromArray:Xl,generateId:Ql,random:Zl,runFunc:Wl,entityDecode:la,initIdGenerator:oa,directiveSanitizer:K,sanitizeCss:me,insertTitle:aa,parseFontSize:$e};var P={},zn=l(function(e,r,n,i){x.debug("parseDirective is being called",r,n,i);try{if(r!==void 0)switch(r=r.trim(),n){case"open_directive":P={};break;case"type_directive":if(!P)throw new Error("currentDirective is undefined");P.type=r.toLowerCase();break;case"arg_directive":if(!P)throw new Error("currentDirective is undefined");P.args=JSON.parse(r);break;case"close_directive":ua(e,P,i),P=void 0;break}}catch(t){x.error(`Error while rendering sequenceDiagram directive: ${r} jison context: ${n}`),x.error(t.message)}},"parseDirective"),ua=l(function(e,r,n){switch(x.info(`Directive type=${r.type} with args:`,r.args),r.type){case"init":case"initialize":{["config"].forEach(i=>{r.args[i]!==void 0&&(n==="flowchart-v2"&&(n="flowchart"),r.args[n]=r.args[i],delete r.args[i])}),x.info("sanitize in handleDirective",r.args),K(r.args),x.info("sanitize in handleDirective (done)",r.args),hr(r.args);break}case"wrap":case"nowrap":e&&e.setWrap&&e.setWrap(r.type==="wrap");break;case"themeCss":x.warn("themeCss encountered");break;default:x.warn(`Unhandled directive: source: '%%{${r.type}: ${JSON.stringify(r.args?r.args:{})}}%%`,r);break}},"handleDirective");var ca=x,fa=Ye,Un=pr,sa=l(e=>fr(e,Un()),"sanitizeText"),pa=dr,ha=l(()=>mr,"getCommonDb"),da=l((e,r,n,i)=>zn(e,r,n,i),"parseDirective"),ve={},Wn=l((e,r,n)=>{if(ve[e])throw new Error(`Diagram ${e} already registered.`);ve[e]=r,n&&He(e,n),ln(e,r.styles),r.injectUtils&&r.injectUtils(ca,fa,Un,sa,pa,ha(),da)},"registerDiagram"),Gn=l(e=>{if(e in ve)return ve[e];throw new Error(`Diagram ${e} not found.`)},"getDiagram");var ye=class extends Error{static{l(this,"UnknownDiagramError")}constructor(r){super(r),this.name="UnknownDiagramError"}};var ma=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ga=/\s*%%.*\n/gm,q={},$n=l(function(e,r){e=e.replace(Ne,"").replace(ma,"").replace(ga,` `);for(let[n,{detector:i}]of Object.entries(q))if(i(e,r))return n;throw new ye(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Tf=l((...e)=>{for(let{id:r,detector:n,loader:i}of e)He(r,n,i)},"registerLazyLoadedDiagrams"),Of=l(async()=>{x.debug("Loading registered diagrams");let r=(await Promise.allSettled(Object.entries(q).map(async([n,{detector:i,loader:t}])=>{if(t)try{Gn(n)}catch{try{let{diagram:o,id:u}=await t();Wn(u,o,i)}catch(o){throw x.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete q[n],o}}}))).filter(n=>n.status==="rejected");if(r.length>0){x.error(`Failed to load ${r.length} external diagrams`);for(let n of r)x.error(n);throw new Error(`Failed to load ${r.length} external diagrams`)}},"loadRegisteredDiagrams"),He=l((e,r,n)=>{q[e]?x.error(`Detector with key ${e} already exists`):q[e]={detector:r,loader:n},x.debug(`Detector with key ${e} added${n?" with loader":""}`)},"addDetector"),Df=l(e=>q[e].loader,"getDiagramLoader");export{an as a,_a as b,Fa as c,zn as d,Un as e,pa as f,Wn as g,Gn as h,ye as i,$n as j,Tf as k,Of as l,Df as m,un as n,Y as o,z as p,hn as q,fe as r,dn as s,xn as t,pe as u,En as v,Ln as w,In as x,ke as y,he as z,jl as A,zl as B,Xl as C,Ql as D,Zl as E,na as F,ta as G,xe as H,K as I,tf as J,$e as K,of as L}; /*! Bundled license information: js-yaml/dist/js-yaml.mjs: (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) */