@mermaid-js/tiny 11.17.1 → 11.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -340,7 +340,7 @@ You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t==
340
340
  L0,20`)},"requirement_arrow"),ZOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
341
341
  L20,10
342
342
  M20,10
343
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),JOe=s((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),e6e=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),t6e={extension:NOe,composition:POe,aggregation:MOe,dependency:OOe,lollipop:$Oe,point:BOe,circle:FOe,cross:GOe,barb:zOe,barbNeo:VOe,only_one:WOe,zero_or_one:qOe,one_or_more:jOe,zero_or_more:HOe,only_one_neo:UOe,zero_or_one_neo:YOe,one_or_more_neo:KOe,zero_or_more_neo:XOe,requirement_arrow:QOe,requirement_contains:JOe,requirement_arrow_neo:ZOe,requirement_contains_neo:e6e},Sm=IOe});async function mc(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let a=t.shape?A1[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),i=await a(n,t,r)}else i=await a(e,t,r),n=i;return n.attr("data-look",$r(t.look)),t.tooltip&&i.attr("title",t.tooltip),hk.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}var hk,GZ,zZ,ll,Nd=_(()=>{"use strict";ft();tk();Pt();hk=new Map;s(mc,"insertNode");GZ=s((e,t)=>{hk.set(t.id,e)},"setNodeElem"),zZ=s(()=>{hk.clear()},"clear"),ll=s(e=>{let t=hk.get(e.id);Y.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode")});var VZ,WZ=_(()=>{"use strict";ir();vr();ft();M1();km();uk();Nd();Ct();Pt();VZ={common:ot,getConfig:mt,insertCluster:Mu,insertEdge:Ou,insertEdgeLabel:bo,insertMarkers:Sm,insertNode:mc,interpolateToCurve:g4,labelHelper:it,log:Y,positionEdgeLabel:Cm}});var r6e,dk,HI=_(()=>{"use strict";r6e=typeof global=="object"&&global&&global.Object===Object&&global,dk=r6e});var n6e,i6e,Wn,Oa=_(()=>{"use strict";HI();n6e=typeof self=="object"&&self&&self.Object===Object&&self,i6e=dk||n6e||Function("return this")(),Wn=i6e});var s6e,Ni,Pd=_(()=>{"use strict";Oa();s6e=Wn.Symbol,Ni=s6e});function l6e(e){var t=a6e.call(e,$1),r=e[$1];try{e[$1]=void 0;var n=!0}catch{}var i=o6e.call(e);return n&&(t?e[$1]=r:delete e[$1]),i}var qZ,a6e,o6e,$1,jZ,HZ=_(()=>{"use strict";Pd();qZ=Object.prototype,a6e=qZ.hasOwnProperty,o6e=qZ.toString,$1=Ni?Ni.toStringTag:void 0;s(l6e,"getRawTag");jZ=l6e});function h6e(e){return u6e.call(e)}var c6e,u6e,UZ,YZ=_(()=>{"use strict";c6e=Object.prototype,u6e=c6e.toString;s(h6e,"objectToString");UZ=h6e});function p6e(e){return e==null?e===void 0?f6e:d6e:KZ&&KZ in Object(e)?jZ(e):UZ(e)}var d6e,f6e,KZ,ys,$u=_(()=>{"use strict";Pd();HZ();YZ();d6e="[object Null]",f6e="[object Undefined]",KZ=Ni?Ni.toStringTag:void 0;s(p6e,"baseGetTag");ys=p6e});function m6e(e){return e!=null&&typeof e=="object"}var Xn,To=_(()=>{"use strict";s(m6e,"isObjectLike");Xn=m6e});function y6e(e){return typeof e=="symbol"||Xn(e)&&ys(e)==g6e}var g6e,fa,Md=_(()=>{"use strict";$u();To();g6e="[object Symbol]";s(y6e,"isSymbol");fa=y6e});function x6e(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var cl,B1=_(()=>{"use strict";s(x6e,"arrayMap");cl=x6e});var b6e,wr,oi=_(()=>{"use strict";b6e=Array.isArray,wr=b6e});function ZZ(e){if(typeof e=="string")return e;if(wr(e))return cl(e,ZZ)+"";if(fa(e))return QZ?QZ.call(e):"";var t=e+"";return t=="0"&&1/e==-T6e?"-0":t}var T6e,XZ,QZ,JZ,eJ=_(()=>{"use strict";Pd();B1();oi();Md();T6e=1/0,XZ=Ni?Ni.prototype:void 0,QZ=XZ?XZ.toString:void 0;s(ZZ,"baseToString");JZ=ZZ});function k6e(e){for(var t=e.length;t--&&C6e.test(e.charAt(t)););return t}var C6e,tJ,rJ=_(()=>{"use strict";C6e=/\s/;s(k6e,"trimmedEndIndex");tJ=k6e});function v6e(e){return e&&e.slice(0,tJ(e)+1).replace(S6e,"")}var S6e,nJ,iJ=_(()=>{"use strict";rJ();S6e=/^\s+/;s(v6e,"baseTrim");nJ=v6e});function E6e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var In,$a=_(()=>{"use strict";s(E6e,"isObject");In=E6e});function L6e(e){if(typeof e=="number")return e;if(fa(e))return sJ;if(In(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=In(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=nJ(e);var r=_6e.test(e);return r||A6e.test(e)?R6e(e.slice(2),r?2:8):w6e.test(e)?sJ:+e}var sJ,w6e,_6e,A6e,R6e,aJ,oJ=_(()=>{"use strict";iJ();$a();Md();sJ=NaN,w6e=/^[-+]0x[0-9a-f]+$/i,_6e=/^0b[01]+$/i,A6e=/^0o[0-7]+$/i,R6e=parseInt;s(L6e,"toNumber");aJ=L6e});function I6e(e){if(!e)return e===0?e:0;if(e=aJ(e),e===lJ||e===-lJ){var t=e<0?-1:1;return t*D6e}return e===e?e:0}var lJ,D6e,vm,UI=_(()=>{"use strict";oJ();lJ=1/0,D6e=17976931348623157e292;s(I6e,"toFinite");vm=I6e});function N6e(e){var t=vm(e),r=t%1;return t===t?r?t-r:t:0}var cJ,uJ=_(()=>{"use strict";UI();s(N6e,"toInteger");cJ=N6e});function P6e(e){return e}var Os,Bu=_(()=>{"use strict";s(P6e,"identity");Os=P6e});function F6e(e){if(!In(e))return!1;var t=ys(e);return t==O6e||t==$6e||t==M6e||t==B6e}var M6e,O6e,$6e,B6e,ul,F1=_(()=>{"use strict";$u();$a();M6e="[object AsyncFunction]",O6e="[object Function]",$6e="[object GeneratorFunction]",B6e="[object Proxy]";s(F6e,"isFunction");ul=F6e});var G6e,fk,hJ=_(()=>{"use strict";Oa();G6e=Wn["__core-js_shared__"],fk=G6e});function z6e(e){return!!dJ&&dJ in e}var dJ,fJ,pJ=_(()=>{"use strict";hJ();dJ=(function(){var e=/[^.]+$/.exec(fk&&fk.keys&&fk.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();s(z6e,"isMasked");fJ=z6e});function q6e(e){if(e!=null){try{return W6e.call(e)}catch{}try{return e+""}catch{}}return""}var V6e,W6e,gc,YI=_(()=>{"use strict";V6e=Function.prototype,W6e=V6e.toString;s(q6e,"toSource");gc=q6e});function Z6e(e){if(!In(e)||fJ(e))return!1;var t=ul(e)?Q6e:H6e;return t.test(gc(e))}var j6e,H6e,U6e,Y6e,K6e,X6e,Q6e,mJ,gJ=_(()=>{"use strict";F1();pJ();$a();YI();j6e=/[\\^$.*+?()[\]{}|]/g,H6e=/^\[object .+?Constructor\]$/,U6e=Function.prototype,Y6e=Object.prototype,K6e=U6e.toString,X6e=Y6e.hasOwnProperty,Q6e=RegExp("^"+K6e.call(X6e).replace(j6e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");s(Z6e,"baseIsNative");mJ=Z6e});function J6e(e,t){return e?.[t]}var yJ,xJ=_(()=>{"use strict";s(J6e,"getValue");yJ=J6e});function e$e(e,t){var r=yJ(e,t);return mJ(r)?r:void 0}var $s,Fu=_(()=>{"use strict";gJ();xJ();s(e$e,"getNative");$s=e$e});var t$e,pk,bJ=_(()=>{"use strict";Fu();Oa();t$e=$s(Wn,"WeakMap"),pk=t$e});var TJ,r$e,CJ,kJ=_(()=>{"use strict";$a();TJ=Object.create,r$e=(function(){function e(){}return s(e,"object"),function(t){if(!In(t))return{};if(TJ)return TJ(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),CJ=r$e});function n$e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var SJ,vJ=_(()=>{"use strict";s(n$e,"apply");SJ=n$e});function i$e(){}var EJ,wJ=_(()=>{"use strict";s(i$e,"noop");EJ=i$e});function s$e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var mk,KI=_(()=>{"use strict";s(s$e,"copyArray");mk=s$e});function c$e(e){var t=0,r=0;return function(){var n=l$e(),i=o$e-(n-r);if(r=n,i>0){if(++t>=a$e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var a$e,o$e,l$e,_J,AJ=_(()=>{"use strict";a$e=800,o$e=16,l$e=Date.now;s(c$e,"shortOut");_J=c$e});function u$e(e){return function(){return e}}var Bs,XI=_(()=>{"use strict";s(u$e,"constant");Bs=u$e});var h$e,Em,QI=_(()=>{"use strict";Fu();h$e=(function(){try{var e=$s(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Em=h$e});var d$e,RJ,LJ=_(()=>{"use strict";XI();QI();Bu();d$e=Em?function(e,t){return Em(e,"toString",{configurable:!0,enumerable:!1,value:Bs(t),writable:!0})}:Os,RJ=d$e});var f$e,gk,ZI=_(()=>{"use strict";LJ();AJ();f$e=_J(RJ),gk=f$e});function p$e(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var yk,JI=_(()=>{"use strict";s(p$e,"arrayEach");yk=p$e});function m$e(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var xk,e5=_(()=>{"use strict";s(m$e,"baseFindIndex");xk=m$e});function g$e(e){return e!==e}var DJ,IJ=_(()=>{"use strict";s(g$e,"baseIsNaN");DJ=g$e});function y$e(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var NJ,PJ=_(()=>{"use strict";s(y$e,"strictIndexOf");NJ=y$e});function x$e(e,t,r){return t===t?NJ(e,t,r):xk(e,DJ,r)}var MJ,OJ=_(()=>{"use strict";e5();IJ();PJ();s(x$e,"baseIndexOf");MJ=x$e});function b$e(e,t){var r=e==null?0:e.length;return!!r&&MJ(e,t,0)>-1}var $J,BJ=_(()=>{"use strict";OJ();s(b$e,"arrayIncludes");$J=b$e});function k$e(e,t){var r=typeof e;return t=t??T$e,!!t&&(r=="number"||r!="symbol"&&C$e.test(e))&&e>-1&&e%1==0&&e<t}var T$e,C$e,Gu,G1=_(()=>{"use strict";T$e=9007199254740991,C$e=/^(?:0|[1-9]\d*)$/;s(k$e,"isIndex");Gu=k$e});function S$e(e,t,r){t=="__proto__"&&Em?Em(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var zu,z1=_(()=>{"use strict";QI();s(S$e,"baseAssignValue");zu=S$e});function v$e(e,t){return e===t||e!==e&&t!==t}var Ba,Od=_(()=>{"use strict";s(v$e,"eq");Ba=v$e});function _$e(e,t,r){var n=e[t];(!(w$e.call(e,t)&&Ba(n,r))||r===void 0&&!(t in e))&&zu(e,t,r)}var E$e,w$e,Vu,V1=_(()=>{"use strict";z1();Od();E$e=Object.prototype,w$e=E$e.hasOwnProperty;s(_$e,"assignValue");Vu=_$e});function A$e(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var l=t[a],u=n?n(r[l],e[l],l,r,e):void 0;u===void 0&&(u=e[l]),i?zu(r,l,u):Vu(r,l,u)}return r}var hl,wm=_(()=>{"use strict";V1();z1();s(A$e,"copyObject");hl=A$e});function R$e(e,t,r){return t=FJ(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=FJ(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(o),SJ(e,this,l)}}var FJ,bk,t5=_(()=>{"use strict";vJ();FJ=Math.max;s(R$e,"overRest");bk=R$e});function L$e(e,t){return gk(bk(e,t,Os),e+"")}var Wu,W1=_(()=>{"use strict";Bu();t5();ZI();s(L$e,"baseRest");Wu=L$e});function I$e(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=D$e}var D$e,_m,Tk=_(()=>{"use strict";D$e=9007199254740991;s(I$e,"isLength");_m=I$e});function N$e(e){return e!=null&&_m(e.length)&&!ul(e)}var Pi,dl=_(()=>{"use strict";F1();Tk();s(N$e,"isArrayLike");Pi=N$e});function P$e(e,t,r){if(!In(r))return!1;var n=typeof t;return(n=="number"?Pi(r)&&Gu(t,r.length):n=="string"&&t in r)?Ba(r[t],e):!1}var yc,q1=_(()=>{"use strict";Od();dl();G1();$a();s(P$e,"isIterateeCall");yc=P$e});function M$e(e){return Wu(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&yc(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,a)}return t})}var GJ,zJ=_(()=>{"use strict";W1();q1();s(M$e,"createAssigner");GJ=M$e});function $$e(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||O$e;return e===r}var O$e,qu,j1=_(()=>{"use strict";O$e=Object.prototype;s($$e,"isPrototype");qu=$$e});function B$e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var VJ,WJ=_(()=>{"use strict";s(B$e,"baseTimes");VJ=B$e});function G$e(e){return Xn(e)&&ys(e)==F$e}var F$e,r5,qJ=_(()=>{"use strict";$u();To();F$e="[object Arguments]";s(G$e,"baseIsArguments");r5=G$e});var jJ,z$e,V$e,W$e,Co,Am=_(()=>{"use strict";qJ();To();jJ=Object.prototype,z$e=jJ.hasOwnProperty,V$e=jJ.propertyIsEnumerable,W$e=r5((function(){return arguments})())?r5:function(e){return Xn(e)&&z$e.call(e,"callee")&&!V$e.call(e,"callee")},Co=W$e});function q$e(){return!1}var HJ,UJ=_(()=>{"use strict";s(q$e,"stubFalse");HJ=q$e});var XJ,YJ,j$e,KJ,H$e,U$e,ko,Rm=_(()=>{"use strict";Oa();UJ();XJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,YJ=XJ&&typeof module=="object"&&module&&!module.nodeType&&module,j$e=YJ&&YJ.exports===XJ,KJ=j$e?Wn.Buffer:void 0,H$e=KJ?KJ.isBuffer:void 0,U$e=H$e||HJ,ko=U$e});function xBe(e){return Xn(e)&&_m(e.length)&&!!wn[ys(e)]}var Y$e,K$e,X$e,Q$e,Z$e,J$e,eBe,tBe,rBe,nBe,iBe,sBe,aBe,oBe,lBe,cBe,uBe,hBe,dBe,fBe,pBe,mBe,gBe,yBe,wn,QJ,ZJ=_(()=>{"use strict";$u();Tk();To();Y$e="[object Arguments]",K$e="[object Array]",X$e="[object Boolean]",Q$e="[object Date]",Z$e="[object Error]",J$e="[object Function]",eBe="[object Map]",tBe="[object Number]",rBe="[object Object]",nBe="[object RegExp]",iBe="[object Set]",sBe="[object String]",aBe="[object WeakMap]",oBe="[object ArrayBuffer]",lBe="[object DataView]",cBe="[object Float32Array]",uBe="[object Float64Array]",hBe="[object Int8Array]",dBe="[object Int16Array]",fBe="[object Int32Array]",pBe="[object Uint8Array]",mBe="[object Uint8ClampedArray]",gBe="[object Uint16Array]",yBe="[object Uint32Array]",wn={};wn[cBe]=wn[uBe]=wn[hBe]=wn[dBe]=wn[fBe]=wn[pBe]=wn[mBe]=wn[gBe]=wn[yBe]=!0;wn[Y$e]=wn[K$e]=wn[oBe]=wn[X$e]=wn[lBe]=wn[Q$e]=wn[Z$e]=wn[J$e]=wn[eBe]=wn[tBe]=wn[rBe]=wn[nBe]=wn[iBe]=wn[sBe]=wn[aBe]=!1;s(xBe,"baseIsTypedArray");QJ=xBe});function bBe(e){return function(t){return e(t)}}var ju,H1=_(()=>{"use strict";s(bBe,"baseUnary");ju=bBe});var JJ,U1,TBe,n5,CBe,xc,Ck=_(()=>{"use strict";HI();JJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,U1=JJ&&typeof module=="object"&&module&&!module.nodeType&&module,TBe=U1&&U1.exports===JJ,n5=TBe&&dk.process,CBe=(function(){try{var e=U1&&U1.require&&U1.require("util").types;return e||n5&&n5.binding&&n5.binding("util")}catch{}})(),xc=CBe});var eee,kBe,Hu,Y1=_(()=>{"use strict";ZJ();H1();Ck();eee=xc&&xc.isTypedArray,kBe=eee?ju(eee):QJ,Hu=kBe});function EBe(e,t){var r=wr(e),n=!r&&Co(e),i=!r&&!n&&ko(e),a=!r&&!n&&!i&&Hu(e),o=r||n||i||a,l=o?VJ(e.length,String):[],u=l.length;for(var h in e)(t||vBe.call(e,h))&&!(o&&(h=="length"||i&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Gu(h,u)))&&l.push(h);return l}var SBe,vBe,kk,i5=_(()=>{"use strict";WJ();Am();oi();Rm();G1();Y1();SBe=Object.prototype,vBe=SBe.hasOwnProperty;s(EBe,"arrayLikeKeys");kk=EBe});function wBe(e,t){return function(r){return e(t(r))}}var Sk,s5=_(()=>{"use strict";s(wBe,"overArg");Sk=wBe});var _Be,tee,ree=_(()=>{"use strict";s5();_Be=Sk(Object.keys,Object),tee=_Be});function LBe(e){if(!qu(e))return tee(e);var t=[];for(var r in Object(e))RBe.call(e,r)&&r!="constructor"&&t.push(r);return t}var ABe,RBe,Lm,vk=_(()=>{"use strict";j1();ree();ABe=Object.prototype,RBe=ABe.hasOwnProperty;s(LBe,"baseKeys");Lm=LBe});function DBe(e){return Pi(e)?kk(e):Lm(e)}var qn,bc=_(()=>{"use strict";i5();vk();dl();s(DBe,"keys");qn=DBe});function IBe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var nee,iee=_(()=>{"use strict";s(IBe,"nativeKeysIn");nee=IBe});function MBe(e){if(!In(e))return nee(e);var t=qu(e),r=[];for(var n in e)n=="constructor"&&(t||!PBe.call(e,n))||r.push(n);return r}var NBe,PBe,see,aee=_(()=>{"use strict";$a();j1();iee();NBe=Object.prototype,PBe=NBe.hasOwnProperty;s(MBe,"baseKeysIn");see=MBe});function OBe(e){return Pi(e)?kk(e,!0):see(e)}var Fs,Uu=_(()=>{"use strict";i5();aee();dl();s(OBe,"keysIn");Fs=OBe});function FBe(e,t){if(wr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||fa(e)?!0:BBe.test(e)||!$Be.test(e)||t!=null&&e in Object(t)}var $Be,BBe,Dm,Ek=_(()=>{"use strict";oi();Md();$Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BBe=/^\w*$/;s(FBe,"isKey");Dm=FBe});var GBe,Tc,K1=_(()=>{"use strict";Fu();GBe=$s(Object,"create"),Tc=GBe});function zBe(){this.__data__=Tc?Tc(null):{},this.size=0}var oee,lee=_(()=>{"use strict";K1();s(zBe,"hashClear");oee=zBe});function VBe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var cee,uee=_(()=>{"use strict";s(VBe,"hashDelete");cee=VBe});function HBe(e){var t=this.__data__;if(Tc){var r=t[e];return r===WBe?void 0:r}return jBe.call(t,e)?t[e]:void 0}var WBe,qBe,jBe,hee,dee=_(()=>{"use strict";K1();WBe="__lodash_hash_undefined__",qBe=Object.prototype,jBe=qBe.hasOwnProperty;s(HBe,"hashGet");hee=HBe});function KBe(e){var t=this.__data__;return Tc?t[e]!==void 0:YBe.call(t,e)}var UBe,YBe,fee,pee=_(()=>{"use strict";K1();UBe=Object.prototype,YBe=UBe.hasOwnProperty;s(KBe,"hashHas");fee=KBe});function QBe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Tc&&t===void 0?XBe:t,this}var XBe,mee,gee=_(()=>{"use strict";K1();XBe="__lodash_hash_undefined__";s(QBe,"hashSet");mee=QBe});function Im(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var a5,yee=_(()=>{"use strict";lee();uee();dee();pee();gee();s(Im,"Hash");Im.prototype.clear=oee;Im.prototype.delete=cee;Im.prototype.get=hee;Im.prototype.has=fee;Im.prototype.set=mee;a5=Im});function ZBe(){this.__data__=[],this.size=0}var xee,bee=_(()=>{"use strict";s(ZBe,"listCacheClear");xee=ZBe});function JBe(e,t){for(var r=e.length;r--;)if(Ba(e[r][0],t))return r;return-1}var Yu,X1=_(()=>{"use strict";Od();s(JBe,"assocIndexOf");Yu=JBe});function r8e(e){var t=this.__data__,r=Yu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():t8e.call(t,r,1),--this.size,!0}var e8e,t8e,Tee,Cee=_(()=>{"use strict";X1();e8e=Array.prototype,t8e=e8e.splice;s(r8e,"listCacheDelete");Tee=r8e});function n8e(e){var t=this.__data__,r=Yu(t,e);return r<0?void 0:t[r][1]}var kee,See=_(()=>{"use strict";X1();s(n8e,"listCacheGet");kee=n8e});function i8e(e){return Yu(this.__data__,e)>-1}var vee,Eee=_(()=>{"use strict";X1();s(i8e,"listCacheHas");vee=i8e});function s8e(e,t){var r=this.__data__,n=Yu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var wee,_ee=_(()=>{"use strict";X1();s(s8e,"listCacheSet");wee=s8e});function Nm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var Ku,Q1=_(()=>{"use strict";bee();Cee();See();Eee();_ee();s(Nm,"ListCache");Nm.prototype.clear=xee;Nm.prototype.delete=Tee;Nm.prototype.get=kee;Nm.prototype.has=vee;Nm.prototype.set=wee;Ku=Nm});var a8e,Xu,wk=_(()=>{"use strict";Fu();Oa();a8e=$s(Wn,"Map"),Xu=a8e});function o8e(){this.size=0,this.__data__={hash:new a5,map:new(Xu||Ku),string:new a5}}var Aee,Ree=_(()=>{"use strict";yee();Q1();wk();s(o8e,"mapCacheClear");Aee=o8e});function l8e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Lee,Dee=_(()=>{"use strict";s(l8e,"isKeyable");Lee=l8e});function c8e(e,t){var r=e.__data__;return Lee(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Qu,Z1=_(()=>{"use strict";Dee();s(c8e,"getMapData");Qu=c8e});function u8e(e){var t=Qu(this,e).delete(e);return this.size-=t?1:0,t}var Iee,Nee=_(()=>{"use strict";Z1();s(u8e,"mapCacheDelete");Iee=u8e});function h8e(e){return Qu(this,e).get(e)}var Pee,Mee=_(()=>{"use strict";Z1();s(h8e,"mapCacheGet");Pee=h8e});function d8e(e){return Qu(this,e).has(e)}var Oee,$ee=_(()=>{"use strict";Z1();s(d8e,"mapCacheHas");Oee=d8e});function f8e(e,t){var r=Qu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Bee,Fee=_(()=>{"use strict";Z1();s(f8e,"mapCacheSet");Bee=f8e});function Pm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var $d,_k=_(()=>{"use strict";Ree();Nee();Mee();$ee();Fee();s(Pm,"MapCache");Pm.prototype.clear=Aee;Pm.prototype.delete=Iee;Pm.prototype.get=Pee;Pm.prototype.has=Oee;Pm.prototype.set=Bee;$d=Pm});function o5(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(p8e);var r=s(function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o},"memoized");return r.cache=new(o5.Cache||$d),r}var p8e,Gee,zee=_(()=>{"use strict";_k();p8e="Expected a function";s(o5,"memoize");o5.Cache=$d;Gee=o5});function g8e(e){var t=Gee(e,function(n){return r.size===m8e&&r.clear(),n}),r=t.cache;return t}var m8e,Vee,Wee=_(()=>{"use strict";zee();m8e=500;s(g8e,"memoizeCapped");Vee=g8e});var y8e,x8e,b8e,qee,jee=_(()=>{"use strict";Wee();y8e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,x8e=/\\(\\)?/g,b8e=Vee(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(y8e,function(r,n,i,a){t.push(i?a.replace(x8e,"$1"):n||r)}),t}),qee=b8e});function T8e(e){return e==null?"":JZ(e)}var Ak,l5=_(()=>{"use strict";eJ();s(T8e,"toString");Ak=T8e});function C8e(e,t){return wr(e)?e:Dm(e,t)?[e]:qee(Ak(e))}var Zu,J1=_(()=>{"use strict";oi();Ek();jee();l5();s(C8e,"castPath");Zu=C8e});function S8e(e){if(typeof e=="string"||fa(e))return e;var t=e+"";return t=="0"&&1/e==-k8e?"-0":t}var k8e,fl,Mm=_(()=>{"use strict";Md();k8e=1/0;s(S8e,"toKey");fl=S8e});function v8e(e,t){t=Zu(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[fl(t[r++])];return r&&r==n?e:void 0}var Ju,ex=_(()=>{"use strict";J1();Mm();s(v8e,"baseGet");Ju=v8e});function E8e(e,t,r){var n=e==null?void 0:Ju(e,t);return n===void 0?r:n}var Hee,Uee=_(()=>{"use strict";ex();s(E8e,"get");Hee=E8e});function w8e(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Om,Rk=_(()=>{"use strict";s(w8e,"arrayPush");Om=w8e});function _8e(e){return wr(e)||Co(e)||!!(Yee&&e&&e[Yee])}var Yee,Kee,Xee=_(()=>{"use strict";Pd();Am();oi();Yee=Ni?Ni.isConcatSpreadable:void 0;s(_8e,"isFlattenable");Kee=_8e});function Qee(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=Kee),i||(i=[]);++a<o;){var l=e[a];t>0&&r(l)?t>1?Qee(l,t-1,r,n,i):Om(i,l):n||(i[i.length]=l)}return i}var $m,Lk=_(()=>{"use strict";Rk();Xee();s(Qee,"baseFlatten");$m=Qee});function A8e(e){var t=e==null?0:e.length;return t?$m(e,1):[]}var Fa,c5=_(()=>{"use strict";Lk();s(A8e,"flatten");Fa=A8e});function R8e(e){return gk(bk(e,void 0,Fa),e+"")}var Zee,Jee=_(()=>{"use strict";c5();t5();ZI();s(R8e,"flatRest");Zee=R8e});var L8e,Bm,Dk=_(()=>{"use strict";s5();L8e=Sk(Object.getPrototypeOf,Object),Bm=L8e});function O8e(e){if(!Xn(e)||ys(e)!=D8e)return!1;var t=Bm(e);if(t===null)return!0;var r=P8e.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&ete.call(r)==M8e}var D8e,I8e,N8e,ete,P8e,M8e,tte,rte=_(()=>{"use strict";$u();Dk();To();D8e="[object Object]",I8e=Function.prototype,N8e=Object.prototype,ete=I8e.toString,P8e=N8e.hasOwnProperty,M8e=ete.call(Object);s(O8e,"isPlainObject");tte=O8e});function j8e(e){return q8e.test(e)}var $8e,B8e,F8e,G8e,z8e,V8e,W8e,q8e,nte,ite=_(()=>{"use strict";$8e="\\ud800-\\udfff",B8e="\\u0300-\\u036f",F8e="\\ufe20-\\ufe2f",G8e="\\u20d0-\\u20ff",z8e=B8e+F8e+G8e,V8e="\\ufe0e\\ufe0f",W8e="\\u200d",q8e=RegExp("["+W8e+$8e+z8e+V8e+"]");s(j8e,"hasUnicode");nte=j8e});function H8e(e,t,r,n){var i=-1,a=e==null?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}var ste,ate=_(()=>{"use strict";s(H8e,"arrayReduce");ste=H8e});function U8e(){this.__data__=new Ku,this.size=0}var ote,lte=_(()=>{"use strict";Q1();s(U8e,"stackClear");ote=U8e});function Y8e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var cte,ute=_(()=>{"use strict";s(Y8e,"stackDelete");cte=Y8e});function K8e(e){return this.__data__.get(e)}var hte,dte=_(()=>{"use strict";s(K8e,"stackGet");hte=K8e});function X8e(e){return this.__data__.has(e)}var fte,pte=_(()=>{"use strict";s(X8e,"stackHas");fte=X8e});function Z8e(e,t){var r=this.__data__;if(r instanceof Ku){var n=r.__data__;if(!Xu||n.length<Q8e-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $d(n)}return r.set(e,t),this.size=r.size,this}var Q8e,mte,gte=_(()=>{"use strict";Q1();wk();_k();Q8e=200;s(Z8e,"stackSet");mte=Z8e});function Fm(e){var t=this.__data__=new Ku(e);this.size=t.size}var pl,tx=_(()=>{"use strict";Q1();lte();ute();dte();pte();gte();s(Fm,"Stack");Fm.prototype.clear=ote;Fm.prototype.delete=cte;Fm.prototype.get=hte;Fm.prototype.has=fte;Fm.prototype.set=mte;pl=Fm});function J8e(e,t){return e&&hl(t,qn(t),e)}var yte,xte=_(()=>{"use strict";wm();bc();s(J8e,"baseAssign");yte=J8e});function e7e(e,t){return e&&hl(t,Fs(t),e)}var bte,Tte=_(()=>{"use strict";wm();Uu();s(e7e,"baseAssignIn");bte=e7e});function r7e(e,t){if(t)return e.slice();var r=e.length,n=Ste?Ste(r):new e.constructor(r);return e.copy(n),n}var vte,Cte,t7e,kte,Ste,Ik,u5=_(()=>{"use strict";Oa();vte=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cte=vte&&typeof module=="object"&&module&&!module.nodeType&&module,t7e=Cte&&Cte.exports===vte,kte=t7e?Wn.Buffer:void 0,Ste=kte?kte.allocUnsafe:void 0;s(r7e,"cloneBuffer");Ik=r7e});function n7e(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}var Nk,h5=_(()=>{"use strict";s(n7e,"arrayFilter");Nk=n7e});function i7e(){return[]}var Pk,d5=_(()=>{"use strict";s(i7e,"stubArray");Pk=i7e});var s7e,a7e,Ete,o7e,Gm,Mk=_(()=>{"use strict";h5();d5();s7e=Object.prototype,a7e=s7e.propertyIsEnumerable,Ete=Object.getOwnPropertySymbols,o7e=Ete?function(e){return e==null?[]:(e=Object(e),Nk(Ete(e),function(t){return a7e.call(e,t)}))}:Pk,Gm=o7e});function l7e(e,t){return hl(e,Gm(e),t)}var wte,_te=_(()=>{"use strict";wm();Mk();s(l7e,"copySymbols");wte=l7e});var c7e,u7e,Ok,f5=_(()=>{"use strict";Rk();Dk();Mk();d5();c7e=Object.getOwnPropertySymbols,u7e=c7e?function(e){for(var t=[];e;)Om(t,Gm(e)),e=Bm(e);return t}:Pk,Ok=u7e});function h7e(e,t){return hl(e,Ok(e),t)}var Ate,Rte=_(()=>{"use strict";wm();f5();s(h7e,"copySymbolsIn");Ate=h7e});function d7e(e,t,r){var n=t(e);return wr(e)?n:Om(n,r(e))}var $k,p5=_(()=>{"use strict";Rk();oi();s(d7e,"baseGetAllKeys");$k=d7e});function f7e(e){return $k(e,qn,Gm)}var rx,m5=_(()=>{"use strict";p5();Mk();bc();s(f7e,"getAllKeys");rx=f7e});function p7e(e){return $k(e,Fs,Ok)}var Lte,Dte=_(()=>{"use strict";p5();f5();Uu();s(p7e,"getAllKeysIn");Lte=p7e});var m7e,Bk,Ite=_(()=>{"use strict";Fu();Oa();m7e=$s(Wn,"DataView"),Bk=m7e});var g7e,Fk,Nte=_(()=>{"use strict";Fu();Oa();g7e=$s(Wn,"Promise"),Fk=g7e});var y7e,eh,g5=_(()=>{"use strict";Fu();Oa();y7e=$s(Wn,"Set"),eh=y7e});var Pte,x7e,Mte,Ote,$te,Bte,b7e,T7e,C7e,k7e,S7e,Bd,pa,Fd=_(()=>{"use strict";Ite();wk();Nte();g5();bJ();$u();YI();Pte="[object Map]",x7e="[object Object]",Mte="[object Promise]",Ote="[object Set]",$te="[object WeakMap]",Bte="[object DataView]",b7e=gc(Bk),T7e=gc(Xu),C7e=gc(Fk),k7e=gc(eh),S7e=gc(pk),Bd=ys;(Bk&&Bd(new Bk(new ArrayBuffer(1)))!=Bte||Xu&&Bd(new Xu)!=Pte||Fk&&Bd(Fk.resolve())!=Mte||eh&&Bd(new eh)!=Ote||pk&&Bd(new pk)!=$te)&&(Bd=s(function(e){var t=ys(e),r=t==x7e?e.constructor:void 0,n=r?gc(r):"";if(n)switch(n){case b7e:return Bte;case T7e:return Pte;case C7e:return Mte;case k7e:return Ote;case S7e:return $te}return t},"getTag"));pa=Bd});function w7e(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&E7e.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var v7e,E7e,Fte,Gte=_(()=>{"use strict";v7e=Object.prototype,E7e=v7e.hasOwnProperty;s(w7e,"initCloneArray");Fte=w7e});var _7e,zm,y5=_(()=>{"use strict";Oa();_7e=Wn.Uint8Array,zm=_7e});function A7e(e){var t=new e.constructor(e.byteLength);return new zm(t).set(new zm(e)),t}var Vm,Gk=_(()=>{"use strict";y5();s(A7e,"cloneArrayBuffer");Vm=A7e});function R7e(e,t){var r=t?Vm(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var zte,Vte=_(()=>{"use strict";Gk();s(R7e,"cloneDataView");zte=R7e});function D7e(e){var t=new e.constructor(e.source,L7e.exec(e));return t.lastIndex=e.lastIndex,t}var L7e,Wte,qte=_(()=>{"use strict";L7e=/\w*$/;s(D7e,"cloneRegExp");Wte=D7e});function I7e(e){return Hte?Object(Hte.call(e)):{}}var jte,Hte,Ute,Yte=_(()=>{"use strict";Pd();jte=Ni?Ni.prototype:void 0,Hte=jte?jte.valueOf:void 0;s(I7e,"cloneSymbol");Ute=I7e});function N7e(e,t){var r=t?Vm(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var zk,x5=_(()=>{"use strict";Gk();s(N7e,"cloneTypedArray");zk=N7e});function J7e(e,t,r){var n=e.constructor;switch(t){case V7e:return Vm(e);case P7e:case M7e:return new n(+e);case W7e:return zte(e,r);case q7e:case j7e:case H7e:case U7e:case Y7e:case K7e:case X7e:case Q7e:case Z7e:return zk(e,r);case O7e:return new n;case $7e:case G7e:return new n(e);case B7e:return Wte(e);case F7e:return new n;case z7e:return Ute(e)}}var P7e,M7e,O7e,$7e,B7e,F7e,G7e,z7e,V7e,W7e,q7e,j7e,H7e,U7e,Y7e,K7e,X7e,Q7e,Z7e,Kte,Xte=_(()=>{"use strict";Gk();Vte();qte();Yte();x5();P7e="[object Boolean]",M7e="[object Date]",O7e="[object Map]",$7e="[object Number]",B7e="[object RegExp]",F7e="[object Set]",G7e="[object String]",z7e="[object Symbol]",V7e="[object ArrayBuffer]",W7e="[object DataView]",q7e="[object Float32Array]",j7e="[object Float64Array]",H7e="[object Int8Array]",U7e="[object Int16Array]",Y7e="[object Int32Array]",K7e="[object Uint8Array]",X7e="[object Uint8ClampedArray]",Q7e="[object Uint16Array]",Z7e="[object Uint32Array]";s(J7e,"initCloneByTag");Kte=J7e});function eFe(e){return typeof e.constructor=="function"&&!qu(e)?CJ(Bm(e)):{}}var Vk,b5=_(()=>{"use strict";kJ();Dk();j1();s(eFe,"initCloneObject");Vk=eFe});function rFe(e){return Xn(e)&&pa(e)==tFe}var tFe,Qte,Zte=_(()=>{"use strict";Fd();To();tFe="[object Map]";s(rFe,"baseIsMap");Qte=rFe});var Jte,nFe,ere,tre=_(()=>{"use strict";Zte();H1();Ck();Jte=xc&&xc.isMap,nFe=Jte?ju(Jte):Qte,ere=nFe});function sFe(e){return Xn(e)&&pa(e)==iFe}var iFe,rre,nre=_(()=>{"use strict";Fd();To();iFe="[object Set]";s(sFe,"baseIsSet");rre=sFe});var ire,aFe,sre,are=_(()=>{"use strict";nre();H1();Ck();ire=xc&&xc.isSet,aFe=ire?ju(ire):rre,sre=aFe});function Wk(e,t,r,n,i,a){var o,l=t&oFe,u=t&lFe,h=t&cFe;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!In(e))return e;var d=wr(e);if(d){if(o=Fte(e),!l)return mk(e,o)}else{var f=pa(e),p=f==lre||f==pFe;if(ko(e))return Ik(e,l);if(f==cre||f==ore||p&&!i){if(o=u||p?{}:Vk(e),!l)return u?Ate(e,bte(o,e)):wte(e,yte(o,e))}else{if(!yn[f])return i?e:{};o=Kte(e,f,l)}}a||(a=new pl);var g=a.get(e);if(g)return g;a.set(e,o),sre(e)?e.forEach(function(x){o.add(Wk(x,t,r,x,e,a))}):ere(e)&&e.forEach(function(x,T){o.set(T,Wk(x,t,r,T,e,a))});var m=h?u?Lte:rx:u?Fs:qn,y=d?void 0:m(e);return yk(y||e,function(x,T){y&&(T=x,x=e[T]),Vu(o,T,Wk(x,t,r,T,e,a))}),o}var oFe,lFe,cFe,ore,uFe,hFe,dFe,fFe,lre,pFe,mFe,gFe,cre,yFe,xFe,bFe,TFe,CFe,kFe,SFe,vFe,EFe,wFe,_Fe,AFe,RFe,LFe,DFe,IFe,yn,ure,hre=_(()=>{"use strict";tx();JI();V1();xte();Tte();u5();KI();_te();Rte();m5();Dte();Fd();Gte();Xte();b5();oi();Rm();tre();$a();are();bc();Uu();oFe=1,lFe=2,cFe=4,ore="[object Arguments]",uFe="[object Array]",hFe="[object Boolean]",dFe="[object Date]",fFe="[object Error]",lre="[object Function]",pFe="[object GeneratorFunction]",mFe="[object Map]",gFe="[object Number]",cre="[object Object]",yFe="[object RegExp]",xFe="[object Set]",bFe="[object String]",TFe="[object Symbol]",CFe="[object WeakMap]",kFe="[object ArrayBuffer]",SFe="[object DataView]",vFe="[object Float32Array]",EFe="[object Float64Array]",wFe="[object Int8Array]",_Fe="[object Int16Array]",AFe="[object Int32Array]",RFe="[object Uint8Array]",LFe="[object Uint8ClampedArray]",DFe="[object Uint16Array]",IFe="[object Uint32Array]",yn={};yn[ore]=yn[uFe]=yn[kFe]=yn[SFe]=yn[hFe]=yn[dFe]=yn[vFe]=yn[EFe]=yn[wFe]=yn[_Fe]=yn[AFe]=yn[mFe]=yn[gFe]=yn[cre]=yn[yFe]=yn[xFe]=yn[bFe]=yn[TFe]=yn[RFe]=yn[LFe]=yn[DFe]=yn[IFe]=!0;yn[fFe]=yn[lre]=yn[CFe]=!1;s(Wk,"baseClone");ure=Wk});function MFe(e){return ure(e,NFe|PFe)}var NFe,PFe,T5,dre=_(()=>{"use strict";hre();NFe=1,PFe=4;s(MFe,"cloneDeep");T5=MFe});function $Fe(e){return this.__data__.set(e,OFe),this}var OFe,fre,pre=_(()=>{"use strict";OFe="__lodash_hash_undefined__";s($Fe,"setCacheAdd");fre=$Fe});function BFe(e){return this.__data__.has(e)}var mre,gre=_(()=>{"use strict";s(BFe,"setCacheHas");mre=BFe});function qk(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new $d;++t<r;)this.add(e[t])}var jk,C5=_(()=>{"use strict";_k();pre();gre();s(qk,"SetCache");qk.prototype.add=qk.prototype.push=fre;qk.prototype.has=mre;jk=qk});function FFe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var yre,xre=_(()=>{"use strict";s(FFe,"arraySome");yre=FFe});function GFe(e,t){return e.has(t)}var Hk,k5=_(()=>{"use strict";s(GFe,"cacheHas");Hk=GFe});function WFe(e,t,r,n,i,a){var o=r&zFe,l=e.length,u=t.length;if(l!=u&&!(o&&u>l))return!1;var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var f=-1,p=!0,g=r&VFe?new jk:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var m=e[f],y=t[f];if(n)var x=o?n(y,m,f,t,e,a):n(m,y,f,e,t,a);if(x!==void 0){if(x)continue;p=!1;break}if(g){if(!yre(t,function(T,C){if(!Hk(g,C)&&(m===T||i(m,T,r,n,a)))return g.push(C)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,a))){p=!1;break}}return a.delete(e),a.delete(t),p}var zFe,VFe,Uk,S5=_(()=>{"use strict";C5();xre();k5();zFe=1,VFe=2;s(WFe,"equalArrays");Uk=WFe});function qFe(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var bre,Tre=_(()=>{"use strict";s(qFe,"mapToArray");bre=qFe});function jFe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Wm,Yk=_(()=>{"use strict";s(jFe,"setToArray");Wm=jFe});function s9e(e,t,r,n,i,a,o){switch(r){case i9e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case n9e:return!(e.byteLength!=t.byteLength||!a(new zm(e),new zm(t)));case YFe:case KFe:case ZFe:return Ba(+e,+t);case XFe:return e.name==t.name&&e.message==t.message;case JFe:case t9e:return e==t+"";case QFe:var l=bre;case e9e:var u=n&HFe;if(l||(l=Wm),e.size!=t.size&&!u)return!1;var h=o.get(e);if(h)return h==t;n|=UFe,o.set(e,t);var d=Uk(l(e),l(t),n,i,a,o);return o.delete(e),d;case r9e:if(v5)return v5.call(e)==v5.call(t)}return!1}var HFe,UFe,YFe,KFe,XFe,QFe,ZFe,JFe,e9e,t9e,r9e,n9e,i9e,Cre,v5,kre,Sre=_(()=>{"use strict";Pd();y5();Od();S5();Tre();Yk();HFe=1,UFe=2,YFe="[object Boolean]",KFe="[object Date]",XFe="[object Error]",QFe="[object Map]",ZFe="[object Number]",JFe="[object RegExp]",e9e="[object Set]",t9e="[object String]",r9e="[object Symbol]",n9e="[object ArrayBuffer]",i9e="[object DataView]",Cre=Ni?Ni.prototype:void 0,v5=Cre?Cre.valueOf:void 0;s(s9e,"equalByTag");kre=s9e});function c9e(e,t,r,n,i,a){var o=r&a9e,l=rx(e),u=l.length,h=rx(t),d=h.length;if(u!=d&&!o)return!1;for(var f=u;f--;){var p=l[f];if(!(o?p in t:l9e.call(t,p)))return!1}var g=a.get(e),m=a.get(t);if(g&&m)return g==t&&m==e;var y=!0;a.set(e,t),a.set(t,e);for(var x=o;++f<u;){p=l[f];var T=e[p],C=t[p];if(n)var k=o?n(C,T,p,t,e,a):n(T,C,p,e,t,a);if(!(k===void 0?T===C||i(T,C,r,n,a):k)){y=!1;break}x||(x=p=="constructor")}if(y&&!x){var E=e.constructor,v=t.constructor;E!=v&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof v=="function"&&v instanceof v)&&(y=!1)}return a.delete(e),a.delete(t),y}var a9e,o9e,l9e,vre,Ere=_(()=>{"use strict";m5();a9e=1,o9e=Object.prototype,l9e=o9e.hasOwnProperty;s(c9e,"equalObjects");vre=c9e});function d9e(e,t,r,n,i,a){var o=wr(e),l=wr(t),u=o?_re:pa(e),h=l?_re:pa(t);u=u==wre?Kk:u,h=h==wre?Kk:h;var d=u==Kk,f=h==Kk,p=u==h;if(p&&ko(e)){if(!ko(t))return!1;o=!0,d=!1}if(p&&!d)return a||(a=new pl),o||Hu(e)?Uk(e,t,r,n,i,a):kre(e,t,u,r,n,i,a);if(!(r&u9e)){var g=d&&Are.call(e,"__wrapped__"),m=f&&Are.call(t,"__wrapped__");if(g||m){var y=g?e.value():e,x=m?t.value():t;return a||(a=new pl),i(y,x,r,n,a)}}return p?(a||(a=new pl),vre(e,t,r,n,i,a)):!1}var u9e,wre,_re,Kk,h9e,Are,Rre,Lre=_(()=>{"use strict";tx();S5();Sre();Ere();Fd();oi();Rm();Y1();u9e=1,wre="[object Arguments]",_re="[object Array]",Kk="[object Object]",h9e=Object.prototype,Are=h9e.hasOwnProperty;s(d9e,"baseIsEqualDeep");Rre=d9e});function Dre(e,t,r,n,i){return e===t?!0:e==null||t==null||!Xn(e)&&!Xn(t)?e!==e&&t!==t:Rre(e,t,r,n,Dre,i)}var Xk,E5=_(()=>{"use strict";Lre();To();s(Dre,"baseIsEqual");Xk=Dre});function m9e(e,t,r,n){var i=r.length,a=i,o=!n;if(e==null)return!a;for(e=Object(e);i--;){var l=r[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=r[i];var u=l[0],h=e[u],d=l[1];if(o&&l[2]){if(h===void 0&&!(u in e))return!1}else{var f=new pl;if(n)var p=n(h,d,u,e,t,f);if(!(p===void 0?Xk(d,h,f9e|p9e,n,f):p))return!1}}return!0}var f9e,p9e,Ire,Nre=_(()=>{"use strict";tx();E5();f9e=1,p9e=2;s(m9e,"baseIsMatch");Ire=m9e});function g9e(e){return e===e&&!In(e)}var Qk,w5=_(()=>{"use strict";$a();s(g9e,"isStrictComparable");Qk=g9e});function y9e(e){for(var t=qn(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Qk(i)]}return t}var Pre,Mre=_(()=>{"use strict";w5();bc();s(y9e,"getMatchData");Pre=y9e});function x9e(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Zk,_5=_(()=>{"use strict";s(x9e,"matchesStrictComparable");Zk=x9e});function b9e(e){var t=Pre(e);return t.length==1&&t[0][2]?Zk(t[0][0],t[0][1]):function(r){return r===e||Ire(r,e,t)}}var Ore,$re=_(()=>{"use strict";Nre();Mre();_5();s(b9e,"baseMatches");Ore=b9e});function T9e(e,t){return e!=null&&t in Object(e)}var Bre,Fre=_(()=>{"use strict";s(T9e,"baseHasIn");Bre=T9e});function C9e(e,t,r){t=Zu(t,e);for(var n=-1,i=t.length,a=!1;++n<i;){var o=fl(t[n]);if(!(a=e!=null&&r(e,o)))break;e=e[o]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&_m(i)&&Gu(o,i)&&(wr(e)||Co(e)))}var Jk,A5=_(()=>{"use strict";J1();Am();oi();G1();Tk();Mm();s(C9e,"hasPath");Jk=C9e});function k9e(e,t){return e!=null&&Jk(e,t,Bre)}var eS,R5=_(()=>{"use strict";Fre();A5();s(k9e,"hasIn");eS=k9e});function E9e(e,t){return Dm(e)&&Qk(t)?Zk(fl(e),t):function(r){var n=Hee(r,e);return n===void 0&&n===t?eS(r,e):Xk(t,n,S9e|v9e)}}var S9e,v9e,Gre,zre=_(()=>{"use strict";E5();Uee();R5();Ek();w5();_5();Mm();S9e=1,v9e=2;s(E9e,"baseMatchesProperty");Gre=E9e});function w9e(e){return function(t){return t?.[e]}}var tS,L5=_(()=>{"use strict";s(w9e,"baseProperty");tS=w9e});function _9e(e){return function(t){return Ju(t,e)}}var Vre,Wre=_(()=>{"use strict";ex();s(_9e,"basePropertyDeep");Vre=_9e});function A9e(e){return Dm(e)?tS(fl(e)):Vre(e)}var qre,jre=_(()=>{"use strict";L5();Wre();Ek();Mm();s(A9e,"property");qre=A9e});function R9e(e){return typeof e=="function"?e:e==null?Os:typeof e=="object"?wr(e)?Gre(e[0],e[1]):Ore(e):qre(e)}var is,Cc=_(()=>{"use strict";$re();zre();Bu();oi();jre();s(R9e,"baseIteratee");is=R9e});function L9e(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),l=o.length;l--;){var u=o[e?l:++i];if(r(a[u],u,a)===!1)break}return t}}var Hre,Ure=_(()=>{"use strict";s(L9e,"createBaseFor");Hre=L9e});var D9e,qm,rS=_(()=>{"use strict";Ure();D9e=Hre(),qm=D9e});function I9e(e,t){return e&&qm(e,t,qn)}var jm,nS=_(()=>{"use strict";rS();bc();s(I9e,"baseForOwn");jm=I9e});function N9e(e,t){return function(r,n){if(r==null)return r;if(!Pi(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++a<i)&&n(o[a],a,o)!==!1;);return r}}var Yre,Kre=_(()=>{"use strict";dl();s(N9e,"createBaseEach");Yre=N9e});var P9e,th,nx=_(()=>{"use strict";nS();Kre();P9e=Yre(jm),th=P9e});var M9e,iS,Xre=_(()=>{"use strict";Oa();M9e=s(function(){return Wn.Date.now()},"now"),iS=M9e});var Qre,O9e,$9e,D5,Zre=_(()=>{"use strict";W1();Od();q1();Uu();Qre=Object.prototype,O9e=Qre.hasOwnProperty,$9e=Wu(function(e,t){e=Object(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&yc(t[0],t[1],i)&&(n=1);++r<n;)for(var a=t[r],o=Fs(a),l=-1,u=o.length;++l<u;){var h=o[l],d=e[h];(d===void 0||Ba(d,Qre[h])&&!O9e.call(e,h))&&(e[h]=a[h])}return e}),D5=$9e});function B9e(e,t,r){(r!==void 0&&!Ba(e[t],r)||r===void 0&&!(t in e))&&zu(e,t,r)}var ix,I5=_(()=>{"use strict";z1();Od();s(B9e,"assignMergeValue");ix=B9e});function F9e(e){return Xn(e)&&Pi(e)}var sS,N5=_(()=>{"use strict";dl();To();s(F9e,"isArrayLikeObject");sS=F9e});function G9e(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var sx,P5=_(()=>{"use strict";s(G9e,"safeGet");sx=G9e});function z9e(e){return hl(e,Fs(e))}var Jre,ene=_(()=>{"use strict";wm();Uu();s(z9e,"toPlainObject");Jre=z9e});function V9e(e,t,r,n,i,a,o){var l=sx(e,r),u=sx(t,r),h=o.get(u);if(h){ix(e,r,h);return}var d=a?a(l,u,r+"",e,t,o):void 0,f=d===void 0;if(f){var p=wr(u),g=!p&&ko(u),m=!p&&!g&&Hu(u);d=u,p||g||m?wr(l)?d=l:sS(l)?d=mk(l):g?(f=!1,d=Ik(u,!0)):m?(f=!1,d=zk(u,!0)):d=[]:tte(u)||Co(u)?(d=l,Co(l)?d=Jre(l):(!In(l)||ul(l))&&(d=Vk(u))):f=!1}f&&(o.set(u,d),i(d,u,n,a,o),o.delete(u)),ix(e,r,d)}var tne,rne=_(()=>{"use strict";I5();u5();x5();KI();b5();Am();oi();N5();Rm();F1();$a();rte();Y1();P5();ene();s(V9e,"baseMergeDeep");tne=V9e});function nne(e,t,r,n,i){e!==t&&qm(t,function(a,o){if(i||(i=new pl),In(a))tne(e,t,o,r,nne,n,i);else{var l=n?n(sx(e,o),a,o+"",e,t,i):void 0;l===void 0&&(l=a),ix(e,o,l)}},Fs)}var ine,sne=_(()=>{"use strict";tx();I5();rS();rne();$a();Uu();P5();s(nne,"baseMerge");ine=nne});function W9e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var ane,one=_(()=>{"use strict";s(W9e,"arrayIncludesWith");ane=W9e});function q9e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var rh,lne=_(()=>{"use strict";s(q9e,"last");rh=q9e});function j9e(e){return typeof e=="function"?e:Os}var Hm,aS=_(()=>{"use strict";Bu();s(j9e,"castFunction");Hm=j9e});function H9e(e,t){var r=wr(e)?yk:th;return r(e,Hm(t))}var He,M5=_(()=>{"use strict";JI();nx();aS();oi();s(H9e,"forEach");He=H9e});var cne=_(()=>{"use strict";M5()});function U9e(e,t){var r=[];return th(e,function(n,i,a){t(n,i,a)&&r.push(n)}),r}var une,hne=_(()=>{"use strict";nx();s(U9e,"baseFilter");une=U9e});function Y9e(e,t){var r=wr(e)?Nk:une;return r(e,is(t,3))}var xs,dne=_(()=>{"use strict";h5();hne();Cc();oi();s(Y9e,"filter");xs=Y9e});function K9e(e){return function(t,r,n){var i=Object(t);if(!Pi(t)){var a=is(r,3);t=qn(t),r=s(function(l){return a(i[l],l,i)},"predicate")}var o=e(t,r,n);return o>-1?i[a?t[o]:o]:void 0}}var fne,pne=_(()=>{"use strict";Cc();dl();bc();s(K9e,"createFind");fne=K9e});function Q9e(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:cJ(r);return i<0&&(i=X9e(n+i,0)),xk(e,is(t,3),i)}var X9e,mne,gne=_(()=>{"use strict";e5();Cc();uJ();X9e=Math.max;s(Q9e,"findIndex");mne=Q9e});var Z9e,Um,yne=_(()=>{"use strict";pne();gne();Z9e=fne(mne),Um=Z9e});function J9e(e,t){var r=-1,n=Pi(e)?Array(e.length):[];return th(e,function(i,a,o){n[++r]=t(i,a,o)}),n}var oS,O5=_(()=>{"use strict";nx();dl();s(J9e,"baseMap");oS=J9e});function eGe(e,t){var r=wr(e)?cl:oS;return r(e,is(t,3))}var an,xne=_(()=>{"use strict";B1();Cc();O5();oi();s(eGe,"map");an=eGe});function tGe(e,t){return e==null?e:qm(e,Hm(t),Fs)}var $5,bne=_(()=>{"use strict";rS();aS();Uu();s(tGe,"forIn");$5=tGe});function rGe(e,t){return e&&jm(e,Hm(t))}var B5,Tne=_(()=>{"use strict";nS();aS();s(rGe,"forOwn");B5=rGe});function nGe(e,t){return e>t}var Cne,kne=_(()=>{"use strict";s(nGe,"baseGt");Cne=nGe});function aGe(e,t){return e!=null&&sGe.call(e,t)}var iGe,sGe,Sne,vne=_(()=>{"use strict";iGe=Object.prototype,sGe=iGe.hasOwnProperty;s(aGe,"baseHas");Sne=aGe});function oGe(e,t){return e!=null&&Jk(e,t,Sne)}var ax,Ene=_(()=>{"use strict";vne();A5();s(oGe,"has");ax=oGe});function cGe(e){return typeof e=="string"||!wr(e)&&Xn(e)&&ys(e)==lGe}var lGe,wne,_ne=_(()=>{"use strict";$u();oi();To();lGe="[object String]";s(cGe,"isString");wne=cGe});function uGe(e,t){return cl(t,function(r){return e[r]})}var Ane,Rne=_(()=>{"use strict";B1();s(uGe,"baseValues");Ane=uGe});function hGe(e){return e==null?[]:Ane(e,qn(e))}var ma,Lne=_(()=>{"use strict";Rne();bc();s(hGe,"values");ma=hGe});function gGe(e){if(e==null)return!0;if(Pi(e)&&(wr(e)||typeof e=="string"||typeof e.splice=="function"||ko(e)||Hu(e)||Co(e)))return!e.length;var t=pa(e);if(t==dGe||t==fGe)return!e.size;if(qu(e))return!Lm(e).length;for(var r in e)if(mGe.call(e,r))return!1;return!0}var dGe,fGe,pGe,mGe,lS,Dne=_(()=>{"use strict";vk();Fd();Am();oi();dl();Rm();j1();Y1();dGe="[object Map]",fGe="[object Set]",pGe=Object.prototype,mGe=pGe.hasOwnProperty;s(gGe,"isEmpty");lS=gGe});function yGe(e){return e===void 0}var jn,Ine=_(()=>{"use strict";s(yGe,"isUndefined");jn=yGe});function xGe(e,t){return e<t}var cS,F5=_(()=>{"use strict";s(xGe,"baseLt");cS=xGe});function bGe(e,t){var r={};return t=is(t,3),jm(e,function(n,i,a){zu(r,i,t(n,i,a))}),r}var Gd,Nne=_(()=>{"use strict";z1();nS();Cc();s(bGe,"mapValues");Gd=bGe});function TGe(e,t,r){for(var n=-1,i=e.length;++n<i;){var a=e[n],o=t(a);if(o!=null&&(l===void 0?o===o&&!fa(o):r(o,l)))var l=o,u=a}return u}var Ym,uS=_(()=>{"use strict";Md();s(TGe,"baseExtremum");Ym=TGe});function CGe(e){return e&&e.length?Ym(e,Os,Cne):void 0}var Gs,Pne=_(()=>{"use strict";uS();kne();Bu();s(CGe,"max");Gs=CGe});var kGe,Km,Mne=_(()=>{"use strict";sne();zJ();kGe=GJ(function(e,t,r){ine(e,t,r)}),Km=kGe});function SGe(e){return e&&e.length?Ym(e,Os,cS):void 0}var kc,One=_(()=>{"use strict";uS();F5();Bu();s(SGe,"min");kc=SGe});function vGe(e,t){return e&&e.length?Ym(e,is(t,2),cS):void 0}var zd,$ne=_(()=>{"use strict";uS();Cc();F5();s(vGe,"minBy");zd=vGe});function EGe(e,t,r,n){if(!In(e))return e;t=Zu(t,e);for(var i=-1,a=t.length,o=a-1,l=e;l!=null&&++i<a;){var u=fl(t[i]),h=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(i!=o){var d=l[u];h=n?n(d,u,l):void 0,h===void 0&&(h=In(d)?d:Gu(t[i+1])?[]:{})}Vu(l,u,h),l=l[u]}return e}var Bne,Fne=_(()=>{"use strict";V1();J1();G1();$a();Mm();s(EGe,"baseSet");Bne=EGe});function wGe(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],l=Ju(e,o);r(l,o)&&Bne(a,Zu(o,e),l)}return a}var Gne,zne=_(()=>{"use strict";ex();Fne();J1();s(wGe,"basePickBy");Gne=wGe});function _Ge(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var Vne,Wne=_(()=>{"use strict";s(_Ge,"baseSortBy");Vne=_Ge});function AGe(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,a=fa(e),o=t!==void 0,l=t===null,u=t===t,h=fa(t);if(!l&&!h&&!a&&e>t||a&&o&&u&&!l&&!h||n&&o&&u||!r&&u||!i)return 1;if(!n&&!a&&!h&&e<t||h&&r&&i&&!n&&!a||l&&r&&i||!o&&i||!u)return-1}return 0}var qne,jne=_(()=>{"use strict";Md();s(AGe,"compareAscending");qne=AGe});function RGe(e,t,r){for(var n=-1,i=e.criteria,a=t.criteria,o=i.length,l=r.length;++n<o;){var u=qne(i[n],a[n]);if(u){if(n>=l)return u;var h=r[n];return u*(h=="desc"?-1:1)}}return e.index-t.index}var Hne,Une=_(()=>{"use strict";jne();s(RGe,"compareMultiple");Hne=RGe});function LGe(e,t,r){t.length?t=cl(t,function(a){return wr(a)?function(o){return Ju(o,a.length===1?a[0]:a)}:a}):t=[Os];var n=-1;t=cl(t,ju(is));var i=oS(e,function(a,o,l){var u=cl(t,function(h){return h(a)});return{criteria:u,index:++n,value:a}});return Vne(i,function(a,o){return Hne(a,o,r)})}var Yne,Kne=_(()=>{"use strict";B1();ex();Cc();O5();Wne();H1();Une();Bu();oi();s(LGe,"baseOrderBy");Yne=LGe});var DGe,Xne,Qne=_(()=>{"use strict";L5();DGe=tS("length"),Xne=DGe});function WGe(e){for(var t=Zne.lastIndex=0;Zne.test(e);)++t;return t}var Jne,IGe,NGe,PGe,MGe,OGe,$Ge,G5,z5,BGe,eie,tie,rie,FGe,nie,iie,GGe,zGe,VGe,Zne,sie,aie=_(()=>{"use strict";Jne="\\ud800-\\udfff",IGe="\\u0300-\\u036f",NGe="\\ufe20-\\ufe2f",PGe="\\u20d0-\\u20ff",MGe=IGe+NGe+PGe,OGe="\\ufe0e\\ufe0f",$Ge="["+Jne+"]",G5="["+MGe+"]",z5="\\ud83c[\\udffb-\\udfff]",BGe="(?:"+G5+"|"+z5+")",eie="[^"+Jne+"]",tie="(?:\\ud83c[\\udde6-\\uddff]){2}",rie="[\\ud800-\\udbff][\\udc00-\\udfff]",FGe="\\u200d",nie=BGe+"?",iie="["+OGe+"]?",GGe="(?:"+FGe+"(?:"+[eie,tie,rie].join("|")+")"+iie+nie+")*",zGe=iie+nie+GGe,VGe="(?:"+[eie+G5+"?",G5,tie,rie,$Ge].join("|")+")",Zne=RegExp(z5+"(?="+z5+")|"+VGe+zGe,"g");s(WGe,"unicodeSize");sie=WGe});function qGe(e){return nte(e)?sie(e):Xne(e)}var oie,lie=_(()=>{"use strict";Qne();ite();aie();s(qGe,"stringSize");oie=qGe});function jGe(e,t){return Gne(e,t,function(r,n){return eS(e,n)})}var cie,uie=_(()=>{"use strict";zne();R5();s(jGe,"basePick");cie=jGe});var HGe,Vd,hie=_(()=>{"use strict";uie();Jee();HGe=Zee(function(e,t){return e==null?{}:cie(e,t)}),Vd=HGe});function KGe(e,t,r,n){for(var i=-1,a=YGe(UGe((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var UGe,YGe,die,fie=_(()=>{"use strict";UGe=Math.ceil,YGe=Math.max;s(KGe,"baseRange");die=KGe});function XGe(e){return function(t,r,n){return n&&typeof n!="number"&&yc(t,r,n)&&(r=n=void 0),t=vm(t),r===void 0?(r=t,t=0):r=vm(r),n=n===void 0?t<r?1:-1:vm(n),die(t,r,n,e)}}var pie,mie=_(()=>{"use strict";fie();q1();UI();s(XGe,"createRange");pie=XGe});var QGe,Ga,gie=_(()=>{"use strict";mie();QGe=pie(),Ga=QGe});function ZGe(e,t,r,n,i){return i(e,function(a,o,l){r=n?(n=!1,a):t(r,a,o,l)}),r}var yie,xie=_(()=>{"use strict";s(ZGe,"baseReduce");yie=ZGe});function JGe(e,t,r){var n=wr(e)?ste:yie,i=arguments.length<3;return n(e,is(t,4),r,i,th)}var ml,bie=_(()=>{"use strict";ate();nx();Cc();xie();oi();s(JGe,"reduce");ml=JGe});function rze(e){if(e==null)return 0;if(Pi(e))return wne(e)?oie(e):e.length;var t=pa(e);return t==eze||t==tze?e.size:Lm(e).length}var eze,tze,V5,Tie=_(()=>{"use strict";vk();Fd();dl();_ne();lie();eze="[object Map]",tze="[object Set]";s(rze,"size");V5=rze});var nze,gl,Cie=_(()=>{"use strict";Lk();Kne();W1();q1();nze=Wu(function(e,t){if(e==null)return[];var r=t.length;return r>1&&yc(e,t[0],t[1])?t=[]:r>2&&yc(t[0],t[1],t[2])&&(t=[t[0]]),Yne(e,$m(t,1),[])}),gl=nze});var ize,sze,kie,Sie=_(()=>{"use strict";g5();wJ();Yk();ize=1/0,sze=eh&&1/Wm(new eh([,-0]))[1]==ize?function(e){return new eh(e)}:EJ,kie=sze});function oze(e,t,r){var n=-1,i=$J,a=e.length,o=!0,l=[],u=l;if(r)o=!1,i=ane;else if(a>=aze){var h=t?null:kie(e);if(h)return Wm(h);o=!1,i=Hk,u=new jk}else u=t?[]:l;e:for(;++n<a;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,o&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;t&&u.push(f),l.push(d)}else i(u,f,r)||(u!==l&&u.push(f),l.push(d))}return l}var aze,vie,Eie=_(()=>{"use strict";C5();BJ();one();k5();Sie();Yk();aze=200;s(oze,"baseUniq");vie=oze});var lze,W5,wie=_(()=>{"use strict";Lk();W1();Eie();N5();lze=Wu(function(e){return vie($m(e,1,sS,!0))}),W5=lze});function uze(e){var t=++cze;return Ak(e)+t}var cze,Wd,_ie=_(()=>{"use strict";l5();cze=0;s(uze,"uniqueId");Wd=uze});function hze(e,t,r){for(var n=-1,i=e.length,a=t.length,o={};++n<i;){var l=n<a?t[n]:void 0;r(o,e[n],l)}return o}var Aie,Rie=_(()=>{"use strict";s(hze,"baseZipObject");Aie=hze});function dze(e,t){return Aie(e||[],t||[],Vu)}var hS,Lie=_(()=>{"use strict";V1();Rie();s(dze,"zipObject");hS=dze});var on=_(()=>{"use strict";dre();XI();Zre();cne();dne();yne();c5();M5();bne();Tne();Ene();oi();Dne();F1();Ine();bc();lne();xne();Nne();Pne();Mne();One();$ne();Xre();hie();gie();bie();Tie();Cie();wie();_ie();Lne();Lie();});function Iie(e,t){e[t]?e[t]++:e[t]=1}function Nie(e,t){--e[t]||delete e[t]}function ox(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}return i+Die+a+Die+(jn(n)?fze:n)}function pze(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}var l={v:i,w:a};return n&&(l.name=n),l}function q5(e,t){return ox(e,t.v,t.w,t.name)}var fze,qd,Die,Qr,j5=_(()=>{"use strict";on();fze="\0",qd="\0",Die="",Qr=class{static{s(this,"Graph")}constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Bs(void 0),this._defaultEdgeLabelFn=Bs(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[qd]={}),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(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return ul(t)||(t=Bs(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return qn(this._nodes)}sources(){var t=this;return xs(this.nodes(),function(r){return lS(t._in[r])})}sinks(){var t=this;return xs(this.nodes(),function(r){return lS(t._out[r])})}setNodes(t,r){var n=arguments,i=this;return He(t,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=qd,this._children[t]={},this._children[qd][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=s(n=>this.removeEdge(this._edgeObjs[n]),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],He(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),He(qn(this._in[t]),r),delete this._in[t],delete this._preds[t],He(qn(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(jn(r))r=qd;else{r+="";for(var n=r;!jn(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==qd)return r}}children(t){if(jn(t)&&(t=qd),this._isCompound){var r=this._children[t];if(r)return qn(r)}else{if(t===qd)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return qn(r)}successors(t){var r=this._sucs[t];if(r)return qn(r)}neighbors(t){var r=this.predecessors(t);if(r)return W5(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;He(this._nodes,function(o,l){t(l)&&r.setNode(l,o)}),He(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var l=n.parent(o);return l===void 0||r.hasNode(l)?(i[o]=l,l):l in i?i[l]:a(l)}return s(a,"findParent"),this._isCompound&&He(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(t){return ul(t)||(t=Bs(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return ma(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return ml(t,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var t,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(t=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(t=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,r=""+r,jn(n)||(n=""+n);var l=ox(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(!jn(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(t,r,n);var u=pze(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[l]=u,Iie(this._preds[r],t),Iie(this._sucs[t],r),this._in[r][l]=u,this._out[t][l]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n),a=this._edgeObjs[i];return a&&(t=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Nie(this._preds[r],t),Nie(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=ma(n);return r?xs(i,function(a){return a.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=ma(n);return r?xs(i,function(a){return a.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}};Qr.prototype._nodeCount=0;Qr.prototype._edgeCount=0;s(Iie,"incrementOrInitEntry");s(Nie,"decrementOrRemoveEntry");s(ox,"edgeArgsToId");s(pze,"edgeArgsToObj");s(q5,"edgeObjToId")});var ga=_(()=>{"use strict";j5()});function Pie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function mze(e,t){if(e!=="_next"&&e!=="_prev")return t}var dS,Mie=_(()=>{"use strict";dS=class{static{s(this,"List")}constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,r=t._prev;if(r!==t)return Pie(r),r}enqueue(t){var r=this._sentinel;t._prev&&t._next&&Pie(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){for(var t=[],r=this._sentinel,n=r._prev;n!==r;)t.push(JSON.stringify(n,mze)),n=n._prev;return"["+t.join(", ")+"]"}};s(Pie,"unlink");s(mze,"filterOutLinks")});function Oie(e,t){if(e.nodeCount()<=1)return[];var r=xze(e,t||gze),n=yze(r.graph,r.buckets,r.zeroIdx);return Fa(an(n,function(i){return e.outEdges(i.v,i.w)}))}function yze(e,t,r){for(var n=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)H5(e,t,r,o);for(;o=i.dequeue();)H5(e,t,r,o);if(e.nodeCount()){for(var l=t.length-2;l>0;--l)if(o=t[l].dequeue(),o){n=n.concat(H5(e,t,r,o,!0));break}}}return n}function H5(e,t,r,n,i){var a=i?[]:void 0;return He(e.inEdges(n.v),function(o){var l=e.edge(o),u=e.node(o.v);i&&a.push({v:o.v,w:o.w}),u.out-=l,U5(t,r,u)}),He(e.outEdges(n.v),function(o){var l=e.edge(o),u=o.w,h=e.node(u);h.in-=l,U5(t,r,h)}),e.removeNode(n.v),a}function xze(e,t){var r=new Qr,n=0,i=0;He(e.nodes(),function(l){r.setNode(l,{v:l,in:0,out:0})}),He(e.edges(),function(l){var u=r.edge(l.v,l.w)||0,h=t(l),d=u+h;r.setEdge(l.v,l.w,d),i=Math.max(i,r.node(l.v).out+=h),n=Math.max(n,r.node(l.w).in+=h)});var a=Ga(i+n+3).map(function(){return new dS}),o=n+1;return He(r.nodes(),function(l){U5(a,o,r.node(l))}),{graph:r,buckets:a,zeroIdx:o}}function U5(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var gze,$ie=_(()=>{"use strict";on();ga();Mie();gze=Bs(1);s(Oie,"greedyFAS");s(yze,"doGreedyFAS");s(H5,"removeNode");s(xze,"buildState");s(U5,"assignBucket")});function Bie(e){var t=e.graph().acyclicer==="greedy"?Oie(e,r(e)):bze(e);He(t,function(n){var i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,Wd("rev"))});function r(n){return function(i){return n.edge(i).weight}}s(r,"weightFn")}function bze(e){var t=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,He(e.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?t.push(o):i(o.w)}),delete r[a])}return s(i,"dfs"),He(e.nodes(),i),t}function Fie(e){He(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}var Y5=_(()=>{"use strict";on();$ie();s(Bie,"run");s(bze,"dfsFAS");s(Fie,"undo")});function yl(e,t,r,n){var i;do i=Wd(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function zie(e){var t=new Qr().setGraph(e.graph());return He(e.nodes(),function(r){t.setNode(r,e.node(r))}),He(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function fS(e){var t=new Qr({multigraph:e.isMultigraph()}).setGraph(e.graph());return He(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),He(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function K5(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,l=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,h;return Math.abs(a)*o>Math.abs(i)*l?(a<0&&(l=-l),u=l*i/a,h=l):(i<0&&(o=-o),u=o,h=o*a/i),{x:r+u,y:n+h}}function nh(e){var t=an(Ga(Q5(e)+1),function(){return[]});return He(e.nodes(),function(r){var n=e.node(r),i=n.rank;jn(i)||(t[i][n.order]=r)}),t}function Vie(e){var t=kc(an(e.nodes(),function(r){return e.node(r).rank}));He(e.nodes(),function(r){var n=e.node(r);ax(n,"rank")&&(n.rank-=t)})}function Wie(e){var t=kc(an(e.nodes(),function(a){return e.node(a).rank})),r=[];He(e.nodes(),function(a){var o=e.node(a).rank-t;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=e.graph().nodeRankFactor;He(r,function(a,o){jn(a)&&o%i!==0?--n:n&&He(a,function(l){e.node(l).rank+=n})})}function X5(e,t,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),yl(e,"border",i,t)}function Q5(e){return Gs(an(e.nodes(),function(t){var r=e.node(t).rank;if(!jn(r))return r}))}function qie(e,t){var r={lhs:[],rhs:[]};return He(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function jie(e,t){var r=iS();try{return t()}finally{console.log(e+" time: "+(iS()-r)+"ms")}}function Hie(e,t){return t()}var xl=_(()=>{"use strict";on();ga();s(yl,"addDummyNode");s(zie,"simplify");s(fS,"asNonCompoundGraph");s(K5,"intersectRect");s(nh,"buildLayerMatrix");s(Vie,"normalizeRanks");s(Wie,"removeEmptyRanks");s(X5,"addBorderNode");s(Q5,"maxRank");s(qie,"partition");s(jie,"time");s(Hie,"notime")});function Yie(e){function t(r){var n=e.children(r),i=e.node(r);if(n.length&&He(n,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Uie(e,"borderLeft","_bl",r,i,a),Uie(e,"borderRight","_br",r,i,a)}}s(t,"dfs"),He(e.children(),t)}function Uie(e,t,r,n,i,a){var o={width:0,height:0,rank:a,borderType:t},l=i[t][a-1],u=yl(e,"border",o,r);i[t][a]=u,e.setParent(u,n),l&&e.setEdge(l,u,{weight:1})}var Kie=_(()=>{"use strict";on();xl();s(Yie,"addBorderSegments");s(Uie,"addBorderNode")});function Qie(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&Jie(e)}function Zie(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&Tze(e),(t==="lr"||t==="rl")&&(Cze(e),Jie(e))}function Jie(e){He(e.nodes(),function(t){Xie(e.node(t))}),He(e.edges(),function(t){Xie(e.edge(t))})}function Xie(e){var t=e.width;e.width=e.height,e.height=t}function Tze(e){He(e.nodes(),function(t){Z5(e.node(t))}),He(e.edges(),function(t){var r=e.edge(t);He(r.points,Z5),Object.prototype.hasOwnProperty.call(r,"y")&&Z5(r)})}function Z5(e){e.y=-e.y}function Cze(e){He(e.nodes(),function(t){J5(e.node(t))}),He(e.edges(),function(t){var r=e.edge(t);He(r.points,J5),Object.prototype.hasOwnProperty.call(r,"x")&&J5(r)})}function J5(e){var t=e.x;e.x=e.y,e.y=t}var ese=_(()=>{"use strict";on();s(Qie,"adjust");s(Zie,"undo");s(Jie,"swapWidthHeight");s(Xie,"swapWidthHeightOne");s(Tze,"reverseY");s(Z5,"reverseYOne");s(Cze,"swapXY");s(J5,"swapXYOne")});function tse(e){e.graph().dummyChains=[],He(e.edges(),function(t){Sze(e,t)})}function Sze(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,l=e.edge(t),u=l.labelRank;if(a!==n+1){e.removeEdge(t);var h=void 0,d,f;for(f=0,++n;n<a;++f,++n)l.points=[],h={width:0,height:0,edgeLabel:l,edgeObj:t,rank:n},d=yl(e,"edge",h,"_d"),n===u&&(h.width=l.width,h.height=l.height,h.dummy="edge-label",h.labelpos=l.labelpos),e.setEdge(r,d,{weight:l.weight},o),f===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:l.weight},o)}}function rse(e){He(e.graph().dummyChains,function(t){var r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),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),t=i,r=e.node(t)})}var eN=_(()=>{"use strict";on();xl();s(tse,"run");s(Sze,"normalizeEdge");s(rse,"undo")});function cx(e){var t={};function r(n){var i=e.node(n);if(Object.prototype.hasOwnProperty.call(t,n))return i.rank;t[n]=!0;var a=kc(an(e.outEdges(n),function(o){return r(o.w)-e.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}s(r,"dfs"),He(e.sources(),r)}function jd(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var pS=_(()=>{"use strict";on();s(cx,"longestPath");s(jd,"slack")});function mS(e){var t=new Qr({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,a;vze(t,e)<n;)i=Eze(t,e),a=t.hasNode(i.v)?jd(e,i):-jd(e,i),wze(t,e,a);return t}function vze(e,t){function r(n){He(t.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;!e.hasNode(o)&&!jd(t,i)&&(e.setNode(o,{}),e.setEdge(n,o,{}),r(o))})}return s(r,"dfs"),He(e.nodes(),r),e.nodeCount()}function Eze(e,t){return zd(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return jd(t,r)})}function wze(e,t,r){He(e.nodes(),function(n){t.node(n).rank+=r})}var tN=_(()=>{"use strict";on();ga();pS();s(mS,"feasibleTree");s(vze,"tightTree");s(Eze,"findMinSlackEdge");s(wze,"shiftRanks")});var ise=_(()=>{"use strict"});var rN=_(()=>{"use strict"});var Olr,nN=_(()=>{"use strict";on();rN();Olr=Bs(1)});var sse=_(()=>{"use strict";nN()});var iN=_(()=>{"use strict"});var ase=_(()=>{"use strict";iN()});var Ulr,ose=_(()=>{"use strict";on();Ulr=Bs(1)});function sN(e){var t={},r={},n=[];function i(a){if(Object.prototype.hasOwnProperty.call(r,a))throw new ux;Object.prototype.hasOwnProperty.call(t,a)||(r[a]=!0,t[a]=!0,He(e.predecessors(a),i),delete r[a],n.push(a))}if(s(i,"visit"),He(e.sinks(),i),V5(t)!==e.nodeCount())throw new ux;return n}function ux(){}var aN=_(()=>{"use strict";on();sN.CycleException=ux;s(sN,"topsort");s(ux,"CycleException");ux.prototype=new Error});var lse=_(()=>{"use strict";aN()});function gS(e,t,r){wr(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return He(t,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);cse(e,o,r==="post",a,n,i)}),i}function cse(e,t,r,n,i,a){Object.prototype.hasOwnProperty.call(n,t)||(n[t]=!0,r||a.push(t),He(i(t),function(o){cse(e,o,r,n,i,a)}),r&&a.push(t))}var oN=_(()=>{"use strict";on();s(gS,"dfs");s(cse,"doDfs")});function lN(e,t){return gS(e,t,"post")}var use=_(()=>{"use strict";oN();s(lN,"postorder")});function cN(e,t){return gS(e,t,"pre")}var hse=_(()=>{"use strict";oN();s(cN,"preorder")});var dse=_(()=>{"use strict";rN();j5()});var fse=_(()=>{"use strict";ise();nN();sse();ase();ose();lse();use();hse();dse();iN();aN()});function sh(e){e=zie(e),cx(e);var t=mS(e);hN(t),uN(t,e);for(var r,n;r=yse(t);)n=xse(t,e,r),bse(t,e,r,n)}function uN(e,t){var r=lN(e,e.nodes());r=r.slice(0,r.length-1),He(r,function(n){Dze(e,t,n)})}function Dze(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=mse(e,t,r)}function mse(e,t,r){var n=e.node(r),i=n.parent,a=!0,o=t.edge(r,i),l=0;return o||(a=!1,o=t.edge(i,r)),l=o.weight,He(t.nodeEdges(r),function(u){var h=u.v===r,d=h?u.w:u.v;if(d!==i){var f=h===a,p=t.edge(u).weight;if(l+=f?p:-p,Nze(e,r,d)){var g=e.edge(r,d).cutvalue;l+=f?-g:g}}}),l}function hN(e,t){arguments.length<2&&(t=e.nodes()[0]),gse(e,{},1,t)}function gse(e,t,r,n,i){var a=r,o=e.node(n);return t[n]=!0,He(e.neighbors(n),function(l){Object.prototype.hasOwnProperty.call(t,l)||(r=gse(e,t,r,l,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function yse(e){return Um(e.edges(),function(t){return e.edge(t).cutvalue<0})}function xse(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var a=e.node(n),o=e.node(i),l=a,u=!1;a.lim>o.lim&&(l=o,u=!0);var h=xs(t.edges(),function(d){return u===pse(e,e.node(d.v),l)&&u!==pse(e,e.node(d.w),l)});return zd(h,function(d){return jd(t,d)})}function bse(e,t,r,n){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(n.v,n.w,{}),hN(e),uN(e,t),Ize(e,t)}function Ize(e,t){var r=Um(e.nodes(),function(i){return!t.node(i).parent}),n=cN(e,r);n=n.slice(1),He(n,function(i){var a=e.node(i).parent,o=t.edge(i,a),l=!1;o||(o=t.edge(a,i),l=!0),t.node(i).rank=t.node(a).rank+(l?o.minlen:-o.minlen)})}function Nze(e,t,r){return e.hasEdge(t,r)}function pse(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var Tse=_(()=>{"use strict";on();fse();xl();tN();pS();sh.initLowLimValues=hN;sh.initCutValues=uN;sh.calcCutValue=mse;sh.leaveEdge=yse;sh.enterEdge=xse;sh.exchangeEdges=bse;s(sh,"networkSimplex");s(uN,"initCutValues");s(Dze,"assignCutValue");s(mse,"calcCutValue");s(hN,"initLowLimValues");s(gse,"dfsAssignLowLim");s(yse,"leaveEdge");s(xse,"enterEdge");s(bse,"exchangeEdges");s(Ize,"updateRanks");s(Nze,"isTreeEdge");s(pse,"isDescendant")});function dN(e){switch(e.graph().ranker){case"network-simplex":Cse(e);break;case"tight-tree":Mze(e);break;case"longest-path":Pze(e);break;default:Cse(e)}}function Mze(e){cx(e),mS(e)}function Cse(e){sh(e)}var Pze,fN=_(()=>{"use strict";tN();Tse();pS();s(dN,"rank");Pze=cx;s(Mze,"tightTreeRanker");s(Cse,"networkSimplexRanker")});function kse(e){var t=yl(e,"root",{},"_root"),r=Oze(e),n=Gs(ma(r))-1,i=2*n+1;e.graph().nestingRoot=t,He(e.edges(),function(o){e.edge(o).minlen*=i});var a=$ze(e)+1;He(e.children(),function(o){Sse(e,t,i,a,n,r,o)}),e.graph().nodeRankFactor=i}function Sse(e,t,r,n,i,a,o){var l=e.children(o);if(!l.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:r});return}var u=X5(e,"_bt"),h=X5(e,"_bb"),d=e.node(o);e.setParent(u,o),d.borderTop=u,e.setParent(h,o),d.borderBottom=h,He(l,function(f){Sse(e,t,r,n,i,a,f);var p=e.node(f),g=p.borderTop?p.borderTop:f,m=p.borderBottom?p.borderBottom:f,y=p.borderTop?n:2*n,x=g!==m?1:i-a[o]+1;e.setEdge(u,g,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(m,h,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:i+a[o]})}function Oze(e){var t={};function r(n,i){var a=e.children(n);a&&a.length&&He(a,function(o){r(o,i+1)}),t[n]=i}return s(r,"dfs"),He(e.children(),function(n){r(n,1)}),t}function $ze(e){return ml(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function vse(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,He(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}var Ese=_(()=>{"use strict";on();xl();s(kse,"run");s(Sse,"dfs");s(Oze,"treeDepths");s($ze,"sumWeights");s(vse,"cleanup")});function wse(e,t,r){var n={},i;He(r,function(a){for(var o=e.parent(a),l,u;o;){if(l=e.parent(o),l?(u=n[l],n[l]=o):(u=i,i=o),u&&u!==o){t.setEdge(u,o);return}o=l}})}var _se=_(()=>{"use strict";on();s(wse,"addSubgraphConstraints")});function Ase(e,t,r){var n=Fze(e),i=new Qr({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return e.node(a)});return He(e.nodes(),function(a){var o=e.node(a),l=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,l||n),He(e[r](a),function(u){var h=u.v===a?u.w:u.v,d=i.edge(h,a),f=jn(d)?0:d.weight;i.setEdge(h,a,{weight:e.edge(u).weight+f})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Fze(e){for(var t;e.hasNode(t=Wd("_root")););return t}var Rse=_(()=>{"use strict";on();ga();s(Ase,"buildLayerGraph");s(Fze,"createRootNode")});function Lse(e,t){for(var r=0,n=1;n<t.length;++n)r+=Gze(e,t[n-1],t[n]);return r}function Gze(e,t,r){for(var n=hS(r,an(r,function(h,d){return d})),i=Fa(an(t,function(h){return gl(an(e.outEdges(h),function(d){return{pos:n[d.w],weight:e.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var o=2*a-1;a-=1;var l=an(new Array(o),function(){return 0}),u=0;return He(i.forEach(function(h){var d=h.pos+a;l[d]+=h.weight;for(var f=0;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=h.weight;u+=h.weight*f})),u}var Dse=_(()=>{"use strict";on();s(Lse,"crossCount");s(Gze,"twoLayerCrossCount")});function Ise(e){var t={},r=xs(e.nodes(),function(l){return!e.children(l).length}),n=Gs(an(r,function(l){return e.node(l).rank})),i=an(Ga(n+1),function(){return[]});function a(l){if(!ax(t,l)){t[l]=!0;var u=e.node(l);i[u.rank].push(l),He(e.successors(l),a)}}s(a,"dfs");var o=gl(r,function(l){return e.node(l).rank});return He(o,a),i}var Nse=_(()=>{"use strict";on();s(Ise,"initOrder")});function Pse(e,t){return an(t,function(r){var n=e.inEdges(r);if(n.length){var i=ml(n,function(a,o){var l=e.edge(o),u=e.node(o.v);return{sum:a.sum+l.weight*u.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}var Mse=_(()=>{"use strict";on();s(Pse,"barycenter")});function Ose(e,t){var r={};He(e,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};jn(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),He(t.edges(),function(i){var a=r[i.v],o=r[i.w];!jn(a)&&!jn(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=xs(r,function(i){return!i.indegree});return zze(n)}function zze(e){var t=[];function r(a){return function(o){o.merged||(jn(o.barycenter)||jn(a.barycenter)||o.barycenter>=a.barycenter)&&Vze(a,o)}}s(r,"handleIn");function n(a){return function(o){o.in.push(a),--o.indegree===0&&e.push(o)}}for(s(n,"handleOut");e.length;){var i=e.pop();t.push(i),He(i.in.reverse(),r(i)),He(i.out,n(i))}return an(xs(t,function(a){return!a.merged}),function(a){return Vd(a,["vs","i","barycenter","weight"])})}function Vze(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var $se=_(()=>{"use strict";on();s(Ose,"resolveConflicts");s(zze,"doResolveConflicts");s(Vze,"mergeEntries")});function Fse(e,t){var r=qie(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=gl(r.rhs,function(d){return-d.i}),a=[],o=0,l=0,u=0;n.sort(Wze(!!t)),u=Bse(a,i,u),He(n,function(d){u+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,u=Bse(a,i,u)});var h={vs:Fa(a)};return l&&(h.barycenter=o/l,h.weight=l),h}function Bse(e,t,r){for(var n;t.length&&(n=rh(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Wze(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}var Gse=_(()=>{"use strict";on();xl();s(Fse,"sort");s(Bse,"consumeUnsortable");s(Wze,"compareWithBias")});function pN(e,t,r,n){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,l=a?a.borderRight:void 0,u={};o&&(i=xs(i,function(m){return m!==o&&m!==l}));var h=Pse(e,i);He(h,function(m){if(e.children(m.v).length){var y=pN(e,m.v,r,n);u[m.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter")&&jze(m,y)}});var d=Ose(h,r);qze(d,u);var f=Fse(d,n);if(o&&(f.vs=Fa([o,f.vs,l]),e.predecessors(o).length)){var p=e.node(e.predecessors(o)[0]),g=e.node(e.predecessors(l)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}return f}function qze(e,t){He(e,function(r){r.vs=Fa(r.vs.map(function(n){return t[n]?t[n].vs:n}))})}function jze(e,t){jn(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var zse=_(()=>{"use strict";on();Mse();$se();Gse();s(pN,"sortSubgraph");s(qze,"expandSubgraphs");s(jze,"mergeBarycenters")});function qse(e){var t=Q5(e),r=Vse(e,Ga(1,t+1),"inEdges"),n=Vse(e,Ga(t-1,-1,-1),"outEdges"),i=Ise(e);Wse(e,i);for(var a=Number.POSITIVE_INFINITY,o,l=0,u=0;u<4;++l,++u){Hze(l%2?r:n,l%4>=2),i=nh(e);var h=Lse(e,i);h<a&&(u=0,o=T5(i),a=h)}Wse(e,o)}function Vse(e,t,r){return an(t,function(n){return Ase(e,n,r)})}function Hze(e,t){var r=new Qr;He(e,function(n){var i=n.graph().root,a=pN(n,i,r,t);He(a.vs,function(o,l){n.node(o).order=l}),wse(n,r,a.vs)})}function Wse(e,t){He(t,function(r){He(r,function(n,i){e.node(n).order=i})})}var jse=_(()=>{"use strict";on();ga();xl();_se();Rse();Dse();Nse();zse();s(qse,"order");s(Vse,"buildLayerGraphs");s(Hze,"sweepLayerGraphs");s(Wse,"assignOrder")});function Hse(e){var t=Yze(e);He(e.graph().dummyChains,function(r){for(var n=e.node(r),i=n.edgeObj,a=Uze(e,t,i.v,i.w),o=a.path,l=a.lca,u=0,h=o[u],d=!0;r!==i.w;){if(n=e.node(r),d){for(;(h=o[u])!==l&&e.node(h).maxRank<n.rank;)u++;h===l&&(d=!1)}if(!d){for(;u<o.length-1&&e.node(h=o[u+1]).minRank<=n.rank;)u++;h=o[u]}e.setParent(r,h),r=e.successors(r)[0]}})}function Uze(e,t,r,n){var i=[],a=[],o=Math.min(t[r].low,t[n].low),l=Math.max(t[r].lim,t[n].lim),u,h;u=r;do u=e.parent(u),i.push(u);while(u&&(t[u].low>o||l>t[u].lim));for(h=u,u=n;(u=e.parent(u))!==h;)a.push(u);return{path:i.concat(a.reverse()),lca:h}}function Yze(e){var t={},r=0;function n(i){var a=r;He(e.children(i),n),t[i]={low:a,lim:r++}}return s(n,"dfs"),He(e.children(),n),t}var Use=_(()=>{"use strict";on();s(Hse,"parentDummyChains");s(Uze,"findPath");s(Yze,"postorder")});function Kze(e,t){var r={};function n(i,a){var o=0,l=0,u=i.length,h=rh(a);return He(a,function(d,f){var p=Qze(e,d),g=p?e.node(p).order:u;(p||d===h)&&(He(a.slice(l,f+1),function(m){He(e.predecessors(m),function(y){var x=e.node(y),T=x.order;(T<o||g<T)&&!(x.dummy&&e.node(m).dummy)&&Yse(r,y,m)})}),l=f+1,o=g)}),a}return s(n,"visitLayer"),ml(t,n),r}function Xze(e,t){var r={};function n(a,o,l,u,h){var d;He(Ga(o,l),function(f){d=a[f],e.node(d).dummy&&He(e.predecessors(d),function(p){var g=e.node(p);g.dummy&&(g.order<u||g.order>h)&&Yse(r,p,d)})})}s(n,"scan");function i(a,o){var l=-1,u,h=0;return He(o,function(d,f){if(e.node(d).dummy==="border"){var p=e.predecessors(d);p.length&&(u=e.node(p[0]).order,n(o,h,f,l,u),h=f,l=u)}n(o,h,o.length,u,a.length)}),o}return s(i,"visitLayer"),ml(t,i),r}function Qze(e,t){if(e.node(t).dummy)return Um(e.predecessors(t),function(r){return e.node(r).dummy})}function Yse(e,t,r){if(t>r){var n=t;t=r,r=n}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Zze(e,t,r){if(t>r){var n=t;t=r,r=n}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],r)}function Jze(e,t,r,n){var i={},a={},o={};return He(t,function(l){He(l,function(u,h){i[u]=u,a[u]=u,o[u]=h})}),He(t,function(l){var u=-1;He(l,function(h){var d=n(h);if(d.length){d=gl(d,function(y){return o[y]});for(var f=(d.length-1)/2,p=Math.floor(f),g=Math.ceil(f);p<=g;++p){var m=d[p];a[h]===h&&u<o[m]&&!Zze(r,h,m)&&(a[m]=h,a[h]=i[h]=i[m],u=o[m])}}})}),{root:i,align:a}}function eVe(e,t,r,n,i){var a={},o=tVe(e,t,r,i),l=i?"borderLeft":"borderRight";function u(f,p){for(var g=o.nodes(),m=g.pop(),y={};m;)y[m]?f(m):(y[m]=!0,g.push(m),g=g.concat(p(m))),m=g.pop()}s(u,"iterate");function h(f){a[f]=o.inEdges(f).reduce(function(p,g){return Math.max(p,a[g.v]+o.edge(g))},0)}s(h,"pass1");function d(f){var p=o.outEdges(f).reduce(function(m,y){return Math.min(m,a[y.w]-o.edge(y))},Number.POSITIVE_INFINITY),g=e.node(f);p!==Number.POSITIVE_INFINITY&&g.borderType!==l&&(a[f]=Math.max(a[f],p))}return s(d,"pass2"),u(h,o.predecessors.bind(o)),u(d,o.successors.bind(o)),He(n,function(f){a[f]=a[r[f]]}),a}function tVe(e,t,r,n){var i=new Qr,a=e.graph(),o=sVe(a.nodesep,a.edgesep,n);return He(t,function(l){var u;He(l,function(h){var d=r[h];if(i.setNode(d),u){var f=r[u],p=i.edge(f,d);i.setEdge(f,d,Math.max(o(e,h,u),p||0))}u=h})}),i}function rVe(e,t){return zd(ma(t),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return $5(r,function(a,o){var l=aVe(e,o)/2;n=Math.max(a+l,n),i=Math.min(a-l,i)}),n-i})}function nVe(e,t){var r=ma(t),n=kc(r),i=Gs(r);He(["u","d"],function(a){He(["l","r"],function(o){var l=a+o,u=e[l],h;if(u!==t){var d=ma(u);h=o==="l"?n-kc(d):i-Gs(d),h&&(e[l]=Gd(u,function(f){return f+h}))}})})}function iVe(e,t){return Gd(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var i=gl(an(e,n));return(i[1]+i[2])/2})}function Kse(e){var t=nh(e),r=Km(Kze(e,t),Xze(e,t)),n={},i;He(["u","d"],function(o){i=o==="u"?t:ma(t).reverse(),He(["l","r"],function(l){l==="r"&&(i=an(i,function(f){return ma(f).reverse()}));var u=(o==="u"?e.predecessors:e.successors).bind(e),h=Jze(e,i,r,u),d=eVe(e,i,h.root,h.align,l==="r");l==="r"&&(d=Gd(d,function(f){return-f})),n[o+l]=d})});var a=rVe(e,n);return nVe(n,a),iVe(n,e.graph().align)}function sVe(e,t,r){return function(n,i,a){var o=n.node(i),l=n.node(a),u=0,h;if(u+=o.width/2,Object.prototype.hasOwnProperty.call(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?t:e)/2,u+=(l.dummy?t:e)/2,u+=l.width/2,Object.prototype.hasOwnProperty.call(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 aVe(e,t){return e.node(t).width}var Xse=_(()=>{"use strict";on();ga();xl();s(Kze,"findType1Conflicts");s(Xze,"findType2Conflicts");s(Qze,"findOtherInnerSegmentNode");s(Yse,"addConflict");s(Zze,"hasConflict");s(Jze,"verticalAlignment");s(eVe,"horizontalCompaction");s(tVe,"buildBlockGraph");s(rVe,"findSmallestWidthAlignment");s(nVe,"alignCoordinates");s(iVe,"balance");s(Kse,"positionX");s(sVe,"sep");s(aVe,"width")});function Qse(e){e=fS(e),oVe(e),B5(Kse(e),function(t,r){e.node(r).x=t})}function oVe(e){var t=nh(e),r=e.graph().ranksep,n=0;He(t,function(i){var a=Gs(an(i,function(o){return e.node(o).height}));He(i,function(o){e.node(o).y=n+a/2}),n+=a+r})}var Zse=_(()=>{"use strict";on();xl();Xse();s(Qse,"position");s(oVe,"positionY")});function hx(e,t){var r=t&&t.debugTiming?jie:Hie;r("layout",()=>{var n=r(" buildLayoutGraph",()=>xVe(e));r(" runLayout",()=>lVe(n,r)),r(" updateInputGraph",()=>cVe(e,n))})}function lVe(e,t){t(" makeSpaceForEdgeLabels",()=>bVe(e)),t(" removeSelfEdges",()=>AVe(e)),t(" acyclic",()=>Bie(e)),t(" nestingGraph.run",()=>kse(e)),t(" rank",()=>dN(fS(e))),t(" injectEdgeLabelProxies",()=>TVe(e)),t(" removeEmptyRanks",()=>Wie(e)),t(" nestingGraph.cleanup",()=>vse(e)),t(" normalizeRanks",()=>Vie(e)),t(" assignRankMinMax",()=>CVe(e)),t(" removeEdgeLabelProxies",()=>kVe(e)),t(" normalize.run",()=>tse(e)),t(" parentDummyChains",()=>Hse(e)),t(" addBorderSegments",()=>Yie(e)),t(" order",()=>qse(e)),t(" insertSelfEdges",()=>RVe(e)),t(" adjustCoordinateSystem",()=>Qie(e)),t(" position",()=>Qse(e)),t(" positionSelfEdges",()=>LVe(e)),t(" removeBorderNodes",()=>_Ve(e)),t(" normalize.undo",()=>rse(e)),t(" fixupEdgeLabelCoords",()=>EVe(e)),t(" undoCoordinateSystem",()=>Zie(e)),t(" translateGraph",()=>SVe(e)),t(" assignNodeIntersects",()=>vVe(e)),t(" reversePoints",()=>wVe(e)),t(" acyclic.undo",()=>Fie(e))}function cVe(e,t){He(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),He(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function xVe(e){var t=new Qr({multigraph:!0,compound:!0}),r=gN(e.graph());return t.setGraph(Km({},hVe,mN(r,uVe),Vd(r,dVe))),He(e.nodes(),function(n){var i=gN(e.node(n));t.setNode(n,D5(mN(i,fVe),pVe)),t.setParent(n,e.parent(n))}),He(e.edges(),function(n){var i=gN(e.edge(n));t.setEdge(n,Km({},gVe,mN(i,mVe),Vd(i,yVe)))}),t}function bVe(e){var t=e.graph();t.ranksep/=2,He(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function TVe(e){He(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};yl(e,"edge-proxy",a,"_ep")}})}function CVe(e){var t=0;He(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Gs(t,n.maxRank))}),e.graph().maxRank=t}function kVe(e){He(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function SVe(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,l=a.marginy||0;function u(h){var d=h.x,f=h.y,p=h.width,g=h.height;t=Math.min(t,d-p/2),r=Math.max(r,d+p/2),n=Math.min(n,f-g/2),i=Math.max(i,f+g/2)}s(u,"getExtremes"),He(e.nodes(),function(h){u(e.node(h))}),He(e.edges(),function(h){var d=e.edge(h);Object.prototype.hasOwnProperty.call(d,"x")&&u(d)}),t-=o,n-=l,He(e.nodes(),function(h){var d=e.node(h);d.x-=t,d.y-=n}),He(e.edges(),function(h){var d=e.edge(h);He(d.points,function(f){f.x-=t,f.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=t),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-t+o,a.height=i-n+l}function vVe(e){He(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),i=e.node(t.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(K5(n,a)),r.points.push(K5(i,o))})}function EVe(e){He(e.edges(),function(t){var r=e.edge(t);if(Object.prototype.hasOwnProperty.call(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 wVe(e){He(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function _Ve(e){He(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(rh(r.borderLeft)),o=e.node(rh(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),He(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function AVe(e){He(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function RVe(e){var t=nh(e);He(t,function(r){var n=0;He(r,function(i,a){var o=e.node(i);o.order=a+n,He(o.selfEdges,function(l){yl(e,"selfedge",{width:l.label.width,height:l.label.height,rank:o.rank,order:a+ ++n,e:l.e,label:l.label},"_se")}),delete o.selfEdges})})}function LVe(e){He(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,l=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-l},{x:i+5*o/6,y:a-l},{x:i+o,y:a},{x:i+5*o/6,y:a+l},{x:i+2*o/3,y:a+l}],r.label.x=r.x,r.label.y=r.y}})}function mN(e,t){return Gd(Vd(e,t),Number)}function gN(e){var t={};return He(e,function(r,n){t[n.toLowerCase()]=r}),t}var uVe,hVe,dVe,fVe,pVe,mVe,gVe,yVe,Jse=_(()=>{"use strict";on();ga();Kie();ese();Y5();eN();fN();Ese();jse();Use();Zse();xl();s(hx,"layout");s(lVe,"runLayout");s(cVe,"updateInputGraph");uVe=["nodesep","edgesep","ranksep","marginx","marginy"],hVe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},dVe=["acyclicer","ranker","rankdir","align"],fVe=["width","height"],pVe={width:0,height:0},mVe=["minlen","weight","width","height","labeloffset"],gVe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yVe=["labelpos"];s(xVe,"buildLayoutGraph");s(bVe,"makeSpaceForEdgeLabels");s(TVe,"injectEdgeLabelProxies");s(CVe,"assignRankMinMax");s(kVe,"removeEdgeLabelProxies");s(SVe,"translateGraph");s(vVe,"assignNodeIntersects");s(EVe,"fixupEdgeLabelCoords");s(wVe,"reversePointsForReversedEdges");s(_Ve,"removeBorderNodes");s(AVe,"removeSelfEdges");s(RVe,"insertSelfEdges");s(LVe,"positionSelfEdges");s(mN,"selectNumberAttrs");s(gN,"canonicalize")});var yN=_(()=>{"use strict";Y5();Jse();eN();fN()});var eae=_(()=>{"use strict"});var rae={};jt(rae,{captureNodeSizes:()=>MVe,shouldCaptureSizes:()=>IVe});function tae(){if(!(typeof globalThis>"u"))return globalThis}function IVe(){return!!tae()?.mermaidCaptureSizes}function NVe(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}function PVe(e,t){let r=tae();if(!r)return;let n=t.node(),a=((n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n)?.id??"(unknown)";r.mermaidCapturedSizes??=[];let o={svgId:a,sizes:e};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}function MVe(e,t){let r=[];for(let n of t.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&PVe({metadata:{captureVersion:1,capturedAt:new Date().toISOString(),capturedFrom:NVe()},nodes:r},e)}var nae=_(()=>{"use strict";eae();s(tae,"getCaptureGlobal");s(IVe,"shouldCaptureSizes");s(NVe,"capturedFromLocation");s(PVe,"emitCapturedSizes");s(MVe,"captureNodeSizes")});function xN(e,{edgePathsClass:t="edges edgePath"}={}){let r=e.insert("g").attr("class","root"),n=r.insert("g").attr("class","clusters"),i=r.insert("g").attr("class",t),a=r.insert("g").attr("class","edgeLabels"),o=r.insert("g").attr("class","nodes");return{clusters:n,edgePaths:i,edgeLabels:a,nodes:o,rootGroups:r}}async function OVe(e,t){if(t.label){let{shapeSvg:r,bbox:n}=await it(e,t);t.labelBBox={width:n.width,height:n.height},r.remove()}else t.labelBBox={width:0,height:0}}async function bN(e,t,r){let n=await mc(e,t,r),i=n.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,n}async function iae(e,t){let r=new Qr({multigraph:!0,compound:!0}),n=[...t.edges],i=xe(),a=xN(e),{edgeLabels:o,nodes:l}=a,u=new Map,h=e.node()!=null;await Promise.all(t.nodes.map(async d=>{if(d.isGroup)h&&await OVe(l,d),r.setNode(d.id,{...d});else{if(h){let f=await bN(l,d,{config:i,dir:d.dir});u.set(d.id,f)}r.setNode(d.id,{...d})}}));for(let d of n)h&&ck(d)&&await bo(o,d),r.setEdge(d.start,d.end,{...d},d.id),t.edges.some(p=>p.id===d.id)||t.edges.push(d);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:d}=await Promise.resolve().then(()=>(nae(),rae));d(e,t)}return{graph:r,groups:a,nodeElements:u}}var TN=_(()=>{"use strict";ga();Nt();km();Nd();Ct();s(xN,"createLayoutElementGroups");s(OVe,"measureGroupLabel");s(bN,"insertMeasuredNode");s(iae,"createGraphWithElements")});var br,Hd,aae,oae,dx,$Ve,lae,cae,BVe,Ud,sae,uae,hae,dae,yS,fae,FVe,CN=_(()=>{"use strict";ft();ga();br=new Map,Hd=new Map,aae=new Map,oae=s(()=>{Hd.clear(),aae.clear(),br.clear()},"clear"),dx=s((e,t)=>{let r=Hd.get(t)||[];return Y.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),$Ve=s((e,t)=>{let r=Hd.get(t)||[];return Y.info("Descendants of ",t," is ",r),Y.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||dx(e.v,t)||dx(e.w,t)||r.includes(e.w):(Y.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),lae=s((e,t,r,n)=>{Y.debug("Copying children of ",e,"root",n,"data",t.node(e),n);let i=t.children(e)||[];e!==n&&i.push(e),Y.debug("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)lae(a,t,r,n);else{let o=t.node(a);Y.info("cp ",a," to ",n," with parent ",e),r.setNode(a,o),n!==t.parent(a)&&(Y.debug("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==n&&a!==e?(Y.debug("Setting parent",a,e),r.setParent(a,e)):(Y.info("In copy ",e,"root",n,"data",t.node(e),n),Y.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==n,"node!==clusterId",a!==e));let l=t.edges(a);Y.debug("Copying Edges",l),l.forEach(u=>{Y.info("Edge",u);let h=t.edge(u.v,u.w,u.name);Y.info("Edge data",h,n);try{$Ve(u,n)?(Y.info("Copying as ",u.v,u.w,h,u.name),r.setEdge(u.v,u.w,h,u.name),Y.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):Y.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",n," clusterId:",e)}catch(d){Y.error(d)}})}Y.debug("Removing node",a),t.removeNode(a)})},"copy"),cae=s((e,t)=>{let r=t.children(e),n=[...r];for(let i of r)aae.set(i,e),n=[...n,...cae(i,t)];return n},"extractDescendants"),BVe=s((e,t,r)=>{let n=e.edges().filter(u=>u.v===t||u.w===t),i=e.edges().filter(u=>u.v===r||u.w===r),a=n.map(u=>({v:u.v===t?r:u.v,w:u.w===t?t:u.w})),o=i.map(u=>({v:u.v,w:u.w}));return a.filter(u=>o.some(h=>u.v===h.v&&u.w===h.w))},"findCommonEdges"),Ud=s((e,t,r)=>{let n=t.children(e);if(Y.trace("Searching children of id ",e,n),n.length<1)return e;let i;for(let a of n){let o=Ud(a,t,r),l=BVe(t,r,o);if(o)if(l.length>0)i=o;else return o}return i},"findNonClusterChild"),sae=s(e=>!br.has(e)||!br.get(e).externalConnections?e:br.has(e)?br.get(e).id:e,"getAnchorId"),uae=s((e,t)=>{if(!e||t>10){Y.debug("Opting out, no graph ");return}else Y.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(Y.debug("Cluster identified",r," Replacement id in edges: ",Ud(r,e,r)),Hd.set(r,cae(r,e)),br.set(r,{id:Ud(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){let n=e.children(r),i=e.edges();n.length>0?(Y.debug("Cluster identified",r,Hd),i.forEach(a=>{let o=dx(a.v,r),l=dx(a.w,r);o^l&&(Y.debug("Edge: ",a," leaves cluster ",r),Y.debug("Descendants of XXX ",r,": ",Hd.get(r)),br.get(r).externalConnections=!0)})):Y.debug("Not a cluster ",r,Hd)});for(let r of br.keys()){let n=br.get(r).id,i=e.parent(n);i!==r&&br.has(i)&&!br.get(i).externalConnections&&(br.get(r).id=i);let a=e.edges().some(o=>o.v===r);if(n&&br.get(r)?.externalConnections&&a&&fae(e,n,r)){let o=FVe(e,r,e.parent(n));o&&(br.get(r).id=o)}}e.edges().forEach(function(r){let n=e.edge(r);Y.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),Y.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let i=r.v,a=r.w;if(Y.debug("Fix XXX",br,"ids:",r.v,r.w,"Translating: ",br.get(r.v)," --- ",br.get(r.w)),br.get(r.v)||br.get(r.w)){if(Y.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),i=sae(r.v),a=sae(r.w),e.removeEdge(r.v,r.w,r.name),i!==r.v){let o=e.parent(i);br.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){let o=e.parent(a);br.get(o).externalConnections=!0,n.toCluster=r.w}Y.debug("Fix Replacing with XXX",i,a,r.name),e.setEdge(i,a,n,r.name)}}),hae(e,0),Y.trace(br)},"adjustClustersAndEdges"),hae=s((e,t)=>{if(t>10){Y.error("Bailing out");return}let r=e.nodes(),n=!1;for(let i of r){let a=e.children(i);n=n||a.length>0}if(!n){Y.debug("Done, no node has children",e.nodes());return}Y.debug("Nodes = ",r,t);for(let i of r)if(Y.debug("Extracting node",i,br,br.has(i)&&!br.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!br.has(i))Y.debug("Not a cluster",i,t);else if(!br.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){Y.debug("Cluster without external connections, without a parent and with children",i,t);let o=e.graph().rankdir==="TB"?"LR":"TB";br.get(i)?.clusterData?.dir&&(o=br.get(i).clusterData.dir,Y.debug("Fixing dir",br.get(i).clusterData.dir,o));let l=new Qr({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});lae(i,e,l,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:br.get(i).clusterData,label:br.get(i).label,graph:l})}else Y.debug("Cluster ** ",i," **not meeting the criteria !externalConnections:",!br.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),Y.debug(br);r=e.nodes(),Y.debug("New list of nodes",r);for(let i of r){let a=e.node(i);Y.debug(" Now next level",i,a),a?.clusterNode&&hae(a.graph,t+1)}},"extractor"),dae=s((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(n=>{let i=e.children(n),a=dae(e,i);r=[...r,...a]}),r},"sorter"),yS=s(e=>dae(e,e.children()),"sortNodesByHierarchy"),fae=s((e,t,r)=>{let n=e.parent(t);for(;n&&n!==r;){let i=br.get(n);if(i&&!i.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),FVe=s((e,t,r)=>{let n=e.children(t)??[];for(let i of n){if(i===r||dx(i,r))continue;let a=Ud(i,e,t);if(a&&!fae(e,a,t))return a}return null},"findSafeAnchorNode")});function Xm({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:n,afterPaint:i,paintOptions:a}){let o=t??SN;return s(async function(u,h,d,f){let p=h.select("g");(d?.insertMarkers??Sm)(p,u.markers,u.type,u.diagramId),kN();let g={element:p,helpers:d,options:f};g.preparedLayout=await e?.(u,g);let m=await o(u,g),y=await r(u,g),x={...g,measure:m};n?await n(u,x,y):await vN(u,x,a),await i?.(u,x,y)},"render")}function kN(){zZ(),FZ(),LZ(),oae()}async function SN(e,{element:t}){return await iae(t,e)}async function vN(e,t,r={}){let{measure:n}=t,{groups:i}=n;for(let o of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(o,t)||await GVe(i,o,t,r);let a=VVe(e.nodes);for(let o of e.edges)WVe(o,r)||await qVe(i,o,a,e,r,t)}async function GVe(e,t,r,n){t.clusterNode?ll(t):zVe(t,r,n)?await Mu(e.clusters,t):ll(t)}function zVe(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}function VVe(e){let t=new Map;for(let r of e)r?.id&&t.set(r.id,r);return t}function WVe(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}async function qVe(e,t,r,n,i,a){let o=Ou(e.edgePaths,{...t},i.clusterDb??new Map,n.type,pae(t.start,t,r,a,i),pae(t.end,t,r,a,i),n.diagramId,jVe(t,i));ck(t)&&(Id.has(t.id)||await bo(e.edgeLabels,t),HVe(t,o))}function pae(e,t,r,n,i){return i.getEdgeNode?.(e,t,n)??(e?r.get(e)??{}:{})}function jVe(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}function HVe(e,t){let r=t?.updatedPath??t?.originalPath,n=mt(),{subGraphTitleTotalMargin:i}=pc({flowchart:n.flowchart??{}});if(e.label){let a=Id.get(e.id),o=e.x,l=e.y;if(r){let u=Bt.calcLabelPosition(r);Y.debug("Moving label "+e.label+" from (",o,",",l,") to (",u.x,",",u.y,") abc88"),t?.updatedPath&&(o=u.x,l=u.y)}a.attr("transform",`translate(${o}, ${l+i/2})`)}if(e?.startLabelLeft){let a=Vn.get(e.id).startLeft,o=e?.x,l=e?.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.startLabelRight){let a=Vn.get(e.id).startRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelLeft){let a=Vn.get(e.id).endLeft,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelRight){let a=Vn.get(e.id).endRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}}var xS=_(()=>{"use strict";ft();mm();ir();Pt();P1();TN();M1();km();uk();Nd();CN();s(Xm,"createCommonLayoutRenderer");s(kN,"clearLayoutRenderState");s(SN,"defaultMeasureLayout");s(vN,"paintLayoutData");s(GVe,"paintLayoutNode");s(zVe,"shouldPaintAsCluster");s(VVe,"buildNodeLookup");s(WVe,"shouldSkipPaintEdge");s(qVe,"paintLayoutEdge");s(pae,"getRenderedNode");s(jVe,"shouldSkipIntersect");s(HVe,"positionRenderedEdgeLabel")});var Sae={};jt(Sae,{applyDagreLayoutResult:()=>Tae,getEdgesToRender:()=>EN,measureDagreLayout:()=>Cae,prepareLayoutForDagre:()=>wN,render:()=>iWe,runDagreLayoutCore:()=>kae});var mae,gae,UVe,YVe,KVe,XVe,QVe,EN,xae,bae,ZVe,yae,JVe,Tae,eWe,tWe,wN,Cae,kae,rWe,nWe,iWe,vae=_(()=>{"use strict";yN();ga();TN();xS();mm();Ct();CN();Nd();M1();km();ft();P1();Nt();mae=s((e,t,r)=>Math.max(t,Math.min(r,e)),"clamp"),gae=s((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),UVe=s(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),YVe=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],KVe=s((e,t,r,n,i)=>{let a=[],o=new Set;if(r.forEach(({start:d,end:f})=>{d!==n&&o.add(d),f!==n&&o.add(f)}),o.forEach(d=>{let f=e.node(d);typeof f?.x=="number"&&typeof f?.y=="number"&&a.push(f)}),a.length===0&&r.forEach(({edge:d})=>{(d.points??[]).forEach(f=>{typeof f?.x=="number"&&typeof f?.y=="number"&&a.push(f)})}),a.length===0)return gae(i);let l=a.reduce((d,f)=>({x:d.x+f.x/a.length,y:d.y+f.y/a.length}),{x:0,y:0}),u=l.x-t.x,h=l.y-t.y;return Math.abs(u)>Math.abs(h)?u>0?"right":"left":Math.abs(h)>0?h>0?"bottom":"top":gae(i)},"getSelfLoopSide"),XVe=s((e,t="top",r=0,n=0)=>{let i=e.x,a=e.y-r,o=e.width/2,l=e.height/2,u=Math.max(36,Math.min(100,e.width*.8)),h=mae(Math.max(n,e.width*.35),36,u),d=mae(Math.min(e.width,e.height)*.45,24,48);switch(t){case"bottom":{let f=a+l;return[{x:i-h/2,y:f},{x:i-h/2,y:f+d},{x:i+h/2,y:f+d},{x:i+h/2,y:f}]}case"right":{let f=i+o;return[{x:f,y:a-h/2},{x:f+d,y:a-h/2},{x:f+d,y:a+h/2},{x:f,y:a+h/2}]}case"left":{let f=i-o;return[{x:f,y:a-h/2},{x:f-d,y:a-h/2},{x:f-d,y:a+h/2},{x:f,y:a+h/2}]}case"top":default:{let f=a-l;return[{x:i-h/2,y:f},{x:i-h/2,y:f-d},{x:i+h/2,y:f-d},{x:i+h/2,y:f}]}}},"getSelfLoopPoints"),QVe=s((e,t,r="top",n=0,i={})=>{let o=e.x,l=e.y-n,u=i.width??0,h=i.height??0;switch(r){case"bottom":return{x:o,y:Math.max(...t.map(d=>d.y))+h/2+4};case"right":return{x:Math.max(...t.map(d=>d.x))+u/2+4,y:l};case"left":return{x:Math.min(...t.map(d=>d.x))-u/2-4,y:l};case"top":default:return{x:o,y:Math.min(...t.map(d=>d.y))-h/2-4}}},"getSelfLoopLabelPosition"),EN=s((e,t=0,{mergeSelfLoops:r=!0}={})=>{let n=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(o=>{let l=e.edge(o);if(r&&l.selfLoop){let u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,C)=>T.edge.selfLoop.order-C.edge.selfLoop.order);let[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=e.node(d.start);if(!f){o.forEach(T=>i.push(T));return}let p={width:u.edge.width,height:u.edge.height},g=KVe(e,f,o,d.start,a),m=XVe(f,g,t,p.width??0),y=QVe(f,m,g,t,p),x={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete x.selfLoop,delete x.originalEdge,i.push({edge:x,start:x.start,end:x.end})}),i},"getEdgesToRender"),xae=s(async({element:e,graph:t,diagramType:r,id:n,parentCluster:i,siteConfig:a})=>{let o=t.graph().rankdir;Y.trace("Dir in recursive render - dir:",o);let{clusters:l,edgePaths:u,edgeLabels:h,nodes:d,rootGroups:f}=xN(e,{edgePathsClass:"edgePaths"});t.nodes()?Y.info("Recursive render XXX",t.nodes()):Y.info("No nodes found for",t),t.edges().length>0&&Y.info("Recursive edges",t.edge(t.edges()[0]));let p=UVe(r);await Promise.all(t.nodes().map(async function(y){let x=t.node(y);if(i!==void 0){let T=JSON.parse(JSON.stringify(i.clusterData));Y.trace(`Setting data for parent cluster XXX
343
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),JOe=s((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),e6e=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),t6e={extension:NOe,composition:POe,aggregation:MOe,dependency:OOe,lollipop:$Oe,point:BOe,circle:FOe,cross:GOe,barb:zOe,barbNeo:VOe,only_one:WOe,zero_or_one:qOe,one_or_more:jOe,zero_or_more:HOe,only_one_neo:UOe,zero_or_one_neo:YOe,one_or_more_neo:KOe,zero_or_more_neo:XOe,requirement_arrow:QOe,requirement_contains:JOe,requirement_arrow_neo:ZOe,requirement_contains_neo:e6e},Sm=IOe});async function mc(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let a=t.shape?A1[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),i=await a(n,t,r)}else i=await a(e,t,r),n=i;return n.attr("data-look",$r(t.look)),t.tooltip&&i.attr("title",t.tooltip),hk.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}var hk,GZ,zZ,ll,Nd=_(()=>{"use strict";ft();tk();Pt();hk=new Map;s(mc,"insertNode");GZ=s((e,t)=>{hk.set(t.id,e)},"setNodeElem"),zZ=s(()=>{hk.clear()},"clear"),ll=s(e=>{let t=hk.get(e.id);Y.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode")});var VZ,WZ=_(()=>{"use strict";ir();vr();ft();M1();km();uk();Nd();Ct();Pt();VZ={common:ot,getConfig:mt,insertCluster:Mu,insertEdge:Ou,insertEdgeLabel:bo,insertMarkers:Sm,insertNode:mc,interpolateToCurve:g4,labelHelper:it,log:Y,positionEdgeLabel:Cm}});var r6e,dk,HI=_(()=>{"use strict";r6e=typeof global=="object"&&global&&global.Object===Object&&global,dk=r6e});var n6e,i6e,Wn,Oa=_(()=>{"use strict";HI();n6e=typeof self=="object"&&self&&self.Object===Object&&self,i6e=dk||n6e||Function("return this")(),Wn=i6e});var s6e,Ni,Pd=_(()=>{"use strict";Oa();s6e=Wn.Symbol,Ni=s6e});function l6e(e){var t=a6e.call(e,$1),r=e[$1];try{e[$1]=void 0;var n=!0}catch{}var i=o6e.call(e);return n&&(t?e[$1]=r:delete e[$1]),i}var qZ,a6e,o6e,$1,jZ,HZ=_(()=>{"use strict";Pd();qZ=Object.prototype,a6e=qZ.hasOwnProperty,o6e=qZ.toString,$1=Ni?Ni.toStringTag:void 0;s(l6e,"getRawTag");jZ=l6e});function h6e(e){return u6e.call(e)}var c6e,u6e,UZ,YZ=_(()=>{"use strict";c6e=Object.prototype,u6e=c6e.toString;s(h6e,"objectToString");UZ=h6e});function p6e(e){return e==null?e===void 0?f6e:d6e:KZ&&KZ in Object(e)?jZ(e):UZ(e)}var d6e,f6e,KZ,ys,$u=_(()=>{"use strict";Pd();HZ();YZ();d6e="[object Null]",f6e="[object Undefined]",KZ=Ni?Ni.toStringTag:void 0;s(p6e,"baseGetTag");ys=p6e});function m6e(e){return e!=null&&typeof e=="object"}var Xn,To=_(()=>{"use strict";s(m6e,"isObjectLike");Xn=m6e});function y6e(e){return typeof e=="symbol"||Xn(e)&&ys(e)==g6e}var g6e,fa,Md=_(()=>{"use strict";$u();To();g6e="[object Symbol]";s(y6e,"isSymbol");fa=y6e});function x6e(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var cl,B1=_(()=>{"use strict";s(x6e,"arrayMap");cl=x6e});var b6e,wr,oi=_(()=>{"use strict";b6e=Array.isArray,wr=b6e});function ZZ(e){if(typeof e=="string")return e;if(wr(e))return cl(e,ZZ)+"";if(fa(e))return QZ?QZ.call(e):"";var t=e+"";return t=="0"&&1/e==-T6e?"-0":t}var T6e,XZ,QZ,JZ,eJ=_(()=>{"use strict";Pd();B1();oi();Md();T6e=1/0,XZ=Ni?Ni.prototype:void 0,QZ=XZ?XZ.toString:void 0;s(ZZ,"baseToString");JZ=ZZ});function k6e(e){for(var t=e.length;t--&&C6e.test(e.charAt(t)););return t}var C6e,tJ,rJ=_(()=>{"use strict";C6e=/\s/;s(k6e,"trimmedEndIndex");tJ=k6e});function v6e(e){return e&&e.slice(0,tJ(e)+1).replace(S6e,"")}var S6e,nJ,iJ=_(()=>{"use strict";rJ();S6e=/^\s+/;s(v6e,"baseTrim");nJ=v6e});function E6e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var In,$a=_(()=>{"use strict";s(E6e,"isObject");In=E6e});function L6e(e){if(typeof e=="number")return e;if(fa(e))return sJ;if(In(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=In(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=nJ(e);var r=_6e.test(e);return r||A6e.test(e)?R6e(e.slice(2),r?2:8):w6e.test(e)?sJ:+e}var sJ,w6e,_6e,A6e,R6e,aJ,oJ=_(()=>{"use strict";iJ();$a();Md();sJ=NaN,w6e=/^[-+]0x[0-9a-f]+$/i,_6e=/^0b[01]+$/i,A6e=/^0o[0-7]+$/i,R6e=parseInt;s(L6e,"toNumber");aJ=L6e});function I6e(e){if(!e)return e===0?e:0;if(e=aJ(e),e===lJ||e===-lJ){var t=e<0?-1:1;return t*D6e}return e===e?e:0}var lJ,D6e,vm,UI=_(()=>{"use strict";oJ();lJ=1/0,D6e=17976931348623157e292;s(I6e,"toFinite");vm=I6e});function N6e(e){var t=vm(e),r=t%1;return t===t?r?t-r:t:0}var cJ,uJ=_(()=>{"use strict";UI();s(N6e,"toInteger");cJ=N6e});function P6e(e){return e}var Os,Bu=_(()=>{"use strict";s(P6e,"identity");Os=P6e});function F6e(e){if(!In(e))return!1;var t=ys(e);return t==O6e||t==$6e||t==M6e||t==B6e}var M6e,O6e,$6e,B6e,ul,F1=_(()=>{"use strict";$u();$a();M6e="[object AsyncFunction]",O6e="[object Function]",$6e="[object GeneratorFunction]",B6e="[object Proxy]";s(F6e,"isFunction");ul=F6e});var G6e,fk,hJ=_(()=>{"use strict";Oa();G6e=Wn["__core-js_shared__"],fk=G6e});function z6e(e){return!!dJ&&dJ in e}var dJ,fJ,pJ=_(()=>{"use strict";hJ();dJ=(function(){var e=/[^.]+$/.exec(fk&&fk.keys&&fk.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();s(z6e,"isMasked");fJ=z6e});function q6e(e){if(e!=null){try{return W6e.call(e)}catch{}try{return e+""}catch{}}return""}var V6e,W6e,gc,YI=_(()=>{"use strict";V6e=Function.prototype,W6e=V6e.toString;s(q6e,"toSource");gc=q6e});function Z6e(e){if(!In(e)||fJ(e))return!1;var t=ul(e)?Q6e:H6e;return t.test(gc(e))}var j6e,H6e,U6e,Y6e,K6e,X6e,Q6e,mJ,gJ=_(()=>{"use strict";F1();pJ();$a();YI();j6e=/[\\^$.*+?()[\]{}|]/g,H6e=/^\[object .+?Constructor\]$/,U6e=Function.prototype,Y6e=Object.prototype,K6e=U6e.toString,X6e=Y6e.hasOwnProperty,Q6e=RegExp("^"+K6e.call(X6e).replace(j6e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");s(Z6e,"baseIsNative");mJ=Z6e});function J6e(e,t){return e?.[t]}var yJ,xJ=_(()=>{"use strict";s(J6e,"getValue");yJ=J6e});function e$e(e,t){var r=yJ(e,t);return mJ(r)?r:void 0}var $s,Fu=_(()=>{"use strict";gJ();xJ();s(e$e,"getNative");$s=e$e});var t$e,pk,bJ=_(()=>{"use strict";Fu();Oa();t$e=$s(Wn,"WeakMap"),pk=t$e});var TJ,r$e,CJ,kJ=_(()=>{"use strict";$a();TJ=Object.create,r$e=(function(){function e(){}return s(e,"object"),function(t){if(!In(t))return{};if(TJ)return TJ(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),CJ=r$e});function n$e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var SJ,vJ=_(()=>{"use strict";s(n$e,"apply");SJ=n$e});function i$e(){}var EJ,wJ=_(()=>{"use strict";s(i$e,"noop");EJ=i$e});function s$e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var mk,KI=_(()=>{"use strict";s(s$e,"copyArray");mk=s$e});function c$e(e){var t=0,r=0;return function(){var n=l$e(),i=o$e-(n-r);if(r=n,i>0){if(++t>=a$e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var a$e,o$e,l$e,_J,AJ=_(()=>{"use strict";a$e=800,o$e=16,l$e=Date.now;s(c$e,"shortOut");_J=c$e});function u$e(e){return function(){return e}}var Bs,XI=_(()=>{"use strict";s(u$e,"constant");Bs=u$e});var h$e,Em,QI=_(()=>{"use strict";Fu();h$e=(function(){try{var e=$s(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Em=h$e});var d$e,RJ,LJ=_(()=>{"use strict";XI();QI();Bu();d$e=Em?function(e,t){return Em(e,"toString",{configurable:!0,enumerable:!1,value:Bs(t),writable:!0})}:Os,RJ=d$e});var f$e,gk,ZI=_(()=>{"use strict";LJ();AJ();f$e=_J(RJ),gk=f$e});function p$e(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var yk,JI=_(()=>{"use strict";s(p$e,"arrayEach");yk=p$e});function m$e(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var xk,e5=_(()=>{"use strict";s(m$e,"baseFindIndex");xk=m$e});function g$e(e){return e!==e}var DJ,IJ=_(()=>{"use strict";s(g$e,"baseIsNaN");DJ=g$e});function y$e(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var NJ,PJ=_(()=>{"use strict";s(y$e,"strictIndexOf");NJ=y$e});function x$e(e,t,r){return t===t?NJ(e,t,r):xk(e,DJ,r)}var MJ,OJ=_(()=>{"use strict";e5();IJ();PJ();s(x$e,"baseIndexOf");MJ=x$e});function b$e(e,t){var r=e==null?0:e.length;return!!r&&MJ(e,t,0)>-1}var $J,BJ=_(()=>{"use strict";OJ();s(b$e,"arrayIncludes");$J=b$e});function k$e(e,t){var r=typeof e;return t=t??T$e,!!t&&(r=="number"||r!="symbol"&&C$e.test(e))&&e>-1&&e%1==0&&e<t}var T$e,C$e,Gu,G1=_(()=>{"use strict";T$e=9007199254740991,C$e=/^(?:0|[1-9]\d*)$/;s(k$e,"isIndex");Gu=k$e});function S$e(e,t,r){t=="__proto__"&&Em?Em(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var zu,z1=_(()=>{"use strict";QI();s(S$e,"baseAssignValue");zu=S$e});function v$e(e,t){return e===t||e!==e&&t!==t}var Ba,Od=_(()=>{"use strict";s(v$e,"eq");Ba=v$e});function _$e(e,t,r){var n=e[t];(!(w$e.call(e,t)&&Ba(n,r))||r===void 0&&!(t in e))&&zu(e,t,r)}var E$e,w$e,Vu,V1=_(()=>{"use strict";z1();Od();E$e=Object.prototype,w$e=E$e.hasOwnProperty;s(_$e,"assignValue");Vu=_$e});function A$e(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var l=t[a],u=n?n(r[l],e[l],l,r,e):void 0;u===void 0&&(u=e[l]),i?zu(r,l,u):Vu(r,l,u)}return r}var hl,wm=_(()=>{"use strict";V1();z1();s(A$e,"copyObject");hl=A$e});function R$e(e,t,r){return t=FJ(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=FJ(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(o),SJ(e,this,l)}}var FJ,bk,t5=_(()=>{"use strict";vJ();FJ=Math.max;s(R$e,"overRest");bk=R$e});function L$e(e,t){return gk(bk(e,t,Os),e+"")}var Wu,W1=_(()=>{"use strict";Bu();t5();ZI();s(L$e,"baseRest");Wu=L$e});function I$e(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=D$e}var D$e,_m,Tk=_(()=>{"use strict";D$e=9007199254740991;s(I$e,"isLength");_m=I$e});function N$e(e){return e!=null&&_m(e.length)&&!ul(e)}var Pi,dl=_(()=>{"use strict";F1();Tk();s(N$e,"isArrayLike");Pi=N$e});function P$e(e,t,r){if(!In(r))return!1;var n=typeof t;return(n=="number"?Pi(r)&&Gu(t,r.length):n=="string"&&t in r)?Ba(r[t],e):!1}var yc,q1=_(()=>{"use strict";Od();dl();G1();$a();s(P$e,"isIterateeCall");yc=P$e});function M$e(e){return Wu(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&yc(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,a)}return t})}var GJ,zJ=_(()=>{"use strict";W1();q1();s(M$e,"createAssigner");GJ=M$e});function $$e(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||O$e;return e===r}var O$e,qu,j1=_(()=>{"use strict";O$e=Object.prototype;s($$e,"isPrototype");qu=$$e});function B$e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var VJ,WJ=_(()=>{"use strict";s(B$e,"baseTimes");VJ=B$e});function G$e(e){return Xn(e)&&ys(e)==F$e}var F$e,r5,qJ=_(()=>{"use strict";$u();To();F$e="[object Arguments]";s(G$e,"baseIsArguments");r5=G$e});var jJ,z$e,V$e,W$e,Co,Am=_(()=>{"use strict";qJ();To();jJ=Object.prototype,z$e=jJ.hasOwnProperty,V$e=jJ.propertyIsEnumerable,W$e=r5((function(){return arguments})())?r5:function(e){return Xn(e)&&z$e.call(e,"callee")&&!V$e.call(e,"callee")},Co=W$e});function q$e(){return!1}var HJ,UJ=_(()=>{"use strict";s(q$e,"stubFalse");HJ=q$e});var XJ,YJ,j$e,KJ,H$e,U$e,ko,Rm=_(()=>{"use strict";Oa();UJ();XJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,YJ=XJ&&typeof module=="object"&&module&&!module.nodeType&&module,j$e=YJ&&YJ.exports===XJ,KJ=j$e?Wn.Buffer:void 0,H$e=KJ?KJ.isBuffer:void 0,U$e=H$e||HJ,ko=U$e});function xBe(e){return Xn(e)&&_m(e.length)&&!!wn[ys(e)]}var Y$e,K$e,X$e,Q$e,Z$e,J$e,eBe,tBe,rBe,nBe,iBe,sBe,aBe,oBe,lBe,cBe,uBe,hBe,dBe,fBe,pBe,mBe,gBe,yBe,wn,QJ,ZJ=_(()=>{"use strict";$u();Tk();To();Y$e="[object Arguments]",K$e="[object Array]",X$e="[object Boolean]",Q$e="[object Date]",Z$e="[object Error]",J$e="[object Function]",eBe="[object Map]",tBe="[object Number]",rBe="[object Object]",nBe="[object RegExp]",iBe="[object Set]",sBe="[object String]",aBe="[object WeakMap]",oBe="[object ArrayBuffer]",lBe="[object DataView]",cBe="[object Float32Array]",uBe="[object Float64Array]",hBe="[object Int8Array]",dBe="[object Int16Array]",fBe="[object Int32Array]",pBe="[object Uint8Array]",mBe="[object Uint8ClampedArray]",gBe="[object Uint16Array]",yBe="[object Uint32Array]",wn={};wn[cBe]=wn[uBe]=wn[hBe]=wn[dBe]=wn[fBe]=wn[pBe]=wn[mBe]=wn[gBe]=wn[yBe]=!0;wn[Y$e]=wn[K$e]=wn[oBe]=wn[X$e]=wn[lBe]=wn[Q$e]=wn[Z$e]=wn[J$e]=wn[eBe]=wn[tBe]=wn[rBe]=wn[nBe]=wn[iBe]=wn[sBe]=wn[aBe]=!1;s(xBe,"baseIsTypedArray");QJ=xBe});function bBe(e){return function(t){return e(t)}}var ju,H1=_(()=>{"use strict";s(bBe,"baseUnary");ju=bBe});var JJ,U1,TBe,n5,CBe,xc,Ck=_(()=>{"use strict";HI();JJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,U1=JJ&&typeof module=="object"&&module&&!module.nodeType&&module,TBe=U1&&U1.exports===JJ,n5=TBe&&dk.process,CBe=(function(){try{var e=U1&&U1.require&&U1.require("util").types;return e||n5&&n5.binding&&n5.binding("util")}catch{}})(),xc=CBe});var eee,kBe,Hu,Y1=_(()=>{"use strict";ZJ();H1();Ck();eee=xc&&xc.isTypedArray,kBe=eee?ju(eee):QJ,Hu=kBe});function EBe(e,t){var r=wr(e),n=!r&&Co(e),i=!r&&!n&&ko(e),a=!r&&!n&&!i&&Hu(e),o=r||n||i||a,l=o?VJ(e.length,String):[],u=l.length;for(var h in e)(t||vBe.call(e,h))&&!(o&&(h=="length"||i&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Gu(h,u)))&&l.push(h);return l}var SBe,vBe,kk,i5=_(()=>{"use strict";WJ();Am();oi();Rm();G1();Y1();SBe=Object.prototype,vBe=SBe.hasOwnProperty;s(EBe,"arrayLikeKeys");kk=EBe});function wBe(e,t){return function(r){return e(t(r))}}var Sk,s5=_(()=>{"use strict";s(wBe,"overArg");Sk=wBe});var _Be,tee,ree=_(()=>{"use strict";s5();_Be=Sk(Object.keys,Object),tee=_Be});function LBe(e){if(!qu(e))return tee(e);var t=[];for(var r in Object(e))RBe.call(e,r)&&r!="constructor"&&t.push(r);return t}var ABe,RBe,Lm,vk=_(()=>{"use strict";j1();ree();ABe=Object.prototype,RBe=ABe.hasOwnProperty;s(LBe,"baseKeys");Lm=LBe});function DBe(e){return Pi(e)?kk(e):Lm(e)}var qn,bc=_(()=>{"use strict";i5();vk();dl();s(DBe,"keys");qn=DBe});function IBe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var nee,iee=_(()=>{"use strict";s(IBe,"nativeKeysIn");nee=IBe});function MBe(e){if(!In(e))return nee(e);var t=qu(e),r=[];for(var n in e)n=="constructor"&&(t||!PBe.call(e,n))||r.push(n);return r}var NBe,PBe,see,aee=_(()=>{"use strict";$a();j1();iee();NBe=Object.prototype,PBe=NBe.hasOwnProperty;s(MBe,"baseKeysIn");see=MBe});function OBe(e){return Pi(e)?kk(e,!0):see(e)}var Fs,Uu=_(()=>{"use strict";i5();aee();dl();s(OBe,"keysIn");Fs=OBe});function FBe(e,t){if(wr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||fa(e)?!0:BBe.test(e)||!$Be.test(e)||t!=null&&e in Object(t)}var $Be,BBe,Dm,Ek=_(()=>{"use strict";oi();Md();$Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BBe=/^\w*$/;s(FBe,"isKey");Dm=FBe});var GBe,Tc,K1=_(()=>{"use strict";Fu();GBe=$s(Object,"create"),Tc=GBe});function zBe(){this.__data__=Tc?Tc(null):{},this.size=0}var oee,lee=_(()=>{"use strict";K1();s(zBe,"hashClear");oee=zBe});function VBe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var cee,uee=_(()=>{"use strict";s(VBe,"hashDelete");cee=VBe});function HBe(e){var t=this.__data__;if(Tc){var r=t[e];return r===WBe?void 0:r}return jBe.call(t,e)?t[e]:void 0}var WBe,qBe,jBe,hee,dee=_(()=>{"use strict";K1();WBe="__lodash_hash_undefined__",qBe=Object.prototype,jBe=qBe.hasOwnProperty;s(HBe,"hashGet");hee=HBe});function KBe(e){var t=this.__data__;return Tc?t[e]!==void 0:YBe.call(t,e)}var UBe,YBe,fee,pee=_(()=>{"use strict";K1();UBe=Object.prototype,YBe=UBe.hasOwnProperty;s(KBe,"hashHas");fee=KBe});function QBe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Tc&&t===void 0?XBe:t,this}var XBe,mee,gee=_(()=>{"use strict";K1();XBe="__lodash_hash_undefined__";s(QBe,"hashSet");mee=QBe});function Im(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var a5,yee=_(()=>{"use strict";lee();uee();dee();pee();gee();s(Im,"Hash");Im.prototype.clear=oee;Im.prototype.delete=cee;Im.prototype.get=hee;Im.prototype.has=fee;Im.prototype.set=mee;a5=Im});function ZBe(){this.__data__=[],this.size=0}var xee,bee=_(()=>{"use strict";s(ZBe,"listCacheClear");xee=ZBe});function JBe(e,t){for(var r=e.length;r--;)if(Ba(e[r][0],t))return r;return-1}var Yu,X1=_(()=>{"use strict";Od();s(JBe,"assocIndexOf");Yu=JBe});function r8e(e){var t=this.__data__,r=Yu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():t8e.call(t,r,1),--this.size,!0}var e8e,t8e,Tee,Cee=_(()=>{"use strict";X1();e8e=Array.prototype,t8e=e8e.splice;s(r8e,"listCacheDelete");Tee=r8e});function n8e(e){var t=this.__data__,r=Yu(t,e);return r<0?void 0:t[r][1]}var kee,See=_(()=>{"use strict";X1();s(n8e,"listCacheGet");kee=n8e});function i8e(e){return Yu(this.__data__,e)>-1}var vee,Eee=_(()=>{"use strict";X1();s(i8e,"listCacheHas");vee=i8e});function s8e(e,t){var r=this.__data__,n=Yu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var wee,_ee=_(()=>{"use strict";X1();s(s8e,"listCacheSet");wee=s8e});function Nm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var Ku,Q1=_(()=>{"use strict";bee();Cee();See();Eee();_ee();s(Nm,"ListCache");Nm.prototype.clear=xee;Nm.prototype.delete=Tee;Nm.prototype.get=kee;Nm.prototype.has=vee;Nm.prototype.set=wee;Ku=Nm});var a8e,Xu,wk=_(()=>{"use strict";Fu();Oa();a8e=$s(Wn,"Map"),Xu=a8e});function o8e(){this.size=0,this.__data__={hash:new a5,map:new(Xu||Ku),string:new a5}}var Aee,Ree=_(()=>{"use strict";yee();Q1();wk();s(o8e,"mapCacheClear");Aee=o8e});function l8e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Lee,Dee=_(()=>{"use strict";s(l8e,"isKeyable");Lee=l8e});function c8e(e,t){var r=e.__data__;return Lee(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Qu,Z1=_(()=>{"use strict";Dee();s(c8e,"getMapData");Qu=c8e});function u8e(e){var t=Qu(this,e).delete(e);return this.size-=t?1:0,t}var Iee,Nee=_(()=>{"use strict";Z1();s(u8e,"mapCacheDelete");Iee=u8e});function h8e(e){return Qu(this,e).get(e)}var Pee,Mee=_(()=>{"use strict";Z1();s(h8e,"mapCacheGet");Pee=h8e});function d8e(e){return Qu(this,e).has(e)}var Oee,$ee=_(()=>{"use strict";Z1();s(d8e,"mapCacheHas");Oee=d8e});function f8e(e,t){var r=Qu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Bee,Fee=_(()=>{"use strict";Z1();s(f8e,"mapCacheSet");Bee=f8e});function Pm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var $d,_k=_(()=>{"use strict";Ree();Nee();Mee();$ee();Fee();s(Pm,"MapCache");Pm.prototype.clear=Aee;Pm.prototype.delete=Iee;Pm.prototype.get=Pee;Pm.prototype.has=Oee;Pm.prototype.set=Bee;$d=Pm});function o5(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(p8e);var r=s(function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o},"memoized");return r.cache=new(o5.Cache||$d),r}var p8e,Gee,zee=_(()=>{"use strict";_k();p8e="Expected a function";s(o5,"memoize");o5.Cache=$d;Gee=o5});function g8e(e){var t=Gee(e,function(n){return r.size===m8e&&r.clear(),n}),r=t.cache;return t}var m8e,Vee,Wee=_(()=>{"use strict";zee();m8e=500;s(g8e,"memoizeCapped");Vee=g8e});var y8e,x8e,b8e,qee,jee=_(()=>{"use strict";Wee();y8e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,x8e=/\\(\\)?/g,b8e=Vee(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(y8e,function(r,n,i,a){t.push(i?a.replace(x8e,"$1"):n||r)}),t}),qee=b8e});function T8e(e){return e==null?"":JZ(e)}var Ak,l5=_(()=>{"use strict";eJ();s(T8e,"toString");Ak=T8e});function C8e(e,t){return wr(e)?e:Dm(e,t)?[e]:qee(Ak(e))}var Zu,J1=_(()=>{"use strict";oi();Ek();jee();l5();s(C8e,"castPath");Zu=C8e});function S8e(e){if(typeof e=="string"||fa(e))return e;var t=e+"";return t=="0"&&1/e==-k8e?"-0":t}var k8e,fl,Mm=_(()=>{"use strict";Md();k8e=1/0;s(S8e,"toKey");fl=S8e});function v8e(e,t){t=Zu(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[fl(t[r++])];return r&&r==n?e:void 0}var Ju,ex=_(()=>{"use strict";J1();Mm();s(v8e,"baseGet");Ju=v8e});function E8e(e,t,r){var n=e==null?void 0:Ju(e,t);return n===void 0?r:n}var Hee,Uee=_(()=>{"use strict";ex();s(E8e,"get");Hee=E8e});function w8e(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Om,Rk=_(()=>{"use strict";s(w8e,"arrayPush");Om=w8e});function _8e(e){return wr(e)||Co(e)||!!(Yee&&e&&e[Yee])}var Yee,Kee,Xee=_(()=>{"use strict";Pd();Am();oi();Yee=Ni?Ni.isConcatSpreadable:void 0;s(_8e,"isFlattenable");Kee=_8e});function Qee(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=Kee),i||(i=[]);++a<o;){var l=e[a];t>0&&r(l)?t>1?Qee(l,t-1,r,n,i):Om(i,l):n||(i[i.length]=l)}return i}var $m,Lk=_(()=>{"use strict";Rk();Xee();s(Qee,"baseFlatten");$m=Qee});function A8e(e){var t=e==null?0:e.length;return t?$m(e,1):[]}var Fa,c5=_(()=>{"use strict";Lk();s(A8e,"flatten");Fa=A8e});function R8e(e){return gk(bk(e,void 0,Fa),e+"")}var Zee,Jee=_(()=>{"use strict";c5();t5();ZI();s(R8e,"flatRest");Zee=R8e});var L8e,Bm,Dk=_(()=>{"use strict";s5();L8e=Sk(Object.getPrototypeOf,Object),Bm=L8e});function O8e(e){if(!Xn(e)||ys(e)!=D8e)return!1;var t=Bm(e);if(t===null)return!0;var r=P8e.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&ete.call(r)==M8e}var D8e,I8e,N8e,ete,P8e,M8e,tte,rte=_(()=>{"use strict";$u();Dk();To();D8e="[object Object]",I8e=Function.prototype,N8e=Object.prototype,ete=I8e.toString,P8e=N8e.hasOwnProperty,M8e=ete.call(Object);s(O8e,"isPlainObject");tte=O8e});function j8e(e){return q8e.test(e)}var $8e,B8e,F8e,G8e,z8e,V8e,W8e,q8e,nte,ite=_(()=>{"use strict";$8e="\\ud800-\\udfff",B8e="\\u0300-\\u036f",F8e="\\ufe20-\\ufe2f",G8e="\\u20d0-\\u20ff",z8e=B8e+F8e+G8e,V8e="\\ufe0e\\ufe0f",W8e="\\u200d",q8e=RegExp("["+W8e+$8e+z8e+V8e+"]");s(j8e,"hasUnicode");nte=j8e});function H8e(e,t,r,n){var i=-1,a=e==null?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}var ste,ate=_(()=>{"use strict";s(H8e,"arrayReduce");ste=H8e});function U8e(){this.__data__=new Ku,this.size=0}var ote,lte=_(()=>{"use strict";Q1();s(U8e,"stackClear");ote=U8e});function Y8e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var cte,ute=_(()=>{"use strict";s(Y8e,"stackDelete");cte=Y8e});function K8e(e){return this.__data__.get(e)}var hte,dte=_(()=>{"use strict";s(K8e,"stackGet");hte=K8e});function X8e(e){return this.__data__.has(e)}var fte,pte=_(()=>{"use strict";s(X8e,"stackHas");fte=X8e});function Z8e(e,t){var r=this.__data__;if(r instanceof Ku){var n=r.__data__;if(!Xu||n.length<Q8e-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $d(n)}return r.set(e,t),this.size=r.size,this}var Q8e,mte,gte=_(()=>{"use strict";Q1();wk();_k();Q8e=200;s(Z8e,"stackSet");mte=Z8e});function Fm(e){var t=this.__data__=new Ku(e);this.size=t.size}var pl,tx=_(()=>{"use strict";Q1();lte();ute();dte();pte();gte();s(Fm,"Stack");Fm.prototype.clear=ote;Fm.prototype.delete=cte;Fm.prototype.get=hte;Fm.prototype.has=fte;Fm.prototype.set=mte;pl=Fm});function J8e(e,t){return e&&hl(t,qn(t),e)}var yte,xte=_(()=>{"use strict";wm();bc();s(J8e,"baseAssign");yte=J8e});function e7e(e,t){return e&&hl(t,Fs(t),e)}var bte,Tte=_(()=>{"use strict";wm();Uu();s(e7e,"baseAssignIn");bte=e7e});function r7e(e,t){if(t)return e.slice();var r=e.length,n=Ste?Ste(r):new e.constructor(r);return e.copy(n),n}var vte,Cte,t7e,kte,Ste,Ik,u5=_(()=>{"use strict";Oa();vte=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cte=vte&&typeof module=="object"&&module&&!module.nodeType&&module,t7e=Cte&&Cte.exports===vte,kte=t7e?Wn.Buffer:void 0,Ste=kte?kte.allocUnsafe:void 0;s(r7e,"cloneBuffer");Ik=r7e});function n7e(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}var Nk,h5=_(()=>{"use strict";s(n7e,"arrayFilter");Nk=n7e});function i7e(){return[]}var Pk,d5=_(()=>{"use strict";s(i7e,"stubArray");Pk=i7e});var s7e,a7e,Ete,o7e,Gm,Mk=_(()=>{"use strict";h5();d5();s7e=Object.prototype,a7e=s7e.propertyIsEnumerable,Ete=Object.getOwnPropertySymbols,o7e=Ete?function(e){return e==null?[]:(e=Object(e),Nk(Ete(e),function(t){return a7e.call(e,t)}))}:Pk,Gm=o7e});function l7e(e,t){return hl(e,Gm(e),t)}var wte,_te=_(()=>{"use strict";wm();Mk();s(l7e,"copySymbols");wte=l7e});var c7e,u7e,Ok,f5=_(()=>{"use strict";Rk();Dk();Mk();d5();c7e=Object.getOwnPropertySymbols,u7e=c7e?function(e){for(var t=[];e;)Om(t,Gm(e)),e=Bm(e);return t}:Pk,Ok=u7e});function h7e(e,t){return hl(e,Ok(e),t)}var Ate,Rte=_(()=>{"use strict";wm();f5();s(h7e,"copySymbolsIn");Ate=h7e});function d7e(e,t,r){var n=t(e);return wr(e)?n:Om(n,r(e))}var $k,p5=_(()=>{"use strict";Rk();oi();s(d7e,"baseGetAllKeys");$k=d7e});function f7e(e){return $k(e,qn,Gm)}var rx,m5=_(()=>{"use strict";p5();Mk();bc();s(f7e,"getAllKeys");rx=f7e});function p7e(e){return $k(e,Fs,Ok)}var Lte,Dte=_(()=>{"use strict";p5();f5();Uu();s(p7e,"getAllKeysIn");Lte=p7e});var m7e,Bk,Ite=_(()=>{"use strict";Fu();Oa();m7e=$s(Wn,"DataView"),Bk=m7e});var g7e,Fk,Nte=_(()=>{"use strict";Fu();Oa();g7e=$s(Wn,"Promise"),Fk=g7e});var y7e,eh,g5=_(()=>{"use strict";Fu();Oa();y7e=$s(Wn,"Set"),eh=y7e});var Pte,x7e,Mte,Ote,$te,Bte,b7e,T7e,C7e,k7e,S7e,Bd,pa,Fd=_(()=>{"use strict";Ite();wk();Nte();g5();bJ();$u();YI();Pte="[object Map]",x7e="[object Object]",Mte="[object Promise]",Ote="[object Set]",$te="[object WeakMap]",Bte="[object DataView]",b7e=gc(Bk),T7e=gc(Xu),C7e=gc(Fk),k7e=gc(eh),S7e=gc(pk),Bd=ys;(Bk&&Bd(new Bk(new ArrayBuffer(1)))!=Bte||Xu&&Bd(new Xu)!=Pte||Fk&&Bd(Fk.resolve())!=Mte||eh&&Bd(new eh)!=Ote||pk&&Bd(new pk)!=$te)&&(Bd=s(function(e){var t=ys(e),r=t==x7e?e.constructor:void 0,n=r?gc(r):"";if(n)switch(n){case b7e:return Bte;case T7e:return Pte;case C7e:return Mte;case k7e:return Ote;case S7e:return $te}return t},"getTag"));pa=Bd});function w7e(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&E7e.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var v7e,E7e,Fte,Gte=_(()=>{"use strict";v7e=Object.prototype,E7e=v7e.hasOwnProperty;s(w7e,"initCloneArray");Fte=w7e});var _7e,zm,y5=_(()=>{"use strict";Oa();_7e=Wn.Uint8Array,zm=_7e});function A7e(e){var t=new e.constructor(e.byteLength);return new zm(t).set(new zm(e)),t}var Vm,Gk=_(()=>{"use strict";y5();s(A7e,"cloneArrayBuffer");Vm=A7e});function R7e(e,t){var r=t?Vm(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var zte,Vte=_(()=>{"use strict";Gk();s(R7e,"cloneDataView");zte=R7e});function D7e(e){var t=new e.constructor(e.source,L7e.exec(e));return t.lastIndex=e.lastIndex,t}var L7e,Wte,qte=_(()=>{"use strict";L7e=/\w*$/;s(D7e,"cloneRegExp");Wte=D7e});function I7e(e){return Hte?Object(Hte.call(e)):{}}var jte,Hte,Ute,Yte=_(()=>{"use strict";Pd();jte=Ni?Ni.prototype:void 0,Hte=jte?jte.valueOf:void 0;s(I7e,"cloneSymbol");Ute=I7e});function N7e(e,t){var r=t?Vm(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var zk,x5=_(()=>{"use strict";Gk();s(N7e,"cloneTypedArray");zk=N7e});function J7e(e,t,r){var n=e.constructor;switch(t){case V7e:return Vm(e);case P7e:case M7e:return new n(+e);case W7e:return zte(e,r);case q7e:case j7e:case H7e:case U7e:case Y7e:case K7e:case X7e:case Q7e:case Z7e:return zk(e,r);case O7e:return new n;case $7e:case G7e:return new n(e);case B7e:return Wte(e);case F7e:return new n;case z7e:return Ute(e)}}var P7e,M7e,O7e,$7e,B7e,F7e,G7e,z7e,V7e,W7e,q7e,j7e,H7e,U7e,Y7e,K7e,X7e,Q7e,Z7e,Kte,Xte=_(()=>{"use strict";Gk();Vte();qte();Yte();x5();P7e="[object Boolean]",M7e="[object Date]",O7e="[object Map]",$7e="[object Number]",B7e="[object RegExp]",F7e="[object Set]",G7e="[object String]",z7e="[object Symbol]",V7e="[object ArrayBuffer]",W7e="[object DataView]",q7e="[object Float32Array]",j7e="[object Float64Array]",H7e="[object Int8Array]",U7e="[object Int16Array]",Y7e="[object Int32Array]",K7e="[object Uint8Array]",X7e="[object Uint8ClampedArray]",Q7e="[object Uint16Array]",Z7e="[object Uint32Array]";s(J7e,"initCloneByTag");Kte=J7e});function eFe(e){return typeof e.constructor=="function"&&!qu(e)?CJ(Bm(e)):{}}var Vk,b5=_(()=>{"use strict";kJ();Dk();j1();s(eFe,"initCloneObject");Vk=eFe});function rFe(e){return Xn(e)&&pa(e)==tFe}var tFe,Qte,Zte=_(()=>{"use strict";Fd();To();tFe="[object Map]";s(rFe,"baseIsMap");Qte=rFe});var Jte,nFe,ere,tre=_(()=>{"use strict";Zte();H1();Ck();Jte=xc&&xc.isMap,nFe=Jte?ju(Jte):Qte,ere=nFe});function sFe(e){return Xn(e)&&pa(e)==iFe}var iFe,rre,nre=_(()=>{"use strict";Fd();To();iFe="[object Set]";s(sFe,"baseIsSet");rre=sFe});var ire,aFe,sre,are=_(()=>{"use strict";nre();H1();Ck();ire=xc&&xc.isSet,aFe=ire?ju(ire):rre,sre=aFe});function Wk(e,t,r,n,i,a){var o,l=t&oFe,u=t&lFe,h=t&cFe;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!In(e))return e;var d=wr(e);if(d){if(o=Fte(e),!l)return mk(e,o)}else{var f=pa(e),p=f==lre||f==pFe;if(ko(e))return Ik(e,l);if(f==cre||f==ore||p&&!i){if(o=u||p?{}:Vk(e),!l)return u?Ate(e,bte(o,e)):wte(e,yte(o,e))}else{if(!yn[f])return i?e:{};o=Kte(e,f,l)}}a||(a=new pl);var g=a.get(e);if(g)return g;a.set(e,o),sre(e)?e.forEach(function(x){o.add(Wk(x,t,r,x,e,a))}):ere(e)&&e.forEach(function(x,T){o.set(T,Wk(x,t,r,T,e,a))});var m=h?u?Lte:rx:u?Fs:qn,y=d?void 0:m(e);return yk(y||e,function(x,T){y&&(T=x,x=e[T]),Vu(o,T,Wk(x,t,r,T,e,a))}),o}var oFe,lFe,cFe,ore,uFe,hFe,dFe,fFe,lre,pFe,mFe,gFe,cre,yFe,xFe,bFe,TFe,CFe,kFe,SFe,vFe,EFe,wFe,_Fe,AFe,RFe,LFe,DFe,IFe,yn,ure,hre=_(()=>{"use strict";tx();JI();V1();xte();Tte();u5();KI();_te();Rte();m5();Dte();Fd();Gte();Xte();b5();oi();Rm();tre();$a();are();bc();Uu();oFe=1,lFe=2,cFe=4,ore="[object Arguments]",uFe="[object Array]",hFe="[object Boolean]",dFe="[object Date]",fFe="[object Error]",lre="[object Function]",pFe="[object GeneratorFunction]",mFe="[object Map]",gFe="[object Number]",cre="[object Object]",yFe="[object RegExp]",xFe="[object Set]",bFe="[object String]",TFe="[object Symbol]",CFe="[object WeakMap]",kFe="[object ArrayBuffer]",SFe="[object DataView]",vFe="[object Float32Array]",EFe="[object Float64Array]",wFe="[object Int8Array]",_Fe="[object Int16Array]",AFe="[object Int32Array]",RFe="[object Uint8Array]",LFe="[object Uint8ClampedArray]",DFe="[object Uint16Array]",IFe="[object Uint32Array]",yn={};yn[ore]=yn[uFe]=yn[kFe]=yn[SFe]=yn[hFe]=yn[dFe]=yn[vFe]=yn[EFe]=yn[wFe]=yn[_Fe]=yn[AFe]=yn[mFe]=yn[gFe]=yn[cre]=yn[yFe]=yn[xFe]=yn[bFe]=yn[TFe]=yn[RFe]=yn[LFe]=yn[DFe]=yn[IFe]=!0;yn[fFe]=yn[lre]=yn[CFe]=!1;s(Wk,"baseClone");ure=Wk});function MFe(e){return ure(e,NFe|PFe)}var NFe,PFe,T5,dre=_(()=>{"use strict";hre();NFe=1,PFe=4;s(MFe,"cloneDeep");T5=MFe});function $Fe(e){return this.__data__.set(e,OFe),this}var OFe,fre,pre=_(()=>{"use strict";OFe="__lodash_hash_undefined__";s($Fe,"setCacheAdd");fre=$Fe});function BFe(e){return this.__data__.has(e)}var mre,gre=_(()=>{"use strict";s(BFe,"setCacheHas");mre=BFe});function qk(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new $d;++t<r;)this.add(e[t])}var jk,C5=_(()=>{"use strict";_k();pre();gre();s(qk,"SetCache");qk.prototype.add=qk.prototype.push=fre;qk.prototype.has=mre;jk=qk});function FFe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var yre,xre=_(()=>{"use strict";s(FFe,"arraySome");yre=FFe});function GFe(e,t){return e.has(t)}var Hk,k5=_(()=>{"use strict";s(GFe,"cacheHas");Hk=GFe});function WFe(e,t,r,n,i,a){var o=r&zFe,l=e.length,u=t.length;if(l!=u&&!(o&&u>l))return!1;var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var f=-1,p=!0,g=r&VFe?new jk:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var m=e[f],y=t[f];if(n)var x=o?n(y,m,f,t,e,a):n(m,y,f,e,t,a);if(x!==void 0){if(x)continue;p=!1;break}if(g){if(!yre(t,function(T,C){if(!Hk(g,C)&&(m===T||i(m,T,r,n,a)))return g.push(C)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,a))){p=!1;break}}return a.delete(e),a.delete(t),p}var zFe,VFe,Uk,S5=_(()=>{"use strict";C5();xre();k5();zFe=1,VFe=2;s(WFe,"equalArrays");Uk=WFe});function qFe(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var bre,Tre=_(()=>{"use strict";s(qFe,"mapToArray");bre=qFe});function jFe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Wm,Yk=_(()=>{"use strict";s(jFe,"setToArray");Wm=jFe});function s9e(e,t,r,n,i,a,o){switch(r){case i9e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case n9e:return!(e.byteLength!=t.byteLength||!a(new zm(e),new zm(t)));case YFe:case KFe:case ZFe:return Ba(+e,+t);case XFe:return e.name==t.name&&e.message==t.message;case JFe:case t9e:return e==t+"";case QFe:var l=bre;case e9e:var u=n&HFe;if(l||(l=Wm),e.size!=t.size&&!u)return!1;var h=o.get(e);if(h)return h==t;n|=UFe,o.set(e,t);var d=Uk(l(e),l(t),n,i,a,o);return o.delete(e),d;case r9e:if(v5)return v5.call(e)==v5.call(t)}return!1}var HFe,UFe,YFe,KFe,XFe,QFe,ZFe,JFe,e9e,t9e,r9e,n9e,i9e,Cre,v5,kre,Sre=_(()=>{"use strict";Pd();y5();Od();S5();Tre();Yk();HFe=1,UFe=2,YFe="[object Boolean]",KFe="[object Date]",XFe="[object Error]",QFe="[object Map]",ZFe="[object Number]",JFe="[object RegExp]",e9e="[object Set]",t9e="[object String]",r9e="[object Symbol]",n9e="[object ArrayBuffer]",i9e="[object DataView]",Cre=Ni?Ni.prototype:void 0,v5=Cre?Cre.valueOf:void 0;s(s9e,"equalByTag");kre=s9e});function c9e(e,t,r,n,i,a){var o=r&a9e,l=rx(e),u=l.length,h=rx(t),d=h.length;if(u!=d&&!o)return!1;for(var f=u;f--;){var p=l[f];if(!(o?p in t:l9e.call(t,p)))return!1}var g=a.get(e),m=a.get(t);if(g&&m)return g==t&&m==e;var y=!0;a.set(e,t),a.set(t,e);for(var x=o;++f<u;){p=l[f];var T=e[p],C=t[p];if(n)var k=o?n(C,T,p,t,e,a):n(T,C,p,e,t,a);if(!(k===void 0?T===C||i(T,C,r,n,a):k)){y=!1;break}x||(x=p=="constructor")}if(y&&!x){var E=e.constructor,v=t.constructor;E!=v&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof v=="function"&&v instanceof v)&&(y=!1)}return a.delete(e),a.delete(t),y}var a9e,o9e,l9e,vre,Ere=_(()=>{"use strict";m5();a9e=1,o9e=Object.prototype,l9e=o9e.hasOwnProperty;s(c9e,"equalObjects");vre=c9e});function d9e(e,t,r,n,i,a){var o=wr(e),l=wr(t),u=o?_re:pa(e),h=l?_re:pa(t);u=u==wre?Kk:u,h=h==wre?Kk:h;var d=u==Kk,f=h==Kk,p=u==h;if(p&&ko(e)){if(!ko(t))return!1;o=!0,d=!1}if(p&&!d)return a||(a=new pl),o||Hu(e)?Uk(e,t,r,n,i,a):kre(e,t,u,r,n,i,a);if(!(r&u9e)){var g=d&&Are.call(e,"__wrapped__"),m=f&&Are.call(t,"__wrapped__");if(g||m){var y=g?e.value():e,x=m?t.value():t;return a||(a=new pl),i(y,x,r,n,a)}}return p?(a||(a=new pl),vre(e,t,r,n,i,a)):!1}var u9e,wre,_re,Kk,h9e,Are,Rre,Lre=_(()=>{"use strict";tx();S5();Sre();Ere();Fd();oi();Rm();Y1();u9e=1,wre="[object Arguments]",_re="[object Array]",Kk="[object Object]",h9e=Object.prototype,Are=h9e.hasOwnProperty;s(d9e,"baseIsEqualDeep");Rre=d9e});function Dre(e,t,r,n,i){return e===t?!0:e==null||t==null||!Xn(e)&&!Xn(t)?e!==e&&t!==t:Rre(e,t,r,n,Dre,i)}var Xk,E5=_(()=>{"use strict";Lre();To();s(Dre,"baseIsEqual");Xk=Dre});function m9e(e,t,r,n){var i=r.length,a=i,o=!n;if(e==null)return!a;for(e=Object(e);i--;){var l=r[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=r[i];var u=l[0],h=e[u],d=l[1];if(o&&l[2]){if(h===void 0&&!(u in e))return!1}else{var f=new pl;if(n)var p=n(h,d,u,e,t,f);if(!(p===void 0?Xk(d,h,f9e|p9e,n,f):p))return!1}}return!0}var f9e,p9e,Ire,Nre=_(()=>{"use strict";tx();E5();f9e=1,p9e=2;s(m9e,"baseIsMatch");Ire=m9e});function g9e(e){return e===e&&!In(e)}var Qk,w5=_(()=>{"use strict";$a();s(g9e,"isStrictComparable");Qk=g9e});function y9e(e){for(var t=qn(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Qk(i)]}return t}var Pre,Mre=_(()=>{"use strict";w5();bc();s(y9e,"getMatchData");Pre=y9e});function x9e(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Zk,_5=_(()=>{"use strict";s(x9e,"matchesStrictComparable");Zk=x9e});function b9e(e){var t=Pre(e);return t.length==1&&t[0][2]?Zk(t[0][0],t[0][1]):function(r){return r===e||Ire(r,e,t)}}var Ore,$re=_(()=>{"use strict";Nre();Mre();_5();s(b9e,"baseMatches");Ore=b9e});function T9e(e,t){return e!=null&&t in Object(e)}var Bre,Fre=_(()=>{"use strict";s(T9e,"baseHasIn");Bre=T9e});function C9e(e,t,r){t=Zu(t,e);for(var n=-1,i=t.length,a=!1;++n<i;){var o=fl(t[n]);if(!(a=e!=null&&r(e,o)))break;e=e[o]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&_m(i)&&Gu(o,i)&&(wr(e)||Co(e)))}var Jk,A5=_(()=>{"use strict";J1();Am();oi();G1();Tk();Mm();s(C9e,"hasPath");Jk=C9e});function k9e(e,t){return e!=null&&Jk(e,t,Bre)}var eS,R5=_(()=>{"use strict";Fre();A5();s(k9e,"hasIn");eS=k9e});function E9e(e,t){return Dm(e)&&Qk(t)?Zk(fl(e),t):function(r){var n=Hee(r,e);return n===void 0&&n===t?eS(r,e):Xk(t,n,S9e|v9e)}}var S9e,v9e,Gre,zre=_(()=>{"use strict";E5();Uee();R5();Ek();w5();_5();Mm();S9e=1,v9e=2;s(E9e,"baseMatchesProperty");Gre=E9e});function w9e(e){return function(t){return t?.[e]}}var tS,L5=_(()=>{"use strict";s(w9e,"baseProperty");tS=w9e});function _9e(e){return function(t){return Ju(t,e)}}var Vre,Wre=_(()=>{"use strict";ex();s(_9e,"basePropertyDeep");Vre=_9e});function A9e(e){return Dm(e)?tS(fl(e)):Vre(e)}var qre,jre=_(()=>{"use strict";L5();Wre();Ek();Mm();s(A9e,"property");qre=A9e});function R9e(e){return typeof e=="function"?e:e==null?Os:typeof e=="object"?wr(e)?Gre(e[0],e[1]):Ore(e):qre(e)}var is,Cc=_(()=>{"use strict";$re();zre();Bu();oi();jre();s(R9e,"baseIteratee");is=R9e});function L9e(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),l=o.length;l--;){var u=o[e?l:++i];if(r(a[u],u,a)===!1)break}return t}}var Hre,Ure=_(()=>{"use strict";s(L9e,"createBaseFor");Hre=L9e});var D9e,qm,rS=_(()=>{"use strict";Ure();D9e=Hre(),qm=D9e});function I9e(e,t){return e&&qm(e,t,qn)}var jm,nS=_(()=>{"use strict";rS();bc();s(I9e,"baseForOwn");jm=I9e});function N9e(e,t){return function(r,n){if(r==null)return r;if(!Pi(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++a<i)&&n(o[a],a,o)!==!1;);return r}}var Yre,Kre=_(()=>{"use strict";dl();s(N9e,"createBaseEach");Yre=N9e});var P9e,th,nx=_(()=>{"use strict";nS();Kre();P9e=Yre(jm),th=P9e});var M9e,iS,Xre=_(()=>{"use strict";Oa();M9e=s(function(){return Wn.Date.now()},"now"),iS=M9e});var Qre,O9e,$9e,D5,Zre=_(()=>{"use strict";W1();Od();q1();Uu();Qre=Object.prototype,O9e=Qre.hasOwnProperty,$9e=Wu(function(e,t){e=Object(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&yc(t[0],t[1],i)&&(n=1);++r<n;)for(var a=t[r],o=Fs(a),l=-1,u=o.length;++l<u;){var h=o[l],d=e[h];(d===void 0||Ba(d,Qre[h])&&!O9e.call(e,h))&&(e[h]=a[h])}return e}),D5=$9e});function B9e(e,t,r){(r!==void 0&&!Ba(e[t],r)||r===void 0&&!(t in e))&&zu(e,t,r)}var ix,I5=_(()=>{"use strict";z1();Od();s(B9e,"assignMergeValue");ix=B9e});function F9e(e){return Xn(e)&&Pi(e)}var sS,N5=_(()=>{"use strict";dl();To();s(F9e,"isArrayLikeObject");sS=F9e});function G9e(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var sx,P5=_(()=>{"use strict";s(G9e,"safeGet");sx=G9e});function z9e(e){return hl(e,Fs(e))}var Jre,ene=_(()=>{"use strict";wm();Uu();s(z9e,"toPlainObject");Jre=z9e});function V9e(e,t,r,n,i,a,o){var l=sx(e,r),u=sx(t,r),h=o.get(u);if(h){ix(e,r,h);return}var d=a?a(l,u,r+"",e,t,o):void 0,f=d===void 0;if(f){var p=wr(u),g=!p&&ko(u),m=!p&&!g&&Hu(u);d=u,p||g||m?wr(l)?d=l:sS(l)?d=mk(l):g?(f=!1,d=Ik(u,!0)):m?(f=!1,d=zk(u,!0)):d=[]:tte(u)||Co(u)?(d=l,Co(l)?d=Jre(l):(!In(l)||ul(l))&&(d=Vk(u))):f=!1}f&&(o.set(u,d),i(d,u,n,a,o),o.delete(u)),ix(e,r,d)}var tne,rne=_(()=>{"use strict";I5();u5();x5();KI();b5();Am();oi();N5();Rm();F1();$a();rte();Y1();P5();ene();s(V9e,"baseMergeDeep");tne=V9e});function nne(e,t,r,n,i){e!==t&&qm(t,function(a,o){if(i||(i=new pl),In(a))tne(e,t,o,r,nne,n,i);else{var l=n?n(sx(e,o),a,o+"",e,t,i):void 0;l===void 0&&(l=a),ix(e,o,l)}},Fs)}var ine,sne=_(()=>{"use strict";tx();I5();rS();rne();$a();Uu();P5();s(nne,"baseMerge");ine=nne});function W9e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var ane,one=_(()=>{"use strict";s(W9e,"arrayIncludesWith");ane=W9e});function q9e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var rh,lne=_(()=>{"use strict";s(q9e,"last");rh=q9e});function j9e(e){return typeof e=="function"?e:Os}var Hm,aS=_(()=>{"use strict";Bu();s(j9e,"castFunction");Hm=j9e});function H9e(e,t){var r=wr(e)?yk:th;return r(e,Hm(t))}var He,M5=_(()=>{"use strict";JI();nx();aS();oi();s(H9e,"forEach");He=H9e});var cne=_(()=>{"use strict";M5()});function U9e(e,t){var r=[];return th(e,function(n,i,a){t(n,i,a)&&r.push(n)}),r}var une,hne=_(()=>{"use strict";nx();s(U9e,"baseFilter");une=U9e});function Y9e(e,t){var r=wr(e)?Nk:une;return r(e,is(t,3))}var xs,dne=_(()=>{"use strict";h5();hne();Cc();oi();s(Y9e,"filter");xs=Y9e});function K9e(e){return function(t,r,n){var i=Object(t);if(!Pi(t)){var a=is(r,3);t=qn(t),r=s(function(l){return a(i[l],l,i)},"predicate")}var o=e(t,r,n);return o>-1?i[a?t[o]:o]:void 0}}var fne,pne=_(()=>{"use strict";Cc();dl();bc();s(K9e,"createFind");fne=K9e});function Q9e(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:cJ(r);return i<0&&(i=X9e(n+i,0)),xk(e,is(t,3),i)}var X9e,mne,gne=_(()=>{"use strict";e5();Cc();uJ();X9e=Math.max;s(Q9e,"findIndex");mne=Q9e});var Z9e,Um,yne=_(()=>{"use strict";pne();gne();Z9e=fne(mne),Um=Z9e});function J9e(e,t){var r=-1,n=Pi(e)?Array(e.length):[];return th(e,function(i,a,o){n[++r]=t(i,a,o)}),n}var oS,O5=_(()=>{"use strict";nx();dl();s(J9e,"baseMap");oS=J9e});function eGe(e,t){var r=wr(e)?cl:oS;return r(e,is(t,3))}var an,xne=_(()=>{"use strict";B1();Cc();O5();oi();s(eGe,"map");an=eGe});function tGe(e,t){return e==null?e:qm(e,Hm(t),Fs)}var $5,bne=_(()=>{"use strict";rS();aS();Uu();s(tGe,"forIn");$5=tGe});function rGe(e,t){return e&&jm(e,Hm(t))}var B5,Tne=_(()=>{"use strict";nS();aS();s(rGe,"forOwn");B5=rGe});function nGe(e,t){return e>t}var Cne,kne=_(()=>{"use strict";s(nGe,"baseGt");Cne=nGe});function aGe(e,t){return e!=null&&sGe.call(e,t)}var iGe,sGe,Sne,vne=_(()=>{"use strict";iGe=Object.prototype,sGe=iGe.hasOwnProperty;s(aGe,"baseHas");Sne=aGe});function oGe(e,t){return e!=null&&Jk(e,t,Sne)}var ax,Ene=_(()=>{"use strict";vne();A5();s(oGe,"has");ax=oGe});function cGe(e){return typeof e=="string"||!wr(e)&&Xn(e)&&ys(e)==lGe}var lGe,wne,_ne=_(()=>{"use strict";$u();oi();To();lGe="[object String]";s(cGe,"isString");wne=cGe});function uGe(e,t){return cl(t,function(r){return e[r]})}var Ane,Rne=_(()=>{"use strict";B1();s(uGe,"baseValues");Ane=uGe});function hGe(e){return e==null?[]:Ane(e,qn(e))}var ma,Lne=_(()=>{"use strict";Rne();bc();s(hGe,"values");ma=hGe});function gGe(e){if(e==null)return!0;if(Pi(e)&&(wr(e)||typeof e=="string"||typeof e.splice=="function"||ko(e)||Hu(e)||Co(e)))return!e.length;var t=pa(e);if(t==dGe||t==fGe)return!e.size;if(qu(e))return!Lm(e).length;for(var r in e)if(mGe.call(e,r))return!1;return!0}var dGe,fGe,pGe,mGe,lS,Dne=_(()=>{"use strict";vk();Fd();Am();oi();dl();Rm();j1();Y1();dGe="[object Map]",fGe="[object Set]",pGe=Object.prototype,mGe=pGe.hasOwnProperty;s(gGe,"isEmpty");lS=gGe});function yGe(e){return e===void 0}var jn,Ine=_(()=>{"use strict";s(yGe,"isUndefined");jn=yGe});function xGe(e,t){return e<t}var cS,F5=_(()=>{"use strict";s(xGe,"baseLt");cS=xGe});function bGe(e,t){var r={};return t=is(t,3),jm(e,function(n,i,a){zu(r,i,t(n,i,a))}),r}var Gd,Nne=_(()=>{"use strict";z1();nS();Cc();s(bGe,"mapValues");Gd=bGe});function TGe(e,t,r){for(var n=-1,i=e.length;++n<i;){var a=e[n],o=t(a);if(o!=null&&(l===void 0?o===o&&!fa(o):r(o,l)))var l=o,u=a}return u}var Ym,uS=_(()=>{"use strict";Md();s(TGe,"baseExtremum");Ym=TGe});function CGe(e){return e&&e.length?Ym(e,Os,Cne):void 0}var Gs,Pne=_(()=>{"use strict";uS();kne();Bu();s(CGe,"max");Gs=CGe});var kGe,Km,Mne=_(()=>{"use strict";sne();zJ();kGe=GJ(function(e,t,r){ine(e,t,r)}),Km=kGe});function SGe(e){return e&&e.length?Ym(e,Os,cS):void 0}var kc,One=_(()=>{"use strict";uS();F5();Bu();s(SGe,"min");kc=SGe});function vGe(e,t){return e&&e.length?Ym(e,is(t,2),cS):void 0}var zd,$ne=_(()=>{"use strict";uS();Cc();F5();s(vGe,"minBy");zd=vGe});function EGe(e,t,r,n){if(!In(e))return e;t=Zu(t,e);for(var i=-1,a=t.length,o=a-1,l=e;l!=null&&++i<a;){var u=fl(t[i]),h=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(i!=o){var d=l[u];h=n?n(d,u,l):void 0,h===void 0&&(h=In(d)?d:Gu(t[i+1])?[]:{})}Vu(l,u,h),l=l[u]}return e}var Bne,Fne=_(()=>{"use strict";V1();J1();G1();$a();Mm();s(EGe,"baseSet");Bne=EGe});function wGe(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],l=Ju(e,o);r(l,o)&&Bne(a,Zu(o,e),l)}return a}var Gne,zne=_(()=>{"use strict";ex();Fne();J1();s(wGe,"basePickBy");Gne=wGe});function _Ge(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var Vne,Wne=_(()=>{"use strict";s(_Ge,"baseSortBy");Vne=_Ge});function AGe(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,a=fa(e),o=t!==void 0,l=t===null,u=t===t,h=fa(t);if(!l&&!h&&!a&&e>t||a&&o&&u&&!l&&!h||n&&o&&u||!r&&u||!i)return 1;if(!n&&!a&&!h&&e<t||h&&r&&i&&!n&&!a||l&&r&&i||!o&&i||!u)return-1}return 0}var qne,jne=_(()=>{"use strict";Md();s(AGe,"compareAscending");qne=AGe});function RGe(e,t,r){for(var n=-1,i=e.criteria,a=t.criteria,o=i.length,l=r.length;++n<o;){var u=qne(i[n],a[n]);if(u){if(n>=l)return u;var h=r[n];return u*(h=="desc"?-1:1)}}return e.index-t.index}var Hne,Une=_(()=>{"use strict";jne();s(RGe,"compareMultiple");Hne=RGe});function LGe(e,t,r){t.length?t=cl(t,function(a){return wr(a)?function(o){return Ju(o,a.length===1?a[0]:a)}:a}):t=[Os];var n=-1;t=cl(t,ju(is));var i=oS(e,function(a,o,l){var u=cl(t,function(h){return h(a)});return{criteria:u,index:++n,value:a}});return Vne(i,function(a,o){return Hne(a,o,r)})}var Yne,Kne=_(()=>{"use strict";B1();ex();Cc();O5();Wne();H1();Une();Bu();oi();s(LGe,"baseOrderBy");Yne=LGe});var DGe,Xne,Qne=_(()=>{"use strict";L5();DGe=tS("length"),Xne=DGe});function WGe(e){for(var t=Zne.lastIndex=0;Zne.test(e);)++t;return t}var Jne,IGe,NGe,PGe,MGe,OGe,$Ge,G5,z5,BGe,eie,tie,rie,FGe,nie,iie,GGe,zGe,VGe,Zne,sie,aie=_(()=>{"use strict";Jne="\\ud800-\\udfff",IGe="\\u0300-\\u036f",NGe="\\ufe20-\\ufe2f",PGe="\\u20d0-\\u20ff",MGe=IGe+NGe+PGe,OGe="\\ufe0e\\ufe0f",$Ge="["+Jne+"]",G5="["+MGe+"]",z5="\\ud83c[\\udffb-\\udfff]",BGe="(?:"+G5+"|"+z5+")",eie="[^"+Jne+"]",tie="(?:\\ud83c[\\udde6-\\uddff]){2}",rie="[\\ud800-\\udbff][\\udc00-\\udfff]",FGe="\\u200d",nie=BGe+"?",iie="["+OGe+"]?",GGe="(?:"+FGe+"(?:"+[eie,tie,rie].join("|")+")"+iie+nie+")*",zGe=iie+nie+GGe,VGe="(?:"+[eie+G5+"?",G5,tie,rie,$Ge].join("|")+")",Zne=RegExp(z5+"(?="+z5+")|"+VGe+zGe,"g");s(WGe,"unicodeSize");sie=WGe});function qGe(e){return nte(e)?sie(e):Xne(e)}var oie,lie=_(()=>{"use strict";Qne();ite();aie();s(qGe,"stringSize");oie=qGe});function jGe(e,t){return Gne(e,t,function(r,n){return eS(e,n)})}var cie,uie=_(()=>{"use strict";zne();R5();s(jGe,"basePick");cie=jGe});var HGe,Vd,hie=_(()=>{"use strict";uie();Jee();HGe=Zee(function(e,t){return e==null?{}:cie(e,t)}),Vd=HGe});function KGe(e,t,r,n){for(var i=-1,a=YGe(UGe((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var UGe,YGe,die,fie=_(()=>{"use strict";UGe=Math.ceil,YGe=Math.max;s(KGe,"baseRange");die=KGe});function XGe(e){return function(t,r,n){return n&&typeof n!="number"&&yc(t,r,n)&&(r=n=void 0),t=vm(t),r===void 0?(r=t,t=0):r=vm(r),n=n===void 0?t<r?1:-1:vm(n),die(t,r,n,e)}}var pie,mie=_(()=>{"use strict";fie();q1();UI();s(XGe,"createRange");pie=XGe});var QGe,Ga,gie=_(()=>{"use strict";mie();QGe=pie(),Ga=QGe});function ZGe(e,t,r,n,i){return i(e,function(a,o,l){r=n?(n=!1,a):t(r,a,o,l)}),r}var yie,xie=_(()=>{"use strict";s(ZGe,"baseReduce");yie=ZGe});function JGe(e,t,r){var n=wr(e)?ste:yie,i=arguments.length<3;return n(e,is(t,4),r,i,th)}var ml,bie=_(()=>{"use strict";ate();nx();Cc();xie();oi();s(JGe,"reduce");ml=JGe});function rze(e){if(e==null)return 0;if(Pi(e))return wne(e)?oie(e):e.length;var t=pa(e);return t==eze||t==tze?e.size:Lm(e).length}var eze,tze,V5,Tie=_(()=>{"use strict";vk();Fd();dl();_ne();lie();eze="[object Map]",tze="[object Set]";s(rze,"size");V5=rze});var nze,gl,Cie=_(()=>{"use strict";Lk();Kne();W1();q1();nze=Wu(function(e,t){if(e==null)return[];var r=t.length;return r>1&&yc(e,t[0],t[1])?t=[]:r>2&&yc(t[0],t[1],t[2])&&(t=[t[0]]),Yne(e,$m(t,1),[])}),gl=nze});var ize,sze,kie,Sie=_(()=>{"use strict";g5();wJ();Yk();ize=1/0,sze=eh&&1/Wm(new eh([,-0]))[1]==ize?function(e){return new eh(e)}:EJ,kie=sze});function oze(e,t,r){var n=-1,i=$J,a=e.length,o=!0,l=[],u=l;if(r)o=!1,i=ane;else if(a>=aze){var h=t?null:kie(e);if(h)return Wm(h);o=!1,i=Hk,u=new jk}else u=t?[]:l;e:for(;++n<a;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,o&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;t&&u.push(f),l.push(d)}else i(u,f,r)||(u!==l&&u.push(f),l.push(d))}return l}var aze,vie,Eie=_(()=>{"use strict";C5();BJ();one();k5();Sie();Yk();aze=200;s(oze,"baseUniq");vie=oze});var lze,W5,wie=_(()=>{"use strict";Lk();W1();Eie();N5();lze=Wu(function(e){return vie($m(e,1,sS,!0))}),W5=lze});function uze(e){var t=++cze;return Ak(e)+t}var cze,Wd,_ie=_(()=>{"use strict";l5();cze=0;s(uze,"uniqueId");Wd=uze});function hze(e,t,r){for(var n=-1,i=e.length,a=t.length,o={};++n<i;){var l=n<a?t[n]:void 0;r(o,e[n],l)}return o}var Aie,Rie=_(()=>{"use strict";s(hze,"baseZipObject");Aie=hze});function dze(e,t){return Aie(e||[],t||[],Vu)}var hS,Lie=_(()=>{"use strict";V1();Rie();s(dze,"zipObject");hS=dze});var on=_(()=>{"use strict";dre();XI();Zre();cne();dne();yne();c5();M5();bne();Tne();Ene();oi();Dne();F1();Ine();bc();lne();xne();Nne();Pne();Mne();One();$ne();Xre();hie();gie();bie();Tie();Cie();wie();_ie();Lne();Lie();});function Iie(e,t){e[t]?e[t]++:e[t]=1}function Nie(e,t){--e[t]||delete e[t]}function ox(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}return i+Die+a+Die+(jn(n)?fze:n)}function pze(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}var l={v:i,w:a};return n&&(l.name=n),l}function q5(e,t){return ox(e,t.v,t.w,t.name)}var fze,qd,Die,Qr,j5=_(()=>{"use strict";on();fze="\0",qd="\0",Die="",Qr=class{static{s(this,"Graph")}constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Bs(void 0),this._defaultEdgeLabelFn=Bs(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[qd]={}),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(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return ul(t)||(t=Bs(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return qn(this._nodes)}sources(){var t=this;return xs(this.nodes(),function(r){return lS(t._in[r])})}sinks(){var t=this;return xs(this.nodes(),function(r){return lS(t._out[r])})}setNodes(t,r){var n=arguments,i=this;return He(t,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=qd,this._children[t]={},this._children[qd][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=s(n=>this.removeEdge(this._edgeObjs[n]),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],He(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),He(qn(this._in[t]),r),delete this._in[t],delete this._preds[t],He(qn(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(jn(r))r=qd;else{r+="";for(var n=r;!jn(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==qd)return r}}children(t){if(jn(t)&&(t=qd),this._isCompound){var r=this._children[t];if(r)return qn(r)}else{if(t===qd)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return qn(r)}successors(t){var r=this._sucs[t];if(r)return qn(r)}neighbors(t){var r=this.predecessors(t);if(r)return W5(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;He(this._nodes,function(o,l){t(l)&&r.setNode(l,o)}),He(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var l=n.parent(o);return l===void 0||r.hasNode(l)?(i[o]=l,l):l in i?i[l]:a(l)}return s(a,"findParent"),this._isCompound&&He(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(t){return ul(t)||(t=Bs(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return ma(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return ml(t,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var t,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(t=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(t=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,r=""+r,jn(n)||(n=""+n);var l=ox(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(!jn(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(t,r,n);var u=pze(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[l]=u,Iie(this._preds[r],t),Iie(this._sucs[t],r),this._in[r][l]=u,this._out[t][l]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n),a=this._edgeObjs[i];return a&&(t=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Nie(this._preds[r],t),Nie(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=ma(n);return r?xs(i,function(a){return a.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=ma(n);return r?xs(i,function(a){return a.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}};Qr.prototype._nodeCount=0;Qr.prototype._edgeCount=0;s(Iie,"incrementOrInitEntry");s(Nie,"decrementOrRemoveEntry");s(ox,"edgeArgsToId");s(pze,"edgeArgsToObj");s(q5,"edgeObjToId")});var ga=_(()=>{"use strict";j5()});function Pie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function mze(e,t){if(e!=="_next"&&e!=="_prev")return t}var dS,Mie=_(()=>{"use strict";dS=class{static{s(this,"List")}constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,r=t._prev;if(r!==t)return Pie(r),r}enqueue(t){var r=this._sentinel;t._prev&&t._next&&Pie(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){for(var t=[],r=this._sentinel,n=r._prev;n!==r;)t.push(JSON.stringify(n,mze)),n=n._prev;return"["+t.join(", ")+"]"}};s(Pie,"unlink");s(mze,"filterOutLinks")});function Oie(e,t){if(e.nodeCount()<=1)return[];var r=xze(e,t||gze),n=yze(r.graph,r.buckets,r.zeroIdx);return Fa(an(n,function(i){return e.outEdges(i.v,i.w)}))}function yze(e,t,r){for(var n=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)H5(e,t,r,o);for(;o=i.dequeue();)H5(e,t,r,o);if(e.nodeCount()){for(var l=t.length-2;l>0;--l)if(o=t[l].dequeue(),o){n=n.concat(H5(e,t,r,o,!0));break}}}return n}function H5(e,t,r,n,i){var a=i?[]:void 0;return He(e.inEdges(n.v),function(o){var l=e.edge(o),u=e.node(o.v);i&&a.push({v:o.v,w:o.w}),u.out-=l,U5(t,r,u)}),He(e.outEdges(n.v),function(o){var l=e.edge(o),u=o.w,h=e.node(u);h.in-=l,U5(t,r,h)}),e.removeNode(n.v),a}function xze(e,t){var r=new Qr,n=0,i=0;He(e.nodes(),function(l){r.setNode(l,{v:l,in:0,out:0})}),He(e.edges(),function(l){var u=r.edge(l.v,l.w)||0,h=t(l),d=u+h;r.setEdge(l.v,l.w,d),i=Math.max(i,r.node(l.v).out+=h),n=Math.max(n,r.node(l.w).in+=h)});var a=Ga(i+n+3).map(function(){return new dS}),o=n+1;return He(r.nodes(),function(l){U5(a,o,r.node(l))}),{graph:r,buckets:a,zeroIdx:o}}function U5(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var gze,$ie=_(()=>{"use strict";on();ga();Mie();gze=Bs(1);s(Oie,"greedyFAS");s(yze,"doGreedyFAS");s(H5,"removeNode");s(xze,"buildState");s(U5,"assignBucket")});function Bie(e){var t=e.graph().acyclicer==="greedy"?Oie(e,r(e)):bze(e);He(t,function(n){var i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,Wd("rev"))});function r(n){return function(i){return n.edge(i).weight}}s(r,"weightFn")}function bze(e){var t=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,He(e.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?t.push(o):i(o.w)}),delete r[a])}return s(i,"dfs"),He(e.nodes(),i),t}function Fie(e){He(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}var Y5=_(()=>{"use strict";on();$ie();s(Bie,"run");s(bze,"dfsFAS");s(Fie,"undo")});function yl(e,t,r,n){var i;do i=Wd(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function zie(e){var t=new Qr().setGraph(e.graph());return He(e.nodes(),function(r){t.setNode(r,e.node(r))}),He(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function fS(e){var t=new Qr({multigraph:e.isMultigraph()}).setGraph(e.graph());return He(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),He(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function K5(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,l=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,h;return Math.abs(a)*o>Math.abs(i)*l?(a<0&&(l=-l),u=l*i/a,h=l):(i<0&&(o=-o),u=o,h=o*a/i),{x:r+u,y:n+h}}function nh(e){var t=an(Ga(Q5(e)+1),function(){return[]});return He(e.nodes(),function(r){var n=e.node(r),i=n.rank;jn(i)||(t[i][n.order]=r)}),t}function Vie(e){var t=kc(an(e.nodes(),function(r){return e.node(r).rank}));He(e.nodes(),function(r){var n=e.node(r);ax(n,"rank")&&(n.rank-=t)})}function Wie(e){var t=kc(an(e.nodes(),function(a){return e.node(a).rank})),r=[];He(e.nodes(),function(a){var o=e.node(a).rank-t;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=e.graph().nodeRankFactor;He(r,function(a,o){jn(a)&&o%i!==0?--n:n&&He(a,function(l){e.node(l).rank+=n})})}function X5(e,t,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),yl(e,"border",i,t)}function Q5(e){return Gs(an(e.nodes(),function(t){var r=e.node(t).rank;if(!jn(r))return r}))}function qie(e,t){var r={lhs:[],rhs:[]};return He(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function jie(e,t){var r=iS();try{return t()}finally{console.log(e+" time: "+(iS()-r)+"ms")}}function Hie(e,t){return t()}var xl=_(()=>{"use strict";on();ga();s(yl,"addDummyNode");s(zie,"simplify");s(fS,"asNonCompoundGraph");s(K5,"intersectRect");s(nh,"buildLayerMatrix");s(Vie,"normalizeRanks");s(Wie,"removeEmptyRanks");s(X5,"addBorderNode");s(Q5,"maxRank");s(qie,"partition");s(jie,"time");s(Hie,"notime")});function Yie(e){function t(r){var n=e.children(r),i=e.node(r);if(n.length&&He(n,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Uie(e,"borderLeft","_bl",r,i,a),Uie(e,"borderRight","_br",r,i,a)}}s(t,"dfs"),He(e.children(),t)}function Uie(e,t,r,n,i,a){var o={width:0,height:0,rank:a,borderType:t},l=i[t][a-1],u=yl(e,"border",o,r);i[t][a]=u,e.setParent(u,n),l&&e.setEdge(l,u,{weight:1})}var Kie=_(()=>{"use strict";on();xl();s(Yie,"addBorderSegments");s(Uie,"addBorderNode")});function Qie(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&Jie(e)}function Zie(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&Tze(e),(t==="lr"||t==="rl")&&(Cze(e),Jie(e))}function Jie(e){He(e.nodes(),function(t){Xie(e.node(t))}),He(e.edges(),function(t){Xie(e.edge(t))})}function Xie(e){var t=e.width;e.width=e.height,e.height=t}function Tze(e){He(e.nodes(),function(t){Z5(e.node(t))}),He(e.edges(),function(t){var r=e.edge(t);He(r.points,Z5),Object.prototype.hasOwnProperty.call(r,"y")&&Z5(r)})}function Z5(e){e.y=-e.y}function Cze(e){He(e.nodes(),function(t){J5(e.node(t))}),He(e.edges(),function(t){var r=e.edge(t);He(r.points,J5),Object.prototype.hasOwnProperty.call(r,"x")&&J5(r)})}function J5(e){var t=e.x;e.x=e.y,e.y=t}var ese=_(()=>{"use strict";on();s(Qie,"adjust");s(Zie,"undo");s(Jie,"swapWidthHeight");s(Xie,"swapWidthHeightOne");s(Tze,"reverseY");s(Z5,"reverseYOne");s(Cze,"swapXY");s(J5,"swapXYOne")});function tse(e){e.graph().dummyChains=[],He(e.edges(),function(t){Sze(e,t)})}function Sze(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,l=e.edge(t),u=l.labelRank;if(a!==n+1){e.removeEdge(t);var h=void 0,d,f;for(f=0,++n;n<a;++f,++n)l.points=[],h={width:0,height:0,edgeLabel:l,edgeObj:t,rank:n},d=yl(e,"edge",h,"_d"),n===u&&(h.width=l.width,h.height=l.height,h.dummy="edge-label",h.labelpos=l.labelpos),e.setEdge(r,d,{weight:l.weight},o),f===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:l.weight},o)}}function rse(e){He(e.graph().dummyChains,function(t){var r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),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),t=i,r=e.node(t)})}var eN=_(()=>{"use strict";on();xl();s(tse,"run");s(Sze,"normalizeEdge");s(rse,"undo")});function cx(e){var t={};function r(n){var i=e.node(n);if(Object.prototype.hasOwnProperty.call(t,n))return i.rank;t[n]=!0;var a=kc(an(e.outEdges(n),function(o){return r(o.w)-e.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}s(r,"dfs"),He(e.sources(),r)}function jd(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var pS=_(()=>{"use strict";on();s(cx,"longestPath");s(jd,"slack")});function mS(e){var t=new Qr({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,a;vze(t,e)<n;)i=Eze(t,e),a=t.hasNode(i.v)?jd(e,i):-jd(e,i),wze(t,e,a);return t}function vze(e,t){function r(n){He(t.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;!e.hasNode(o)&&!jd(t,i)&&(e.setNode(o,{}),e.setEdge(n,o,{}),r(o))})}return s(r,"dfs"),He(e.nodes(),r),e.nodeCount()}function Eze(e,t){return zd(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return jd(t,r)})}function wze(e,t,r){He(e.nodes(),function(n){t.node(n).rank+=r})}var tN=_(()=>{"use strict";on();ga();pS();s(mS,"feasibleTree");s(vze,"tightTree");s(Eze,"findMinSlackEdge");s(wze,"shiftRanks")});var ise=_(()=>{"use strict"});var rN=_(()=>{"use strict"});var Olr,nN=_(()=>{"use strict";on();rN();Olr=Bs(1)});var sse=_(()=>{"use strict";nN()});var iN=_(()=>{"use strict"});var ase=_(()=>{"use strict";iN()});var Ulr,ose=_(()=>{"use strict";on();Ulr=Bs(1)});function sN(e){var t={},r={},n=[];function i(a){if(Object.prototype.hasOwnProperty.call(r,a))throw new ux;Object.prototype.hasOwnProperty.call(t,a)||(r[a]=!0,t[a]=!0,He(e.predecessors(a),i),delete r[a],n.push(a))}if(s(i,"visit"),He(e.sinks(),i),V5(t)!==e.nodeCount())throw new ux;return n}function ux(){}var aN=_(()=>{"use strict";on();sN.CycleException=ux;s(sN,"topsort");s(ux,"CycleException");ux.prototype=new Error});var lse=_(()=>{"use strict";aN()});function gS(e,t,r){wr(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return He(t,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);cse(e,o,r==="post",a,n,i)}),i}function cse(e,t,r,n,i,a){Object.prototype.hasOwnProperty.call(n,t)||(n[t]=!0,r||a.push(t),He(i(t),function(o){cse(e,o,r,n,i,a)}),r&&a.push(t))}var oN=_(()=>{"use strict";on();s(gS,"dfs");s(cse,"doDfs")});function lN(e,t){return gS(e,t,"post")}var use=_(()=>{"use strict";oN();s(lN,"postorder")});function cN(e,t){return gS(e,t,"pre")}var hse=_(()=>{"use strict";oN();s(cN,"preorder")});var dse=_(()=>{"use strict";rN();j5()});var fse=_(()=>{"use strict";ise();nN();sse();ase();ose();lse();use();hse();dse();iN();aN()});function sh(e){e=zie(e),cx(e);var t=mS(e);hN(t),uN(t,e);for(var r,n;r=yse(t);)n=xse(t,e,r),bse(t,e,r,n)}function uN(e,t){var r=lN(e,e.nodes());r=r.slice(0,r.length-1),He(r,function(n){Dze(e,t,n)})}function Dze(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=mse(e,t,r)}function mse(e,t,r){var n=e.node(r),i=n.parent,a=!0,o=t.edge(r,i),l=0;return o||(a=!1,o=t.edge(i,r)),l=o.weight,He(t.nodeEdges(r),function(u){var h=u.v===r,d=h?u.w:u.v;if(d!==i){var f=h===a,p=t.edge(u).weight;if(l+=f?p:-p,Nze(e,r,d)){var g=e.edge(r,d).cutvalue;l+=f?-g:g}}}),l}function hN(e,t){arguments.length<2&&(t=e.nodes()[0]),gse(e,{},1,t)}function gse(e,t,r,n,i){var a=r,o=e.node(n);return t[n]=!0,He(e.neighbors(n),function(l){Object.prototype.hasOwnProperty.call(t,l)||(r=gse(e,t,r,l,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function yse(e){return Um(e.edges(),function(t){return e.edge(t).cutvalue<0})}function xse(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var a=e.node(n),o=e.node(i),l=a,u=!1;a.lim>o.lim&&(l=o,u=!0);var h=xs(t.edges(),function(d){return u===pse(e,e.node(d.v),l)&&u!==pse(e,e.node(d.w),l)});return zd(h,function(d){return jd(t,d)})}function bse(e,t,r,n){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(n.v,n.w,{}),hN(e),uN(e,t),Ize(e,t)}function Ize(e,t){var r=Um(e.nodes(),function(i){return!t.node(i).parent}),n=cN(e,r);n=n.slice(1),He(n,function(i){var a=e.node(i).parent,o=t.edge(i,a),l=!1;o||(o=t.edge(a,i),l=!0),t.node(i).rank=t.node(a).rank+(l?o.minlen:-o.minlen)})}function Nze(e,t,r){return e.hasEdge(t,r)}function pse(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var Tse=_(()=>{"use strict";on();fse();xl();tN();pS();sh.initLowLimValues=hN;sh.initCutValues=uN;sh.calcCutValue=mse;sh.leaveEdge=yse;sh.enterEdge=xse;sh.exchangeEdges=bse;s(sh,"networkSimplex");s(uN,"initCutValues");s(Dze,"assignCutValue");s(mse,"calcCutValue");s(hN,"initLowLimValues");s(gse,"dfsAssignLowLim");s(yse,"leaveEdge");s(xse,"enterEdge");s(bse,"exchangeEdges");s(Ize,"updateRanks");s(Nze,"isTreeEdge");s(pse,"isDescendant")});function dN(e){switch(e.graph().ranker){case"network-simplex":Cse(e);break;case"tight-tree":Mze(e);break;case"longest-path":Pze(e);break;default:Cse(e)}}function Mze(e){cx(e),mS(e)}function Cse(e){sh(e)}var Pze,fN=_(()=>{"use strict";tN();Tse();pS();s(dN,"rank");Pze=cx;s(Mze,"tightTreeRanker");s(Cse,"networkSimplexRanker")});function kse(e){var t=yl(e,"root",{},"_root"),r=Oze(e),n=Gs(ma(r))-1,i=2*n+1;e.graph().nestingRoot=t,He(e.edges(),function(o){e.edge(o).minlen*=i});var a=$ze(e)+1;He(e.children(),function(o){Sse(e,t,i,a,n,r,o)}),e.graph().nodeRankFactor=i}function Sse(e,t,r,n,i,a,o){var l=e.children(o);if(!l.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:r});return}var u=X5(e,"_bt"),h=X5(e,"_bb"),d=e.node(o);e.setParent(u,o),d.borderTop=u,e.setParent(h,o),d.borderBottom=h,He(l,function(f){Sse(e,t,r,n,i,a,f);var p=e.node(f),g=p.borderTop?p.borderTop:f,m=p.borderBottom?p.borderBottom:f,y=p.borderTop?n:2*n,x=g!==m?1:i-a[o]+1;e.setEdge(u,g,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(m,h,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:i+a[o]})}function Oze(e){var t={};function r(n,i){var a=e.children(n);a&&a.length&&He(a,function(o){r(o,i+1)}),t[n]=i}return s(r,"dfs"),He(e.children(),function(n){r(n,1)}),t}function $ze(e){return ml(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function vse(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,He(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}var Ese=_(()=>{"use strict";on();xl();s(kse,"run");s(Sse,"dfs");s(Oze,"treeDepths");s($ze,"sumWeights");s(vse,"cleanup")});function wse(e,t,r){var n={},i;He(r,function(a){for(var o=e.parent(a),l,u;o;){if(l=e.parent(o),l?(u=n[l],n[l]=o):(u=i,i=o),u&&u!==o){t.setEdge(u,o);return}o=l}})}var _se=_(()=>{"use strict";on();s(wse,"addSubgraphConstraints")});function Ase(e,t,r){var n=Fze(e),i=new Qr({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return e.node(a)});return He(e.nodes(),function(a){var o=e.node(a),l=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,l||n),He(e[r](a),function(u){var h=u.v===a?u.w:u.v,d=i.edge(h,a),f=jn(d)?0:d.weight;i.setEdge(h,a,{weight:e.edge(u).weight+f})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Fze(e){for(var t;e.hasNode(t=Wd("_root")););return t}var Rse=_(()=>{"use strict";on();ga();s(Ase,"buildLayerGraph");s(Fze,"createRootNode")});function Lse(e,t){for(var r=0,n=1;n<t.length;++n)r+=Gze(e,t[n-1],t[n]);return r}function Gze(e,t,r){for(var n=hS(r,an(r,function(h,d){return d})),i=Fa(an(t,function(h){return gl(an(e.outEdges(h),function(d){return{pos:n[d.w],weight:e.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var o=2*a-1;a-=1;var l=an(new Array(o),function(){return 0}),u=0;return He(i.forEach(function(h){var d=h.pos+a;l[d]+=h.weight;for(var f=0;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=h.weight;u+=h.weight*f})),u}var Dse=_(()=>{"use strict";on();s(Lse,"crossCount");s(Gze,"twoLayerCrossCount")});function Ise(e){var t={},r=xs(e.nodes(),function(l){return!e.children(l).length}),n=Gs(an(r,function(l){return e.node(l).rank})),i=an(Ga(n+1),function(){return[]});function a(l){if(!ax(t,l)){t[l]=!0;var u=e.node(l);i[u.rank].push(l),He(e.successors(l),a)}}s(a,"dfs");var o=gl(r,function(l){return e.node(l).rank});return He(o,a),i}var Nse=_(()=>{"use strict";on();s(Ise,"initOrder")});function Pse(e,t){return an(t,function(r){var n=e.inEdges(r);if(n.length){var i=ml(n,function(a,o){var l=e.edge(o),u=e.node(o.v);return{sum:a.sum+l.weight*u.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}var Mse=_(()=>{"use strict";on();s(Pse,"barycenter")});function Ose(e,t){var r={};He(e,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};jn(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),He(t.edges(),function(i){var a=r[i.v],o=r[i.w];!jn(a)&&!jn(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=xs(r,function(i){return!i.indegree});return zze(n)}function zze(e){var t=[];function r(a){return function(o){o.merged||(jn(o.barycenter)||jn(a.barycenter)||o.barycenter>=a.barycenter)&&Vze(a,o)}}s(r,"handleIn");function n(a){return function(o){o.in.push(a),--o.indegree===0&&e.push(o)}}for(s(n,"handleOut");e.length;){var i=e.pop();t.push(i),He(i.in.reverse(),r(i)),He(i.out,n(i))}return an(xs(t,function(a){return!a.merged}),function(a){return Vd(a,["vs","i","barycenter","weight"])})}function Vze(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var $se=_(()=>{"use strict";on();s(Ose,"resolveConflicts");s(zze,"doResolveConflicts");s(Vze,"mergeEntries")});function Fse(e,t){var r=qie(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=gl(r.rhs,function(d){return-d.i}),a=[],o=0,l=0,u=0;n.sort(Wze(!!t)),u=Bse(a,i,u),He(n,function(d){u+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,u=Bse(a,i,u)});var h={vs:Fa(a)};return l&&(h.barycenter=o/l,h.weight=l),h}function Bse(e,t,r){for(var n;t.length&&(n=rh(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Wze(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}var Gse=_(()=>{"use strict";on();xl();s(Fse,"sort");s(Bse,"consumeUnsortable");s(Wze,"compareWithBias")});function pN(e,t,r,n){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,l=a?a.borderRight:void 0,u={};o&&(i=xs(i,function(m){return m!==o&&m!==l}));var h=Pse(e,i);He(h,function(m){if(e.children(m.v).length){var y=pN(e,m.v,r,n);u[m.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter")&&jze(m,y)}});var d=Ose(h,r);qze(d,u);var f=Fse(d,n);if(o&&(f.vs=Fa([o,f.vs,l]),e.predecessors(o).length)){var p=e.node(e.predecessors(o)[0]),g=e.node(e.predecessors(l)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}return f}function qze(e,t){He(e,function(r){r.vs=Fa(r.vs.map(function(n){return t[n]?t[n].vs:n}))})}function jze(e,t){jn(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var zse=_(()=>{"use strict";on();Mse();$se();Gse();s(pN,"sortSubgraph");s(qze,"expandSubgraphs");s(jze,"mergeBarycenters")});function qse(e){var t=Q5(e),r=Vse(e,Ga(1,t+1),"inEdges"),n=Vse(e,Ga(t-1,-1,-1),"outEdges"),i=Ise(e);Wse(e,i);for(var a=Number.POSITIVE_INFINITY,o,l=0,u=0;u<4;++l,++u){Hze(l%2?r:n,l%4>=2),i=nh(e);var h=Lse(e,i);h<a&&(u=0,o=T5(i),a=h)}Wse(e,o)}function Vse(e,t,r){return an(t,function(n){return Ase(e,n,r)})}function Hze(e,t){var r=new Qr;He(e,function(n){var i=n.graph().root,a=pN(n,i,r,t);He(a.vs,function(o,l){n.node(o).order=l}),wse(n,r,a.vs)})}function Wse(e,t){He(t,function(r){He(r,function(n,i){e.node(n).order=i})})}var jse=_(()=>{"use strict";on();ga();xl();_se();Rse();Dse();Nse();zse();s(qse,"order");s(Vse,"buildLayerGraphs");s(Hze,"sweepLayerGraphs");s(Wse,"assignOrder")});function Hse(e){var t=Yze(e);He(e.graph().dummyChains,function(r){for(var n=e.node(r),i=n.edgeObj,a=Uze(e,t,i.v,i.w),o=a.path,l=a.lca,u=0,h=o[u],d=!0;r!==i.w;){if(n=e.node(r),d){for(;(h=o[u])!==l&&e.node(h).maxRank<n.rank;)u++;h===l&&(d=!1)}if(!d){for(;u<o.length-1&&e.node(h=o[u+1]).minRank<=n.rank;)u++;h=o[u]}e.setParent(r,h),r=e.successors(r)[0]}})}function Uze(e,t,r,n){var i=[],a=[],o=Math.min(t[r].low,t[n].low),l=Math.max(t[r].lim,t[n].lim),u,h;u=r;do u=e.parent(u),i.push(u);while(u&&(t[u].low>o||l>t[u].lim));for(h=u,u=n;(u=e.parent(u))!==h;)a.push(u);return{path:i.concat(a.reverse()),lca:h}}function Yze(e){var t={},r=0;function n(i){var a=r;He(e.children(i),n),t[i]={low:a,lim:r++}}return s(n,"dfs"),He(e.children(),n),t}var Use=_(()=>{"use strict";on();s(Hse,"parentDummyChains");s(Uze,"findPath");s(Yze,"postorder")});function Kze(e,t){var r={};function n(i,a){var o=0,l=0,u=i.length,h=rh(a);return He(a,function(d,f){var p=Qze(e,d),g=p?e.node(p).order:u;(p||d===h)&&(He(a.slice(l,f+1),function(m){He(e.predecessors(m),function(y){var x=e.node(y),T=x.order;(T<o||g<T)&&!(x.dummy&&e.node(m).dummy)&&Yse(r,y,m)})}),l=f+1,o=g)}),a}return s(n,"visitLayer"),ml(t,n),r}function Xze(e,t){var r={};function n(a,o,l,u,h){var d;He(Ga(o,l),function(f){d=a[f],e.node(d).dummy&&He(e.predecessors(d),function(p){var g=e.node(p);g.dummy&&(g.order<u||g.order>h)&&Yse(r,p,d)})})}s(n,"scan");function i(a,o){var l=-1,u,h=0;return He(o,function(d,f){if(e.node(d).dummy==="border"){var p=e.predecessors(d);p.length&&(u=e.node(p[0]).order,n(o,h,f,l,u),h=f,l=u)}n(o,h,o.length,u,a.length)}),o}return s(i,"visitLayer"),ml(t,i),r}function Qze(e,t){if(e.node(t).dummy)return Um(e.predecessors(t),function(r){return e.node(r).dummy})}function Yse(e,t,r){if(t>r){var n=t;t=r,r=n}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Zze(e,t,r){if(t>r){var n=t;t=r,r=n}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],r)}function Jze(e,t,r,n){var i={},a={},o={};return He(t,function(l){He(l,function(u,h){i[u]=u,a[u]=u,o[u]=h})}),He(t,function(l){var u=-1;He(l,function(h){var d=n(h);if(d.length){d=gl(d,function(y){return o[y]});for(var f=(d.length-1)/2,p=Math.floor(f),g=Math.ceil(f);p<=g;++p){var m=d[p];a[h]===h&&u<o[m]&&!Zze(r,h,m)&&(a[m]=h,a[h]=i[h]=i[m],u=o[m])}}})}),{root:i,align:a}}function eVe(e,t,r,n,i){var a={},o=tVe(e,t,r,i),l=i?"borderLeft":"borderRight";function u(f,p){for(var g=o.nodes(),m=g.pop(),y={};m;)y[m]?f(m):(y[m]=!0,g.push(m),g=g.concat(p(m))),m=g.pop()}s(u,"iterate");function h(f){a[f]=o.inEdges(f).reduce(function(p,g){return Math.max(p,a[g.v]+o.edge(g))},0)}s(h,"pass1");function d(f){var p=o.outEdges(f).reduce(function(m,y){return Math.min(m,a[y.w]-o.edge(y))},Number.POSITIVE_INFINITY),g=e.node(f);p!==Number.POSITIVE_INFINITY&&g.borderType!==l&&(a[f]=Math.max(a[f],p))}return s(d,"pass2"),u(h,o.predecessors.bind(o)),u(d,o.successors.bind(o)),He(n,function(f){a[f]=a[r[f]]}),a}function tVe(e,t,r,n){var i=new Qr,a=e.graph(),o=sVe(a.nodesep,a.edgesep,n);return He(t,function(l){var u;He(l,function(h){var d=r[h];if(i.setNode(d),u){var f=r[u],p=i.edge(f,d);i.setEdge(f,d,Math.max(o(e,h,u),p||0))}u=h})}),i}function rVe(e,t){return zd(ma(t),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return $5(r,function(a,o){var l=aVe(e,o)/2;n=Math.max(a+l,n),i=Math.min(a-l,i)}),n-i})}function nVe(e,t){var r=ma(t),n=kc(r),i=Gs(r);He(["u","d"],function(a){He(["l","r"],function(o){var l=a+o,u=e[l],h;if(u!==t){var d=ma(u);h=o==="l"?n-kc(d):i-Gs(d),h&&(e[l]=Gd(u,function(f){return f+h}))}})})}function iVe(e,t){return Gd(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var i=gl(an(e,n));return(i[1]+i[2])/2})}function Kse(e){var t=nh(e),r=Km(Kze(e,t),Xze(e,t)),n={},i;He(["u","d"],function(o){i=o==="u"?t:ma(t).reverse(),He(["l","r"],function(l){l==="r"&&(i=an(i,function(f){return ma(f).reverse()}));var u=(o==="u"?e.predecessors:e.successors).bind(e),h=Jze(e,i,r,u),d=eVe(e,i,h.root,h.align,l==="r");l==="r"&&(d=Gd(d,function(f){return-f})),n[o+l]=d})});var a=rVe(e,n);return nVe(n,a),iVe(n,e.graph().align)}function sVe(e,t,r){return function(n,i,a){var o=n.node(i),l=n.node(a),u=0,h;if(u+=o.width/2,Object.prototype.hasOwnProperty.call(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?t:e)/2,u+=(l.dummy?t:e)/2,u+=l.width/2,Object.prototype.hasOwnProperty.call(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 aVe(e,t){return e.node(t).width}var Xse=_(()=>{"use strict";on();ga();xl();s(Kze,"findType1Conflicts");s(Xze,"findType2Conflicts");s(Qze,"findOtherInnerSegmentNode");s(Yse,"addConflict");s(Zze,"hasConflict");s(Jze,"verticalAlignment");s(eVe,"horizontalCompaction");s(tVe,"buildBlockGraph");s(rVe,"findSmallestWidthAlignment");s(nVe,"alignCoordinates");s(iVe,"balance");s(Kse,"positionX");s(sVe,"sep");s(aVe,"width")});function Qse(e){e=fS(e),oVe(e),B5(Kse(e),function(t,r){e.node(r).x=t})}function oVe(e){var t=nh(e),r=e.graph().ranksep,n=0;He(t,function(i){var a=Gs(an(i,function(o){return e.node(o).height}));He(i,function(o){e.node(o).y=n+a/2}),n+=a+r})}var Zse=_(()=>{"use strict";on();xl();Xse();s(Qse,"position");s(oVe,"positionY")});function hx(e,t){var r=t&&t.debugTiming?jie:Hie;r("layout",()=>{var n=r(" buildLayoutGraph",()=>xVe(e));r(" runLayout",()=>lVe(n,r)),r(" updateInputGraph",()=>cVe(e,n))})}function lVe(e,t){t(" makeSpaceForEdgeLabels",()=>bVe(e)),t(" removeSelfEdges",()=>AVe(e)),t(" acyclic",()=>Bie(e)),t(" nestingGraph.run",()=>kse(e)),t(" rank",()=>dN(fS(e))),t(" injectEdgeLabelProxies",()=>TVe(e)),t(" removeEmptyRanks",()=>Wie(e)),t(" nestingGraph.cleanup",()=>vse(e)),t(" normalizeRanks",()=>Vie(e)),t(" assignRankMinMax",()=>CVe(e)),t(" removeEdgeLabelProxies",()=>kVe(e)),t(" normalize.run",()=>tse(e)),t(" parentDummyChains",()=>Hse(e)),t(" addBorderSegments",()=>Yie(e)),t(" order",()=>qse(e)),t(" insertSelfEdges",()=>RVe(e)),t(" adjustCoordinateSystem",()=>Qie(e)),t(" position",()=>Qse(e)),t(" positionSelfEdges",()=>LVe(e)),t(" removeBorderNodes",()=>_Ve(e)),t(" normalize.undo",()=>rse(e)),t(" fixupEdgeLabelCoords",()=>EVe(e)),t(" undoCoordinateSystem",()=>Zie(e)),t(" translateGraph",()=>SVe(e)),t(" assignNodeIntersects",()=>vVe(e)),t(" reversePoints",()=>wVe(e)),t(" acyclic.undo",()=>Fie(e))}function cVe(e,t){He(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),He(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function xVe(e){var t=new Qr({multigraph:!0,compound:!0}),r=gN(e.graph());return t.setGraph(Km({},hVe,mN(r,uVe),Vd(r,dVe))),He(e.nodes(),function(n){var i=gN(e.node(n));t.setNode(n,D5(mN(i,fVe),pVe)),t.setParent(n,e.parent(n))}),He(e.edges(),function(n){var i=gN(e.edge(n));t.setEdge(n,Km({},gVe,mN(i,mVe),Vd(i,yVe)))}),t}function bVe(e){var t=e.graph();t.ranksep/=2,He(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function TVe(e){He(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};yl(e,"edge-proxy",a,"_ep")}})}function CVe(e){var t=0;He(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Gs(t,n.maxRank))}),e.graph().maxRank=t}function kVe(e){He(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function SVe(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,l=a.marginy||0;function u(h){var d=h.x,f=h.y,p=h.width,g=h.height;t=Math.min(t,d-p/2),r=Math.max(r,d+p/2),n=Math.min(n,f-g/2),i=Math.max(i,f+g/2)}s(u,"getExtremes"),He(e.nodes(),function(h){u(e.node(h))}),He(e.edges(),function(h){var d=e.edge(h);Object.prototype.hasOwnProperty.call(d,"x")&&u(d)}),t-=o,n-=l,He(e.nodes(),function(h){var d=e.node(h);d.x-=t,d.y-=n}),He(e.edges(),function(h){var d=e.edge(h);He(d.points,function(f){f.x-=t,f.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=t),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-t+o,a.height=i-n+l}function vVe(e){He(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),i=e.node(t.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(K5(n,a)),r.points.push(K5(i,o))})}function EVe(e){He(e.edges(),function(t){var r=e.edge(t);if(Object.prototype.hasOwnProperty.call(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 wVe(e){He(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function _Ve(e){He(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(rh(r.borderLeft)),o=e.node(rh(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),He(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function AVe(e){He(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function RVe(e){var t=nh(e);He(t,function(r){var n=0;He(r,function(i,a){var o=e.node(i);o.order=a+n,He(o.selfEdges,function(l){yl(e,"selfedge",{width:l.label.width,height:l.label.height,rank:o.rank,order:a+ ++n,e:l.e,label:l.label},"_se")}),delete o.selfEdges})})}function LVe(e){He(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,l=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-l},{x:i+5*o/6,y:a-l},{x:i+o,y:a},{x:i+5*o/6,y:a+l},{x:i+2*o/3,y:a+l}],r.label.x=r.x,r.label.y=r.y}})}function mN(e,t){return Gd(Vd(e,t),Number)}function gN(e){var t={};return He(e,function(r,n){t[n.toLowerCase()]=r}),t}var uVe,hVe,dVe,fVe,pVe,mVe,gVe,yVe,Jse=_(()=>{"use strict";on();ga();Kie();ese();Y5();eN();fN();Ese();jse();Use();Zse();xl();s(hx,"layout");s(lVe,"runLayout");s(cVe,"updateInputGraph");uVe=["nodesep","edgesep","ranksep","marginx","marginy"],hVe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},dVe=["acyclicer","ranker","rankdir","align"],fVe=["width","height"],pVe={width:0,height:0},mVe=["minlen","weight","width","height","labeloffset"],gVe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yVe=["labelpos"];s(xVe,"buildLayoutGraph");s(bVe,"makeSpaceForEdgeLabels");s(TVe,"injectEdgeLabelProxies");s(CVe,"assignRankMinMax");s(kVe,"removeEdgeLabelProxies");s(SVe,"translateGraph");s(vVe,"assignNodeIntersects");s(EVe,"fixupEdgeLabelCoords");s(wVe,"reversePointsForReversedEdges");s(_Ve,"removeBorderNodes");s(AVe,"removeSelfEdges");s(RVe,"insertSelfEdges");s(LVe,"positionSelfEdges");s(mN,"selectNumberAttrs");s(gN,"canonicalize")});var yN=_(()=>{"use strict";Y5();Jse();eN();fN()});var eae=_(()=>{"use strict"});var rae={};jt(rae,{captureNodeSizes:()=>MVe,shouldCaptureSizes:()=>IVe});function tae(){if(!(typeof globalThis>"u"))return globalThis}function IVe(){return!!tae()?.mermaidCaptureSizes}function NVe(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}function PVe(e,t){let r=tae();if(!r)return;let n=t.node(),a=((n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n)?.id??"(unknown)";r.mermaidCapturedSizes??=[];let o={svgId:a,sizes:e};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}function MVe(e,t){let r=[];for(let n of t.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&PVe({metadata:{captureVersion:1,capturedAt:new Date().toISOString(),capturedFrom:NVe()},nodes:r},e)}var nae=_(()=>{"use strict";eae();s(tae,"getCaptureGlobal");s(IVe,"shouldCaptureSizes");s(NVe,"capturedFromLocation");s(PVe,"emitCapturedSizes");s(MVe,"captureNodeSizes")});function xN(e,{edgePathsClass:t="edges edgePaths"}={}){let r=e.insert("g").attr("class","root"),n=r.insert("g").attr("class","clusters"),i=r.insert("g").attr("class",t),a=r.insert("g").attr("class","edgeLabels"),o=r.insert("g").attr("class","nodes");return{clusters:n,edgePaths:i,edgeLabels:a,nodes:o,rootGroups:r}}async function OVe(e,t){if(t.label){let{shapeSvg:r,bbox:n}=await it(e,t);t.labelBBox={width:n.width,height:n.height},r.remove()}else t.labelBBox={width:0,height:0}}async function bN(e,t,r){let n=await mc(e,t,r),i=n.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,n}async function iae(e,t){let r=new Qr({multigraph:!0,compound:!0}),n=[...t.edges],i=xe(),a=xN(e),{edgeLabels:o,nodes:l}=a,u=new Map,h=e.node()!=null;await Promise.all(t.nodes.map(async d=>{if(d.isGroup)h&&await OVe(l,d),r.setNode(d.id,{...d});else{if(h){let f=await bN(l,d,{config:i,dir:d.dir});u.set(d.id,f)}r.setNode(d.id,{...d})}}));for(let d of n)h&&ck(d)&&await bo(o,d),r.setEdge(d.start,d.end,{...d},d.id),t.edges.some(p=>p.id===d.id)||t.edges.push(d);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:d}=await Promise.resolve().then(()=>(nae(),rae));d(e,t)}return{graph:r,groups:a,nodeElements:u}}var TN=_(()=>{"use strict";ga();Nt();km();Nd();Ct();s(xN,"createLayoutElementGroups");s(OVe,"measureGroupLabel");s(bN,"insertMeasuredNode");s(iae,"createGraphWithElements")});var br,Hd,aae,oae,dx,$Ve,lae,cae,BVe,Ud,sae,uae,hae,dae,yS,fae,FVe,CN=_(()=>{"use strict";ft();ga();br=new Map,Hd=new Map,aae=new Map,oae=s(()=>{Hd.clear(),aae.clear(),br.clear()},"clear"),dx=s((e,t)=>{let r=Hd.get(t)||[];return Y.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),$Ve=s((e,t)=>{let r=Hd.get(t)||[];return Y.info("Descendants of ",t," is ",r),Y.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||dx(e.v,t)||dx(e.w,t)||r.includes(e.w):(Y.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),lae=s((e,t,r,n)=>{Y.debug("Copying children of ",e,"root",n,"data",t.node(e),n);let i=t.children(e)||[];e!==n&&i.push(e),Y.debug("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)lae(a,t,r,n);else{let o=t.node(a);Y.info("cp ",a," to ",n," with parent ",e),r.setNode(a,o),n!==t.parent(a)&&(Y.debug("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==n&&a!==e?(Y.debug("Setting parent",a,e),r.setParent(a,e)):(Y.info("In copy ",e,"root",n,"data",t.node(e),n),Y.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==n,"node!==clusterId",a!==e));let l=t.edges(a);Y.debug("Copying Edges",l),l.forEach(u=>{Y.info("Edge",u);let h=t.edge(u.v,u.w,u.name);Y.info("Edge data",h,n);try{$Ve(u,n)?(Y.info("Copying as ",u.v,u.w,h,u.name),r.setEdge(u.v,u.w,h,u.name),Y.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):Y.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",n," clusterId:",e)}catch(d){Y.error(d)}})}Y.debug("Removing node",a),t.removeNode(a)})},"copy"),cae=s((e,t)=>{let r=t.children(e),n=[...r];for(let i of r)aae.set(i,e),n=[...n,...cae(i,t)];return n},"extractDescendants"),BVe=s((e,t,r)=>{let n=e.edges().filter(u=>u.v===t||u.w===t),i=e.edges().filter(u=>u.v===r||u.w===r),a=n.map(u=>({v:u.v===t?r:u.v,w:u.w===t?t:u.w})),o=i.map(u=>({v:u.v,w:u.w}));return a.filter(u=>o.some(h=>u.v===h.v&&u.w===h.w))},"findCommonEdges"),Ud=s((e,t,r)=>{let n=t.children(e);if(Y.trace("Searching children of id ",e,n),n.length<1)return e;let i;for(let a of n){let o=Ud(a,t,r),l=BVe(t,r,o);if(o)if(l.length>0)i=o;else return o}return i},"findNonClusterChild"),sae=s(e=>!br.has(e)||!br.get(e).externalConnections?e:br.has(e)?br.get(e).id:e,"getAnchorId"),uae=s((e,t)=>{if(!e||t>10){Y.debug("Opting out, no graph ");return}else Y.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(Y.debug("Cluster identified",r," Replacement id in edges: ",Ud(r,e,r)),Hd.set(r,cae(r,e)),br.set(r,{id:Ud(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){let n=e.children(r),i=e.edges();n.length>0?(Y.debug("Cluster identified",r,Hd),i.forEach(a=>{let o=dx(a.v,r),l=dx(a.w,r);o^l&&(Y.debug("Edge: ",a," leaves cluster ",r),Y.debug("Descendants of XXX ",r,": ",Hd.get(r)),br.get(r).externalConnections=!0)})):Y.debug("Not a cluster ",r,Hd)});for(let r of br.keys()){let n=br.get(r).id,i=e.parent(n);i!==r&&br.has(i)&&!br.get(i).externalConnections&&(br.get(r).id=i);let a=e.edges().some(o=>o.v===r);if(n&&br.get(r)?.externalConnections&&a&&fae(e,n,r)){let o=FVe(e,r,e.parent(n));o&&(br.get(r).id=o)}}e.edges().forEach(function(r){let n=e.edge(r);Y.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),Y.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let i=r.v,a=r.w;if(Y.debug("Fix XXX",br,"ids:",r.v,r.w,"Translating: ",br.get(r.v)," --- ",br.get(r.w)),br.get(r.v)||br.get(r.w)){if(Y.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),i=sae(r.v),a=sae(r.w),e.removeEdge(r.v,r.w,r.name),i!==r.v){let o=e.parent(i);br.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){let o=e.parent(a);br.get(o).externalConnections=!0,n.toCluster=r.w}Y.debug("Fix Replacing with XXX",i,a,r.name),e.setEdge(i,a,n,r.name)}}),hae(e,0),Y.trace(br)},"adjustClustersAndEdges"),hae=s((e,t)=>{if(t>10){Y.error("Bailing out");return}let r=e.nodes(),n=!1;for(let i of r){let a=e.children(i);n=n||a.length>0}if(!n){Y.debug("Done, no node has children",e.nodes());return}Y.debug("Nodes = ",r,t);for(let i of r)if(Y.debug("Extracting node",i,br,br.has(i)&&!br.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!br.has(i))Y.debug("Not a cluster",i,t);else if(!br.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){Y.debug("Cluster without external connections, without a parent and with children",i,t);let o=e.graph().rankdir==="TB"?"LR":"TB";br.get(i)?.clusterData?.dir&&(o=br.get(i).clusterData.dir,Y.debug("Fixing dir",br.get(i).clusterData.dir,o));let l=new Qr({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});lae(i,e,l,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:br.get(i).clusterData,label:br.get(i).label,graph:l})}else Y.debug("Cluster ** ",i," **not meeting the criteria !externalConnections:",!br.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),Y.debug(br);r=e.nodes(),Y.debug("New list of nodes",r);for(let i of r){let a=e.node(i);Y.debug(" Now next level",i,a),a?.clusterNode&&hae(a.graph,t+1)}},"extractor"),dae=s((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(n=>{let i=e.children(n),a=dae(e,i);r=[...r,...a]}),r},"sorter"),yS=s(e=>dae(e,e.children()),"sortNodesByHierarchy"),fae=s((e,t,r)=>{let n=e.parent(t);for(;n&&n!==r;){let i=br.get(n);if(i&&!i.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),FVe=s((e,t,r)=>{let n=e.children(t)??[];for(let i of n){if(i===r||dx(i,r))continue;let a=Ud(i,e,t);if(a&&!fae(e,a,t))return a}return null},"findSafeAnchorNode")});function Xm({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:n,afterPaint:i,paintOptions:a}){let o=t??SN;return s(async function(u,h,d,f){let p=h.select("g");(d?.insertMarkers??Sm)(p,u.markers,u.type,u.diagramId),kN();let g={element:p,helpers:d,options:f};g.preparedLayout=await e?.(u,g);let m=await o(u,g),y=await r(u,g),x={...g,measure:m};n?await n(u,x,y):await vN(u,x,a),await i?.(u,x,y)},"render")}function kN(){zZ(),FZ(),LZ(),oae()}async function SN(e,{element:t}){return await iae(t,e)}async function vN(e,t,r={}){let{measure:n}=t,{groups:i}=n;for(let o of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(o,t)||await GVe(i,o,t,r);let a=VVe(e.nodes);for(let o of e.edges)WVe(o,r)||await qVe(i,o,a,e,r,t)}async function GVe(e,t,r,n){t.clusterNode?ll(t):zVe(t,r,n)?await Mu(e.clusters,t):ll(t)}function zVe(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}function VVe(e){let t=new Map;for(let r of e)r?.id&&t.set(r.id,r);return t}function WVe(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}async function qVe(e,t,r,n,i,a){let o=Ou(e.edgePaths,{...t},i.clusterDb??new Map,n.type,pae(t.start,t,r,a,i),pae(t.end,t,r,a,i),n.diagramId,jVe(t,i));ck(t)&&(Id.has(t.id)||await bo(e.edgeLabels,t),HVe(t,o))}function pae(e,t,r,n,i){return i.getEdgeNode?.(e,t,n)??(e?r.get(e)??{}:{})}function jVe(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}function HVe(e,t){let r=t?.updatedPath??t?.originalPath,n=mt(),{subGraphTitleTotalMargin:i}=pc({flowchart:n.flowchart??{}});if(e.label){let a=Id.get(e.id),o=e.x,l=e.y;if(r){let u=Bt.calcLabelPosition(r);Y.debug("Moving label "+e.label+" from (",o,",",l,") to (",u.x,",",u.y,") abc88"),t?.updatedPath&&(o=u.x,l=u.y)}a.attr("transform",`translate(${o}, ${l+i/2})`)}if(e?.startLabelLeft){let a=Vn.get(e.id).startLeft,o=e?.x,l=e?.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.startLabelRight){let a=Vn.get(e.id).startRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelLeft){let a=Vn.get(e.id).endLeft,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelRight){let a=Vn.get(e.id).endRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}}var xS=_(()=>{"use strict";ft();mm();ir();Pt();P1();TN();M1();km();uk();Nd();CN();s(Xm,"createCommonLayoutRenderer");s(kN,"clearLayoutRenderState");s(SN,"defaultMeasureLayout");s(vN,"paintLayoutData");s(GVe,"paintLayoutNode");s(zVe,"shouldPaintAsCluster");s(VVe,"buildNodeLookup");s(WVe,"shouldSkipPaintEdge");s(qVe,"paintLayoutEdge");s(pae,"getRenderedNode");s(jVe,"shouldSkipIntersect");s(HVe,"positionRenderedEdgeLabel")});var Sae={};jt(Sae,{applyDagreLayoutResult:()=>Tae,getEdgesToRender:()=>EN,measureDagreLayout:()=>Cae,prepareLayoutForDagre:()=>wN,render:()=>iWe,runDagreLayoutCore:()=>kae});var mae,gae,UVe,YVe,KVe,XVe,QVe,EN,xae,bae,ZVe,yae,JVe,Tae,eWe,tWe,wN,Cae,kae,rWe,nWe,iWe,vae=_(()=>{"use strict";yN();ga();TN();xS();mm();Ct();CN();Nd();M1();km();ft();P1();Nt();mae=s((e,t,r)=>Math.max(t,Math.min(r,e)),"clamp"),gae=s((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),UVe=s(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),YVe=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],KVe=s((e,t,r,n,i)=>{let a=[],o=new Set;if(r.forEach(({start:d,end:f})=>{d!==n&&o.add(d),f!==n&&o.add(f)}),o.forEach(d=>{let f=e.node(d);typeof f?.x=="number"&&typeof f?.y=="number"&&a.push(f)}),a.length===0&&r.forEach(({edge:d})=>{(d.points??[]).forEach(f=>{typeof f?.x=="number"&&typeof f?.y=="number"&&a.push(f)})}),a.length===0)return gae(i);let l=a.reduce((d,f)=>({x:d.x+f.x/a.length,y:d.y+f.y/a.length}),{x:0,y:0}),u=l.x-t.x,h=l.y-t.y;return Math.abs(u)>Math.abs(h)?u>0?"right":"left":Math.abs(h)>0?h>0?"bottom":"top":gae(i)},"getSelfLoopSide"),XVe=s((e,t="top",r=0,n=0)=>{let i=e.x,a=e.y-r,o=e.width/2,l=e.height/2,u=Math.max(36,Math.min(100,e.width*.8)),h=mae(Math.max(n,e.width*.35),36,u),d=mae(Math.min(e.width,e.height)*.45,24,48);switch(t){case"bottom":{let f=a+l;return[{x:i-h/2,y:f},{x:i-h/2,y:f+d},{x:i+h/2,y:f+d},{x:i+h/2,y:f}]}case"right":{let f=i+o;return[{x:f,y:a-h/2},{x:f+d,y:a-h/2},{x:f+d,y:a+h/2},{x:f,y:a+h/2}]}case"left":{let f=i-o;return[{x:f,y:a-h/2},{x:f-d,y:a-h/2},{x:f-d,y:a+h/2},{x:f,y:a+h/2}]}case"top":default:{let f=a-l;return[{x:i-h/2,y:f},{x:i-h/2,y:f-d},{x:i+h/2,y:f-d},{x:i+h/2,y:f}]}}},"getSelfLoopPoints"),QVe=s((e,t,r="top",n=0,i={})=>{let o=e.x,l=e.y-n,u=i.width??0,h=i.height??0;switch(r){case"bottom":return{x:o,y:Math.max(...t.map(d=>d.y))+h/2+4};case"right":return{x:Math.max(...t.map(d=>d.x))+u/2+4,y:l};case"left":return{x:Math.min(...t.map(d=>d.x))-u/2-4,y:l};case"top":default:return{x:o,y:Math.min(...t.map(d=>d.y))-h/2-4}}},"getSelfLoopLabelPosition"),EN=s((e,t=0,{mergeSelfLoops:r=!0}={})=>{let n=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(o=>{let l=e.edge(o);if(r&&l.selfLoop){let u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,C)=>T.edge.selfLoop.order-C.edge.selfLoop.order);let[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=e.node(d.start);if(!f){o.forEach(T=>i.push(T));return}let p={width:u.edge.width,height:u.edge.height},g=KVe(e,f,o,d.start,a),m=XVe(f,g,t,p.width??0),y=QVe(f,m,g,t,p),x={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete x.selfLoop,delete x.originalEdge,i.push({edge:x,start:x.start,end:x.end})}),i},"getEdgesToRender"),xae=s(async({element:e,graph:t,diagramType:r,id:n,parentCluster:i,siteConfig:a})=>{let o=t.graph().rankdir;Y.trace("Dir in recursive render - dir:",o);let{clusters:l,edgePaths:u,edgeLabels:h,nodes:d,rootGroups:f}=xN(e,{edgePathsClass:"edgePaths"});t.nodes()?Y.info("Recursive render XXX",t.nodes()):Y.info("No nodes found for",t),t.edges().length>0&&Y.info("Recursive edges",t.edge(t.edges()[0]));let p=UVe(r);await Promise.all(t.nodes().map(async function(y){let x=t.node(y);if(i!==void 0){let T=JSON.parse(JSON.stringify(i.clusterData));Y.trace(`Setting data for parent cluster XXX
344
344
  Node.id = `,y,`
345
345
  data=`,T.height,`
346
346
  Parent cluster`,i.height),t.setNode(i.id,T),t.parent(y)||(Y.trace("Setting parent",y,i.id),t.setParent(y,i.id,T))}if(Y.info("(Insert) Node XXX"+y+": "+JSON.stringify(t.node(y))),x?.clusterNode){Y.info("Cluster identified XBX",y,x.width,t.node(y));let{ranksep:T,nodesep:C}=t.graph();x.graph.setGraph({...x.graph.graph(),ranksep:T+25,nodesep:C});let k=await tWe({element:d,graph:x.graph,diagramType:r,id:n,parentCluster:t.node(y),siteConfig:a}),E=k.elem;Ze(x,E),x.diff=k.diff||0,Y.info("New compound node after recursive render XAX",y,"width",x.width,"height",x.height),GZ(E,x)}else t.children(y).length>0?(Y.trace("Cluster - the non recursive path XBX",y,x.id,x,x.width,"Graph:",t),Y.trace(Ud(x.id,t)),br.set(x.id,{id:Ud(x.id,t),node:x})):(Y.trace("Node - the non recursive path XAX",y,d,t.node(y),o),await bN(d,t.node(y),{config:a,dir:o}))})),await s(async()=>{let y=t.edges().map(async function(x){let T=t.edge(x.v,x.w,x.name);if(Y.info("Edge "+x.v+" -> "+x.w+": "+JSON.stringify(x)),Y.info("Edge "+x.v+" -> "+x.w+": ",x," ",JSON.stringify(t.edge(x))),Y.info("Fix",br,"ids:",x.v,x.w,"Translating: ",br.get(x.v),br.get(x.w)),p&&T.selfLoop){if(T.selfLoop.order!==1)return;let C={...T.originalEdge,...T,id:T.selfLoop.id,startLabelLeft:T.originalEdge?.startLabelLeft??T.startLabelLeft,startLabelRight:T.originalEdge?.startLabelRight??T.startLabelRight,endLabelLeft:T.originalEdge?.endLabelLeft??T.endLabelLeft,endLabelRight:T.originalEdge?.endLabelRight??T.endLabelRight};await bo(h,C),T.width=C.width,T.height=C.height,T.labelStyle=C.labelStyle;return}await bo(h,T)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:m}=pc(a);return{elem:f,graph:t,groups:{clusters:l,edgePaths:u,edgeLabels:h,nodes:d,rootGroups:f},diagramType:r,id:n,mergeSelfLoops:p,subGraphTitleTotalMargin:m}},"measureDagreGraph"),bae=s(e=>{Y.info("############################################# XXX"),Y.info("### Layout ### XXX"),Y.info("############################################# XXX"),hx(e)},"runDagreGraphLayout"),ZVe=s((e,t,r)=>{let n=e.node(t);if(!n)return;let i={...n};return n?.clusterNode?i.y=(n.y??0)+r:e.children(t).length>0?i.height=(n.height??0)+r:i.y=(n.y??0)+r/2,i},"normalizeDagreNode"),yae=s((e,t)=>{YVe.forEach(r=>{t[r]!==void 0&&(e[r]=t[r])})},"applyDagreNodeLayout"),JVe=s((e,t,r,n)=>({...e,start:e.start??t,end:e.end??r,points:(e.points??[]).map(i=>({...i,y:typeof i.y=="number"?i.y+n:i.y}))}),"normalizeDagreEdge"),Tae=s((e,t)=>{let{graph:r,mergeSelfLoops:n,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(l=>[l.id,l]));yS(r).forEach(l=>{let u=ZVe(r,l,i);if(!u)return;yae(r.node(l),u);let h=a.get(l);h&&yae(h,u)});let o=i/2;return e.edges=EN(r,o,{mergeSelfLoops:n}).map(({edge:l,start:u,end:h})=>JVe(l,u,h,o)),e},"applyDagreLayoutResult"),eWe=s(async({elem:e,graph:t,groups:{clusters:r,edgePaths:n},diagramType:i,id:a,mergeSelfLoops:o,subGraphTitleTotalMargin:l})=>{let u=0;await Promise.all(yS(t).map(async function(f){let p=t.node(f);if(Y.info("Position XBX => "+f+": ("+p.x,","+p.y,") width: ",p.width," height: ",p.height),p?.clusterNode)p.y+=l,Y.info("A tainted cluster node XBX1",f,p.id,p.width,p.height,p.x,p.y,t.parent(f)),br.get(p.id).node=p,ll(p);else if(t.children(f).length>0){Y.info("A pure cluster node XBX1",f,p.id,p.x,p.y,p.width,p.height,t.parent(f)),p.height+=l,t.node(p.parentId);let g=p?.padding/2||0,m=p?.labelBBox?.height||0,y=m-g||0;Y.debug("OffsetY",y,"labelHeight",m,"halfPadding",g),await Mu(r,p),br.get(p.id).node=p}else{let g=t.node(p.parentId);p.y+=l/2,Y.info("A regular node XBX1 - using the padding",p.id,"parent",p.parentId,p.width,p.height,p.x,p.y,"offsetY",p.offsetY,"parent",g,g?.offsetY,p),ll(p)}}));let h=l/2;return EN(t,h,{mergeSelfLoops:o}).forEach(function({edge:f,start:p,end:g}){Y.info("Edge "+p+" -> "+g+": "+JSON.stringify(f),f),f.points.forEach(T=>T.y+=h);let m=t.node(p),y=t.node(g),x=Ou(n,f,br,i,m,y,a);Cm(f,x)}),t.nodes().forEach(function(f){let p=t.node(f);Y.info(f,p.type,p.diff),p.isGroup&&(u=p.diff)}),Y.warn("Returning from recursive render XAX",e,u),{elem:e,diff:u}},"paintDagreLayoutCore"),tWe=s(async e=>{let t=await xae(e);return bae(t.graph),await eWe(t)},"renderDagreSubgraph"),wN=s(e=>{let t=new Qr({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(r=>{t.setNode(r.id,{...r}),r.parentId&&t.setParent(r.id,r.parentId)}),Y.debug("Edges:",e.edges),e.edges.forEach(r=>{if(r.start===r.end){let n=r.start,i=n+"---"+n+"---1",a=n+"---"+n+"---2",o=t.node(n);t.setNode(i,{domId:i,id:i,parentId:o.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(i,o.parentId),t.setNode(a,{domId:a,id:a,parentId:o.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(a,o.parentId);let l=structuredClone(r),u=structuredClone(r),h=structuredClone(r),d=structuredClone(r);u.originalEdge=l,u.selfLoop={id:l.id,order:0},h.originalEdge=l,h.selfLoop={id:l.id,order:1},d.originalEdge=l,d.selfLoop={id:l.id,order:2},u.label="",u.arrowTypeEnd="none",u.endLabelLeft="",u.endLabelRight="",u.startLabelLeft="",u.id=n+"-cyclic-special-1",h.startLabelRight="",h.startLabelLeft="",h.endLabelLeft="",h.endLabelRight="",h.arrowTypeStart="none",h.arrowTypeEnd="none",h.id=n+"-cyclic-special-mid",d.label="",d.startLabelRight="",d.startLabelLeft="",d.arrowTypeStart="none",o.isGroup&&(u.fromCluster=n,d.toCluster=n),d.id=n+"-cyclic-special-2",d.arrowTypeStart="none",t.setEdge(n,i,u,n+"-cyclic-special-0"),t.setEdge(i,a,h,n+"-cyclic-special-1"),t.setEdge(a,n,d,n+"-cyclic-special-2")}else t.setEdge(r.start,r.end,{...r},r.id)}),uae(t),{graph:t}},"prepareLayoutForDagre"),Cae=s(async(e,{element:t,preparedLayout:r})=>{let n=r??wN(e),i=xe(),a=await xae({element:t,graph:n.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:i});return n.measuredLayout=a,a},"measureDagreLayout"),kae=s((e,t)=>{let r=t.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return bae(r.graph),Tae(e,r),r},"runDagreLayoutCore"),rWe=s((e,{measure:t})=>yS(t.graph).map(r=>t.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),nWe=s((e,t,{measure:r})=>e?r.graph.node(e):void 0,"getDagreEdgeNode"),iWe=Xm({prepareLayout:wN,measureLayout:Cae,runLayoutCore:kae,paintOptions:{clusterDb:br,getNodes:rWe,getEdgeNode:nWe,skipNode:s((e,{measure:t})=>!t.graph.hasNode(e.id),"skipNode"),isCluster:s((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,"isCluster")}})});function _N(e){let t=[];for(let r=0;r<e.length-1;r++)t.push({a:e[r],b:e[r+1]});return t}function sWe(e,t,r,n){let i=t.x-e.x,a=t.y-e.y,o=n.x-r.x,l=n.y-r.y,u=i*l-a*o;if(u===0)return null;let h=r.x-e.x,d=r.y-e.y,f=(h*l-d*o)/u,p=(h*a-d*i)/u;return f<=TS||f>=1-TS||p<=TS||p>=1-TS?null:{point:{x:e.x+f*i,y:e.y+f*a},tA:f,tB:p}}function wae(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}function aWe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=_N(n.points);for(let a=r+1;a<e.length;a++){let o=e[a],l=_N(o.points);for(let[u,h]of i.entries())for(let[d,f]of l.entries()){let p=sWe(h.a,h.b,f.a,f.b);if(!p)continue;let g=wae(h),m=wae(f);(g!==m?g:!1)?t.push({jumpEdgeId:n.id,otherEdgeId:o.id,segIndex:u,t:p.tA,point:p.point}):t.push({jumpEdgeId:o.id,otherEdgeId:n.id,segIndex:d,t:p.tB,point:p.point})}}}return t}function bl(e){let t=Math.round(e*1e3)/1e3;return Number.isInteger(t)?`${t}`:`${t}`}function fx(e){return`${bl(e.x)},${bl(e.y)}`}function oWe(e){let t=e.b.x-e.a.x,r=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(r)?t>=0?1:0:r>=0?1:0}function cWe(e,t){if(e.length<2)return e.map(a=>({...a}));let r=e.map(a=>({...a})),n=t.arrowTypeStart&&ai[t.arrowTypeStart];if(n){let a=e[0],o=e[1],l=Math.atan2(o.y-a.y,o.x-a.x);r[0].x=a.x+n*Math.cos(l),r[0].y=a.y+n*Math.sin(l)}let i=t.arrowTypeEnd&&ai[t.arrowTypeEnd];if(i){let a=e.length,o=e[a-2],l=e[a-1],u=Math.atan2(l.y-o.y,l.x-o.x);r[a-1].x=l.x-i*Math.cos(u),r[a-1].y=l.y-i*Math.sin(u)}return r}function uWe(e,t,r,n,i){let a=e.point.x,o=e.point.y,l={x:a-t*e.r,y:o-r*e.r},u={x:a+t*e.r,y:o+r*e.r},h=[`L${fx(l)}`];return i==="arc"?h.push(`A${bl(e.r)},${bl(e.r)} 0 0 ${n} ${fx(u)}`):h.push(`M${fx(u)}`),h}function _ae(e,t,r,n){let i=t.x-e.x,a=t.y-e.y,o=r.x-t.x,l=r.y-t.y,u=Math.hypot(i,a),h=Math.hypot(o,l);if(u<bS||h<bS)return null;let d=i/u,f=a/u,p=o/h,g=l/h,m=d*p+f*g,y=Math.max(-1,Math.min(1,m)),x=Math.acos(y);if(x<bS||Math.abs(Math.PI-x)<bS)return null;let T=Math.min(n/Math.sin(x/2),u/2,h/2);return{startX:t.x-d*T,startY:t.y-f*T,endX:t.x+p*T,endY:t.y+g*T,ctrlX:t.x,ctrlY:t.y,cutLen:T}}function hWe(e,t,r){let n=e.points;if(n.length<2)return"";let i=cWe(n,e),a=e.curve==="rounded",o=_N(i),l=new Map;for(let h of t){let d=o[h.segIndex];if(!d)continue;let f=Math.hypot(d.b.x-d.a.x,d.b.y-d.a.y),p=l.get(h.segIndex)??[];p.push({t:h.t,point:h.point,d:h.t*f,r:r.jumpRadius}),l.set(h.segIndex,p)}let u=[`M${fx(i[0])}`];for(let h=0;h<o.length;h++){let d=o[h],f=Math.hypot(d.b.x-d.a.x,d.b.y-d.a.y),p=f===0?0:(d.b.x-d.a.x)/f,g=f===0?0:(d.b.y-d.a.y)/f,m=oWe(d),y=0;if(a&&h>0){let k=_ae(i[h-1],i[h],i[h+1]??i[h],Eae);k&&(y=k.cutLen)}let x=f,T=null;a&&h<o.length-1&&(T=_ae(i[h],i[h+1],i[h+2]??i[h+1],Eae),T&&(x=f-T.cutLen));let C=[...l.get(h)??[]].sort((k,E)=>k.t-E.t);for(let k of C)k.r=Math.min(k.r,k.d-y,x-k.d);for(let k=0;k<C.length-1;k++){let E=C[k+1].d-C[k].d;if(C[k].r+C[k+1].r>E){let v=E/2;C[k].r=Math.min(C[k].r,v),C[k+1].r=Math.min(C[k+1].r,v)}}for(let k of C)k.r<lWe||u.push(...uWe(k,p,g,m,r.jumpStyle));a&&T?(u.push(`L${bl(T.startX)},${bl(T.startY)}`),u.push(`Q${bl(T.ctrlX)},${bl(T.ctrlY)} ${bl(T.endX)},${bl(T.endY)}`)):u.push(`L${fx(d.b)}`)}return u.join(" ")}function dWe(e){return/^[\d\s+,.LMelm-]*$/.test(e)}function fWe(e){return e?e==="linear"||e==="rounded"||e==="step"||e==="stepBefore"||e==="stepAfter":!0}function pWe(e){if(!e)return null;try{let t=typeof atob=="function"?atob(e):Buffer.from(e,"base64").toString(),r=JSON.parse(t);if(!Array.isArray(r))return null;let n=[];for(let i of r)i&&typeof i.x=="number"&&typeof i.y=="number"&&n.push({x:i.x,y:i.y});return n.length>=2?n:null}catch{return null}}function Aae(e,t,r){if(!r.enabled)return;let n=e.node();if(!n)return;let i=new Map;for(let h of t)i.set(h.id,h);let a=[],o=new Map;for(let h of t){let d=typeof CSS<"u"&&CSS.escape?CSS.escape(h.id):h.id,f=n.querySelector(`path[data-id="${d}"]`);if(!f)continue;o.set(h.id,f);let g=pWe(f.getAttribute("data-points"))??h.points;a.push({...h,points:g})}let l=aWe(a);if(l.length===0)return;let u=new Map;for(let h of l){let d=u.get(h.jumpEdgeId)??[];d.push(h),u.set(h.jumpEdgeId,d)}for(let h of a){let d=u.get(h.id);if(!d||d.length===0)continue;let p=i.get(h.id)?.curve;if(p!==void 0&&!fWe(p))continue;let g=o.get(h.id);if(!g)continue;if(p===void 0){let k=g.getAttribute("d")??"";if(!dWe(k))continue}let m=g.getAttribute("style")??"",y=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(m),x=y?Number.parseFloat(y[1]):null,T=y?Number.parseFloat(y[2]):null,C=hWe(h,d,r);if(g.setAttribute("d",C),x!==null&&T!==null&&typeof g.getTotalLength=="function"){let k=g.getTotalLength(),E=Math.max(0,k-x-T),v=`0 ${x} ${E} ${T}`,S=m.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${v};`).replace(/;\s*;+/g,";");g.setAttribute("style",S)}}}var Eae,bS,TS,lWe,Rae=_(()=>{"use strict";jI();Eae=5,bS=1e-5,TS=1e-6;s(_N,"buildSegmentList");s(sWe,"segmentIntersection");s(wae,"isHorizontalSeg");s(aWe,"findEdgeIntersections");s(bl,"fmt");s(fx,"pointToString");s(oWe,"getArcSweepFlag");lWe=.001;s(cWe,"applyMarkerOffsets");s(uWe,"emitJump");s(_ae,"computeRoundedCorner");s(hWe,"rewriteEdgePath");s(dWe,"isStraightPath");s(fWe,"curveSupportsLineHops");s(pWe,"decodeDataPoints");s(Aae,"applyLineJumpsToSvg")});function Lae(e,{measure:t}){let r=e.config?.swimlane?.lineHops;if(r===!1)return;let n=r==="gap"?"gap":"arc",i=e.edges.filter(a=>Array.isArray(a.points)&&a.points.length>=2).map(a=>({id:a.id,points:a.points,curve:a.curve,arrowTypeStart:a.arrowTypeStart,arrowTypeEnd:a.arrowTypeEnd}));Aae(t.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:n})}var Dae=_(()=>{"use strict";Rae();s(Lae,"applySwimlaneLineJumps")});function Iae(e){return Math.max(e.padding??20,20)}function mWe(e){let{x:t,y:r,width:n,height:i}=e,a=e.swimlaneContentTop;if(typeof t!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete e.groupTitleRect;return}let o=r-i/2,l=Math.min(a,r+i/2),u=Math.min(21,Math.max(0,l-o)),h=o+u;if(h<=o){delete e.groupTitleRect;return}e.groupTitleRect={left:t-n/2,right:t+n/2,top:o,bottom:h}}function Nae(e){let t=e.direction,r=e.nodes??=[];for(let a of e.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",t&&(a.direction=t));let n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===AN);i?i.isGroup&&(i.shape="swimlane",t&&(i.direction=t)):(i={id:AN,label:"",isGroup:!0,shape:"swimlane",padding:20,...t?{direction:t}:{}},r.push(i));for(let a of n)a.parentId=AN}function Pae(e){let t=new Map;for(let u of e.nodes??[])t.set(u.id,u);let r=[];for(let u of e.edges??[]){let h=typeof u.start=="string"?u.start:void 0,d=typeof u.end=="string"?u.end:void 0;!h||!d||u.labelNodeId||r.push({id:u.id,src:h,dst:d,ref:u})}let n=e.nodes??[],i=n.filter(u=>u.isGroup),a=n.filter(u=>!u.isGroup);return{nodes:[...[...i].reverse(),...a].map(u=>u.id),edges:r,layout:e,nodeById:t}}function Mae(e,t,r,n){let{layout:i}=e,a=e.nodeById,o=n?.layerGap??100,l=n?.nodeGap??40,u=0;for(let p of t.layers){let g=0;for(let m of p){let y=a.get(m);if(!y){g++;continue}y.layer=u,y.order=g;let x=r.x[m]??g*l,T=r.y[m]??u*o;y.x=x,y.y=T,g++}u++}let h=i.nodes??[],d=new Map,f=[];for(let p of h){if(!p?.isGroup)continue;p.parentId||f.push(p);let g=h.filter(C=>C.parentId===p.id),m=1/0,y=-1/0,x=1/0,T=-1/0;for(let C of g){let k=C.x??r.x[C.id],E=C.y??r.y[C.id],v=C.width??0,S=C.height??0;k!=null&&E!=null&&(m=Math.min(m,k-v/2),y=Math.max(y,k+v/2),x=Math.min(x,E-S/2),T=Math.max(T,E+S/2))}if(m===1/0||x===1/0)p.x=p.x??0,p.y=p.y??0,p.width=p.width??0,p.height=p.height??0;else{let C=p.padding??20,k=p.parentId?C:2*Iae(p),E=C,v=Math.max(0,y-m)+k,S=Math.max(0,T-x)+E,w=(m+y)/2,L=(x+T)/2;p.x=w,p.y=L,p.width=v,p.height=S,d.set(p.id,{minX:m,maxX:y,minY:x,maxY:T})}}if(f.length>0&&d.size>0){let p=1/0,g=-1/0,m=0;for(let y of f){let x=y.padding??20;x>m&&(m=x);let T=d.get(y.id);T&&(p=Math.min(p,T.minY),g=Math.max(g,T.maxY))}if(p!==1/0&&g!==-1/0){let y=Math.max(0,g-p),T=Math.max(m,36),C=y+2*T,k=(p+g)/2;for(let O of f)O.y=k,O.height=C,O.swimlaneContentTop=p;let E=[...f].sort((O,F)=>{let N=O.x??0,G=F.x??0;return N-G}),v=[],S=[],w=[];for(let O of E){let F=d.get(O.id);if(!F)continue;let N=Math.max(0,F.maxX-F.minX)+2*Iae(O),G=(F.minX+F.maxX)/2;v.push(O.id),S.push(G),w.push(N)}let L=v.length;if(L>0){let O=new Map;if(L===1)O.set(v[0],w[0]);else{let F=[];for(let I=0;I<L-1;I++)F.push(S[I+1]-S[I]);let N=new Array(L);N[0]=0;for(let I=0;I<L-1;I++)N[I+1]=2*F[I]-N[I];let G=0,A=Number.POSITIVE_INFINITY;for(let I=0;I<L;I++){let P=w[I];I%2===0?G=Math.max(G,P-N[I]):A=Math.min(A,N[I]-P)}let M=G;G<=A?M=(G+A)/2:M=G;for(let I=0;I<L;I++){let P=N[I]+(I%2===0?M:-M),B=Math.max(w[I],P);O.set(v[I],B)}}for(let F of f){let N=O.get(F.id);N!=null&&(F.width=N),mWe(F)}}}}}var AN,RN=_(()=>{"use strict";AN="__swimlane_default__";s(Iae,"topLaneHorizontalPadding");s(mWe,"assignTopLaneTitleRect");s(Nae,"prepareLayoutForSwimlanes");s(Pae,"toGraphView");s(Mae,"writeBackToLayoutData")});function Oae(e){let t=[],r=[],n=new Map;for(let o of e.nodes)n.set(o.id,o);for(let o of e.edges){if(!o.label||o.label.length===0||o.isLayoutOnly||o.labelNodeId)continue;let l=o.start?n.get(o.start):void 0,u=o.end?n.get(o.end):void 0;if(!l||!u){Y.warn(gWe,`Edge ${o.id} has missing source or target node`);continue}let h=`edge-label-${o.start}-${o.end}-${o.id}`,f=l.parentId!==u.parentId?u.parentId:l.parentId,p={id:h,label:o.label,edgeStart:o.start??"",edgeEnd:o.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:f,isGroup:!1,labelStyle:Array.isArray(o.labelStyle)?o.labelStyle[0]:o.labelStyle??"",...l.dir?{dir:l.dir}:{}};t.push(p),o.labelNodeId=h,o.label=void 0,o.text=void 0;let g={id:`${o.id}-to-label`,start:o.start,end:h,type:"normal",isLayoutOnly:!0},m={id:`${o.id}-from-label`,start:h,end:o.end,type:"normal",isLayoutOnly:!0};r.push(g,m)}let i=[...e.nodes,...t],a=[...e.edges,...r];return{...e,nodes:i,edges:a}}var gWe,$ae=_(()=>{"use strict";ft();gWe="[EdgeLabelNodes]";s(Oae,"createEdgeLabelNodes")});function Fae(e){let t=e.x??0,r=e.y??0,n=e.width??0,i=e.height??0;return n>0&&i>0?{cx:t,cy:r,rect:Qm(t,r,n,i)}:void 0}function Gae(e){if(e.isGroup)return;let t=Fae(e);return t?{id:String(e.id??""),cx:t.cx,cy:t.cy,rect:t.rect}:void 0}function zs(e,t,r=.001){return Math.abs(e.x-t.x)<r&&Math.abs(e.y-t.y)<r}function Lr(e,t,r=.001){return Math.abs(e.x-t.x)<r}function Nr(e,t,r=.001){return Math.abs(e.y-t.y)<r}function Mn(e,t,r=.001){return Nr(e,t,r)&&Math.abs(e.x-t.x)>r}function On(e,t,r=.001){return Lr(e,t,r)&&Math.abs(e.y-t.y)>r}function ss(e,t,r,n){return Math.max(0,Math.min(Math.max(e,t),Math.max(r,n))-Math.max(Math.min(e,t),Math.min(r,n)))}function So(e,t,r=.001){return e.horizontal&&t.horizontal&&Nr(e.a,t.a,r)?ss(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&Lr(e.a,t.a,r)?ss(e.a.y,e.b.y,t.a.y,t.b.y):0}function ah(e,t=.001){let r=[];for(let n=0;n<e.length-1;n++){let i=e[n],a=e[n+1],o=Mn(i,a,t),l=On(i,a,t);(o||l)&&r.push({index:n,a:i,b:a,horizontal:o,vertical:l})}return r}function Vs(e,t=.001){let r=ah(e,t),n=0;for(let i=1;i<r.length;i++)r[i-1].horizontal!==r[i].horizontal&&n++;return n}function Dr(e,t=.001){let r=[];for(let n of e){let i=r.length>0?r[r.length-1]:void 0;(!i||!zs(i,n,t))&&r.push({x:n.x,y:n.y})}return r}function CS(e,t=.001){if(!e||e.length!==4)return;let[r,n,i,a]=e;return Mn(r,n,t)&&On(n,i,t)&&Mn(i,a,t)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:On(r,n,t)&&Mn(n,i,t)&&On(i,a,t)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}function px(e,t,r,n=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),l=Math.max(e.y,t.y);return a>r.left-n&&i<r.right+n&&l>r.top-n&&o<r.bottom+n}function kS(e,t,r=0){return e.x>t.left+r&&e.x<t.right-r&&e.y>t.top+r&&e.y<t.bottom-r}function zae(e,t){return e.left<=t.left&&e.right>=t.right&&e.top<=t.top&&e.bottom>=t.bottom}function SS(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function LN(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}function Qm(e,t,r,n){return{left:e-r/2,right:e+r/2,top:t-n/2,bottom:t+n/2}}function Mi(e){return Fae(e)?.rect}function oh(e,t){switch(t){case"top":return{x:e.cx,y:e.rect.top};case"bottom":return{x:e.cx,y:e.rect.bottom};case"left":return{x:e.rect.left,y:e.cy};case"right":return{x:e.rect.right,y:e.cy}}}function vS(e,t,r,n,i,a=.001){let o=t==="left"||t==="right",l=n==="left"||n==="right";if(o&&l){if(t==="right"&&n==="left"&&e.x<r.x||t==="left"&&n==="right"&&e.x>r.x){if(Nr(e,r,a))return[e,r];let f=(e.x+r.x)/2;return[e,{x:f,y:e.y},{x:f,y:r.y},r]}if(t===n){if(Nr(e,r,a))return;let f=t==="left"?Math.min(e.x,r.x)-i:Math.max(e.x,r.x)+i;return[e,{x:f,y:e.y},{x:f,y:r.y},r]}return}if(!o&&!l){if(t===n){if(Lr(e,r,a))return;let p=t==="top"?Math.min(e.y,r.y)-i:Math.max(e.y,r.y)+i;return[e,{x:e.x,y:p},{x:r.x,y:p},r]}if(!(t==="bottom"&&n==="top"&&e.y<r.y||t==="top"&&n==="bottom"&&e.y>r.y))return;if(Lr(e,r,a))return[e,r];let f=(e.y+r.y)/2;return[e,{x:e.x,y:f},{x:r.x,y:f},r]}if(o&&!l){let d=t==="right"&&r.x>e.x||t==="left"&&r.x<e.x,f=n==="top"&&e.y<r.y||n==="bottom"&&e.y>r.y;return d&&f?[e,{x:r.x,y:e.y},r]:void 0}let u=t==="bottom"&&r.y>e.y||t==="top"&&r.y<e.y,h=n==="left"&&e.x<r.x||n==="right"&&e.x>r.x;return u&&h?[e,{x:e.x,y:r.y},r]:void 0}function ES(e,t,r,n){return t==="left"||t==="right"?[e,{x:n,y:e.y},{x:n,y:r.y},r]:[e,{x:e.x,y:n},{x:r.x,y:n},r]}function Zm(e){let t=new Map,r=[];for(let n of e){if(n.isEdgeLabel)continue;let i=Gae(n);i&&(t.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:t,realNodeRects:r}}function Tl(e){let t=[],r=[];for(let n of e){let i=Gae(n);if(!i)continue;let a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):t.push(a)}return{realNodeRects:t,labelNodeRects:r}}function Vae(e,{includeEdgeLabels:t=!0}={}){let r=[];for(let n of e){if(n.isGroup||!t&&n.isEdgeLabel)continue;let i=n.x??0,a=n.y??0,o=n.width??0,l=n.height??0;r.push({nodeId:n.id,...Qm(i,a,o,l)})}return r}function wS(e,t,r=.001){let n=e.start,i=e.end;if(!n||!i)return;let a=t.get(n),o=t.get(i);if(!(!a||!o))return{srcId:n,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)<r,collinearY:Math.abs(a.cy-o.cy)<r}}function xn(e,t,r,n=[],i=0){for(let a of r)if(!n.includes(a.id)&&px(e,t,a.rect,-i))return!0;return!1}function DN(e,t,r,n,i=.001,a=1e-6){let o=Nr(e,t,i),l=Lr(e,t,i),u=Nr(r,n,i),h=Lr(r,n,i);if(o&&u||l&&h||!(o||l)||!(u||h))return!1;let d=o?{a:e,b:t}:{a:r,b:n},f=l?{a:e,b:t}:{a:r,b:n},p=d.a.y,g=Math.min(d.a.x,d.b.x),m=Math.max(d.a.x,d.b.x),y=f.a.x,x=Math.min(f.a.y,f.b.y),T=Math.max(f.a.y,f.b.y);if(y<g||y>m||p<x||p>T)return!1;let C=Math.abs(y-d.a.x)<a&&Math.abs(p-d.a.y)<a||Math.abs(y-d.b.x)<a&&Math.abs(p-d.b.y)<a,k=Math.abs(y-f.a.x)<a&&Math.abs(p-f.a.y)<a||Math.abs(y-f.b.x)<a&&Math.abs(p-f.b.y)<a;return!(C&&k)}function yWe(e,t,r,n,i=.001){let a=Nr(e,t,i),o=Lr(e,t,i),l=Nr(r,n,i),u=Lr(r,n,i);return o&&u&&Lr(e,r,i)?ss(e.y,t.y,r.y,n.y)>i:a&&l&&Nr(e,r,i)?ss(e.x,t.x,r.x,n.x)>i:!1}function mx(e,t,r,n,{epsilon:i=.001,skipDegenerateOther:a=!1}={}){for(let o of r){if(o===n||o.isLayoutOnly)continue;let l=o.points;if(!(!l||l.length<2))for(let u=0;u<l.length-1;u++){let h=l[u],d=l[u+1];if(!(a&&zs(h,d,i))&&(DN(e,t,h,d,i)||yWe(e,t,h,d,i)))return!0}}return!1}function vo(e,t,r,n,i=.001){let a=Nr(e,t,i),o=Lr(e,t,i),l=Nr(r,n,i),u=Lr(r,n,i);if(!(a&&u||o&&l))return!1;let h=a?{a:e,b:t}:{a:r,b:n},d=a?{a:r,b:n}:{a:e,b:t},f=h.a.y,p=Math.min(h.a.x,h.b.x),g=Math.max(h.a.x,h.b.x),m=d.a.x,y=Math.min(d.a.y,d.b.y),x=Math.max(d.a.y,d.b.y);return m>p+i&&m<g-i&&f>y+i&&f<x-i}function Bae(e,t,r){let n=Math.min(t,r),i=Math.max(t,r);return e>n+.001&&e<i-.001}function xWe(e,t,r){return Lr(e,t)&&Lr(t,r)?Bae(t.y,e.y,r.y):Nr(e,t)&&Nr(t,r)?Bae(t.x,e.x,r.x):!1}function bWe(e){let t=!1,r=[];for(let n=0;n<e.length;n++){let i=r[r.length-1],a=e[n],o=n+1<e.length?e[n+1]:void 0;if(i&&o){if(zs(i,o)){n++,t=!0;continue}if(xWe(i,a,o)){t=!0;continue}}r.push(a)}return{points:r,changed:t}}function gx(e){let t=[e[0]];for(let n=1;n<e.length;n++){let i=t[t.length-1],a=e[n];if(!Lr(i,a)&&!Nr(i,a)){let o=t.length>=2?t[t.length-2]:void 0,u=(o?Lr(o,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};t.push(u)}t.push(a)}let r=[];for(let n of t){let i=r[r.length-1];(!i||!zs(i,n))&&r.push(n)}return r}function za(e){if(e.length<3)return e;let t=[...e];for(let r=0;r<32;r++){let n=bWe(t);if(t=n.points,!n.changed)break}return t}var Eo=_(()=>{"use strict";s(Fae,"measuredNodeRect");s(Gae,"nodeBoundsInfoFor");s(zs,"samePoint");s(Lr,"sameX");s(Nr,"sameY");s(Mn,"isHorizontalSegment");s(On,"isVerticalSegment");s(ss,"overlapLength");s(So,"sameAxisSegmentOverlapLength");s(ah,"orthogonalSegmentsForPoints");s(Vs,"countOrthogonalBends");s(Dr,"dedupeConsecutivePoints");s(CS,"classifyThreeSegmentRoute");s(px,"segmentBoundsOverlapRect");s(kS,"pointInsideRect");s(zae,"rectContainsRect");s(SS,"rectsOverlap");s(LN,"inflateRect");s(Qm,"rectFromCenterSize");s(Mi,"rectOfNodeBounds");s(oh,"portForRectSide");s(vS,"buildOrthogonalPortPath");s(ES,"buildSameSideTrackPath");s(Zm,"collectRealNodeBounds");s(Tl,"collectNodeRectEntries");s(Vae,"collectLayoutNodeRects");s(wS,"getNodePairGeometry");s(xn,"segmentHitsAnyRect");s(DN,"orthogonalSegmentsCross");s(yWe,"sameAxisSegmentsOverlap");s(mx,"segmentConflictsWithAnyEdge");s(vo,"orthogonalSegmentsStrictlyCross");s(Bae,"strictlyBetween");s(xWe,"isCollinearIntermediate");s(bWe,"simplifyPolylineOnce");s(gx,"orthogonalizePolyline");s(za,"simplifyPolyline")});function Jae(e,t,r){let n=e;if(n.isLayoutOnly||!n.points||n.points.length<r)return;let i=n.start?t.get(n.start):void 0,a=n.end?t.get(n.end):void 0;return{edge:n,points:n.points,srcRect:i?Mi(i):void 0,dstRect:a?Mi(a):void 0}}function CWe(e,t,r){if(Nr(e,t,sr))return{x:e.x<r.left?r.left:r.right,y:e.y};if(Lr(e,t,sr)){let n=e.y<r.top?r.top:r.bottom;return{x:e.x,y:n}}return{x:Math.min(r.right,Math.max(r.left,e.x)),y:Math.min(r.bottom,Math.max(r.top,e.y))}}function qae(e,t,r){let n=r?1:-1,i=r?0:e.length-1;for(;i>=0&&i<e.length&&kS(e[i],t,TWe);)i+=n;if(i<0||i>=e.length)return e;let a=i-n;if(a<0||a>=e.length)return e;let o=CWe(e[i],e[a],t);return r?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}function eoe(e,t){for(let r of e){let n=Jae(r,t,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=qae(i,n.srcRect,!0)),n.dstRect&&(i=qae(i,n.dstRect,!1)),i=za(gx(i)),i=toe(i,n.srcRect,n.dstRect),n.edge.points=za(gx(i))}}function jae(e,t,r,n=!1){if(Nr(e,t,sr)){if(t.y<r.top-sr||t.y>r.bottom+sr)return t;if(n){if(e.x<r.left-sr)return{x:r.left,y:e.y};if(e.x>r.right+sr)return{x:r.right,y:e.y}}return{x:Math.abs(t.x-r.left)<=Math.abs(t.x-r.right)?r.left:r.right,y:e.y}}if(Lr(e,t,sr)){if(t.x<r.left-sr||t.x>r.right+sr)return t;if(n){if(e.y<r.top-sr)return{x:e.x,y:r.top};if(e.y>r.bottom+sr)return{x:e.x,y:r.bottom}}let i=Math.abs(t.y-r.top)<=Math.abs(t.y-r.bottom);return{x:e.x,y:i?r.top:r.bottom}}return t}function IN(e,t,r){let n=e[t];for(let i=t+r;i>=0&&i<e.length;i+=r){let a=e[i];if(!zs(a,n,sr))return a}return e[t+r]}function NN(e,t){let r=e+Wae,n=t-Wae;return r<=n?{lo:r,hi:n}:{lo:(e+t)/2,hi:(e+t)/2}}function Hae(e,t,r){let{lo:n,hi:i}=NN(t,r);return Math.min(i,Math.max(n,e))}function kWe(e){let t=Math.max(...e.map(n=>n.lo)),r=Math.min(...e.map(n=>n.hi));if(!(t>r))return{lo:t,hi:r}}function Uae(e,t){return t==="left"||t==="right"?NN(e.top,e.bottom):NN(e.left,e.right)}function PN(e,t,r){let n=e.y>=r.top-sr&&e.y<=r.bottom+sr,i=e.x>=r.left-sr&&e.x<=r.right+sr;if(Nr(e,t,sr)&&n){if(Math.abs(e.x-r.left)<sr)return"left";if(Math.abs(e.x-r.right)<sr)return"right"}if(Lr(e,t,sr)&&i){if(Math.abs(e.y-r.top)<sr)return"top";if(Math.abs(e.y-r.bottom)<sr)return"bottom"}}function _S(e){return e==="left"||e==="right"}function SWe(e,t,r,n,i){let a=[],o=r?PN(e,t,r):void 0,l=n?PN(t,e,n):void 0;return r&&o&&_S(o)===i&&a.push(Uae(r,o)),n&&l&&_S(l)===i&&a.push(Uae(n,l)),a.length>0?kWe(a):void 0}function Yae(e,t,r,n,i){let a=SWe(e,t,r,n,i);if(!a)return;let o=i?e.y:e.x,l=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(l-o)<sr))return i?[{x:e.x,y:l},{x:t.x,y:l}]:[{x:l,y:e.y},{x:l,y:t.y}]}function toe(e,t,r){if(e.length!==2)return e;let[n,i]=e;return Nr(n,i,sr)?Yae(n,i,t,r,!0)??e:Lr(n,i,sr)?Yae(n,i,t,r,!1)??e:e}function vWe(e,t,r){return _S(r)?{x:e.x,y:Hae(e.y,t.top,t.bottom)}:{x:Hae(e.x,t.left,t.right),y:e.y}}function EWe(e,t,r,n,i,a){let o=e.map(l=>({...l}));for(let l=t;l>=0&&l<e.length;l+=r){let u=e[l];if(a&&!Nr(u,n,sr)||!a&&!Lr(u,n,sr))break;a?o[l].y=i.y:o[l].x=i.x}return o}function Kae(e,t,r){if(e.length<2)return e;let n=r?0:e.length-1,i=r?1:-1,a=e[n],o=IN(e,n,i);if(!o)return e;let l=PN(a,o,t);if(!l)return e;let u=_S(l),h=vWe(a,t,l);return zs(a,h,sr)?e:EWe(e,n,i,a,h,u)}function Xae(e,t,r){let n=Math.min(e.x,t.x)>=r.left-sr&&Math.max(e.x,t.x)<=r.right+sr,i=Math.min(e.y,t.y)>=r.top-sr&&Math.max(e.y,t.y)<=r.bottom+sr;if(Math.abs(e.y-r.top)<sr&&Math.abs(t.y-r.top)<sr&&n)return"top";if(Math.abs(e.y-r.bottom)<sr&&Math.abs(t.y-r.bottom)<sr&&n)return"bottom";if(Math.abs(e.x-r.left)<sr&&Math.abs(t.x-r.left)<sr&&i)return"left";if(Math.abs(e.x-r.right)<sr&&Math.abs(t.x-r.right)<sr&&i)return"right"}function Qae(e,t,r,n){switch(e){case"top":return Lr(t,r,sr)&&r.y<n.top-sr;case"bottom":return Lr(t,r,sr)&&r.y>n.bottom+sr;case"left":return Nr(t,r,sr)&&r.x<n.left-sr;case"right":return Nr(t,r,sr)&&r.x>n.right+sr}}function Zae(e,t,r){if(e.length<3)return e;if(r){let a=Xae(e[0],e[1],t);return a&&Qae(a,e[1],e[2],t)?e.slice(1):e}let n=e.length-1,i=Xae(e[n-1],e[n],t);return i&&Qae(i,e[n-1],e[n-2],t)?e.slice(0,n):e}function wWe(e,t,r){let n=e;if(t){let a=IN(n,0,1);if(a){let o=jae(a,n[0],t);o!==n[0]&&(n=[o,...n.slice(1)])}n=Zae(n,t,!0)}if(r){let a=n.length-1,o=IN(n,a,-1);if(o){let l=jae(o,n[a],r,!0);l!==n[a]&&(n=[...n.slice(0,a),l])}n=Zae(n,r,!1)}let i=toe(n,t,r);return i!==n||n.length===2?i:(t&&(n=Kae(n,t,!0)),r&&(n=Kae(n,r,!1)),n)}function MN(e,t){for(let r of e){let n=Jae(r,t,2);if(!n)continue;let i=Dr(n.points,sr),a=wWe(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}let o=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=o}}var sr,TWe,Wae,roe=_(()=>{"use strict";Eo();sr=.001,TWe=.5,Wae=4;s(Jae,"endpointContextFor");s(CWe,"segmentEnterPoint");s(qae,"clipEndpoint");s(eoe,"clipEdgeEndpointsToNodeBoundaries");s(jae,"snapEndpointToBoundary");s(IN,"firstDistinctAdjacent");s(NN,"cornerClearanceRange");s(Hae,"clampToCornerClearance");s(kWe,"intersectRanges");s(Uae,"clearanceRangeForSide");s(PN,"terminalSideForSegment");s(_S,"isHorizontalSide");s(SWe,"straightClearanceRange");s(Yae,"clearStraightEndpointCornerAxis");s(toe,"clearStraightEndpointCornerConnections");s(vWe,"cornerClearedEndpoint");s(EWe,"moveCollinearEndpointRun");s(Kae,"clearEndpointCornerConnection");s(Xae,"borderSideForSegment");s(Qae,"leavesOutward");s(Zae,"collapseOwnBorderStub");s(wWe,"snapAndCollapseEndpoints");s(MN,"prepareEdgeEndpointsForRenderer")});function ioe(e){return new Map(e.map(t=>[t.id,t]))}function _We(e,t){let r=e.parentId,n=null;for(;r;){let i=t.get(r);if(!i?.isGroup)break;n=i.id,r=i.parentId}return n}function noe(e,t){let r=0,n=e.parentId;for(;n;){let i=t.get(n);if(!i?.isGroup)break;r++,n=i.parentId}return r}function soe(e){let t=1/0,r=-1/0,n=1/0,i=-1/0;for(let a of e){let o=a.x,l=a.y;if(typeof o!="number"||typeof l!="number")continue;let u=a.width??0,h=a.height??0;t=Math.min(t,o-u/2),r=Math.max(r,o+u/2),n=Math.min(n,l-h/2),i=Math.max(i,l+h/2)}return t===1/0||n===1/0?null:{minX:t,maxX:r,minY:n,maxY:i}}function AWe(e,t){let r=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+r,e.height=Math.max(0,t.maxY-t.minY)+r}function RWe(e){let t=ioe(e),r=e.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>noe(i,t)-noe(n,t));for(let n of r){let i=e.filter(o=>o.parentId===n.id),a=soe(i);a&&AWe(n,a)}}function ON(e,t){let r=e.nodes??[],n=e.edges??[],i=r.filter(u=>!u.isGroup),a=1/0,o=-1/0;for(let u of i){let h=u[t];typeof h=="number"&&(a=Math.min(a,h),o=Math.max(o,h))}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let l=s(u=>a+o-u,"mirror");for(let u of r){let h=u[t];typeof h=="number"&&(u[t]=l(h));let d=u.groupTitleRect;d&&(u.groupTitleRect=t==="x"?{...d,left:l(d.right),right:l(d.left)}:{...d,top:l(d.bottom),bottom:l(d.top)})}for(let u of n)for(let h of u.points??[])h[t]=l(h[t]);return!0}function aoe(e){return(e.nodes??[]).some(r=>!r.isGroup)?ON(e,"y"):!0}function ooe(e,t="LR"){let r=e.nodes??[],n=e.edges??[],i=r.filter(A=>!A.isGroup),a=1/0,o=1/0;for(let A of i){let M=A.x??0,I=A.y??0;M<a&&(a=M),I<o&&(o=I)}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let l=36,u=0,h=0;for(let A of i)u+=A.width??0,h+=A.height??0;let d=u/i.length,f=h/i.length,p=f>0?Math.max(1,d/f):1;for(let A of i){let M=A.x??0,P=((A.y??0)-o)*p+l,B=M-a;A.x=P,A.y=B}for(let A of n)if(A.points)for(let M of A.points){let I=M.x,B=(M.y-o)*p+l,D=I-a;M.x=B,M.y=D}RWe(r);let g=r.filter(A=>A.isGroup&&!A.parentId);if(g.length===0)return t==="RL"&&ON(e,"x"),!0;let m=ioe(r),y=new Map;for(let A of r){if(A.isGroup)continue;let M=_We(A,m);if(!M)continue;let I=y.get(M)??[];I.push(A),y.set(M,I)}let x=0;for(let A of g){let M=A.padding??0;M>x&&(x=M)}let T=[],C=1/0,k=-1/0;for(let A of g){let M=y.get(A.id)??[],I=soe(M);I&&(C=Math.min(C,I.minX),k=Math.max(k,I.maxX),T.push({lane:A,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(C===1/0||k===-1/0)return!0;let E=Math.max(0,k-C),v=Math.max(x,10),S=E+2*v,w=l+S,F=(C+k)/2-S/2-l,N=F+w/2,G=Math.max(x,l);T.sort((A,M)=>A.centerY-M.centerY);for(let A=0;A<T.length;A++){let M=T[A],I,P;if(A===0?I=M.contentTop-G:I=(T[A-1].contentBottom+M.contentTop)/2,A===T.length-1)P=M.contentBottom+G;else{let $=T[A+1];P=(M.contentBottom+$.contentTop)/2}let B=Math.max(0,P-I),D=(I+P)/2;M.lane.x=N,M.lane.y=D,M.lane.width=w,M.lane.height=B,M.lane.swimlaneContentTop=M.contentTop,M.lane.groupTitleRect={left:F,right:F+l,top:I,bottom:P}}return t==="RL"&&ON(e,"x"),!0}var loe=_(()=>{"use strict";s(ioe,"buildNodeMap");s(_We,"resolveTopLevelGroupId");s(noe,"groupDepth");s(soe,"boundsForChildren");s(AWe,"applyGroupBounds");s(RWe,"recomputeNestedGroupBounds");s(ON,"mirrorAxis");s(aoe,"applyBtDirectionTransform");s(ooe,"applyLrDirectionTransform")});function coe(e,t){let{nodeInfoById:r,realNodeRects:n}=Zm(t);for(let i of e){if(i.isLayoutOnly)continue;let a=i.points;if(!a||a.length<4)continue;let o=CS(Dr(a,wo),wo);if(!o)continue;let{p3:l}=o,u=o.kind==="HVH",h=wS(i,r,wo);if(!h)continue;let{srcId:d,dstId:f,srcInfo:p,dstInfo:g,collinearX:m,collinearY:y}=h;if(m||y)continue;let x,T=p.rect;for(let C of DWe){let k,E,v;if(u){let N=g.cy>p.cy?T.bottom:T.top,G=p.cx+C;if(G<=T.left+wo||G>=T.right-wo)continue;k={x:G,y:N},E={x:G,y:l.y},v={x:l.x,y:l.y}}else{let N=g.cx>p.cx?T.right:T.left,G=p.cy+C;if(G<=T.top+wo||G>=T.bottom-wo)continue;k={x:N,y:G},E={x:l.x,y:G},v={x:l.x,y:l.y}}let S=zs(k,E,wo),w=zs(E,v,wo);if(S&&w||!S&&xn(k,E,n,[d],1)||!w&&xn(E,v,n,[f],1))continue;let L=!S&&mx(k,E,e,i,{epsilon:wo,skipDegenerateOther:!0}),O=!w&&mx(E,v,e,i,{epsilon:wo,skipDegenerateOther:!0});if(!(L||O)){S?x=[E,v]:w?x=[k,E]:x=[k,E,v];break}}x&&(i.points=x)}}var wo,LWe,AS,DWe,uoe=_(()=>{"use strict";Eo();wo=1e-6,LWe=8,AS=LWe,DWe=[0,AS,-AS,2*AS,-2*AS];s(coe,"portSwapToLShape")});function hoe(e,t){let{realNodeRects:a,labelNodeRects:o}=Tl(t.values());for(let l of e){if(l.isLayoutOnly)continue;let u=l.points;if(!u||u.length<4)continue;let h=Dr(u,.001);if(h.length<4)continue;let d=h.length-1,f=h[d],p=h[d-1],g=h[d-2],m=f.x-p.x,y=f.y-p.y,x=Math.hypot(m,y);if(x>=10||x<.001)continue;let T=p.x-g.x,C=p.y-g.y;if(Math.hypot(T,C)<.001)continue;let E=Mn(p,f,.001),v=On(p,f,.001),S=Mn(g,p,.001),w=On(g,p,.001);if(!(E&&w||v&&S))continue;let L=l.end,O=l.start,F=L?t.get(L):void 0;if(!F)continue;let N=F.x??0,G=F.y??0,A=Mi(F);if(!A)continue;let M,I;if(w){let z=C<0;M={x:N,y:g.y},I={x:N,y:z?A.bottom:A.top}}else{let z=T>0;M={x:g.x,y:G},I={x:z?A.right:A.left,y:G}}if(xn(M,I,a,L?[L]:[],-2)||xn(M,I,o,[],-2))continue;if(O){let z=t.get(O),j=z?Mi(z):void 0;if(j&&kS(M,j,2))continue}let P=s((z,j)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${j.x.toFixed(3)},${j.y.toFixed(3)}`,"ownSegmentKey"),B=new Set;for(let z=0;z<h.length-1;z++)B.add(P(h[z],h[z+1]));let D=s((z,j)=>{for(let J of e){if(J===l||J.isLayoutOnly)continue;let ee=J.points;if(!(!ee||ee.length<2))for(let le=0;le<ee.length-1;le++){let se=ee[le],Ce=ee[le+1];if(!B.has(P(se,Ce))&&vo(z,j,se,Ce,.001))return!0}}return!1},"segmentCrossesOtherEdge");if(D(M,I))continue;if(d-3>=0){let z=h[d-3],j=[O,L].filter(J=>!!J);if(xn(z,M,a,j,-2)||D(z,M))continue}let W=[...h.slice(0,d-2),M,I];l.points=W;let q=l.labelNodeId;if(q){let z=t.get(q);if(z){let j=z.width??0,J=z.height??0;if(j>0&&J>0){let ee,le,se=-1;for(let Ce=0;Ce<W.length-1;Ce++){let ce=W[Ce],_e=W[Ce+1],me=Math.hypot(_e.x-ce.x,_e.y-ce.y),ge=Nr(ce,_e,.001),Be=Lr(ce,_e,.001);(ge&&me>=j+2||Be&&me>=J+2)&&me>se&&(se=me,ee=(ce.x+_e.x)/2,le=(ce.y+_e.y)/2)}ee!==void 0&&le!==void 0&&(z.x=ee,z.y=le)}}}}}var doe=_(()=>{"use strict";Eo();s(hoe,"collapseShortTerminalStub")});function foe(e,t){let i=s((g,m)=>{let y=g.x??0,x=g.y??0,T=m.x-y,C=m.y-x,k=(g.width??0)/2,E=(g.height??0)/2;return Math.abs(C)*k>Math.abs(T)*E?(C<0&&(E=-E),{x:y+(C===0?0:E*T/C),y:x+E}):(T<0&&(k=-k),{x:y+k,y:x+(T===0?0:k*C/T)})},"rectIntersect"),a=s((g,m)=>{let y=Dr(g.points??[]);if(y.length<2)return;let x=m?g.start:g.end,T=x?t.get(x):void 0,C=T?Mi(T):void 0;if(!T||!x||!C)return;let k=m?y[0]:y[y.length-1],E=m?y[1]:y[y.length-2],v=i(T,k),S=k;if($N(E,v)&&(S=E),Lr(v,S,Mt))return{edge:g,edgeId:String(g.id??""),nodeId:x,atStart:m,orientation:"V",coord:v.x,min:Math.min(v.y,S.y),max:Math.max(v.y,S.y),boundary:v,railEnd:S,rect:C};if(Nr(v,S,Mt))return{edge:g,edgeId:String(g.id??""),nodeId:x,atStart:m,orientation:"H",coord:v.y,min:Math.min(v.x,S.x),max:Math.max(v.x,S.x),boundary:v,railEnd:S,rect:C}},"terminalLaneFor"),o=s((g,m)=>Math.max(0,Math.min(g.max,m.max)-Math.max(g.min,m.min)),"projectedOverlapLength"),l=s((g,m)=>g.nodeId!==m.nodeId||g.orientation!==m.orientation?!1:g.orientation==="H"?(Math.abs(g.boundary.x-g.rect.left)<1||Math.abs(g.boundary.x-g.rect.right)<1)&&Lr(g.boundary,m.boundary,1):(Math.abs(g.boundary.y-g.rect.top)<1||Math.abs(g.boundary.y-g.rect.bottom)<1)&&Nr(g.boundary,m.boundary,1),"sameTerminalFace"),u=s((g,m)=>g.nodeId!==m.nodeId||g.orientation!==m.orientation?!1:o(g,m)>=Oi&&Math.abs(g.coord-m.coord)<.5,"exactTerminalLaneConflict"),h=s((g,m)=>{if(g.nodeId!==m.nodeId||g.orientation!==m.orientation||g.orientation!=="H"||g.atStart===m.atStart)return!1;let y=o(g,m);if(y<Oi)return!1;let x=g.rect.bottom-g.rect.top;return y<x||y>2*x?!1:l(g,m)&&Math.abs(g.coord-m.coord)<16},"nearTerminalLaneConflict"),d=s((g,m)=>{let y=Dr(g.edge.points??[]);if(y.length<2)return;let x=g.orientation==="V"?{x:g.boundary.x+m,y:g.boundary.y}:{x:g.boundary.x,y:g.boundary.y+m},T=g.orientation==="V"?{x:g.railEnd.x+m,y:g.railEnd.y}:{x:g.railEnd.x,y:g.railEnd.y+m};if(!s(()=>Math.abs(g.boundary.y-g.rect.top)<1||Math.abs(g.boundary.y-g.rect.bottom)<1?Nr(x,g.boundary,Mt)&&x.x>=g.rect.left+1&&x.x<=g.rect.right-1:Math.abs(g.boundary.x-g.rect.left)<1||Math.abs(g.boundary.x-g.rect.right)<1?Lr(x,g.boundary,Mt)&&x.y>=g.rect.top+1&&x.y<=g.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(g.atStart){let S=y.length>1&&zs(y[1],g.railEnd,Mt),w=y.slice(S?2:1),L=w[0];return L&&!$N(L,T)?void 0:[x,T,...w]}let k=y.length>1&&zs(y[y.length-2],g.railEnd,Mt),E=y.slice(0,k?-2:-1),v=E[E.length-1];if(!(v&&!$N(v,T)))return[...E,T,x]},"shiftedCandidate"),f=s(g=>{let m=g.edge,y=Dr(m.points??[]);if(y.length!==2)return!1;let x=m.start,T=m.end,C=x?t.get(x):void 0,k=T?t.get(T):void 0;if(!C||!k)return!1;let E=C.x??0,v=C.y??0,S=k.x??0,w=k.y??0,[L,O]=y;return Nr(L,O,Mt)&&Math.abs(v-w)<1&&Math.abs(E-S)>1||Lr(L,O,Mt)&&Math.abs(E-S)<1&&Math.abs(v-w)>1},"laneIsStraightCollinearConnector"),p=[-7,7,-14,14,-21,21];for(let g=0;g<8;g++){let m=e.filter(x=>!x.isLayoutOnly).flatMap(x=>[a(x,!0),a(x,!1)]).filter(x=>!!x),y=!1;for(let x=0;x<m.length&&!y;x++)for(let T=x+1;T<m.length&&!y;T++){let C=m[x],k=m[T];if(C.edge===k.edge||!(u(C,k)||h(C,k)))continue;let E=!u(C,k),v=[C,k].sort((S,w)=>{let L=f(S),O=f(w);return L!==O?Number(L)-Number(O):+!w.atStart-+!S.atStart});for(let S of v){for(let w of p){let L=d(S,w);if(!L)continue;let O=a({...S.edge,points:L},S.atStart);if(!(!O||m.some(F=>F.edge!==S.edge&&(u(O,F)||E&&h(O,F))))){S.edge.points=L,y=!0;break}}if(y)break}}if(!y)return}}function poe(e,t){let{realNodeRects:i,labelNodeRects:a}=Tl(t.values()),o=s((u,h)=>{let d=u.start,f=u.end,p=_r(h);if(p.length!==h.length-1)return!1;let g=[d,f].filter(m=>!!m);for(let m of p)if(xn(m.a,m.b,i,g,-2)||xn(m.a,m.b,a,[],-2))return!1;for(let m of e){if(m===u||m.isLayoutOnly)continue;let y=m.points;if(!(!y||y.length<2)){for(let x of p)for(let T of _r(Dr(y)))if(So(x,T,.5)>=Oi||vo(x.a,x.b,T.a,T.b,Mt))return!1}}return!0},"candidateIsSafe"),l=s((u,h)=>{if(h+4>=u.length)return;let d=u[h],f=u[h+1],p=u[h+2],g=u[h+3],m=u[h+4],y=Mn(d,f)&&On(f,p)&&Mn(p,g)&&On(g,m)&&Lr(d,g,Mt)&&Lr(d,m,Mt)&&Lr(f,p,Mt)&&(f.x-d.x)*(g.x-p.x)<0,x=On(d,f)&&Mn(f,p)&&On(p,g)&&Mn(g,m)&&Nr(d,g,Mt)&&Nr(d,m,Mt)&&Nr(f,p,Mt)&&(f.y-d.y)*(g.y-p.y)<0;if(y||x)return Dr([...u.slice(0,h+1),m,...u.slice(h+5)]);if(h+5>=u.length)return;let T=u[h+5],C=On(d,f)&&Mn(f,p)&&On(p,g)&&Mn(g,m)&&On(m,T)&&Lr(d,m,Mt)&&Lr(d,T,Mt)&&Lr(p,g,Mt)&&(p.x-f.x)*(m.x-g.x)<0,k=Mn(d,f)&&On(f,p)&&Mn(p,g)&&On(g,m)&&Mn(m,T)&&Nr(d,m,Mt)&&Nr(d,T,Mt)&&Nr(p,g,Mt)&&(p.y-f.y)*(m.y-g.y)<0;if(!(!C&&!k))return Dr([...u.slice(0,h+1),T,...u.slice(h+6)])},"withoutDogleg");for(let u=0;u<8;u++){let h=!1;for(let d of e){if(d.isLayoutOnly)continue;let f=Dr(d.points??[]);for(let p=0;p<=f.length-5;p++){let g=l(f,p);if(!(!g||!o(d,g))){d.points=g,h=!0;break}}if(h)break}if(!h)return}}function BN(e,t){let{realNodeRects:a,labelNodeRects:o}=Tl(t.values()),l=e.filter(m=>!m.isLayoutOnly),u=s((m,y,x)=>Dr(m===y?x??[]:m.points??[]),"pointsFor"),h=s((m,y)=>{let x=0;for(let T=0;T<l.length;T++){let C=_r(u(l[T],m,y));for(let k=T+1;k<l.length;k++){let E=_r(u(l[k],m,y));for(let v of C)for(let S of E)vo(v.a,v.b,S.a,S.b,Mt)&&x++}}return x},"strictCrossingCount"),d=s(m=>{let y=_r(m);if(y.length!==3)return;let x=y[1];if(!(y[0].horizontal===x.horizontal||y[2].horizontal===x.horizontal))return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),f=s((m,y)=>{let x=[m.start,m.end].filter(T=>!!T);return a.filter(T=>{if(x.includes(T.id))return!1;let C=T.rect;return y.horizontal?ss(y.a.x,y.b.x,C.left,C.right)>=Oi&&y.a.y>=C.top-2&&y.a.y<=C.bottom+2:ss(y.a.y,y.b.y,C.top,C.bottom)>=Oi&&y.a.x>=C.left-2&&y.a.x<=C.right+2})},"blockingRectsFor"),p=s((m,y,x)=>{let T=m.map(k=>({...k}));if(y.horizontal)T[y.index].y=x,T[y.index+1].y=x;else if(y.vertical)T[y.index].x=x,T[y.index+1].x=x;else return;let C=za(Dr(T));return _r(C).length===C.length-1?C:void 0},"candidateByMovingRail"),g=s((m,y,x)=>{let T=[m.start,m.end].filter(k=>!!k),C=_r(y);if(C.length!==y.length-1)return!1;for(let k of C)if(xn(k.a,k.b,a,T,-2)||xn(k.a,k.b,o,[],-2))return!1;for(let k of l)if(k!==m){for(let E of C)for(let v of _r(u(k)))if(So(E,v,.5)>=Oi)return!1}return h(m,y)<=x},"candidateIsSafe");for(let m=0;m<8;m++){let y=h(),x=!1;for(let T of l){let C=u(T),k=d(C);if(!k)continue;let E=f(T,k.segment);if(E.length===0)continue;let v=k.horizontal?[Math.min(...E.map(S=>S.rect.top))-20,Math.max(...E.map(S=>S.rect.bottom))+20]:[Math.min(...E.map(S=>S.rect.left))-20,Math.max(...E.map(S=>S.rect.right))+20];for(let S of v){let w=p(C,k.segment,S);if(!(!w||!g(T,w,y))){T.points=w,x=!0;break}}if(x)break}if(!x)return}}function FN(e,t){let n=s(u=>{let h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=s(u=>{if(!u.isGroup||u.parentId)return;let h=u.direction,d=typeof h=="string"?h.toUpperCase():"";if(d==="LR"||d==="RL"||d==="BT")return;let f=n(u),p=u.y,g=u.height;if(!f||typeof p!="number"||typeof g!="number"||!Number.isFinite(p)||!Number.isFinite(g)||g<=0)return;let m=f.right-f.left,y=f.bottom-f.top;if(!(y<=0||m<y))return{node:u,rect:f}},"topLaneTitleFor"),a=s((u,h)=>{if(!u.horizontal)return!1;let d=u.a.y;return d<=h.top+Mt||d>=h.bottom-Mt?!1:ss(u.a.x,u.b.x,h.left,h.right)>=Oi},"horizontalSegmentIntersectsTitle"),o=[...t.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(let u of e){if(u.isLayoutOnly)continue;let h=Dr(u.points??[]);for(let d of _r(h))for(let f of o)a(d,f.rect)&&(l=Math.max(l,f.rect.bottom-d.a.y+4))}if(!(l<=Mt))for(let u of o){let h=u.node.y,d=u.node.height;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.y=h-l/2,u.node.height=d+l,u.node.groupTitleRect={...u.rect,top:u.rect.top-l,bottom:u.rect.bottom-l})}}function GN(e,t){let n=s(h=>{let d=h.groupTitleRect;if(!(!d||typeof d.left!="number"||typeof d.right!="number"||typeof d.top!="number"||typeof d.bottom!="number"||!Number.isFinite(d.left)||!Number.isFinite(d.right)||!Number.isFinite(d.top)||!Number.isFinite(d.bottom)||d.right<=d.left||d.bottom<=d.top))return{left:d.left,right:d.right,top:d.top,bottom:d.bottom}},"validTitleRect"),i=s(h=>{if(!h.isGroup||h.parentId||h.direction!=="LR")return;let f=n(h),p=h.x,g=h.width;if(!f||typeof p!="number"||typeof g!="number"||!Number.isFinite(p)||!Number.isFinite(g)||g<=0)return;let m=f.right-f.left,y=f.bottom-f.top;if(!(m<=0||y<m))return{node:h,rect:f}},"leftLaneTitleFor"),a=s((h,d)=>{if(!h.vertical)return!1;let f=h.a.x;return f<=d.left+Mt||f>=d.right-Mt?!1:ss(h.a.y,h.b.y,d.top,d.bottom)>=Oi},"verticalSegmentIntersectsTitle"),o=s((h,d)=>{if(!h.horizontal)return!1;let f=h.a.y;return f<=d.top+Mt||f>=d.bottom-Mt?!1:ss(h.a.x,h.b.x,d.left,d.right)>=Oi},"horizontalSegmentIntersectsTitle"),l=[...t.values()].map(i).filter(h=>!!h);if(l.length===0)return;let u=0;for(let h of e){if(h.isLayoutOnly)continue;let d=Dr(h.points??[]);for(let f of _r(d))for(let p of l)if(a(f,p.rect))u=Math.max(u,p.rect.right-f.a.x+4);else if(o(f,p.rect)){let g=Math.min(f.a.x,f.b.x);u=Math.max(u,p.rect.right-g+4)}}if(!(u<=Mt))for(let h of l){let d=h.node.x,f=h.node.width;typeof d!="number"||typeof f!="number"||!Number.isFinite(d)||!Number.isFinite(f)||f<=0||(h.node.x=d-u/2,h.node.width=f+u,h.node.groupTitleRect={...h.rect,left:h.rect.left-u,right:h.rect.right-u})}}function moe(e,t){let{realNodeRects:i}=Tl(t.values()),a=e.filter(y=>!y.isLayoutOnly),o=s((y,x=new Map)=>Dr(x.get(y)??y.points??[]),"replacementPointsFor"),l=s((y=new Map)=>{let x=0;for(let T=0;T<a.length;T++){let C=_r(o(a[T],y));for(let k=T+1;k<a.length;k++){let E=_r(o(a[k],y));for(let v of C)for(let S of E)vo(v.a,v.b,S.a,S.b,Mt)&&x++}}return x},"crossingCount"),u=s((y=new Map)=>a.reduce((x,T)=>x+Vs(o(T,y)),0),"totalBends"),h=s(y=>{let x=o(y);if(x.length<4)return;let T=x[x.length-2],C=x[x.length-1];if(!(!Mn(T,C,Mt)&&!On(T,C,Mt)))return{tailStart:T,terminal:C}},"terminalTailFor"),d=s((y,x)=>{let T=o(y);if(T.length<3)return;let C=T[0],k=T[1],E;if(Mn(C,k,Mt))E={x:k.x,y:x.tailStart.y};else if(On(C,k,Mt))E={x:x.tailStart.x,y:k.y};else return;let v=za(Dr([C,k,E,x.tailStart,x.terminal]));return _r(v).length===v.length-1?v:void 0},"candidateWithDestinationTail"),f=s((y,x)=>{let T=[y.start,y.end].filter(C=>!!C);for(let C of _r(x))if(xn(C.a,C.b,i,T,-2))return!0;return!1},"pathHasNodeHit"),p=s((y,x,T)=>{for(let C of a)if(C!==y){for(let k of _r(x))for(let E of _r(o(C,T)))if(So(k,E,.5)>=Oi)return!0}return!1},"pathHasSharedTrack"),g=s((y,x,T)=>!f(y,x)&&!p(y,x,T),"candidateIsSafe"),m=s(()=>{let y=new Map;for(let x of a){let T=x.end;if(!T||!t.has(T)||o(x).length<4)continue;let k=y.get(T)??[];k.push(x),y.set(T,k)}return y},"edgesByDestination");for(let y=0;y<4;y++){let x=l();if(x===0)return;let T=u(),C,k=x,E=T;for(let v of m().values())for(let S=0;S<v.length;S++)for(let w=S+1;w<v.length;w++){let L=v[S],O=v[w],F=h(L),N=h(O);if(!F||!N)continue;let G=d(L,N),A=d(O,F);if(!G||!A)continue;let M=new Map([[L,G],[O,A]]);if(!g(L,G,M)||!g(O,A,M))continue;let I=l(M),P=u(M);I>=x||I>k||I===k&&P>=E||(C=M,k=I,E=P)}if(!C)return;for(let[v,S]of C)v.points=S}}function goe(e,t){let{realNodeRects:o,labelNodeRects:l}=Tl(t.values()),u=e.filter(v=>!v.isLayoutOnly),h=s((v,S=new Map)=>Dr(S.get(v)??v.points??[]),"replacementPointsFor"),d=s((v=new Map)=>{let S=0;for(let w=0;w<u.length;w++){let L=_r(h(u[w],v));for(let O=w+1;O<u.length;O++){let F=_r(h(u[O],v));for(let N of L)for(let G of F)vo(N.a,N.b,G.a,G.b,Mt)&&S++}}return S},"strictCrossingCount"),f=s((v=new Map)=>u.reduce((S,w)=>S+Vs(h(w,v)),0),"totalBends"),p=s(v=>{let S=v.start,w=v.end,L=S?t.get(S):void 0,O=w?t.get(w):void 0,F=L?Mi(L):void 0,N=O?Mi(O):void 0;return F&&N?{src:F,dst:N}:void 0},"endpointRectsFor"),g=s((v,S,w)=>{if(w.index<=0||w.index+1>=S.length-1)return;let L=p(v);if(L){if(w.vertical){let O=w.a.x,F=Math.min(L.src.left,L.dst.left),N=Math.max(L.src.right,L.dst.right),G=O<F-Mt?"left":O>N+Mt?"right":void 0;return G?{edge:v,points:S,segmentIndex:w.index,axis:"vertical",side:G,coord:O,min:Math.min(w.a.y,w.b.y),max:Math.max(w.a.y,w.b.y)}:void 0}if(w.horizontal){let O=w.a.y,F=Math.min(L.src.top,L.dst.top),N=Math.max(L.src.bottom,L.dst.bottom),G=O<F-Mt?"top":O>N+Mt?"bottom":void 0;return G?{edge:v,points:S,segmentIndex:w.index,axis:"horizontal",side:G,coord:O,min:Math.min(w.a.x,w.b.x),max:Math.max(w.a.x,w.b.x)}:void 0}}},"externalRailForSegment"),m=s(()=>{let v=[];for(let S of u){let w=h(S);for(let L of _r(w)){let O=g(S,w,L);O&&v.push(O)}}return v},"collectExternalRails"),y=s((v,S)=>v.edge!==S.edge&&v.axis===S.axis&&v.side===S.side&&ss(v.min,v.max,S.min,S.max)>=Oi,"railsInteract"),x=s(v=>{let S=[],w=new Set;for(let L of v){if(w.has(L))continue;let O=[L],F=[];for(w.add(L);O.length>0;){let N=O.pop();F.push(N);for(let G of v)!w.has(G)&&y(N,G)&&(w.add(G),O.push(G))}F.length>1&&S.push(F)}return S},"connectedComponents"),T=s(v=>{let S=[];for(let w of v)S.some(L=>Math.abs(L-w.coord)<Mt)||S.push(w.coord);for(;S.length<v.length;){let w=Math.min(...S),L=Math.max(...S),O=v[0].side;S.push(O==="left"||O==="top"?w-12*(v.length-S.length):L+12*(v.length-S.length))}return S},"uniqueCoordsFor"),C=s(v=>{let S=v.map(O=>O.coord),w=T(v),L=[];if(v.length<=6){let O=new Array(w.length).fill(!1),F=[],N=s(()=>{if(F.length===v.length){F.some((G,A)=>Math.abs(G-S[A])>=Mt)&&L.push([...F]);return}for(let[G,A]of w.entries())O[G]||(O[G]=!0,F.push(A),N(),F.pop(),O[G]=!1)},"visit");return N(),L}for(let O=0;O<S.length;O++)for(let F=O+1;F<S.length;F++){let N=[...S];[N[O],N[F]]=[N[F],N[O]],L.push(N)}return L},"coordinateAssignmentsFor"),k=s((v,S)=>{let w=new Map;for(let[O,F]of v.entries()){let N=S[O],G=w.get(F.edge)??F.points.map(A=>({x:A.x,y:A.y}));F.axis==="vertical"?(G[F.segmentIndex].x=N,G[F.segmentIndex+1].x=N):(G[F.segmentIndex].y=N,G[F.segmentIndex+1].y=N),w.set(F.edge,G)}let L=new Map;for(let[O,F]of w){let N=za(Dr(F));if(_r(N).length!==N.length-1)return;L.set(O,N)}return L},"replacementsForAssignment"),E=s(v=>{for(let[S,w]of v){let L=[S.start,S.end].filter(O=>!!O);for(let O of _r(w))if(xn(O.a,O.b,o,L,-2)||xn(O.a,O.b,l,[],-2))return!1}for(let S=0;S<u.length;S++){let w=u[S],L=v.has(w),O=_r(h(w,v));for(let F=S+1;F<u.length;F++){let N=u[F];if(!L&&!v.has(N))continue;let G=_r(h(N,v));for(let A of O)for(let M of G)if(So(A,M,.5)>=Oi)return!1}}return!0},"candidateIsSafe");for(let v=0;v<4;v++){let S=d();if(S===0)return;let w,L=S,O=f(),F=Number.POSITIVE_INFINITY;for(let N of x(m()))for(let G of C(N)){let A=k(N,G);if(!A||!E(A))continue;let M=d(A);if(M>=S)continue;let I=f(A),P=N.reduce((B,D,$)=>B+Math.abs(G[$]-D.coord),0);M>L||M===L&&(I>O||I===O&&P>=F)||(w=A,L=M,O=I,F=P)}if(!w)return;for(let[N,G]of w)N.points=G}}function yoe(e,t){let{realNodeRects:i,labelNodeRects:a}=Tl(t.values()),o=e.filter(m=>!m.isLayoutOnly),l=s((m,y,x)=>Dr(m===y?x??[]:m.points??[]),"pointsFor"),u=s(m=>_r(m).reduce((y,x)=>{let T=x.a.x-x.b.x,C=x.a.y-x.b.y;return y+Math.hypot(T,C)},0),"pathLength"),h=s((m,y)=>{let x=0;for(let T=0;T<o.length;T++){let C=_r(l(o[T],m,y));for(let k=T+1;k<o.length;k++){let E=_r(l(o[k],m,y));for(let v of C)for(let S of E)vo(v.a,v.b,S.a,S.b,Mt)&&x++}}return x},"strictCrossingCount"),d=s((m,y)=>{if(m.horizontal){let x=m.a.y;return(Math.abs(x-y.top)<1||Math.abs(x-y.bottom)<1)&&ss(m.a.x,m.b.x,y.left,y.right)>=Oi}if(m.vertical){let x=m.a.x;return(Math.abs(x-y.left)<1||Math.abs(x-y.right)<1)&&ss(m.a.y,m.b.y,y.top,y.bottom)>=Oi}return!1},"segmentRunsAlongRectBorder"),f=s(m=>{let y=[m.start,m.end].filter(T=>!!T),x=[];for(let T of y){let C=t.get(T),k=C?Mi(C):void 0;k&&x.push(k)}return x},"endpointRectsFor"),p=s((m,y)=>{if(y+3>=m.length)return[];let x=m[y],T=m[y+1],C=m[y+2],k=m[y+3],E=Mn(x,T,Mt)&&On(T,C,Mt)&&Mn(C,k,Mt),v=On(x,T,Mt)&&Mn(T,C,Mt)&&On(C,k,Mt);if(!E&&!v)return[];if(!(E?Math.sign(T.x-x.x)!==Math.sign(k.x-C.x):Math.sign(T.y-x.y)!==Math.sign(k.y-C.y)))return[];let w=Lr(x,k,Mt)||Nr(x,k,Mt)?[]:[{x:x.x,y:k.y},{x:k.x,y:x.y}],L=w.length===0?[[...m.slice(0,y+1),...m.slice(y+3)]]:w.map(F=>[...m.slice(0,y+1),F,...m.slice(y+3)]),O=new Set;return L.map(F=>za(Dr(F))).filter(F=>{if(_r(F).length!==F.length-1||!F.some(G=>zs(G,k,Mt)))return!1;let N=F.map(G=>`${G.x.toFixed(3)},${G.y.toFixed(3)}`).join("|");return O.has(N)?!1:(O.add(N),!0)})},"shortcutCandidatesAt"),g=s((m,y,x)=>{let T=[m.start,m.end].filter(k=>!!k),C=f(m);for(let k of _r(y))if(xn(k.a,k.b,i,T,-2)||xn(k.a,k.b,a,[],-2)||C.some(E=>d(k,E)))return!1;for(let k of o)if(k!==m){for(let E of _r(y))for(let v of _r(l(k)))if(So(E,v,.5)>=Oi)return!1}return h(m,y)<=x},"candidateIsSafe");for(let m=0;m<8;m++){let y=h(),x,T,C=y,k=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(let v of o){let S=l(v),w=Vs(S,Mt),L=u(S);for(let O=0;O<=S.length-4;O++)for(let F of p(S,O)){let N=Vs(F,Mt),G=u(F);if(!(N<w||N===w&&G<L-Mt)||!g(v,F,y))continue;let M=h(v,F);M>C||M===C&&(N>k||N===k&&G>=E)||(x=v,T=F,C=M,k=N,E=G)}}if(!x||!T)return;x.points=T}}function xoe(e,t){let o=[];for(let Te of t.values()){if(Te.isGroup||Te.isEdgeLabel)continue;let Ne=Te.x??0,Pe=Te.y??0,Re=Mi(Te);Re&&o.push({id:String(Te.id??""),cx:Ne,cy:Pe,rect:Re})}if(o.length===0)return;let l=new Map(o.map(Te=>[Te.id,Te])),u=o.map(Te=>({id:Te.id,rect:Te.rect})),h=["top","bottom","left","right"],d={top:Math.min(...o.map(Te=>Te.rect.top))-20,bottom:Math.max(...o.map(Te=>Te.rect.bottom))+20,left:Math.min(...o.map(Te=>Te.rect.left))-20,right:Math.max(...o.map(Te=>Te.rect.right))+20},f=e.filter(Te=>!Te.isLayoutOnly),p=new Map(f.map((Te,Ne)=>[Te,Ne])),g=s(Te=>{let Ne=Te==="left"||Te==="top"?-1:1,Pe=[];for(let Re=0;Re<=2;Re++)Pe.push(d[Te]+Ne*20*Re);return Pe},"outwardTracksForSide"),m=s((Te,Ne=new Map)=>Dr(Ne.get(Te)??Te.points??[]),"replacementPointsFor"),y=s((Te,Ne)=>{let Pe=0;for(let Re of Te)for(let X of Ne)vo(Re.a,Re.b,X.a,X.b,Mt)&&Pe++;return Pe},"crossingCountBetweenSegments"),x=s((Te,Ne)=>y(_r(Te),_r(Ne)),"crossingCountBetweenPaths"),T=s((Te=new Map)=>{let Ne=0,Pe=[],Re=new Set,X=[],re=s(te=>{Re.has(te)||(Re.add(te),X.push(te))},"addEdge");for(let te=0;te<f.length;te++){let ie=f[te],ue=m(ie,Te);for(let Q=te+1;Q<f.length;Q++){let R=f[Q],V=x(ue,m(R,Te));V>0&&(Ne+=V,Pe.push({first:ie,second:R,count:V}),re(ie),re(R))}}return X.sort((te,ie)=>(p.get(te)??0)-(p.get(ie)??0)),{count:Ne,pairs:Pe,edgeSet:Re,edges:X}},"crossingSnapshot"),C=s((Te,Ne)=>{let Pe=new Set(Ne.keys());if(Pe.size===0)return Te.count;let Re=0;for(let re of Te.pairs)(Pe.has(re.first)||Pe.has(re.second))&&(Re+=re.count);let X=0;for(let re=0;re<f.length;re++){let te=f[re],ie=Pe.has(te),ue=m(te,Ne);for(let Q=re+1;Q<f.length;Q++){let R=f[Q];!ie&&!Pe.has(R)||(X+=x(ue,m(R,Ne)))}}return Te.count-Re+X},"crossingCountWithReplacements"),k=s(Te=>{let Ne=new Map;for(let X of Te.pairs){let re=Ne.get(X.first)??new Set;re.add(X.second),Ne.set(X.first,re);let te=Ne.get(X.second)??new Set;te.add(X.first),Ne.set(X.second,te)}let Pe=[],Re=new Set;for(let X of Te.edges){if(Re.has(X))continue;let re=[X],te=[];for(Re.add(X);re.length>0;){let ie=re.pop();te.push(ie);for(let ue of Ne.get(ie)??[])Re.has(ue)||(Re.add(ue),re.push(ue))}te.sort((ie,ue)=>(p.get(ie)??0)-(p.get(ue)??0)),te.length>1&&Pe.push(te)}return Pe},"crossingComponents"),E=s(Te=>[Te.start,Te.end].filter(Ne=>!!Ne),"endpointIdsFor"),v=s(Te=>{let Ne=[];for(let Pe of k(Te)){let Re=new Set(Pe),X=new Set(Pe.flatMap(te=>E(te))),re=[...Pe];for(let te of f)Re.has(te)||E(te).some(ie=>X.has(ie))&&re.push(te);re.sort((te,ie)=>(p.get(te)??0)-(p.get(ie)??0)),Ne.push(re)}return Ne},"pairSearchGroups"),S=s((Te,Ne,Pe)=>C(Te,new Map([[Ne,Pe]])),"crossingCountWithSingleReplacement"),w=s(Te=>{let Ne=new Map;for(let Pe of Te.pairs)Ne.set(Pe.first,(Ne.get(Pe.first)??0)+Pe.count),Ne.set(Pe.second,(Ne.get(Pe.second)??0)+Pe.count);return Ne},"currentCrossingsByEdge"),L=s(Te=>Te.slice(1).reduce((Ne,Pe,Re)=>{let X=Te[Re];return Ne+Math.abs(Pe.x-X.x)+Math.abs(Pe.y-X.y)},0),"pathLength"),O=s((Te=new Map)=>f.reduce((Ne,Pe)=>Ne+Vs(m(Pe,Te)),0),"totalBends"),F=s((Te=new Map)=>f.reduce((Ne,Pe)=>Ne+L(m(Pe,Te)),0),"totalLength"),N=s((Te,Ne,Pe=new Map)=>{let Re=_r(Ne);for(let X of f)if(X!==Te){for(let re of Re)for(let te of _r(m(X,Pe)))if(So(re,te,.5)>=Oi)return!0}return!1},"pathHasSegmentConflict"),G=s((Te,Ne)=>{let Pe=[Te.start,Te.end].filter(Re=>!!Re);for(let Re of _r(Ne))if(xn(Re.a,Re.b,u,Pe,-2))return!0;return!1},"pathHitsNode"),A=s((Te,Ne)=>{let Pe=za(Dr(Ne));_r(Pe).length===Pe.length-1&&Te.push(Pe)},"pushOrthogonalCandidate"),M=s(Te=>Te==="left"||Te==="right","sideIsHorizontal"),I=s((Te,Ne,Pe)=>{switch(Ne){case"left":return Math.min(Te.x,Pe.x)-20;case"right":return Math.max(Te.x,Pe.x)+20;case"top":return Math.min(Te.y,Pe.y)-20;case"bottom":return Math.max(Te.y,Pe.y)+20}},"localTrackForSameSide"),P=s((Te,Ne,Pe,Re)=>{let X=Pe==="left"||Pe==="top"?-1:1,re=[I(Ne,Pe,Re),d[Pe]];for(let te of re)for(let ie=0;ie<=2;ie++)A(Te,ES(Ne,Pe,Re,te+X*20*ie))},"addSameSideCandidates"),B=s((Te,Ne,Pe,Re,X)=>{for(let re of g(Pe))for(let te of g(X))A(Te,[Ne,{x:re,y:Ne.y},{x:re,y:te},{x:Re.x,y:te},Re])},"addHorizontalToVerticalCandidates"),D=s((Te,Ne,Pe,Re,X)=>{for(let re of g(Pe))for(let te of g(X))A(Te,[Ne,{x:Ne.x,y:re},{x:te,y:re},{x:te,y:Re.y},Re])},"addVerticalToHorizontalCandidates"),$=s((Te,Ne,Pe,Re,X)=>{let re=[...g("top"),...g("bottom")];for(let te of g(Pe))for(let ie of g(X))for(let ue of re)A(Te,[Ne,{x:te,y:Ne.y},{x:te,y:ue},{x:ie,y:ue},{x:ie,y:Re.y},Re])},"addHorizontalPairCandidates"),W=s((Te,Ne,Pe,Re,X)=>{let re=[...g("left"),...g("right")];for(let te of g(Pe))for(let ie of g(X))for(let ue of re)A(Te,[Ne,{x:Ne.x,y:te},{x:ue,y:te},{x:ue,y:ie},{x:Re.x,y:ie},Re])},"addVerticalPairCandidates"),q=s(Te=>{let Ne=new Set;return Te.map(Pe=>Dr(Pe)).filter(Pe=>{let Re=Pe.map(X=>`${X.x.toFixed(3)},${X.y.toFixed(3)}`).join("|");return Ne.has(Re)||Pe.length<2?!1:(Ne.add(Re),!0)})},"dedupeCandidatePaths"),z=s((Te,Ne,Pe,Re)=>{let X=[],re=vS(Te,Ne,Pe,Re,20,Mt);re&&A(X,re),Ne===Re&&P(X,Te,Ne,Pe);let te=M(Ne),ie=M(Re);return te&&!ie?B(X,Te,Ne,Pe,Re):!te&&ie?D(X,Te,Ne,Pe,Re):te?$(X,Te,Ne,Pe,Re):W(X,Te,Ne,Pe,Re),q(X)},"buildCandidatesForSides"),j=s((Te,Ne,Pe,Re)=>{let X=[...g("left"),...g("right")],re=[...g("top"),...g("bottom")];for(let te of h){let ie=oh(Re,te),ue=te==="top"||te==="bottom"?g(te):re;for(let Q of X){A(Te,[Ne,Pe,{x:Q,y:Pe.y},{x:Q,y:ie.y},ie]);for(let R of ue)A(Te,[Ne,Pe,{x:Q,y:Pe.y},{x:Q,y:R},{x:ie.x,y:R},ie])}}},"addVerticalDepartureOuterTrackCandidates"),J=s((Te,Ne,Pe,Re)=>{let X=[...g("left"),...g("right")],re=[...g("top"),...g("bottom")];for(let te of h){let ie=oh(Re,te),ue=te==="left"||te==="right"?g(te):X;for(let Q of re){A(Te,[Ne,Pe,{x:Pe.x,y:Q},{x:ie.x,y:Q},ie]);for(let R of ue)A(Te,[Ne,Pe,{x:Pe.x,y:Q},{x:R,y:Q},{x:R,y:ie.y},ie])}}},"addHorizontalDepartureOuterTrackCandidates"),ee=s(Te=>{let Ne=Te.start,Pe=Te.end,Re=Pe?l.get(Pe):void 0;if(!Ne||!Re)return[];let X=Dr(Te.points??[]);if(X.length<4)return[];let re=X[0],te=X[1],ie=[];return On(re,te,Mt)?j(ie,re,te,Re):Mn(re,te,Mt)&&J(ie,re,te,Re),ie},"terminalPreservingOuterTrackCandidates"),le=s(Te=>{let Ne=Te.start,Pe=Te.end,Re=Ne?l.get(Ne):void 0,X=Pe?l.get(Pe):void 0;if(!Re||!X)return[];let re=[];for(let te of h){let ie=oh(Re,te);for(let ue of h)re.push(...z(ie,te,oh(X,ue),ue))}return re.push(...ee(Te)),re},"candidatePathsFor"),se=s(()=>new Map(f.map(Te=>[Te,_r(m(Te))])),"currentSegmentsByEdge"),Ce=s((Te,Ne,Pe)=>{let Re=new Set;for(let X of f){if(X===Te)continue;let re=Pe.get(X)??_r(m(X));Ne.some(te=>re.some(ie=>So(te,ie,.5)>=Oi))&&Re.add(X)}return Re},"sharedTrackConflictsFor"),ce=s((Te,Ne,Pe,Re)=>{let X=new Set;return le(Te).map(te=>za(Dr(te))).filter(te=>{if(G(Te,te))return!1;let ie=te.map(ue=>`${ue.x.toFixed(3)},${ue.y.toFixed(3)}`).join("|");return X.has(ie)||te.length<2?!1:(X.add(ie),!0)}).map(te=>{let ie=_r(te),ue=0;for(let Q of f)Q!==Te&&(ue+=y(ie,Pe.get(Q)??_r(m(Q))));return{candidate:te,candidateSegments:ie,crossings:Ne.count-(Re.get(Te)??0)+ue,bends:Vs(te,Mt),totalBends:Vs(te),length:L(te)}}).filter(({crossings:te})=>te<=Ne.count).sort((te,ie)=>te.crossings-ie.crossings||te.bends-ie.bends||te.length-ie.length).slice(0,48).map(te=>({path:te.candidate,segments:te.candidateSegments,sharedTrackConflicts:Ce(Te,te.candidateSegments,Pe),totalBends:te.totalBends,length:te.length}))},"pairCandidatesFor"),_e=s((Te,Ne,Pe,Re,X,re)=>{let te=0;for(let ue of Te.pairs)(ue.first===Ne||ue.second===Ne||ue.first===Re||ue.second===Re)&&(te+=ue.count);let ie=y(Pe.segments,X.segments);for(let ue of f){if(ue===Ne||ue===Re)continue;let Q=re.get(ue)??_r(m(ue));ie+=y(Pe.segments,Q)+y(X.segments,Q)}return Te.count-te+ie},"pairCrossingCount"),me=s((Te,Ne)=>{for(let Pe of Te.sharedTrackConflicts)if(Pe!==Ne)return!1;return!0},"conflictsOnlyWith"),ge=s((Te,Ne)=>Te.segments.some(Pe=>Ne.segments.some(Re=>So(Pe,Re,.5)>=Oi)),"candidatesShareTrack"),Be=s((Te,Ne,Pe,Re)=>me(Ne,Pe.edge)&&me(Re,Te.edge)&&!ge(Ne,Re),"pairCandidatesAreCompatible"),$e=s((Te,Ne,Pe,Re,X)=>{let re=_e(Te.current,Ne.edge,Pe,Re.edge,X,Te.baseSegments);if(!(re>=Te.current.count))return{replacements:new Map([[Ne.edge,Pe.path],[Re.edge,X.path]]),crossings:re,bends:Te.currentBends-(Te.baseBendsByEdge.get(Ne.edge)??0)-(Te.baseBendsByEdge.get(Re.edge)??0)+Pe.totalBends+X.totalBends,length:Te.currentLength-(Te.baseLengthByEdge.get(Ne.edge)??0)-(Te.baseLengthByEdge.get(Re.edge)??0)+Pe.length+X.length}},"scorePairReplacement"),Ie=s((Te,Ne)=>Te.crossings<Ne.crossings||Te.crossings===Ne.crossings&&(Te.bends<Ne.bends||Te.bends===Ne.bends&&Te.length<Ne.length),"pairScoreIsBetter"),nt=s((Te,Ne,Pe,Re)=>{let X=Re;for(let re of Ne.candidates)for(let te of Pe.candidates){if(!Be(Ne,re,Pe,te))continue;let ie=$e(Te,Ne,re,Pe,te);ie&&Ie(ie,X)&&(X=ie)}return X},"bestScoreForOptionPair"),lt=s(Te=>{let Ne=O(),Pe=F(),Re=se(),X=w(Te),re=new Map(f.map(V=>[V,Vs(m(V))])),te=new Map(f.map(V=>[V,L(m(V))])),ie=new Map,ue=v(Te);for(let V of ue)for(let ae of V){if(ie.has(ae))continue;let K=ce(ae,Te,Re,X);K.length>0&&ie.set(ae,{edge:ae,candidates:K})}let Q={replacements:new Map,crossings:Te.count,bends:Ne,length:Pe},R={current:Te,currentBends:Ne,currentLength:Pe,baseBendsByEdge:re,baseLengthByEdge:te,baseSegments:Re};for(let V of ue){let ae=new Set(V.filter(ye=>Te.edgeSet.has(ye))),K=V.map(ye=>ie.get(ye)).filter(ye=>!!ye);for(let ye=0;ye<K.length;ye++){let Z=K[ye];for(let H=ye+1;H<K.length;H++){let U=K[H];!ae.has(Z.edge)&&!ae.has(U.edge)||(Q=nt(R,Z,U,Q))}}}return Q.replacements.size>0?Q.replacements:void 0},"bestPairedReplacement");for(let Te=0;Te<4;Te++){let Ne=T(),Pe=Ne.count;if(Pe===0)return;let Re,X,re=Pe,te=Number.POSITIVE_INFINITY;for(let ue of Ne.edges){let Q=Vs(m(ue),Mt);for(let R of le(ue)){let V=G(ue,R),ae=!V&&N(ue,R),K=S(Ne,ue,R),ye=Vs(R,Mt);V||ae||!(K<Pe||K===Pe&&ye<Q)||K>re||K===re&&ye>=te||(Re=ue,X=R,re=K,te=ye)}}if(Re&&X){Re.points=X;continue}let ie=lt(Ne);if(!ie)return;for(let[ue,Q]of ie)ue.points=Q}}var Mt,Oi,_r,$N,boe=_(()=>{"use strict";Eo();Mt=.001,Oi=8,_r=ah,$N=s((e,t)=>Lr(e,t,Mt)||Nr(e,t,Mt),"orthogonallyAligned");s(foe,"separateSharedRenderedTerminalLanes");s(poe,"collapseRedundantRectangularDoglegs");s(BN,"liftObstacleHuggingSameSideRails");s(FN,"liftTopLaneTitleBandsAboveRails");s(GN,"shiftLeftLaneTitleBandsLeftOfRails");s(moe,"swapDestinationTerminalTailsToReduceCrossings");s(goe,"reassignCrossingExternalRailChannels");s(yoe,"shortcutRedundantOrthogonalJogs");s(xoe,"resolveRenderedOrthogonalCrossings")});function Toe(e,t){let{nodeInfoById:r,realNodeRects:n}=Zm(t),i=["top","bottom","left","right"],a=20,o={top:Math.min(...n.map(y=>y.rect.top))-a,bottom:Math.max(...n.map(y=>y.rect.bottom))+a,left:Math.min(...n.map(y=>y.rect.left))-a,right:Math.max(...n.map(y=>y.rect.right))+a},l=s((y,x,T,C)=>{let k=[],E=vS(y,x,T,C,a,lh);return E&&k.push(E),x===C&&k.push(ES(y,x,T,o[x])),k},"buildOrthogonalPathCandidates"),u=s((y,x)=>{for(let T=0;T<y.length-1;T++){let C=y[T],k=y[T+1];if(xn(C,k,n,x,1))return!0}return!1},"pathHitsNode"),h=s((y,x,T=!1)=>{let C=0,k=ah(y,lh),E=x.start,v=x.end;for(let S of e){if(S===x||S.isLayoutOnly)continue;let w=S.start,L=S.end;if(!T&&E&&v&&(w===E||w===v||L===E||L===v))continue;let O=S.points;if(!(!O||O.length<2))for(let F of k)for(let N of ah(O,lh)){if(DN(F.a,F.b,N.a,N.b,lh,lh)){C++;continue}So(F,N,lh)>=IWe&&C++}}return C},"pathConflictCount"),d=4,f=s((y,x)=>{let T=Math.abs(y.y-x.rect.top),C=Math.abs(y.y-x.rect.bottom),k=Math.abs(y.x-x.rect.left),E=Math.abs(y.x-x.rect.right),v="top",S=T;return C<S&&(v="bottom",S=C),k<S&&(v="left",S=k),E<S&&(v="right",S=E),v},"nearestSideOfRect"),p=new Map,g=s((y,x,T)=>{let C=p.get(y)??[];C.push({side:x,edgeId:T}),p.set(y,C)},"addFaceClaim");for(let y of e){if(y.isLayoutOnly)continue;let x=y.points??[];if(x.length<1)continue;let T=y.id??"",C=y.start,k=y.end;if(C){let E=r.get(C);E&&g(C,f(x[0],E),T)}if(k){let E=r.get(k);E&&g(k,f(x[x.length-1],E),T)}}let m=s((y,x,T)=>p.get(y)?.some(C=>C.edgeId!==T&&C.side===x)??!1,"faceIsClaimed");for(let y of e){if(y.isLayoutOnly)continue;let x=y.points;if(!x||x.length<2)continue;let T=Vs(x,lh);if(T<d)continue;let C=y.start,k=y.end;if(!C||!k)continue;let E=r.get(C),v=r.get(k);if(!E||!v)continue;let S=y.id??"",w=h(x,y,!0),L=h(x,y),O,F=w,N=T;for(let G of i){if(m(C,G,S))continue;let A=oh(E,G);for(let M of i){if(m(k,M,S))continue;let I=oh(v,M);for(let P of l(A,G,I,M)){if(u(P,[C,k]))continue;let B=Vs(P,lh);if(w>0){let D=h(P,y,!0);if(D>F||D===F&&B>=N)continue;F=D,N=B,O=P;continue}h(P,y)>L||B<N&&(N=B,O=P)}}}if(O){y.points=O;let G=p.get(C);G&&p.set(C,G.filter(M=>M.edgeId!==S));let A=p.get(k);A&&p.set(k,A.filter(M=>M.edgeId!==S)),g(C,f(O[0],E),S),g(k,f(O[O.length-1],v),S)}}}var lh,IWe,Coe=_(()=>{"use strict";Eo();lh=.001,IWe=8;s(Toe,"simplifyDetouredEdges")});function Soe(e,t){let r=t?0:e.length-1,n=t?1:-1,i=e[r],a=e[r+n];if(!i||!a)return;let o=a.x-i.x,l=a.y-i.y;if(!(Math.abs(o)+Math.abs(l)<Ws)){if(Math.abs(l)<=Ws){let h=i.x+Math.sign(o)*koe;return{left:Math.min(i.x,h),right:Math.max(i.x,h),top:i.y-RS,bottom:i.y+RS}}if(Math.abs(o)<=Ws){let h=i.y+Math.sign(l)*koe;return{left:i.x-RS,right:i.x+RS,top:Math.min(i.y,h),bottom:Math.max(i.y,h)}}return{left:Math.min(i.x,a.x),right:Math.max(i.x,a.x),top:Math.min(i.y,a.y),bottom:Math.max(i.y,a.y)}}}function NWe(e){return{left:Math.min(e.left,e.right),right:Math.max(e.left,e.right),top:Math.min(e.top,e.bottom),bottom:Math.max(e.top,e.bottom)}}function voe(e,t){let r=Dr(t),n=Soe(r,!0),i=Soe(r,!1);return[n,i].some(a=>a&&SS(e,NWe(a)))}function LS(e,t){let r=[];for(let m of e){if(m.isLayoutOnly)continue;let y=m.points;if(!(!y||y.length<2))for(let x=0;x<y.length-1;x++)r.push({edgeId:m.id,p1:y[x],p2:y[x+1]})}let n=[],i=[];for(let m of t.values()){let y=m.isGroup,x=m.parentId;if(y&&!x){let C=Mi(m);C&&i.push({id:m.id,rect:C});continue}if(y||m.isEdgeLabel)continue;let T=Mi(m);T&&n.push({nodeId:m.id,rect:T})}let a=3,o=1,l=12,u=s((m,y)=>{let x=LN(y,a);for(let{nodeId:T,rect:C}of n)if(T!==m&&SS(x,C))return!0;return!1},"labelOverlapsForeignNode"),h=s((m,y)=>{let x=LN(y,a);for(let T of r)if(T.edgeId!==m&&px(T.p1,T.p2,x))return!0;return!1},"labelOverlapsForeignEdge"),d=s((m,y,x)=>u(m,x)||h(y,x),"labelOverlapsAnything"),f=[],p=s(m=>{for(let{id:y,rect:x}of i)if(zae(x,m))return y},"findContainingLane"),g=s((m,y)=>f.some(x=>x.labelId!==m&&SS(y,x.rect)),"overlapsPlacedLabel");for(let m of e){if(m.isLayoutOnly)continue;let y=m.labelNodeId;if(!y)continue;let x=t.get(y);if(!x)continue;let T=m.points;if(!T||T.length<2)continue;let C=x.width??0,k=x.height??0;if(C<=0||k<=0)continue;let E=[];for(let q=0;q<T.length-1;q++){let z=T[q],j=T[q+1],J=Math.abs(z.x-j.x),ee=Math.abs(z.y-j.y);J<Ws&&ee<Ws||J>=Ws&&ee>=Ws||E.push({idx:q,length:J+ee,orientation:J>=Ws?"horizontal":"vertical",midX:(z.x+j.x)/2,midY:(z.y+j.y)/2})}if(E.length===0)continue;let v=E.length>=3?E.filter(q=>q.idx>0&&q.idx<E.length-1):E,S=v.length>0?v:E,w=C>=k?"horizontal":"vertical",L=s(q=>[...q].sort((z,j)=>{let J=z.orientation===w,ee=j.orientation===w;if(J!==ee)return J?-1:1;let le=z.length>=(z.orientation==="horizontal"?C:k)+2,se=j.length>=(j.orientation==="horizontal"?C:k)+2;return le!==se?le?-1:1:j.length-z.length}),"rankSegments"),O=E[0],F=E[E.length-1],N=[.5,.25,.75,.05,.95,.15,.85,.1,.9],G=s((q,z)=>{let j=T[q.idx],J=T[q.idx+1];return{midX:j.x+(J.x-j.x)*z,midY:j.y+(J.y-j.y)*z}},"anchorAtT"),A=s((q,z,j)=>Math.min(j,Math.max(z,q)),"clamp"),M=s((q,z)=>q.midX>=z.left-Ws&&q.midX<=z.right+Ws&&q.midY>=z.top-Ws&&q.midY<=z.bottom+Ws,"pointInsideRectInclusive"),I=s(q=>{let z=Qm(q.midX,q.midY,C,k),j=p(z);if(j)return{laneId:j,anchor:q,rect:z};let J=i.find(({rect:me})=>M(q,me));if(!J)return;let ee=J.rect.left+C/2+o,le=J.rect.right-C/2-o,se=J.rect.top+k/2+o,Ce=J.rect.bottom-k/2-o;if(ee>le||se>Ce)return;let ce={midX:A(q.midX,ee,le),midY:A(q.midY,se,Ce)},_e=Qm(ce.midX,ce.midY,C,k);return M(q,_e)?{laneId:J.id,anchor:ce,rect:_e}:void 0},"placementForAnchor"),P=s((q,z,j)=>q.orientation==="horizontal"?Math.abs(z.midX-j.x):Math.abs(z.midY-j.y),"distanceAlongSegment"),B=s((q,z)=>{let J=(q.orientation==="horizontal"?C/2:k/2)+l;if(q===O){let ee=T[q.idx];if(P(q,z,ee)+Ws<J)return!1}if(q===F){let ee=T[q.idx+1];if(P(q,z,ee)+Ws<J)return!1}return!0},"labelClearsTerminalEndpoints"),D=s(q=>{let z=L(q);for(let j of z)for(let J of N){let ee=G(j,J);if(!B(j,ee))continue;let le=I(ee);if(le&&!voe(le.rect,T)&&!g(y,le.rect)&&!d(y,m.id,le.rect))return{laneId:le.laneId,anchor:le.anchor}}},"tryPool"),$=s((q,z,j=!1)=>{let J=L(q);for(let ee of J){let le={midX:ee.midX,midY:ee.midY};if(z&&!B(ee,le))continue;let se=I(le);if(se&&!voe(se.rect,T)&&!g(y,se.rect)&&!u(y,se.rect)&&(j||!h(m.id,se.rect)))return{laneId:se.laneId,anchor:se.anchor}}},"findLaneContainingFallback"),W=D(S)??(S.length<E.length?D(E):void 0)??$(E,!0)??$(E,!1)??$(E,!1,!0);if(W){x.x=W.anchor.midX,x.y=W.anchor.midY,x.parentId=W.laneId;let q=Qm(W.anchor.midX,W.anchor.midY,C,k),z=f.findIndex(j=>j.labelId===y);z>=0?f[z]={labelId:y,rect:q}:f.push({labelId:y,rect:q})}}}var Ws,koe,RS,Eoe=_(()=>{"use strict";Eo();Ws=.001,koe=10,RS=7;s(Soe,"markerClearanceRectFor");s(NWe,"normalizeRect");s(voe,"labelOverlapsOwnMarker");s(LS,"anchorLabelsToPolyline")});function _oe(e,t){return e<t?`${e}::${t}`:`${t}::${e}`}function Aoe(e,t){let{nodeInfoById:r,realNodeRects:n}=Zm(t),i=new Map;for(let o of t){let l=o.id;if(!o.isGroup&&o.isEdgeLabel){i.set(l,{w:o.width??0,h:o.height??0});continue}}let a=s((o,l,u,h)=>{let d=_oe(l,u),f=0,p=s(g=>{if(!g)return;let m=i.get(g);if(!m)return;let y=h==="x"?m.w/2:m.h/2;y>f&&(f=y)},"consider");p(o.labelNodeId);for(let g of e){if(g===o||g.isLayoutOnly)continue;let m=g.start,y=g.end;!m||!y||_oe(m,y)===d&&p(g.labelNodeId)}return f>0?f+MWe:0},"labelClearanceFor");for(let o of e){if(o.isLayoutOnly)continue;let l=o.points;if(!CS(l,zN))continue;let u=wS(o,r,zN);if(!u)continue;let{srcId:h,dstId:d,srcInfo:f,dstInfo:p,collinearX:g,collinearY:m}=u;if(g===m)continue;let y,x;if(g){let v=p.cy>f.cy;y={x:f.cx,y:v?f.rect.bottom:f.rect.top},x={x:p.cx,y:v?p.rect.top:p.rect.bottom}}else{let v=p.cx>f.cx;y={x:v?f.rect.right:f.rect.left,y:f.cy},x={x:v?p.rect.left:p.rect.right,y:p.cy}}if(xn(y,x,n,[h,d],1))continue;let C=a(o,h,d,g?"x":"y"),k=C>woe?C:woe,E=[0,k,-k];for(let v of E){let S={...y},w={...x};if(g){if(S.x+=v,w.x+=v,S.x<=f.rect.left||S.x>=f.rect.right||w.x<=p.rect.left||w.x>=p.rect.right)continue}else if(S.y+=v,w.y+=v,S.y<=f.rect.top||S.y>=f.rect.bottom||w.y<=p.rect.top||w.y>=p.rect.bottom)continue;if(!xn(S,w,n,[h,d],1)&&!mx(S,w,e,o,{epsilon:zN})){o.points=[S,w];break}}}}var zN,PWe,woe,MWe,Roe=_(()=>{"use strict";Eo();zN=1e-6,PWe=8,woe=PWe/2,MWe=3;s(_oe,"pairKey");s(Aoe,"straightenCollinearSiblingDetours")});function VN(e,t){let{realNodeRects:h,labelNodeRects:d}=Tl(t.values()),f=s((S,w)=>ah(w,.001).map(L=>({...L,edge:S,interior:L.index>=1&&L.index<=w.length-3})),"segmentsFor"),p=s(()=>{let S=[];for(let w of e){if(w.isLayoutOnly)continue;let L=w.points;!L||L.length<2||S.push(...f(w,Dr(L)))}return S},"allSegments"),g=s((S,w)=>S.horizontal&&w.horizontal?ss(S.a.x,S.b.x,w.a.x,w.b.x)>=8&&Math.abs(S.a.y-w.a.y)<7:S.vertical&&w.vertical?ss(S.a.y,S.b.y,w.a.y,w.b.y)>=8&&Math.abs(S.a.x-w.a.x)<7:!1,"hasCrowdedParallelTrack"),m=s((S,w)=>{let L=S.start,O=S.end,F=f(S,w);if(F.length!==w.length-1)return!1;let N=[L,O].filter(A=>!!A),G=S.labelNodeId?[S.labelNodeId]:[];for(let A of F)if(xn(A.a,A.b,h,N,-2)||xn(A.a,A.b,d,G,-2))return!1;for(let A of e){if(A===S||A.isLayoutOnly)continue;let M=A.points;if(!(!M||M.length<2)){for(let I of F)for(let P of f(A,Dr(M)))if(g(I,P)||vo(I.a,I.b,P.a,P.b,.001))return!1}}return!0},"candidateIsSafe"),y=s((S,w)=>{let L=Dr(S.edge.points??[]);if(L.length<4||S.index>=L.length-1)return;let O=L.map(F=>({...F}));if(S.horizontal)O[S.index].y+=w,O[S.index+1].y+=w;else if(S.vertical)O[S.index].x+=w,O[S.index+1].x+=w;else return;return f(S.edge,O).length===O.length-1?O:void 0},"shiftedCandidate"),x=s((S,w)=>({x:S.x??(w.left+w.right)/2,y:S.y??(w.top+w.bottom)/2}),"nodeCenter"),T=s(S=>{let w=S.edge,L=Dr(w.points??[]);if(L.length!==4||S.index!==1)return;let O=w.start?t.get(w.start):void 0,F=w.end?t.get(w.end):void 0,N=O?Mi(O):void 0,G=F?Mi(F):void 0,A=L.slice(S.index+2);if(!(!O||!F||!N||!G||A.length===0))return{sourceCenter:x(O,N),targetCenter:x(F,G),sourceRect:N,tail:A}},"sourceDetourContextFor"),C=s((S,w,L,O,F,N)=>{let G=O.y>=L.y,A=G?F.bottom:F.top,M=A+(G?20:-20);if(G&&S.b.y<=M+.001||!G&&S.b.y>=M-.001)return;let I=S.a.x+w;return Dr([{x:L.x,y:A},{x:L.x,y:M},{x:I,y:M},{x:I,y:S.b.y},...N],.001)},"verticalSourceDetour"),k=s((S,w,L,O,F,N)=>{let G=O.x>=L.x,A=G?F.right:F.left,M=A+(G?20:-20);if(G&&S.b.x<=M+.001||!G&&S.b.x>=M-.001)return;let I=S.a.y+w;return Dr([{x:A,y:L.y},{x:M,y:L.y},{x:M,y:I},{x:S.b.x,y:I},...N],.001)},"horizontalSourceDetour"),E=s((S,w)=>{let L=T(S);if(L){if(S.vertical)return C(S,w,L.sourceCenter,L.targetCenter,L.sourceRect,L.tail);if(S.horizontal)return k(S,w,L.sourceCenter,L.targetCenter,L.sourceRect,L.tail)}},"sourceDetourCandidate"),v=[-7,7,-14,14,-21,21];for(let S=0;S<12;S++){let w=p(),L=!1;for(let O=0;O<w.length&&!L;O++)for(let F=O+1;F<w.length&&!L;F++){let N=w[O],G=w[F];if(N.edge===G.edge||!g(N,G))continue;let A=[N,G].filter(M=>M.interior);for(let M of A){for(let I of v){let P=y(M,I);if(P&&m(M.edge,P)){M.edge.points=P,L=!0;break}let B=E(M,I);if(B&&m(M.edge,B)){M.edge.points=B,L=!0;break}}if(L)break}}if(!L)return}}var Loe=_(()=>{"use strict";Eo();s(VN,"nudgeSharedInteriorSubpaths")});function OWe(e,t,r,n){let i=t.x-e.x,a=t.y-e.y,o=n.x-r.x,l=n.y-r.y,u=i*l-a*o;if(Math.abs(u)<1e-10)return!1;let h=r.x-e.x,d=r.y-e.y,f=(h*l-d*o)/u,p=(h*a-d*i)/u,g=.01;return f>g&&f<1-g&&p>g&&p<1-g}function WN(e){let t=e.nodes??[],r=e.edges??[],n=[];if(!r.length||!t.length)return n;let i=Vae(t),a=1,o=[];for(let u of r){if(u.isLayoutOnly)continue;let h=u.points;if(!h||h.length<2)continue;let d=u.start,f=u.end,p=u.labelNodeId,g=u.id??`${d}->${f}`;for(let m of i)if(!(m.nodeId===d||m.nodeId===f)&&!(p&&m.nodeId===p)){for(let y=0;y<h.length-1;y++)if(px(h[y],h[y+1],m,-a)){n.push({type:"edge-node-overlap",edgeId:g,targetId:m.nodeId,detail:`segment ${y} passes through node "${m.nodeId}"`});break}}for(let m=0;m<h.length-1;m++)o.push({edgeId:g,start:d,end:f,p1:h[m],p2:h[m+1]})}let l=new Set;for(let u=0;u<o.length;u++)for(let h=u+1;h<o.length;h++){let d=o[u],f=o[h];if(d.edgeId!==f.edgeId&&!(d.start===f.start||d.start===f.end||d.end===f.start||d.end===f.end)&&OWe(d.p1,d.p2,f.p1,f.p2)){let p=d.edgeId<f.edgeId?`${d.edgeId}|${f.edgeId}`:`${f.edgeId}|${d.edgeId}`;l.has(p)||(l.add(p),n.push({type:"edge-edge-crossing",edgeId:d.edgeId,targetId:f.edgeId,detail:`edges "${d.edgeId}" and "${f.edgeId}" cross`}))}}if(n.length>0){let u=n.filter(d=>d.type==="edge-node-overlap").length,h=n.filter(d=>d.type==="edge-edge-crossing").length;Y.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${u} edge-node overlap(s), ${h} edge crossing(s)`);for(let d of n)Y.warn(`[SWIMLANE_VALIDATE] ${d.type}: ${d.detail}`)}return n}var Doe=_(()=>{"use strict";ft();Eo();s(OWe,"segmentsIntersect");s(WN,"validateSwimlanesLayout")});function Ioe(e,t){let r=e.nodes??[],n=e.edges??[],i=r.filter(l=>!l.isGroup);if((t==="LR"||t==="RL")&&i.length>0&&!ooe(e,t)||t==="BT"&&i.length>0&&!aoe(e))return;for(let l of n){if(l.isLayoutOnly)continue;let u=l.points;!u||u.length<2||(l.points=za(gx(u)))}Toe(n,r),Aoe(n,r),coe(n,r);let a=new Map;for(let l of r)a.set(String(l.id),l);LS(n,a),eoe(n,a),hoe(n,a),VN(n,a),foe(n,a),poe(n,a),BN(n,a),moe(n,a);let o=s(()=>{xoe(n,a),goe(n,a),yoe(n,a),LS(n,a),MN(n,a),BN(n,a),LS(n,a),MN(n,a)},"finalizeRenderedEdges");o(),VN(n,a),o(),FN(n,a),GN(n,a),FN(n,a),GN(n,a)}var Noe=_(()=>{"use strict";roe();Eo();loe();uoe();doe();boe();Coe();Eoe();Roe();Loe();Doe();s(Ioe,"postProcessSwimlaneLayout")});function qs(e){let t=new Map(e.nodeById),r=new Set,n=[];for(let a of e.edges){if(!t.has(a.src)||!t.has(a.dst))continue;let o=`${a.id}:${a.src}->${a.dst}`;r.has(o)||(r.add(o),n.push(a))}return{nodes:[...t.keys()],edges:n,layout:e.layout,nodeById:t}}function DS(e,t){return e.edges.filter(r=>r.dst===t)}function $We(e){let t=new Map;for(let r of e.nodes)t.set(r,[]);for(let r of e.edges)t.get(r.src).push(r.dst);return t}function qN(e){let t=$We(e);for(let r of t.values())r.sort((n,i)=>n.localeCompare(i));return t}function jN(e){let t=new Map;for(let r of e.nodes)t.set(r,0);for(let r of e.edges)t.set(r.dst,(t.get(r.dst)??0)+1);return t}function HN(e){return[...e.entries()].filter(([,t])=>t===0).map(([t])=>t).sort((t,r)=>t.localeCompare(r))}function Jm(e,t=()=>!0){let r=new Map,n=new Map;for(let i of e.nodes)r.set(i,[]),n.set(i,[]);for(let i of e.edges)t(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}function IS(e,t,r,n){let i=0;for(let o of e.nodes)n?.skipGroups&&e.nodeById.get(o)?.isGroup||(i=Math.max(i,r[o]??0));let a=Array.from({length:i+1},()=>[]);for(let o of t)n?.skipGroups&&e.nodeById.get(o)?.isGroup||a[Math.max(0,r[o]??0)].push(o);return a}function ch(e){let t=jN(e),r=HN(t),n=[],i=qN(e);for(;r.length;){let a=r.shift();n.push(a);for(let o of i.get(a)??[])if(t.set(o,(t.get(o)??0)-1),(t.get(o)??0)===0){let l=0;for(;l<r.length&&r[l]<o;)l++;r.splice(l,0,o)}}return n.length===e.nodes.length?n:null}function Yd(e){let t=new Map,r=0;for(let n of e)t.set(n,r),r++;return t}function NS(e){let t=new Array(e.length),r=s((n,i)=>{if(i-n<=1)return 0;let a=n+i>>1,o=r(n,a)+r(a,i),l=n,u=a,h=n;for(;l<a||u<i;)u>=i||l<a&&e[l]<=e[u]?t[h++]=e[l++]:(t[h++]=e[u++],o+=a-l);for(let d=n;d<i;d++)e[d]=t[d];return o},"count");return r(0,e.length)}var Cl=_(()=>{"use strict";s(qs,"normalizeGraph");s(DS,"incoming");s($We,"buildSuccessorMap");s(qN,"buildSortedSuccessorMap");s(jN,"buildInDegreeMap");s(HN,"sortedZeroInDegreeNodes");s(Jm,"buildPredecessorSuccessorMaps");s(IS,"buildLayersFromRanks");s(ch,"topoSortIfAcyclic");s(Yd,"buildLayerIndex");s(NS,"countInversions")});function Poe(e){let t=qs(e),r=new Map;for(let d of t.nodes)r.set(d,[]);for(let d of t.edges)r.get(d.src).push(d);for(let d of r.values())d.sort((f,p)=>f.dst===p.dst?f.id.localeCompare(p.id):f.dst.localeCompare(p.dst));let n=Object.create(null);for(let d of t.nodes)n[d]=0;let i=[],a=s(d=>{n[d]=1;for(let f of r.get(d)??[]){let p=f.dst;n[p]===0?a(p):n[p]===1&&i.push(f)}n[d]=2},"dfs"),o=[...t.nodes].sort((d,f)=>d.localeCompare(f));for(let d of o)n[d]===0&&a(d);let l=new Set(i.map(d=>`${d.id}:${d.src}->${d.dst}`)),u=t.edges.map(d=>l.has(`${d.id}:${d.src}->${d.dst}`)?{id:d.id,src:d.dst,dst:d.src,weight:d.weight,ref:d.ref}:d);return{acyclic:{nodes:[...t.nodes],edges:u,layout:t.layout,nodeById:new Map(t.nodeById)},reversed:i}}var Moe=_(()=>{"use strict";Cl();s(Poe,"removeCycles_DFS")});function BWe(e){let t=new Map,r=s(n=>{if(t.has(n))return t.get(n);let i=e.nodeById.get(n);if(!i)return t.set(n,null),null;let a=i.parentId;if(!a)return t.set(n,null),null;let l=r(a)??a;return t.set(n,l),l},"resolve");for(let n of e.nodes)r(n);return t}function as(e){let t=BWe(e);return r=>t.get(r)??null}function PS(e){let t=[];for(let r of e.layout.nodes??[])r.isGroup&&!r.parentId&&t.push(r.id);return[...new Set(t)].reverse()}function MS(e,t){let r=PS(e);if(!t||t.length===0)return r;let n=new Set(r),i=new Set,a=[];for(let o of t)!n.has(o)||i.has(o)||(i.add(o),a.push(o));for(let o of r)i.has(o)||a.push(o);return a}var Sc=_(()=>{"use strict";s(BWe,"buildTopLaneMap");s(as,"createTopLaneResolver");s(PS,"buildTopLaneOrder");s(MS,"resolveTopLaneOrder")});var Ooe,Kd,UN,eg=_(()=>{"use strict";Ooe={EPSILON:1e-6},Kd={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},UN={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40}});function $oe(e,t){let r=qs(e),n=t?.laneOf??(()=>null),i=t?.rankHint,{preds:a}=Jm(r);for(let v of a.values())v.sort((S,w)=>S.localeCompare(w));let o=ch(r)??[...r.nodes].sort((v,S)=>v.localeCompare(S)),l=new Map;for(let[v,S]of o.entries())l.set(S,v);let u=new Map,h=new Map;for(let v of r.nodes)h.set(v,[]);for(let v of o){let S=(a.get(v)??[]).filter(w=>u.has(w));if(S.length>0){let w=FWe(v,S,{laneOf:n,rankHint:i,topoIndex:l});u.set(v,w),h.get(w).push(v)}else u.has(v)||u.set(v,null)}for(let v of r.nodes)u.has(v)||u.set(v,null);let d=new Set;for(let v of r.nodes)(u.get(v)??null)===null&&d.add(v);let f=[...d].sort((v,S)=>{let w=l.get(v)??0,L=l.get(S)??0;return w===L?v.localeCompare(S):w-L}),p=GWe(r),g=new Map;for(let[v,S]of p.entries())g.set(v,[...S].sort((w,L)=>w.localeCompare(L)));let m=zWe(g),y=VWe(g),x=new Map;for(let v of r.nodes)x.set(v,[]);for(let v of y)for(let S of v.nodes){let w=x.get(S);w?w.push(v.id):x.set(S,[v.id])}let T=[],C=[],k=new Set,E=s(v=>{if(!k.has(v)){k.add(v),T.push(v);for(let S of h.get(v)??[])E(S);C.push(v)}},"walk");for(let v of f)E(v);for(let v of o)E(v);return{parent:u,children:h,roots:f,componentOf:m,blocks:y,nodeBlocks:x,adjacency:g,preorder:T,postorder:C,topologicalOrder:o}}function FWe(e,t,r){let n=r.laneOf(e);return[...t].sort((a,o)=>{let l=r.laneOf(a),u=r.laneOf(o),h=l!=null&&l===n,d=u!=null&&u===n;if(h!==d)return h?-1:1;let f=r.rankHint?.[a],p=r.rankHint?.[o];if(f!=null&&p!=null&&f!==p)return p-f;let g=r.topoIndex.get(a)??0,m=r.topoIndex.get(o)??0;return g!==m?g-m:a.localeCompare(o)})[0]}function GWe(e){let t=new Map;for(let r of e.nodes)t.set(r,new Set);for(let r of e.edges)t.get(r.src).add(r.dst),t.get(r.dst).add(r.src);return t}function zWe(e){let t=new Map,r=0;for(let n of e.keys()){if(t.has(n))continue;let i=[n];for(;i.length>0;){let a=i.pop();if(!t.has(a)){t.set(a,r);for(let o of e.get(a)??[])t.has(o)||i.push(o)}}r++}return t}function VWe(e){let t=new Map,r=new Map,n=[],i=[],a=0,o=s((l,u)=>{t.set(l,++a),r.set(l,a);for(let h of e.get(l)??[])h!==u&&(t.has(h)?(t.get(h)??0)<(t.get(l)??0)&&(n.push([l,h]),r.set(l,Math.min(r.get(l)??a,t.get(h)??a))):(n.push([l,h]),o(h,l),r.set(l,Math.min(r.get(l)??a,r.get(h)??a)),(r.get(h)??0)>=(t.get(l)??0)&&i.push(WWe(l,h,n,i.length))))},"visit");for(let l of e.keys())t.has(l)||o(l,null);return i}function WWe(e,t,r,n){let i=[],a=new Set;for(;r.length>0;){let o=r.pop();if(i.push(o),a.add(o[0]),a.add(o[1]),o[0]===e&&o[1]===t||o[0]===t&&o[1]===e)break}return{id:n,edges:i,nodes:[...a]}}var Boe=_(()=>{"use strict";Cl();s($oe,"buildDrivingTree");s(FWe,"chooseParent");s(GWe,"buildAdjacency");s(zWe,"assignComponents");s(VWe,"computeBlocks");s(WWe,"popBlock")});function Foe(e,t,r){let n=[...e.nodes],i=new Map;for(let[C,k]of n.entries())i.set(k,C);let a=n.length,o=new Array(a).fill(-1),l=new Array(a).fill(0),u=[],h=new Set;for(let C of n){let k=r.parent.get(C)??null,E=i.get(C);E!=null&&k==null&&(o[E]=-1,l[E]=0,h.has(C)||(h.add(C),u.push(C)))}for(;u.length>0;){let C=u.shift(),k=i.get(C);if(k==null)continue;let E=r.children.get(C)??[];for(let v of E){if(h.has(v))continue;let S=i.get(v);S!=null&&(o[S]=k,l[S]=l[k]+1,h.add(v),u.push(v))}}for(let C of n){if(h.has(C))continue;let k=i.get(C);k!=null&&(o[k]=-1,l[k]=0,h.add(C))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),f=Array.from({length:d},()=>new Array(a).fill(-1));for(let C=0;C<a;C++)f[0][C]=o[C];for(let C=1;C<d;C++)for(let k=0;k<a;k++){let E=f[C-1][k];f[C][k]=E===-1?-1:f[C-1][E]}let p=s((C,k)=>{if(C===-1||k===-1)return-1;l[C]<l[k]&&([C,k]=[k,C]);let E=l[C]-l[k];for(let v=0;v<d;v++)if(E>>v&1&&(C=f[v][C],C===-1))return-1;if(C===k)return C;for(let v=d-1;v>=0;v--){let S=f[v][C],w=f[v][k];S===-1||w===-1||S!==w&&(C=S,k=w)}return f[0][C]},"lcaIndex"),g=Array.from({length:a},()=>new Map);for(let C of e.edges){let k=C.src,E=C.dst,v=t[k],S=t[E];if(v==null||S==null||(v>S&&([k,E]=[E,k],[v,S]=[S,v]),v==null||S==null||v===S))continue;let w=i.get(k),L=i.get(E);if(w==null||L==null)continue;let O=p(w,L);if(O===-1)continue;let F=g[O];for(let N=v;N<S;N++)F.set(N,(F.get(N)??0)+1)}let m=new Map,y=s((C,k)=>{if(k.size!==0)for(let[E,v]of k)C.set(E,(C.get(E)??0)+v)},"mergeInto"),x=new Set,T=s(C=>{let k=i.get(C);x.add(C);let E=k==null?void 0:g[k],v=E?new Map(E):new Map,S=r.children.get(C)??[];for(let w of S){let L=T(w),O=t[C];if(O!=null){let F=m.get(C);F||(F=new Map,m.set(C,F));let N=L.get(O)??0,G=t[w];G!=null&&G>O&&(N+=1),F.set(w,N)}y(v,L)}return v},"dfs");for(let C of r.roots)x.has(C)||T(C);for(let C of n)x.has(C)||T(C);return m}var Goe=_(()=>{"use strict";s(Foe,"computeSubtreeCrossCounts")});function zoe(e,t,r){let n=new Map,i=s(a=>{let o=r[a]??0,l=[...t.get(a)??[]];l.sort(YN(r));for(let u of l){i(u);let h=n.get(u);h!=null&&(o=Math.min(o,h))}n.set(a,o)},"annotate");for(let a of e)i(a);return n}function YN(e){return(t,r)=>{let n=e[t]??0,i=e[r]??0;return n===i?t.localeCompare(r):n-i}}function Voe(e,t,r,n){let i=0;for(let u of t){let h=r[u]??0;h>i&&(i=h)}let a=Array.from({length:i+1},()=>[]),o=new Set,l=s(u=>{if(o.has(u))return;o.add(u);let h=r[u]??0;a[h]||(a[h]=[]),a[h].push(u);for(let d of n(u))l(d)},"emit");for(let u of e)l(u);for(let u of t)if(!o.has(u)){let h=r[u]??0;a[h]||(a[h]=[]),a[h].push(u),o.add(u)}return a}function Woe(e){let t=[];for(let r of e){let n=new Set,i=[];for(let a of r)n.has(a)||(n.add(a),i.push(a));t.push(i)}return t}var qoe=_(()=>{"use strict";s(zoe,"annotateMinimumLayers");s(YN,"compareByRankThenId");s(Voe,"emitNodesInTreeOrder");s(Woe,"deduplicateLayers")});function qWe(e,t,r,n){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,l=[],u=[],h=r.get(i);for(let d of a){let f=n.get(d)??o;f>o?l.push({child:d,min:f}):u.push(d)}return l.sort((d,f)=>d.min===f.min?d.child.localeCompare(f.child):d.min-f.min),u.sort((d,f)=>{let p=h?.get(d)??0,g=h?.get(f)??0;if(p!==g)return p-g;let m=n.get(d)??o,y=n.get(f)??o;return m!==y?m-y:d.localeCompare(f)}),[...l.map(d=>d.child),...u]}}function yx(e,t,r){let n=$oe(e,{rankHint:t,laneOf:r}),{children:i,roots:a}=n;for(let f of e.nodes)i.has(f)||i.set(f,[]);let o=Foe(e,t,n),l=[...a].sort(YN(t)),u=zoe(l,i,t),h=qWe(i,t,o,u),d=Voe(l,e.nodes,t,h);return d=Woe(d),d}var KN=_(()=>{"use strict";Boe();Goe();qoe();s(qWe,"createChildOrderer");s(yx,"buildMultitreeLayerOrder")});function jWe(e,t,r){let n=new Set(e),i=new Set(t),a=Yd(t),o=[];for(let l of r)n.has(l.src)&&i.has(l.dst)&&o.push(a.get(l.dst));return NS(o)}function joe(e,t,r){let n=[];for(let a of t){let o=r[a.src],l=r[a.dst];if(o==null||l==null||o===l)continue;let u=a.src,h=a.dst,d=o,f=l;o>l&&(u=a.dst,h=a.src,d=l,f=o);for(let p=d;p<f;p++)n.push({id:`${a.id}@${p}`,src:u,dst:h,ref:a.ref})}let i=0;for(let a=0;a+1<e.length;a++)i+=jWe(e[a],e[a+1],n);return i}function Hoe(e,t){let r={...t},{preds:n}=Jm(e),i=as(e),a=yx(e,r,i),o=joe(a,e.edges,r),l=Kd.MAX_CROSSING_OPTIMIZATION_PASSES;for(let u=0;u<l;u++){let h=!1,d=[...e.nodes].sort((f,p)=>(r[p]??0)-(r[f]??0));for(let f of d){let p=r[f]??0;if(p===0)continue;let g=0;for(let T of n.get(f)??[])g=Math.max(g,(r[T]??0)+1);if(g>=p)continue;let m=p;r[f]=g;let y=yx(e,r,i),x=joe(y,e.edges,r);x<o?(o=x,h=!0):r[f]=m}if(!h)break}return r}var Uoe=_(()=>{"use strict";Cl();eg();Sc();KN();s(jWe,"countCrossingsBetweenAdjacent");s(joe,"totalCrossings");s(Hoe,"optimizeRanksByCrossings")});function Yoe(e,t){let r=as(e),n=[...e.nodes].sort((i,a)=>(t[i]??0)-(t[a]??0)||i.localeCompare(a));for(let i of n){let a=r(i);if(!a)continue;let o=e.edges.filter(y=>y.src===i);if(o.length===0)continue;let l=!1,u=0;for(let y of o){let x=r(y.dst);x==null||x===a?l=!0:u++}if(u===0||l)continue;let h=0,d=!1;for(let y of e.edges){if(y.dst!==i)continue;let x=r(y.src);x&&(x===a?d=!0:h++)}if(h>0||!d)continue;let f=t[i]??0,p=f+u,g=0;for(let y of e.edges)y.dst===i&&(g=Math.max(g,(t[y.src]??0)+1));let m=Math.max(f,g,p);m!==f&&(t[i]=m)}}var Koe=_(()=>{"use strict";Sc();s(Yoe,"adjustCrossLaneSources")});function Xoe(e,t){let r=qs(e),n=ch(r)??[...r.nodes].sort(),i=t?.compactSingleInput??!1,a=as(r),o=Object.create(null);for(let u of n){let h=DS(r,u),d=t?.ignoreCrossLaneEdges?h.filter(f=>{let p=a(f.src),g=a(u);return!p||!g?!0:p===g}):h;if(d.length===0)o[u]=0;else if(i&&d.length===1){let f=d[0].src,p=a(f),g=a(u);p!==g?o[u]=o[f]??0:o[u]=(o[f]??0)+1}else{let f=-1/0;for(let p of d)f=Math.max(f,(o[p.src]??0)+1);o[u]=f===-1/0?0:f}}return(t?.optimizeRanksByCrossings??!1)&&(o=Hoe(r,o)),t?.ignoreCrossLaneEdges&&Yoe(r,o),{layers:yx(r,o,a),rankOf:o,dummy:new Set}}var Qoe=_(()=>{"use strict";Cl();Sc();Uoe();Koe();KN();s(Xoe,"assignLayers_LongestPath")});function Zoe(e,t){let r=qs(e),i={...Xoe(r,{compactSingleInput:t?.compactSingleInput,ignoreCrossLaneEdges:t?.ignoreCrossLaneEdges,optimizeRanksByCrossings:t?.optimizeRanksByCrossings}).rankOf},a=as(r),{preds:o,succs:l}=Jm(r,m=>{if(t?.ignoreCrossLaneEdges){let y=a(m.src),x=a(m.dst);if(y&&x&&y!==x)return!1}return!0}),u=ch(r)??[...r.nodes],h=[...u].reverse(),d=s((m,y)=>{let x=0;for(let k of o.get(m)??[])x=Math.max(x,(i[k]??0)+1);let T=Number.POSITIVE_INFINITY,C=l.get(m)??[];return C.length>0&&(T=Math.min(...C.map(k=>(i[k]??0)-1))),Number.isFinite(T)||(T=Math.max(x,y)),Math.min(Math.max(y,x),T)},"clampFeasible"),f=Kd.GRAVITY_ITERATIONS,p=s(m=>{let y=!1;for(let x of m){let T=o.get(x)??[],C=l.get(x)??[];if(T.length===0&&C.length===0)continue;let k=T.length>0?T.reduce((w,L)=>w+(i[L]??0)+1,0)/T.length:i[x]??0,E=C.length>0?C.reduce((w,L)=>w+(i[L]??0)-1,0)/C.length:i[x]??0,v=Math.round((k+E)/2),S=d(x,v);S!==i[x]&&(i[x]=S,y=!0)}return y},"relaxOrder");for(let m=0;m<f;m++){let y=p(u),x=p(h);if(!y&&!x)break}for(let m of u){let y=0;for(let x of o.get(m)??[])y=Math.max(y,(i[x]??0)+1);(i[m]??0)<y&&(i[m]=y)}for(let m of h){let y=l.get(m)??[];if(y.length>0){let x=Math.min(...y.map(T=>(i[T]??0)-1));(i[m]??0)>x&&(i[m]=x)}}return{layers:IS(r,u,i),rankOf:i,dummy:new Set}}var Joe=_(()=>{"use strict";Cl();Sc();eg();Qoe();s(Zoe,"assignLayers_Gravity")});function HWe(e){let t=jN(e),r=qN(e),n=HN(t),i=[];for(;n.length>0;){let a=[];for(let o of n){i.push(o);for(let l of r.get(o)??[])t.set(l,(t.get(l)??0)-1),(t.get(l)??0)===0&&a.push(l)}n=a.sort((o,l)=>o.localeCompare(l))}return i.length===e.nodes.length?i:null}function ele(e,t){let r=qs(e),n=t?.direction==="LR"?HWe(r)??[...r.nodes].sort():ch(r)??[...r.nodes].sort(),i=as(r),a=s(d=>i(d)??d,"laneOf"),o=Object.create(null),l=new Map,u=s((d,f)=>t?.ignoreCrossLaneEdges??!0?a(d)===a(f)?1:0:1,"edgeWeight");for(let d of n){if(r.nodeById.get(d)?.isGroup)continue;let p=DS(r,d),g=0;if(p.length>0)for(let T of p){let C=T.src,k=o[C]??0;g=Math.max(g,k+u(C,d))}let m=a(d),y=l.get(m)??0,x=Math.max(g,y);o[d]=x,l.set(m,x+1)}return{layers:IS(r,n,o,{skipGroups:!0}),rankOf:o,dummy:new Set}}var tle=_(()=>{"use strict";Cl();Sc();s(HWe,"topoSortByGenerationIfAcyclic");s(ele,"assignLayers_LaneAwareCompact")});function rle(e,t){let r=qs(t),{rankOf:n}=e,i=e.layers.map(g=>[...g]),a=new Set(e.dummy?[...e.dummy]:[]),o=0,l=new Map(r.nodeById),u=s(g=>{let m=`placeholder-${o++}`,y={id:m,isGroup:!1,isDummy:!0,width:0,height:0};for(l.set(m,y),a.add(m);i.length<=g;)i.push([]);return i[g].push(m),n[m]=g,m},"addDummyAt"),h=[...r.edges].sort((g,m)=>g.id===m.id?g.src===m.src?g.dst.localeCompare(m.dst):g.src.localeCompare(m.src):g.id.localeCompare(m.id)),d=[];for(let g of h){let m=n[g.src]??0,y=n[g.dst]??0;if(y-m<=1){d.push(g);continue}let x=g.src;for(let C=m+1,k=0;C<y;C++,k++){let E=u(C);d.push({id:`${g.id}#${k}`,src:x,dst:E,weight:g.weight,ref:g.ref}),x=E}let T=y-m-2;d.push({id:`${g.id}#${Math.max(T+1,0)}`,src:x,dst:g.dst,weight:g.weight,ref:g.ref})}let p={nodes:[...r.nodes,...[...a].filter(g=>!r.nodes.includes(g))],edges:d,layout:r.layout,nodeById:l};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:p}}var nle=_(()=>{"use strict";Cl();s(rle,"makeProperLayering")});function ile(e){let t=e.length;if(t===0)return Number.POSITIVE_INFINITY;let r=[...e].sort((n,i)=>n-i);return t%2===1?r[(t-1)/2]:.5*(r[t/2-1]+r[t/2])}function sle(e){return e.length===0?Number.POSITIVE_INFINITY:e.reduce((r,n)=>r+n,0)/e.length}function UWe(e,t,r,n){let i=new Map;for(let a of e)i.set(a,[]);for(let a of r)n==="down"?t.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(t.get(a.src)):t.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(t.get(a.dst));return i}function YWe(e,t,r){let n=r.get(e)??0,i=r.get(t)??0;return n!==i?n-i:e.localeCompare(t)}function ale(e,t,r){let n=new Set(e),i=new Set(t),a=Yd(e),o=Yd(t),l=[];for(let h of r)n.has(h.src)&&i.has(h.dst)&&l.push({u:a.get(h.src),v:o.get(h.dst)});l.sort((h,d)=>h.u===d.u?h.v-d.v:h.u-d.u);let u=l.map(h=>h.v);return NS(u)}function XN(e,t,r){return[...e].sort((n,i)=>{let a=ile(t.get(n)??[]),o=ile(t.get(i)??[]);return a===o?YWe(n,i,r):isFinite(a)?isFinite(o)?a-o:-1:1})}function ole(e,t,r,n,i,a){let o=Yd(e),l=Yd(t),u=UWe(t,o,r,n);if(!i||!a||a.length===0)return XN(t,u,l);let h=new Map;for(let p of t){let g=i(p),m=h.get(g)??[];m.push(p),h.set(g,m)}let d=[];for(let p of a){let g=h.get(p);if(!g||g.length===0)continue;let m=XN(g,u,l);d.push(...m)}let f=h.get(null);if(f&&f.length>0){let p=XN(f,u,l);for(let g of p){let m=sle(u.get(g)??[]),y=d.length;if(isFinite(m))for(let[x,T]of d.entries()){let C=sle(u.get(T)??[]);if(m<C){y=x;break}}d.splice(y,0,g)}}return d}function lle(e,t,r,n,i){let a=[...t],o=new Set(e),l=new Set(t),u=n?new Set(n):null,h=r.filter(y=>o.has(y.src)&&l.has(y.dst)),d=u?r.filter(y=>l.has(y.src)&&u.has(y.dst)):void 0,f=s(y=>{let x=ale(e,y,h);return d&&n&&(x+=ale(y,n,d)),x},"crossingScore"),p=i?new Map:null;if(i&&p)for(let y of t)p.set(y,i(y));let g=!0,m=f(a);for(;g;){g=!1;for(let y=0;y+1<a.length;y++){if(p){let C=p.get(a[y]),k=p.get(a[y+1]);if(C!==k)continue}let x=m;[a[y],a[y+1]]=[a[y+1],a[y]];let T=f(a);T<x?(m=T,g=!0):[a[y],a[y+1]]=[a[y+1],a[y]]}}return a}function cle(e,t,r){let n=e.layers.map(l=>[...l]),i=t.edges,a=as(t),o=MS(t,r?.laneOrder);for(let l=0;l<3;l++){for(let u=1;u<n.length;u++)n[u]=ole(n[u-1],n[u],i,"down",a,o),n[u]=lle(n[u-1],n[u],i,n[u+1],a);for(let u=n.length-2;u>=0;u--)n[u]=ole(n[u+1],n[u],i,"up",a,o),n[u]=lle(n[u+1],n[u],i,n[u-1],a)}return{layers:n}}var ule=_(()=>{"use strict";Cl();Sc();s(ile,"median");s(sle,"barycenter");s(UWe,"neighborPositionsFor");s(YWe,"currentOrderTieBreak");s(ale,"countCrossingsBetweenAdjacent");s(XN,"sortByHeuristic");s(ole,"reorderLayer");s(lle,"transposeImprove");s(cle,"orderLayers")});function hle(e,t,r){let n=r?.layerGap??UN.DEFAULT_LAYER_GAP,i=r?.nodeGap??UN.DEFAULT_NODE_GAP,a=r?.laneGap??i*2,o=r?.direction??"TB",l=o==="LR"||o==="RL",u=e.layers,h=Object.create(null),d=Object.create(null),f=s(F=>t.nodeById.get(F),"getNode"),p=s(F=>f(F)?.width??0,"getWidth"),g=s(F=>f(F)?.height??0,"getHeight"),m=as(t),y=MS(t,r?.laneOrder),x=u.map(F=>F.reduce((N,G)=>Math.max(N,g(G)),0)),T=[];if(l)for(let F=0;F+1<u.length;F++){let N=u[F].reduce((D,$)=>Math.max(D,p($)),0),G=u[F+1].reduce((D,$)=>Math.max(D,p($)),0),A=x[F],M=x[F+1],I=A/2+M/2,P=(N+G)/2,B=Math.max(0,P-I-n);T.push(B)}let C=new Set;for(let F of u)for(let N of F)C.add(m(N));let k=C.has(null),E=y.filter(F=>C.has(F)),v=[...k?[null]:[],...E],S=Object.create(null);for(let F of E)S[F]=0;k&&(S.null=0);for(let F of u){let N=Object.create(null),G=[];for(let A of F){let M=m(A);M===null?G.push(A):(N[M]||=[]).push(A)}for(let[A,M]of Object.entries(N)){let I=M.reduce((P,B)=>P+p(B),0)+i*Math.max(0,M.length-1);S[A]=Math.max(S[A]??0,I)}if(k&&G.length){let A=G.reduce((M,I)=>M+p(I),0)+i*Math.max(0,G.length-1);S.null=Math.max(S.null??0,A)}}let w=new Map;{let F=v.map(A=>(A===null?S.null:S[A])??0),G=-(F.reduce((A,M)=>A+M,0)+a*Math.max(0,v.length-1))/2;for(let A=0;A<v.length;A++){let M=v[A],I=F[A]??0,P=G+I/2;w.set(M,P),G+=I,A<v.length-1&&(G+=a)}}let L=0;for(let[F,N]of u.entries()){let G=x[F]??0,A=new Map;for(let I of N){let P=m(I),B=A.get(P)??[];B.push(I),A.set(P,B)}for(let I of v){let P=A.get(I)??[];if(P.length===0)continue;let B=w.get(I);if(P.length===1){let D=P[0];h[D]=B,d[D]=L+G/2}else{let D=P.map(q=>p(q)),$=D.reduce((q,z)=>q+z,0)+i*(P.length-1),W=B-$/2;for(let[q,z]of P.entries()){let j=D[q];h[z]=W+j/2,d[z]=L+G/2,W+=j+i}}}let M=T[F]??0;L+=G+n+M}let O=new Map;for(let F of t.edges){let N=F.ref.id;O.has(N)||O.set(N,[]),O.get(N).push(F)}for(let[,F]of O){if(F.length===0)continue;let N=F[0].ref,G=N.start,A=N.end;if(G==null||A==null)continue;let M=Math.round(((h[G]??0)+(h[A]??0))/2),I=new Set;for(let P of F)I.add(P.src),I.add(P.dst);for(let P of I){if(P===G||P===A)continue;t.nodeById.get(P)?.isDummy&&(h[P]=M)}}return{x:h,y:d}}var dle=_(()=>{"use strict";eg();Sc();s(hle,"assignCoordinates")});function KWe(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0}function XWe(e){let t=e>>>0;return()=>{t+=1831565813;let r=t;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function QWe(e,t){let r=[...e],n=XWe(t);for(let i=r.length-1;i>0;i--){let a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}function ZWe(e,t){let r=0;for(let[n,i]of e.entries())r+=Math.abs(n-(t.get(i)??n));return r}function fle(e,t){let r=new Map;for(let[i,a]of e.entries())r.set(a,i);let n=0;for(let{a:i,b:a,weight:o}of t){let l=r.get(i),u=r.get(a);l==null||u==null||(n+=o*Math.abs(l-u))}return n}function JWe(e){let t=PS(e);if(t.length<2)return[];let r=new Map(t.map((a,o)=>[a,o])),n=as(e),i=new Map;for(let a of e.layout.edges??[]){if(a.isLayoutOnly)continue;let o=typeof a.start=="string"?a.start:void 0,l=typeof a.end=="string"?a.end:void 0;if(!o||!l||!e.nodeById.has(o)||!e.nodeById.has(l))continue;let u=n(o),h=n(l);if(!u||!h||u===h)continue;let d=r.get(u),f=r.get(h);if(d==null||f==null)continue;let[p,g]=d<=f?[u,h]:[h,u],m=`${p}\0${g}`,y=i.get(m);y?y.weight++:i.set(m,{a:p,b:g,weight:1})}return[...i.values()]}function ple(e,t,r){let n=[...e],i=fle(n,t),a=!0,o=0,l=Math.max(1,n.length);for(;a&&o<l;){a=!1,o++;for(let u=0;u+1<n.length;u++){[n[u],n[u+1]]=[n[u+1],n[u]];let h=fle(n,t);h<i?(i=h,a=!0):[n[u],n[u+1]]=[n[u+1],n[u]]}}return{order:n,cost:i,sourceDistance:ZWe(n,r)}}function eqe(e,t){return e.cost!==t.cost?e.cost<t.cost:e.sourceDistance<t.sourceDistance}function tqe(e,t,r){let n=[...t].sort((i,a)=>i.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:o})=>`${i}:${a}:${o}`).join("|");return KWe(`${e.join("|")}#${n}#${r}`)}function mle(e,t={}){let r=PS(e);if(r.length<2)return r;let n=JWe(e);if(n.length===0)return r;let i=new Map(r.map((l,u)=>[l,u])),a=ple(r,n,i),o=Math.max(0,t.restarts??QN);for(let l=0;l<o;l++){let u=tqe(r,n,l),h=QWe(r,u),d=ple(h,n,i);eqe(d,a)&&(a=d)}return a.order}var QN,gle=_(()=>{"use strict";Sc();QN=8;s(KWe,"hashString");s(XWe,"mulberry32");s(QWe,"deterministicShuffle");s(ZWe,"sourceDistance");s(fle,"laneArrangementCost");s(JWe,"buildWeightedLaneEdges");s(ple,"greedySwitch");s(eqe,"isBetterCandidate");s(tqe,"seedForRestart");s(mle,"optimizeTopLaneOrder")});function yle(e,t){let r=t?.ignoreCrossLaneEdges??!0,n=t?.optimizeRanksByCrossings??!0,i=qs(e),a=t?.automaticLaneOrdering?mle(i,{restarts:QN}):void 0,o=Poe(i),l=o.acyclic,u=r?ele(l,{compactSingleInput:t?.compactSingleInput??Kd.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:t?.direction}):Zoe(l,{compactSingleInput:t?.compactSingleInput??Kd.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:n}),{layering:h,graphWithDummies:d}=rle(u,l),f=cle(h,d,{laneOrder:a}),p=hle(f,d,{layerGap:t?.layerGap,nodeGap:t?.nodeGap,direction:t?.direction,laneOrder:a});return{acyclic:l,reversed:o.reversed,layering:h,ordered:f,coordinates:p}}var xle=_(()=>{"use strict";Cl();Moe();Joe();tle();nle();ule();dle();eg();gle();s(yle,"sugiyamaLayout")});function ble(e,t,r){let n=e.x??0,i=e.y??0,a=t.x-n,o=t.y-i,l=Math.abs(a),u=Math.abs(o);return l<Rr&&u<Rr?r:u>Rr&&u*3>=l?o>0?"bottom":"top":l>Rr?a>0?"right":"left":r}function Tle(e,t){return Math.abs(e.to-t.from)<Rr||Math.abs(e.to-t.to)<Rr?e.to:e.from}function rg(e,t){return e.orient==="vertical"?{x:e.coord,y:t}:{x:t,y:e.coord}}function Cle(e,t){let r=e.nodes??[],n=e.edges??[],i=[];for(let X of n)X.isLayoutOnly||i.push({...X,__originalEdge:X});let a=new Map,o=new Map,l=[],u=t==="LR";for(let X of r)a.set(X.id,X);let h=r.filter(X=>X.isGroup&&!X.parentId);for(let X of h){let re={id:X.id},te=s(ie=>{o.set(ie.id,re),r.filter(ue=>ue.parentId===ie.id).forEach(te)},"assignLane");te(X)}let d=r.filter(X=>!X.isGroup&&!X.isEdgeLabel).map(X=>{let re=X.width??10,te=X.height??10,ie=X.x??0,ue=X.y??0,Q=rqe;return{nodeId:X.id,minX:ie-re/2-Q,maxX:ie+re/2+Q,minY:ue-te/2-Q,maxY:ue+te/2+Q,visualXHalfExtent:u?te/2+Q:re/2+Q}}),f=s((X,re,te,ie)=>{let ue=l.find(Q=>Q.orientation===X&&Math.abs(Q.coord-re)<1);return ue||(ue={id:`pipe-${X}-${re.toFixed(0)}`,orientation:X,coord:re,spanMin:te,spanMax:ie,tracks:[]},l.push(ue)),ue.spanMin=Math.min(ue.spanMin,te),ue.spanMax=Math.max(ue.spanMax,ie),ue},"getOrAddPipe"),p=s((X,re)=>{let te=X.width??10,ie=X.height??10,ue=X.x??0,Q=X.y??0;switch(re){case"top":return{x:ue,y:Q-ie/2};case"bottom":return{x:ue,y:Q+ie/2};case"left":return{x:ue-te/2,y:Q};case"right":return{x:ue+te/2,y:Q}}},"portForSide"),g=s((X,re,te)=>p(X,ble(X,re,te?"bottom":"top")),"getOrthogonalPort"),m=[],y=[],x=new Set,T=1e3,C=s((X,re,te)=>{if(m.length===0)return 0;let ie=Math.abs(re.y-te.y)<Rr,ue=Math.abs(re.x-te.x)<Rr;if(!ie&&!ue)return 0;let Q=0;if(ie){let R=re.y,V=Math.min(re.x,te.x)-Rr,ae=Math.max(re.x,te.x)+Rr;if(ae<=V)return 0;for(let K of m)K.edgeIndex===X||K.orientation!=="vertical"||K.pipe.coord<V||K.pipe.coord>ae||K.from-Rr<=R&&K.to+Rr>=R&&(Q+=T)}else if(ue){let R=re.x,V=Math.min(re.y,te.y)-Rr,ae=Math.max(re.y,te.y)+Rr;if(ae<=V)return 0;for(let K of m)K.edgeIndex===X||K.orientation!=="horizontal"||K.pipe.coord<V||K.pipe.coord>ae||K.from-Rr<=R&&K.to+Rr>=R&&(Q+=T)}return Q},"crossingPenalty"),k=i.map((X,re)=>{if(!X.start||!X.end)return{idx:re,crossLane:0,dx:0,dy:0};let te=a.get(X.start),ie=a.get(X.end),ue=o.get(X.start),Q=o.get(X.end),R=ue&&Q&&ue.id!==Q.id?1:0,V=te&&ie?Math.abs((ie.x??0)-(te.x??0)):0,ae=te&&ie?Math.abs((ie.y??0)-(te.y??0)):0;return{idx:re,crossLane:R,dx:V,dy:ae}}).sort((X,re)=>{if(X.crossLane!==re.crossLane)return re.crossLane-X.crossLane;let te=X.dx+X.dy,ie=re.dx+re.dy;return Math.abs(te-ie)>1?te-ie:X.idx-re.idx}).map(X=>X.idx),E=s((X,re,te,ie)=>{let ue=Math.min(X.x,re.x),Q=Math.max(X.x,re.x),R=Math.min(X.y,re.y),V=Math.max(X.y,re.y);return!!d.find(K=>te&&K.nodeId===te||ie&&K.nodeId===ie?!1:Math.abs(X.x-re.x)>Rr?K.minY<X.y&&K.maxY>X.y&&K.maxX>ue&&K.minX<Q:K.minX<X.x&&K.maxX>X.x&&K.maxY>R&&K.minY<V)},"isSegmentBlocked"),v=new Map,S=new Map;for(let X of i)!X.start||!X.end||X.start===X.end||(S.set(X.start,(S.get(X.start)??0)+1),S.set(X.end,(S.get(X.end)??0)+1));let w=s((X,re)=>ble(X,re,"bottom"),"determineSide"),L=new Map;for(let[X,re]of i.entries()){if(!re.start||!re.end||re.start===re.end||re.points&&re.points.length>0)continue;let te=a.get(re.start),ie=a.get(re.end);if(!te||!ie)continue;let ue=(ie.x??0)-(te.x??0),Q=(ie.y??0)-(te.y??0);L.set(X,{edgeIdx:X,srcId:re.start,dstId:re.end,srcSide:w(te,{x:ie.x??0,y:ie.y??0}),dstSide:w(ie,{x:te.x??0,y:te.y??0}),absDx:Math.abs(ue),absDy:Math.abs(Q),dxSign:Math.sign(ue),dySign:Math.sign(Q)})}let O=s(X=>X.srcSide==="top"||X.srcSide==="bottom"?X.absDx===0?1/0:X.absDy/X.absDx:X.absDy===0?1/0:X.absDx/X.absDy,"preferenceStrength"),F=s(X=>X.srcSide==="top"||X.srcSide==="bottom"?X.dxSign>=0?"right":"left":X.dySign>=0?"bottom":"top","secondarySide"),N=new Map;for(let X of L.values()){let re=`${X.srcId}:${X.srcSide}`;N.has(re)||N.set(re,[]),N.get(re).push(X)}let G=new Map,A=s((X,re)=>`${X}:${re}`,"loadKey");for(let X of L.values())G.set(A(X.srcId,X.srcSide),(G.get(A(X.srcId,X.srcSide))??0)+1),G.set(A(X.dstId,X.dstSide),(G.get(A(X.dstId,X.dstSide))??0)+1);for(let X of N.values())if(!(X.length<2)){X.sort((re,te)=>{let ie=O(re),ue=O(te);return Math.abs(ie-ue)>1e-9?ue-ie:re.edgeIdx-te.edgeIdx});for(let re=1;re<X.length;re++){let te=X[re],ie=F(te),ue=G.get(A(te.srcId,te.srcSide))??0,Q=G.get(A(te.srcId,ie))??0;Q>=ue||(G.set(A(te.srcId,te.srcSide),ue-1),G.set(A(te.srcId,ie),Q+1),te.srcSide=ie)}}let M=s(X=>{let re=X?.shape;return re==="question"||re==="diamond"},"isDiamondNode"),I=new Map;for(let X of L.values())I.has(X.dstId)||I.set(X.dstId,new Set),I.get(X.dstId).add(X.dstSide);for(let X of L.values()){if(!M(a.get(X.srcId)))continue;let re=I.get(X.srcId);if(!re?.has(X.srcSide))continue;let te=F(X);if(re.has(te)||(G.get(A(X.srcId,te))??0)>0)continue;let ie=G.get(A(X.srcId,X.srcSide))??0;G.set(A(X.srcId,X.srcSide),Math.max(0,ie-1)),G.set(A(X.srcId,te),1),X.srcSide=te}for(let X of L.values()){let{edgeIdx:re,srcId:te,dstId:ie,srcSide:ue,dstSide:Q}=X,R=a.get(te),V=a.get(ie),ae=`${te}:${ue}:src`,K=ue==="top"||ue==="bottom"?V.x??0:V.y??0;v.has(ae)||v.set(ae,[]),v.get(ae).push({edgeIdx:re,oppositeCoord:K});let ye=`${ie}:${Q}:dst`,Z=Q==="top"||Q==="bottom"?R.x??0:R.y??0;v.has(ye)||v.set(ye,[]),v.get(ye).push({edgeIdx:re,oppositeCoord:Z})}let P=new Map,B=8;for(let[X,re]of v){if(re.length<2)continue;re.sort((Ae,Se)=>Ae.oppositeCoord-Se.oppositeCoord);let te=X.split(":"),ie=te.slice(0,-2).join(":"),ue=te[te.length-2],Q=te[te.length-1],R=a.get(ie);if(!R)continue;let ae=ue==="left"||ue==="right"?R.height??10:R.width??10,K=R.shape,Z=K==="question"||K==="diamond"?ae*.3:ae,U=Math.min(20,Math.max(B,Z/(re.length+1))),ke=-(U*(re.length-1))/2;for(let[Ae,Se]of re.entries()){let De=ke+Ae*U,Le=`${Se.edgeIdx}:${Q}`;P.set(Le,De)}}let D=s(X=>!!i[X]?.labelNodeId,"edgeHasLabelNode"),$=s((X,re)=>X?(v.get(`${X}:${re}:src`)??[]).some(({edgeIdx:te})=>D(te))||(v.get(`${X}:${re}:dst`)??[]).some(({edgeIdx:te})=>D(te)):!1,"faceHasLabelNode"),W=s((X,re,te)=>re==="top"||re==="bottom"?{x:X.x+te,y:X.y}:{x:X.x,y:X.y+te},"applyPortOffset"),q=s((X,re,te)=>{let ie=L.get(X),ue={x:te.x??0,y:te.y??0},Q={x:re.x??0,y:re.y??0},R=ie?.srcSide??w(re,ue),V=ie?.dstSide??w(te,Q),ae=ie?p(re,ie.srcSide):g(re,ue,!0),K=ie?p(te,ie.dstSide):g(te,Q,!1),ye=P.get(`${X}:src`),Z=P.get(`${X}:dst`);return ye!==void 0&&(ae=W(ae,R,ye)),Z!==void 0&&(K=W(K,V,Z)),{pSrcPort:ae,pDstPort:K,srcSide:R,dstSide:V}},"portsForEdge");for(let X of k){let re=i[X];if(y[X]=[],!re.start||!re.end||re.points&&re.points.length>0||re.start===re.end)continue;let te=a.get(re.start),ie=a.get(re.end);if(!te||!ie)continue;let{pSrcPort:ue,pDstPort:Q,srcSide:R,dstSide:V}=q(X,te,ie),ae={...ue},K={...Q},ye=R==="top"||R==="bottom",Z=V==="top"||V==="bottom";if(ye){let We=ue.y>(te.y??0);ae.y=We?ue.y+Va:ue.y-Va}else{let We=ue.x>(te.x??0);ae.x=We?ue.x+Va:ue.x-Va}if(Z){let We=Q.y>(ie.y??0);K.y=We?Q.y+Va:Q.y-Va}else{let We=Q.x>(ie.x??0);K.x=We?Q.x+Va:Q.x-Va}let H=s((We,rt)=>{for(let pt of d)if(!rt.includes(pt.nodeId)&&We.x>pt.minX&&We.x<pt.maxX&&We.y>pt.minY&&We.y<pt.maxY)return{inside:!0,obstacle:pt};return{inside:!1}},"isPointInObstacle"),U=s((We,rt,pt,nr,Wt)=>{if(Wt){let gn=We.y>(rt.y??0);return{x:(pt.x??0)>=We.x?nr.maxX+Xd:nr.minX-Xd,y:gn?nr.maxY+tg:nr.minY-tg,leavesPositiveSide:gn}}let Or=We.x>(rt.x??0),cn=(pt.y??0)>=We.y;return{x:Or?nr.maxX+Xd:nr.minX-Xd,y:cn?nr.maxY+tg:nr.minY-tg,leavesPositiveSide:Or}},"obstacleDetour"),ve=[],ke=[re.start,re.end],Ae=H(ae,ke);if(Ae.inside&&Ae.obstacle){let We=Ae.obstacle;if(ye){let rt=U(ue,te,ie,We,!0);ae.x=rt.x,ae.y=rt.y;let pt=rt.leavesPositiveSide?Math.min(We.minY-2,ue.y+Va):Math.max(We.maxY+2,ue.y-Va);ve=[{x:ue.x,y:pt},{x:rt.x,y:pt},{x:rt.x,y:rt.y}]}else{let rt=U(ue,te,ie,We,!1),pt=rt.leavesPositiveSide?Math.min(We.minX-2,ue.x+Va):Math.max(We.maxX+2,ue.x-Va);ae.x=rt.x,ae.y=rt.y,ve=[{x:pt,y:ue.y},{x:pt,y:rt.y},{x:rt.x,y:rt.y}]}}let Se=[],De=H(K,ke);if(De.inside&&De.obstacle){let We=De.obstacle;if(Z){let rt=U(Q,ie,te,We,!0);K.x=rt.x,K.y=rt.y,Se=[{x:rt.x,y:rt.y},{x:Q.x,y:rt.y}]}else{let rt=U(Q,ie,te,We,!1);K.x=rt.x,K.y=rt.y,Se=[{x:rt.x,y:rt.y},{x:rt.x,y:Q.y}]}}if(ve.length===0&&Se.length===0){let We=Xd,rt=Math.abs(ae.x-K.x)<We,pt=Math.abs(ae.y-K.y)<We,nr=P.get(`${X}:src`)!==void 0||P.get(`${X}:dst`)!==void 0,Wt=(v.get(`${re.start??""}:${R}:src`)?.length??0)+(v.get(`${re.start??""}:${R}:dst`)?.length??0),Or=(v.get(`${re.end??""}:${V}:src`)?.length??0)+(v.get(`${re.end??""}:${V}:dst`)?.length??0),cn=Wt>1||Or>1,gn=S.get(re.start??"")??0,dr=S.get(re.end??"")??0,kt=Wt>1&&$(re.start,R)||Or>1&&$(re.end,V),Rt=Wt<=1||gn<=2,Dt=Or<=1||dr<=2;if((rt||pt)&&!nr&&(!cn||cn&&!kt&&Rt&&Dt)&&!E(ue,Q,re.start,re.end)){re.points=[{...ue},{...ae},{...K},{...Q}],x.add(X);let he=pt?"horizontal":"vertical",Fr=pt?ue.y:ue.x,be=pt?Math.min(ue.x,Q.x):Math.min(ue.y,Q.y),ur=pt?Math.max(ue.x,Q.x):Math.max(ue.y,Q.y),ei={id:`fast-path-${he}-${Fr.toFixed(0)}-${X}`,orientation:he,coord:Fr,spanMin:be,spanMax:ur,tracks:[]};m.push({edgeIndex:X,segmentIndex:0,orientation:he,pipe:ei,trackIndex:0,from:be,to:ur});continue}}let Le=f("vertical",ae.x,ae.y,ae.y);ae.x=Le.coord;let Fe=f("vertical",K.x,K.y,K.y);K.x=Fe.coord;let Ee=Math.min(ae.x,K.x)-50,tt=Math.max(ae.x,K.x)+50,de=Math.min(ae.y,K.y)-50,bt=Math.max(ae.y,K.y)+50;for(let We of d){let rt=Math.min(ae.x,K.x),pt=Math.max(ae.x,K.x),nr=Math.min(ae.y,K.y),Wt=Math.max(ae.y,K.y);We.minX<pt&&We.maxX>rt&&We.minY<Wt&&We.maxY>nr&&(Ee=Math.min(Ee,We.minX-OS),tt=Math.max(tt,We.maxX+OS),de=Math.min(de,We.minY-OS),bt=Math.max(bt,We.maxY+OS))}for(let We of d){if(We.maxX<Ee||We.minX>tt||We.maxY<de||We.minY>bt)continue;let rt=Xd;f("horizontal",We.minY-rt,Ee,tt),f("horizontal",We.maxY+rt,Ee,tt);let pt=tg;f("vertical",We.minX-pt,de,bt),f("vertical",We.maxX+pt,de,bt)}f("horizontal",ae.y,Ee,tt),f("horizontal",K.y,Ee,tt);let we=l.filter(We=>We.orientation==="horizontal"&&We.coord>=de&&We.coord<=bt),vt=l.filter(We=>We.orientation==="vertical"&&We.coord>=Ee&&We.coord<=tt),Ot=s((We,rt)=>`${We.toFixed(1)},${rt.toFixed(1)}`,"getKey"),Ar=Ot(ae.x,ae.y),xt=Ot(K.x,K.y),$t=new Map,Et=new Map,oe=new Map,ut=new Set,yt=[];$t.set(Ar,0),oe.set(Ar,"n"),yt.push({key:Ar,f:Math.hypot(K.x-ae.x,K.y-ae.y),pt:ae}),ut.add(Ar);let Ue=[],fe=s((We,rt)=>E(We,rt,re.start,re.end),"checkSegmentBlocked"),Qe={x:K.x,y:ae.y},Ye=fe(ae,Qe),ct=fe(Qe,K),Jt=Ye||ct,St={x:ae.x,y:K.y},Kt=fe(ae,St),kr=fe(St,K);if(Jt?Kt||kr||(Math.abs(ae.x-K.x)<Rr?Ue=[ae,K]:Ue=[ae,St,K]):Math.abs(ae.y-K.y)<Rr||Math.abs(ae.x-K.x)<Rr?Ue=[ae,K]:Ue=[ae,Qe,K],Ue.length===0)for(;yt.length>0;){yt.sort((dr,kt)=>dr.f-kt.f);let We=yt.shift();if(ut.delete(We.key),We.key===xt){let dr=xt,kt=K;for(Ue=[kt];Et.has(dr);){let Rt=Et.get(dr);Ue.unshift(Rt),kt=Rt,dr=Ot(Rt.x,Rt.y)}break}let rt=We.pt.x,pt=We.pt.y,nr=vt.sort((dr,kt)=>dr.coord-kt.coord),Wt=nr.findIndex(dr=>Math.abs(dr.coord-rt)<1),Or=we.sort((dr,kt)=>dr.coord-kt.coord),cn=Or.findIndex(dr=>Math.abs(dr.coord-pt)<1),gn=[];Wt>0&&gn.push({x:nr[Wt-1].coord,y:pt}),Wt>=0&&Wt<nr.length-1&&gn.push({x:nr[Wt+1].coord,y:pt}),cn>0&&gn.push({x:rt,y:Or[cn-1].coord}),cn>=0&&cn<Or.length-1&&gn.push({x:rt,y:Or[cn+1].coord});for(let dr of gn){let kt=Math.min(rt,dr.x),Rt=Math.max(rt,dr.x),Dt=Math.min(pt,dr.y),ht=Math.max(pt,dr.y);if(d.some(pe=>pe.nodeId===re.start||pe.nodeId===re.end?!1:kt!==Rt?pe.minY<pt&&pe.maxY>pt&&pe.maxX>kt&&pe.minX<Rt:pe.minX<rt&&pe.maxX>rt&&pe.maxY>Dt&&pe.minY<ht))continue;let he=Ot(dr.x,dr.y),Fr=Math.abs(dr.x-rt)+Math.abs(dr.y-pt),be=C(X,We.pt,dr),ur=0,ei=K.x-ae.x,_a=K.y-ae.y,iu=dr.x-rt,Hl=dr.y-pt;(_a>10&&Hl<-5||_a<-10&&Hl>5)&&(ur=Math.abs(Hl)*100),(ei>10&&iu<-5||ei<-10&&iu>5)&&(ur+=Math.abs(iu)*50);let wp=0,Nn=oe.get(We.key)??"n",na=Math.abs(iu)>Rr?"h":"v";Nn!=="n"&&Nn!==na&&(wp=50);let Go=Fr+be+ur+wp,Aa=($t.get(We.key)??1/0)+Go,gt=Math.abs(K.x-dr.x)+Math.abs(K.y-dr.y);if(Aa<($t.get(he)??1/0))if(Et.set(he,We.pt),$t.set(he,Aa),oe.set(he,na),!ut.has(he))yt.push({key:he,f:Aa+gt,pt:dr}),ut.add(he);else{let pe=yt.findIndex(qe=>qe.key===he);pe!==-1&&(yt[pe].f=Aa+gt)}}}if(Ue.length===0&&(Ue=[ae,{x:ae.x,y:K.y},K]),Ue.length>4){let We=Ue[0],rt=Ue[Ue.length-1],pt=Math.min(We.x,rt.x),nr=Math.max(We.x,rt.x),Wt=Math.min(We.y,rt.y),Or=Math.max(We.y,rt.y);for(let Dt of Ue)pt=Math.min(pt,Dt.x),nr=Math.max(nr,Dt.x),Wt=Math.min(Wt,Dt.y),Or=Math.max(Or,Dt.y);let cn=nr>Math.max(We.x,rt.x),gn=pt<Math.min(We.x,rt.x);if(u){let Dt=tg;if(cn){let ht=Math.max(We.x,rt.x),Xt=Math.min(We.y,rt.y),he=Math.max(We.y,rt.y),Fr=d.filter(be=>be.minX<ht&&be.maxX>ht&&be.minY<he&&be.maxY>Xt);if(Fr.length>0){let be=Math.max(We.x,rt.x);for(let ur of Fr){let ei=(ur.minX+ur.maxX)/2;if(ur.visualXHalfExtent===void 0||isNaN(ur.visualXHalfExtent))continue;let _a=ei+ur.visualXHalfExtent+Dt;be=Math.max(be,_a)}isNaN(be)||(nr=be)}}if(gn){let ht=d.filter(Xt=>Xt.minX<Math.min(We.x,rt.x)+Dt&&Xt.minY<Math.max(We.y,rt.y)&&Xt.maxY>Math.min(We.y,rt.y));if(ht.length>0){let Xt=Math.min(We.x,rt.x);for(let he of ht){let be=(he.minX+he.maxX)/2-he.visualXHalfExtent-Dt;Xt=Math.min(Xt,be)}pt=Xt}}}let dr=s(Dt=>{let ht=rt.y>We.y,Xt=d.filter(be=>{let ur=Math.min(We.x,rt.x)<be.maxX&&Math.max(We.x,rt.x)>be.minX,ei=Math.min(We.y,rt.y)<be.maxY&&Math.max(We.y,rt.y)>be.minY;return ur&&ei}),he=Xt;if(u&&Xt.length>0){let be=Xt.filter(ur=>ur.minX<Dt&&ur.maxX>Dt);be.length>0&&(he=be)}if(he.length===0)return rt.y;let Fr=Xd;if(ht){let ur=Math.max(...he.map(ei=>ei.maxY))+Fr;if(ur<rt.y-Rr)return ur}else{let ur=Math.min(...he.map(ei=>ei.minY))-Fr;if(ur>rt.y+Rr)return ur}return rt.y},"findBestReturnY"),kt=s(Dt=>{let ht=dr(Dt),Xt={x:Dt,y:We.y},he={x:Dt,y:ht},Fr={x:rt.x,y:ht},be=fe(We,Xt),ur=fe(Xt,he),ei=fe(he,Fr),_a=ht!==rt.y?fe(Fr,rt):!1;return!be&&!ur&&!ei&&!_a?Math.abs(ht-rt.y)<Rr?[We,Xt,he,rt]:[We,Xt,he,Fr,rt]:null},"trySimplifyWithDetourX"),Rt=cn&&!gn?kt(nr):gn&&!cn?kt(pt):null;Rt&&(Ue=Rt)}let wt=[ue,...ve,...Ue,...Se.reverse(),Q];if(wt.length>=3){let We=wt[wt.length-1],rt=wt[wt.length-2],pt=wt[wt.length-3],nr=Math.abs(pt.y-rt.y)<Rr&&Math.abs(rt.y-We.y)<Rr,Wt=Math.abs(pt.x-rt.x)<Rr&&Math.abs(rt.x-We.x)<Rr;if(nr){let Or=Math.sign(rt.x-pt.x),cn=Math.sign(We.x-pt.x);Or!==0&&Or===cn&&Math.abs(rt.x-pt.x)>Math.abs(We.x-pt.x)&&wt.splice(-2,1)}else if(Wt){let Or=Math.sign(rt.y-pt.y),cn=Math.sign(We.y-pt.y);Or!==0&&Or===cn&&Math.abs(rt.y-pt.y)>Math.abs(We.y-pt.y)&&wt.splice(-2,1)}}let Vt=[wt[0]];for(let We=1;We<wt.length-1;We++){if(We===1){Vt.push(wt[We]);continue}let rt=Vt[Vt.length-1],pt=wt[We],nr=wt[We+1];if(Math.abs(rt.y-pt.y)<Rr&&Math.abs(pt.y-nr.y)<Rr){let Wt=pt.x>rt.x,Or=nr.x>pt.x;if(Wt!==Or){Vt.push(pt);continue}continue}if(Math.abs(rt.x-pt.x)<Rr&&Math.abs(pt.x-nr.x)<Rr){let Wt=pt.y>rt.y,Or=nr.y>pt.y;if(Wt!==Or){Vt.push(pt);continue}continue}Vt.push(pt)}Vt.push(wt[wt.length-1]);for(let We=0;We<Vt.length-1;We++){let rt=Vt[We],pt=Vt[We+1],nr=Math.abs(rt.x-pt.x)<Rr?"vertical":"horizontal",Wt=nr==="vertical"?rt.x:rt.y,Or=nr==="vertical"?Math.min(rt.y,pt.y):Math.min(rt.x,pt.x),cn=nr==="vertical"?Math.max(rt.y,pt.y):Math.max(rt.x,pt.x),gn=f(nr,Wt,Or,cn),dr={edgeIndex:X,segmentIndex:We,orientation:nr,pipe:gn,trackIndex:0,from:Or,to:cn};m.push(dr),y[X].push(m.length-1),gn.tracks[0]||(gn.tracks[0]={index:0,coord:gn.coord,segments:[]}),gn.tracks[0].segments.push({edgeIndex:X,segmentIndex:We,from:Or,to:cn})}}let z=s((X,re)=>X.from<re.to&&re.from<X.to,"segmentsOverlap"),j=s((X,re,te,ie)=>{let ue=!ie.segments.some(R=>(R.edgeIndex!==re.edgeIndex||R.segmentIndex!==re.segmentIndex)&&z(R,X)),Q=!te.segments.some(R=>(R.edgeIndex!==X.edgeIndex||R.segmentIndex!==X.segmentIndex)&&z(R,re));return ue&&Q?(X.trackIndex=ie.index,re.trackIndex=te.index,te.segments=[...te.segments.filter(R=>R.edgeIndex!==X.edgeIndex||R.segmentIndex!==X.segmentIndex),{edgeIndex:re.edgeIndex,segmentIndex:re.segmentIndex,from:re.from,to:re.to}],ie.segments=[...ie.segments.filter(R=>R.edgeIndex!==re.edgeIndex||R.segmentIndex!==re.segmentIndex),{edgeIndex:X.edgeIndex,segmentIndex:X.segmentIndex,from:X.from,to:X.to}],!0):!1},"trySwapSegmentsAcrossTracks"),J=s(X=>{let re=X.tracks.length;return X.tracks[re]={index:re,coord:X.coord,segments:[]},re},"createNewTrack"),ee=s((X,re)=>{let te=X.pipe.tracks[X.trackIndex];te.segments=te.segments.filter(ue=>ue.edgeIndex!==X.edgeIndex||ue.segmentIndex!==X.segmentIndex),X.trackIndex=re,X.pipe.tracks[re].segments.push({edgeIndex:X.edgeIndex,segmentIndex:X.segmentIndex,from:X.from,to:X.to})},"moveSegmentToTrack"),le=s((X,re)=>{let te=y[X.edgeIndex];for(let ie of te){let ue=m[ie];ue.pipe===X.pipe&&ee(ue,re)}},"moveSegmentChainToTrack"),se=s(X=>{let re=y[X.edgeIndex],te=re.indexOf(m.indexOf(X)),ie=[];return te>0&&ie.push(m[re[te-1]]),te<re.length-1&&ie.push(m[re[te+1]]),ie},"getAdjacentSegmentsAlongEdge"),Ce=s((X,re)=>{if(X.orientation===re.orientation)return!1;let te=X.orientation==="horizontal"?X:re,ie=X.orientation==="horizontal"?re:X;return ie.pipe.coord>te.from&&ie.pipe.coord<te.to&&te.pipe.coord>ie.from&&te.pipe.coord<ie.to},"haveAnyCrossing"),ce=s((X,re)=>{for(let te of X.tracks)if(!te.segments.some(ue=>(ue.edgeIndex!==re.edgeIndex||ue.segmentIndex!==re.segmentIndex)&&z(ue,re)))return te.index;return-1},"findAvailableTrack"),_e=s((X,re)=>{if(X.trackIndex===re.trackIndex)return z(X,re);let te=se(X),ie=se(re);return te.some(ue=>ie.some(Q=>Ce(ue,Q)))},"segmentsConflict"),me=s((X,re,te)=>{if(j(X,re,X.pipe.tracks[X.trackIndex],re.pipe.tracks[re.trackIndex]))return;let ie=ce(X.pipe,re);te(re,ie!==-1?ie:J(X.pipe))},"resolveTrackConflict"),ge=s(X=>{let re=0;for(let te=0;te<X.length;te++)for(let ie=te+1;ie<X.length;ie++){let ue=X[te],Q=X[ie];ue.pipe===Q.pipe&&_e(ue,Q)&&(re++,me(ue,Q,le))}return re},"resolveHandleConflicts"),Be=new Map,$e=s(X=>{if(Be.has(X))return Be.get(X);let re=y[X];if(re.length===0){let V={dest:0,deviation:0,base:0,delta:0};return Be.set(X,V),V}let ie=m[re[0]].pipe.coord,ue=ie;for(let V=1;V<re.length;V++){let ae=m[re[V]];if(ae.orientation==="horizontal"){let K=ae.from,ye=ae.to;ue=Math.abs(K-ie)>Math.abs(ye-ie)?K:ye;break}}let Q=Math.abs(ue-ie),R={dest:ue,deviation:Q,base:ie,delta:ue-ie};return Be.set(X,R),R},"getDestInfo"),Ie=s(()=>{let X=0,re=new Map;for(let[ie,ue]of i.entries())y[ie].length!==0&&ue.start&&(re.has(ue.start)||re.set(ue.start,[]),re.get(ue.start).push(ie));let te=s(ie=>{let ue=i[ie];if(!ue.start||!ue.end)return 0;let Q=a.get(ue.start),R=a.get(ue.end);if(!Q||!R)return 0;let V=(R.x??0)-(Q.x??0),ae=(R.y??0)-(Q.y??0);return Math.abs(V)+Math.abs(ae)},"getEdgeDistance");for(let ie of re.values()){ie.sort((Q,R)=>{let V=$e(Q),ae=$e(R);if(Math.abs(V.deviation-ae.deviation)>1)return V.deviation-ae.deviation;if(Math.abs(V.dest-ae.dest)>1)return V.dest-ae.dest;let K=te(Q),ye=te(R);if(Math.abs(K-ye)>1)return ye-K;let Z=y[Q].length,H=y[R].length;if(Z!==H)return Z-H;if(Z===1){let U=y[Q][0],ve=y[R][0];if(m[U]&&m[ve]){let ke=m[U],Ae=m[ve],Se=Math.abs(ke.to-ke.from),De=Math.abs(Ae.to-Ae.from);if(Math.abs(Se-De)>1)return Se-De}}return 0});let ue=ie.map(Q=>m[y[Q][0]]);X+=ge(ue)}return X},"fixSourceHandleCrossings"),nt=s(()=>{let X=0,re=new Map;for(let[te,ie]of i.entries())y[te].length!==0&&ie.end&&(re.has(ie.end)||re.set(ie.end,[]),re.get(ie.end).push(te));for(let te of re.values()){te.sort((ue,Q)=>{let R=s(K=>{let ye=y[K];if(ye.length<2)return 0;let Z=m[ye[ye.length-2]];return Math.abs(Z.to-Z.from)},"getDist"),V=R(ue),ae=R(Q);return Math.abs(V-ae)>.1?V-ae:ue-Q});let ie=te.map(ue=>m[y[ue][y[ue].length-1]]);X+=ge(ie)}return X},"fixTargetHandleCrossings"),lt=s(()=>{let X=0;for(let re of l){let te=[];for(let ie of re.tracks)for(let ue of ie.segments){let Q=y[ue.edgeIndex].find(R=>m[R].segmentIndex===ue.segmentIndex);Q!==void 0&&te.push(m[Q])}te.sort((ie,ue)=>ie.edgeIndex-ue.edgeIndex||ie.segmentIndex-ue.segmentIndex);for(let ie=0;ie<te.length;ie++)for(let ue=ie+1;ue<te.length;ue++){let Q=te[ie],R=te[ue];_e(Q,R)&&(X++,me(Q,R,ee))}}return X},"fixPipeCrossings"),Te=0,Ne=10;for(;Te<Ne;){let X=0;if(X+=Ie(),X+=nt(),X+=lt(),X===0)break;Te++}let Pe=new Map;for(let X of l){let re=[];X.tracks.forEach(ie=>{ie.segments.forEach(ue=>{re.push({edgeIndex:ue.edgeIndex,segmentIndex:ue.segmentIndex,trackIndex:ie.index,from:ue.from,to:ue.to})})}),re.sort((ie,ue)=>ie.from-ue.from);let te=[];if(re.length>0){let ie=[re[0]],ue=re[0].to;for(let Q=1;Q<re.length;Q++){let R=re[Q];R.from<ue?(ie.push(R),ue=Math.max(ue,R.to)):(te.push(ie),ie=[R],ue=R.to)}te.push(ie)}for(let ie of te){let ue=new Set;ie.forEach(U=>ue.add(U.trackIndex));let Q=new Map;ie.forEach(U=>{let ve=$e(U.edgeIndex);Q.set(U.trackIndex,(Q.get(U.trackIndex)??0)+ve.delta)});let R=[...ue].filter(U=>(Q.get(U)??0)<-1),V=[...ue].filter(U=>(Q.get(U)??0)>1),ae=[...ue].filter(U=>Math.abs(Q.get(U)??0)<=1);R.sort((U,ve)=>(Q.get(ve)??0)-(Q.get(U)??0)),V.sort((U,ve)=>(Q.get(U)??0)-(Q.get(ve)??0));let K=s((U,ve)=>{ie.filter(ke=>ke.trackIndex===U).forEach(ke=>{let Ae=x.has(ke.edgeIndex)?X.coord:ve;Pe.set(`${ke.edgeIndex}-${ke.segmentIndex}`,Ae)})},"assignCoord"),ye=0;for(let U of R)ye++,K(U,X.coord-ye*ZN);if(ae.length===0&&ue.size>0){let U=[...ue].sort((Ae,Se)=>Math.abs(Q.get(Ae)??0)-Math.abs(Q.get(Se)??0))[0],ve=R.indexOf(U);ve!==-1&&R.splice(ve,1);let ke=V.indexOf(U);ke!==-1&&V.splice(ke,1),ae.push(U)}let Z=0;for(let U of ae){if(Z===0)K(U,X.coord);else{let ve=Z%2===1?1:-1,ke=Math.ceil(Z/2);K(U,X.coord+ve*ke*ZN*.5)}Z++}let H=0;for(let U of V)H++,K(U,X.coord+H*ZN)}}for(let[X,re]of i.entries()){let te=y[X]??[];if(te.length===0)continue;let ie=[],ue=a.get(re.start),Q=a.get(re.end),{pSrcPort:R,pDstPort:V}=q(X,ue,Q),ae=te.map(Z=>{let H=m[Z],U=Pe.get(`${H.edgeIndex}-${H.segmentIndex}`)??H.pipe.coord;return{orient:H.orientation,coord:U,from:H.from,to:H.to}});ie.push(R);for(let Z=0;Z<ae.length;Z++){let H=ae[Z],U=ie[ie.length-1],ve=H.orient==="vertical"?U.y:U.x,ke=H.orient==="vertical"?U.x:U.y,Ae=ae[Z+1],Se=Z<ae.length-1;if(Math.abs(ke-H.coord)>Rr&&ie.push(rg(H,ve)),Se&&Ae.orient===H.orient)if(Math.abs(H.coord-Ae.coord)>Rr){let De=H.orient==="vertical"?(ve+Ae.from)/2:Tle(H,Ae);ie.push(rg(H,De),rg(Ae,De))}else(Z===0||Z===ae.length-2)&&ie.push(rg(H,Tle(H,Ae)));else if(Se)ie.push(rg(H,Ae.coord));else{let De=Math.abs(H.from-ve)<Math.abs(H.to-ve)?H.to:H.from;ie.push(rg(H,De))}}let K=ie[ie.length-1];(Math.abs(K.x-V.x)>Rr||Math.abs(K.y-V.y)>Rr)&&ie.push(V);let ye=[];ie.length>0&&ye.push(ie[0]);for(let Z=1;Z<ie.length;Z++){let H=ie[Z],U=ye[ye.length-1];(Math.abs(H.x-U.x)>Rr||Math.abs(H.y-U.y)>Rr)&&ye.push(H)}re.points=ye}for(let X of i){let re=X.__originalEdge;re&&X.points&&(re.points=X.points)}e.edges=(e.edges??[]).filter(X=>!X.isLayoutOnly);let Re=s((X,re)=>{let te=re.x??0,ie=re.y??0,ue=re.width??0,Q=re.height??0;if(ue<=0||Q<=0)return X;let R=te-ue/2,V=te+ue/2,ae=ie-Q/2,K=ie+Q/2;if(X.x<R||X.x>V||X.y<ae||X.y>K)return X;let ye=X.x-R,Z=V-X.x,H=X.y-ae,U=K-X.y,ve=Math.min(ye,Z,H,U);return ve===ye?{x:R,y:X.y}:ve===Z?{x:V,y:X.y}:ve===H?{x:X.x,y:ae}:{x:X.x,y:K}},"nodeBoundaryClamp");for(let X of e.edges){let re=X.points;if(!re||re.length<2)continue;let te=X.start,ie=X.end,ue=te?a.get(te):void 0,Q=ie?a.get(ie):void 0;ue&&(re[0]=Re(re[0],ue)),Q&&(re[re.length-1]=Re(re[re.length-1],Q))}return e}var Rr,rqe,Xd,tg,OS,Va,ZN,kle=_(()=>{"use strict";eg();Rr=Ooe.EPSILON,rqe=8,Xd=15,tg=15,OS=25,Va=20,ZN=10;s(ble,"chooseOrthogonalSide");s(Tle,"sharedLineEndpointCoord");s(rg,"pointOnLine");s(Cle,"routeEdgesOrthogonal")});function nqe(e){return e.direction??"TB"}function Sle(e){let t=Pae(e),r=e.config.flowchart?.nodeSpacing??40,n=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,l=nqe(e),{ordered:u,coordinates:h}=yle(t,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:l});Mae(t,u,h,{nodeGap:r,layerGap:n});for(let d of e.edges??[])delete d.points;Cle(e,l);for(let d of e.edges??[])(!d.curve||d.curve==="basis")&&(d.curve="rounded");return Ioe(e,l),WN(e),l}var vle=_(()=>{"use strict";Noe();RN();xle();kle();s(nqe,"getSwimlaneDirection");s(Sle,"runSwimlaneLayoutCore")});var Ele={};jt(Ele,{render:()=>sqe});function iqe(e){Nae(e);let t=Oae(e);e.nodes=t.nodes,e.edges=t.edges}var sqe,wle=_(()=>{"use strict";xS();Dae();RN();$ae();vle();s(iqe,"prepareSwimlaneLayout");sqe=Xm({prepareLayout:iqe,runLayoutCore:Sle,afterPaint:Lae})});var xx,JN,aqe,kl,uh,Qd=_(()=>{"use strict";WZ();ft();xx={},JN=s(e=>{for(let t of e)xx[t.name]=t},"registerLayoutLoaders"),aqe=s(()=>{JN([{name:"dagre",loader:s(async()=>await Promise.resolve().then(()=>(vae(),Sae)),"loader")},{name:"swimlane",loader:s(async()=>await Promise.resolve().then(()=>(wle(),Ele)),"loader")}])},"registerDefaultLayoutLoaders");aqe();kl=s(async(e,t)=>{if(!(e.layoutAlgorithm in xx))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let d of e.nodes){let f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}let r=xx[e.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:l,gradientStop:u}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i?.includes("dark")?"#FFFFFF":"#000000"}`),o){let d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return n.render(e,t,VZ,{algorithm:r.algorithm})},"render"),uh=s((e="",{fallback:t="dagre"}={})=>{if(e in xx)return e;if(t in xx)return Y.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm")});var Wa,oqe,lqe,Zd=_(()=>{"use strict";fn();ft();Wa=s((e,t,r,n)=>{e.attr("class",r);let{width:i,height:a,x:o,y:l}=oqe(e,t);Cr(e,a,i,n);let u=lqe(o,l,i,a,t);e.attr("viewBox",u),Y.debug(`viewBox configured: ${u} with padding: ${t}`)},"setupViewPortForSVG"),oqe=s((e,t)=>{let r=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:r.width+t*2,height:r.height+t*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),lqe=s((e,t,r,n,i)=>`${e-i} ${t-i} ${r} ${n}`,"createViewBox")});var cqe,uqe,_le,Ale=_(()=>{"use strict";Nt();ft();bm();Qd();Zd();Pt();cqe=s(function(e,t){return t.db.getClasses()},"getClasses"),uqe=s(async function(e,t,r,n){Y.info("REF0:"),Y.info("Drawing state diagram (v2)",t);let{securityLevel:i,flowchart:a,layout:o}=xe();n.db.setDiagramId(t),Y.debug("Before getData: ");let l=n.db.getData();Y.debug("Data: ",l);let u=ol(t,i),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=uh(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&Y.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=a?.nodeSpacing||50,l.rankSpacing=a?.rankSpacing||50,l.markers=["point","circle","cross"],l.diagramId=t,Y.debug("REF1:",l),await kl(l,u);let d=l.config.flowchart?.diagramPadding??8;Bt.insertTitle(u,"flowchartTitleText",a?.titleTopMargin||0,n.db.getDiagramTitle()),Wa(u,d,"flowchart",a?.useMaxWidth||!1)},"draw"),_le={getClasses:cqe,draw:uqe}});var eP,tP,Rle=_(()=>{"use strict";eP=(function(){var e=s(function(dr,kt,Rt,Dt){for(Rt=Rt||{},Dt=dr.length;Dt--;Rt[dr[Dt]]=kt);return Rt},"o"),t=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],o=[1,13],l=[1,14],u=[1,15],h=[1,16],d=[1,23],f=[1,25],p=[1,26],g=[1,27],m=[1,50],y=[1,49],x=[1,29],T=[1,30],C=[1,31],k=[1,32],E=[1,33],v=[1,45],S=[1,47],w=[1,43],L=[1,48],O=[1,44],F=[1,51],N=[1,46],G=[1,52],A=[1,53],M=[1,34],I=[1,35],P=[1,36],B=[1,37],D=[1,38],$=[1,58],W=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],q=[1,62],z=[1,61],j=[1,63],J=[8,9,11,75,77,78],ee=[1,79],le=[1,92],se=[1,97],Ce=[1,96],ce=[1,93],_e=[1,89],me=[1,95],ge=[1,91],Be=[1,98],$e=[1,94],Ie=[1,99],nt=[1,90],lt=[8,9,10,11,40,75,77,78],Te=[8,9,10,11,40,46,75,77,78],Ne=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Pe=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Re=[44,60,89,102,105,106,109,111,114,115,116],X=[1,122],re=[1,123],te=[1,125],ie=[1,124],ue=[44,60,62,74,89,102,105,106,109,111,114,115,116],Q=[1,134],R=[1,148],V=[1,149],ae=[1,150],K=[1,151],ye=[1,136],Z=[1,138],H=[1,142],U=[1,143],ve=[1,144],ke=[1,145],Ae=[1,146],Se=[1,147],De=[1,152],Le=[1,153],Fe=[1,132],Ee=[1,133],tt=[1,140],de=[1,135],bt=[1,139],we=[1,137],vt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Ot=[1,155],Ar=[1,157],xt=[8,9,11],$t=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Et=[1,177],oe=[1,173],ut=[1,174],yt=[1,178],Ue=[1,175],fe=[1,176],Qe=[77,116,119],Ye=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],ct=[10,106],Jt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],St=[1,248],Kt=[1,246],kr=[1,250],Yt=[1,244],wt=[1,245],Vt=[1,247],We=[1,249],rt=[1,251],pt=[1,269],nr=[8,9,11,106],Wt=[8,9,10,11,60,84,105,106,109,110,111,112],Or={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:s(function(kt,Rt,Dt,ht,Xt,he,Fr){var be=he.length-1;switch(Xt){case 2:this.$=[];break;case 3:(!Array.isArray(he[be])||he[be].length>0)&&he[be-1].push(he[be]),this.$=he[be-1];break;case 4:case 183:this.$=he[be];break;case 11:ht.setDirection("TB"),this.$="TB";break;case 12:ht.setDirection(he[be-1]),this.$=he[be-1];break;case 27:this.$=he[be-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=ht.addSubGraph(he[be-6],he[be-1],he[be-4]);break;case 34:this.$=ht.addSubGraph(he[be-3],he[be-1],he[be-3]);break;case 35:this.$=ht.addSubGraph(void 0,he[be-1],void 0);break;case 37:this.$=he[be].trim(),ht.setAccTitle(this.$);break;case 38:case 39:this.$=he[be].trim(),ht.setAccDescription(this.$);break;case 43:this.$=he[be-1]+he[be];break;case 44:this.$=he[be];break;case 45:ht.addVertex(he[be-1][he[be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,he[be]),ht.addLink(he[be-3].stmt,he[be-1],he[be-2]),this.$={stmt:he[be-1],nodes:he[be-1].concat(he[be-3].nodes)};break;case 46:ht.addLink(he[be-2].stmt,he[be],he[be-1]),this.$={stmt:he[be],nodes:he[be].concat(he[be-2].nodes)};break;case 47:ht.addLink(he[be-3].stmt,he[be-1],he[be-2]),this.$={stmt:he[be-1],nodes:he[be-1].concat(he[be-3].nodes)};break;case 48:this.$={stmt:he[be-1],nodes:he[be-1]};break;case 49:ht.addVertex(he[be-1][he[be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,he[be]),this.$={stmt:he[be-1],nodes:he[be-1],shapeData:he[be]};break;case 50:this.$={stmt:he[be],nodes:he[be]};break;case 51:this.$=[he[be]];break;case 52:ht.addVertex(he[be-5][he[be-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,he[be-4]),this.$=he[be-5].concat(he[be]);break;case 53:this.$=he[be-4].concat(he[be]);break;case 54:this.$=he[be];break;case 55:this.$=he[be-2],ht.setClass(he[be-2],he[be]);break;case 56:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"square");break;case 57:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"doublecircle");break;case 58:this.$=he[be-5],ht.addVertex(he[be-5],he[be-2],"circle");break;case 59:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"ellipse");break;case 60:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"stadium");break;case 61:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"subroutine");break;case 62:this.$=he[be-7],ht.addVertex(he[be-7],he[be-1],"rect",void 0,void 0,void 0,Object.fromEntries([[he[be-5],he[be-3]]]));break;case 63:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"cylinder");break;case 64:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"round");break;case 65:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"diamond");break;case 66:this.$=he[be-5],ht.addVertex(he[be-5],he[be-2],"hexagon");break;case 67:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"odd");break;case 68:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"trapezoid");break;case 69:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"inv_trapezoid");break;case 70:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"lean_right");break;case 71:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"lean_left");break;case 72:this.$=he[be],ht.addVertex(he[be]);break;case 73:he[be-1].text=he[be],this.$=he[be-1];break;case 74:case 75:he[be-2].text=he[be-1],this.$=he[be-2];break;case 76:this.$=he[be];break;case 77:var ur=ht.destructLink(he[be],he[be-2]);this.$={type:ur.type,stroke:ur.stroke,length:ur.length,text:he[be-1]};break;case 78:var ur=ht.destructLink(he[be],he[be-2]);this.$={type:ur.type,stroke:ur.stroke,length:ur.length,text:he[be-1],id:he[be-3]};break;case 79:this.$={text:he[be],type:"text"};break;case 80:this.$={text:he[be-1].text+""+he[be],type:he[be-1].type};break;case 81:this.$={text:he[be],type:"string"};break;case 82:this.$={text:he[be],type:"markdown"};break;case 83:var ur=ht.destructLink(he[be]);this.$={type:ur.type,stroke:ur.stroke,length:ur.length};break;case 84:var ur=ht.destructLink(he[be]);this.$={type:ur.type,stroke:ur.stroke,length:ur.length,id:he[be-1]};break;case 85:this.$=he[be-1];break;case 86:this.$={text:he[be],type:"text"};break;case 87:this.$={text:he[be-1].text+""+he[be],type:he[be-1].type};break;case 88:this.$={text:he[be],type:"string"};break;case 89:case 104:this.$={text:he[be],type:"markdown"};break;case 101:this.$={text:he[be],type:"text"};break;case 102:this.$={text:he[be-1].text+""+he[be],type:he[be-1].type};break;case 103:this.$={text:he[be],type:"text"};break;case 105:this.$=he[be-4],ht.addClass(he[be-2],he[be]);break;case 106:this.$=he[be-4],ht.setClass(he[be-2],he[be]);break;case 107:case 115:this.$=he[be-1],ht.setClickEvent(he[be-1],he[be]);break;case 108:case 116:this.$=he[be-3],ht.setClickEvent(he[be-3],he[be-2]),ht.setTooltip(he[be-3],he[be]);break;case 109:this.$=he[be-2],ht.setClickEvent(he[be-2],he[be-1],he[be]);break;case 110:this.$=he[be-4],ht.setClickEvent(he[be-4],he[be-3],he[be-2]),ht.setTooltip(he[be-4],he[be]);break;case 111:this.$=he[be-2],ht.setLink(he[be-2],he[be]);break;case 112:this.$=he[be-4],ht.setLink(he[be-4],he[be-2]),ht.setTooltip(he[be-4],he[be]);break;case 113:this.$=he[be-4],ht.setLink(he[be-4],he[be-2],he[be]);break;case 114:this.$=he[be-6],ht.setLink(he[be-6],he[be-4],he[be]),ht.setTooltip(he[be-6],he[be-2]);break;case 117:this.$=he[be-1],ht.setLink(he[be-1],he[be]);break;case 118:this.$=he[be-3],ht.setLink(he[be-3],he[be-2]),ht.setTooltip(he[be-3],he[be]);break;case 119:this.$=he[be-3],ht.setLink(he[be-3],he[be-2],he[be]);break;case 120:this.$=he[be-5],ht.setLink(he[be-5],he[be-4],he[be]),ht.setTooltip(he[be-5],he[be-2]);break;case 121:this.$=he[be-4],ht.addVertex(he[be-2],void 0,void 0,he[be]);break;case 122:this.$=he[be-4],ht.updateLink([he[be-2]],he[be]);break;case 123:this.$=he[be-4],ht.updateLink(he[be-2],he[be]);break;case 124:this.$=he[be-8],ht.updateLinkInterpolate([he[be-6]],he[be-2]),ht.updateLink([he[be-6]],he[be]);break;case 125:this.$=he[be-8],ht.updateLinkInterpolate(he[be-6],he[be-2]),ht.updateLink(he[be-6],he[be]);break;case 126:this.$=he[be-6],ht.updateLinkInterpolate([he[be-4]],he[be]);break;case 127:this.$=he[be-6],ht.updateLinkInterpolate(he[be-4],he[be]);break;case 128:case 130:this.$=[he[be]];break;case 129:case 131:he[be-2].push(he[be]),this.$=he[be-2];break;case 133:this.$=he[be-1]+he[be];break;case 181:this.$=he[be];break;case 182:this.$=he[be-1]+""+he[be];break;case 184:this.$=he[be-1]+""+he[be];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:t,10:r,12:n},{1:[3]},e(i,a,{5:6}),{4:7,9:t,10:r,12:n},{4:8,9:t,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:o,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:f,36:p,38:g,42:28,43:39,44:m,45:40,47:41,60:y,84:x,85:T,86:C,87:k,88:E,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A,121:M,122:I,123:P,124:B,125:D},e(i,[2,9]),e(i,[2,10]),e(i,[2,11]),{8:[1,55],9:[1,56],10:$,15:54,18:57},e(W,[2,3]),e(W,[2,4]),e(W,[2,5]),e(W,[2,6]),e(W,[2,7]),e(W,[2,8]),{8:q,9:z,11:j,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:q,9:z,11:j,21:68},{8:q,9:z,11:j,21:69},{8:q,9:z,11:j,21:70},{8:q,9:z,11:j,21:71},{8:q,9:z,11:j,21:72},{8:q,9:z,10:[1,73],11:j,21:74},e(W,[2,36]),{35:[1,75]},{37:[1,76]},e(W,[2,39]),e(J,[2,50],{18:77,39:78,10:$,40:ee}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:le,44:se,60:Ce,80:[1,87],89:ce,95:[1,84],97:[1,85],101:86,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt,120:88},e(W,[2,185]),e(W,[2,186]),e(W,[2,187]),e(W,[2,188]),e(W,[2,189]),e(lt,[2,51]),e(lt,[2,54],{46:[1,100]}),e(Te,[2,72],{113:113,29:[1,101],44:m,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:y,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:v,102:S,105:w,106:L,109:O,111:F,114:N,115:G,116:A}),e(Ne,[2,181]),e(Ne,[2,142]),e(Ne,[2,143]),e(Ne,[2,144]),e(Ne,[2,145]),e(Ne,[2,146]),e(Ne,[2,147]),e(Ne,[2,148]),e(Ne,[2,149]),e(Ne,[2,150]),e(Ne,[2,151]),e(Ne,[2,152]),e(i,[2,12]),e(i,[2,18]),e(i,[2,19]),{9:[1,114]},e(Pe,[2,26],{18:115,10:$}),e(W,[2,27]),{42:116,43:39,44:m,45:40,47:41,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},e(W,[2,40]),e(W,[2,41]),e(W,[2,42]),e(Re,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:X,81:re,116:te,119:ie},{75:[1,126],77:[1,127]},e(ue,[2,83]),e(W,[2,28]),e(W,[2,29]),e(W,[2,30]),e(W,[2,31]),e(W,[2,32]),{10:Q,12:R,14:V,27:ae,28:128,32:K,44:ye,60:Z,75:H,80:[1,130],81:[1,131],83:141,84:U,85:ve,86:ke,87:Ae,88:Se,89:De,90:Le,91:129,105:Fe,109:Ee,111:tt,114:de,115:bt,116:we},e(vt,a,{5:154}),e(W,[2,37]),e(W,[2,38]),e(J,[2,48],{44:Ot}),e(J,[2,49],{18:156,10:$,40:Ar}),e(lt,[2,44]),{44:m,47:158,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},{102:[1,159],103:160,105:[1,161]},{44:m,47:162,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},{44:m,47:163,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},e(xt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(xt,[2,115],{120:168,10:[1,167],14:le,44:se,60:Ce,89:ce,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt}),e(xt,[2,117],{10:[1,169]}),e($t,[2,183]),e($t,[2,170]),e($t,[2,171]),e($t,[2,172]),e($t,[2,173]),e($t,[2,174]),e($t,[2,175]),e($t,[2,176]),e($t,[2,177]),e($t,[2,178]),e($t,[2,179]),e($t,[2,180]),{44:m,47:170,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},{30:171,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:179,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:181,50:[1,180],67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:182,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:183,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:184,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{109:[1,185]},{30:186,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:187,65:[1,188],67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:189,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:190,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:191,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},e(Ne,[2,182]),e(i,[2,20]),e(Pe,[2,25]),e(J,[2,46],{39:192,18:193,10:$,40:ee}),e(Re,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{77:[1,197],79:198,116:te,119:ie},e(Qe,[2,79]),e(Qe,[2,81]),e(Qe,[2,82]),e(Qe,[2,168]),e(Qe,[2,169]),{76:199,79:121,80:X,81:re,116:te,119:ie},e(ue,[2,84]),{8:q,9:z,10:Q,11:j,12:R,14:V,21:201,27:ae,29:[1,200],32:K,44:ye,60:Z,75:H,83:141,84:U,85:ve,86:ke,87:Ae,88:Se,89:De,90:Le,91:202,105:Fe,109:Ee,111:tt,114:de,115:bt,116:we},e(Ye,[2,101]),e(Ye,[2,103]),e(Ye,[2,104]),e(Ye,[2,157]),e(Ye,[2,158]),e(Ye,[2,159]),e(Ye,[2,160]),e(Ye,[2,161]),e(Ye,[2,162]),e(Ye,[2,163]),e(Ye,[2,164]),e(Ye,[2,165]),e(Ye,[2,166]),e(Ye,[2,167]),e(Ye,[2,90]),e(Ye,[2,91]),e(Ye,[2,92]),e(Ye,[2,93]),e(Ye,[2,94]),e(Ye,[2,95]),e(Ye,[2,96]),e(Ye,[2,97]),e(Ye,[2,98]),e(Ye,[2,99]),e(Ye,[2,100]),{6:11,7:12,8:o,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:f,36:p,38:g,42:28,43:39,44:m,45:40,47:41,60:y,84:x,85:T,86:C,87:k,88:E,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A,121:M,122:I,123:P,124:B,125:D},{10:$,18:204},{44:[1,205]},e(lt,[2,43]),{10:[1,206],44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:113,114:N,115:G,116:A},{10:[1,207]},{10:[1,208],106:[1,209]},e(ct,[2,128]),{10:[1,210],44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:113,114:N,115:G,116:A},{10:[1,211],44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:113,114:N,115:G,116:A},{80:[1,212]},e(xt,[2,109],{10:[1,213]}),e(xt,[2,111],{10:[1,214]}),{80:[1,215]},e($t,[2,184]),{80:[1,216],98:[1,217]},e(lt,[2,55],{113:113,44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,114:N,115:G,116:A}),{31:[1,218],67:Et,82:219,116:yt,117:Ue,118:fe},e(Jt,[2,86]),e(Jt,[2,88]),e(Jt,[2,89]),e(Jt,[2,153]),e(Jt,[2,154]),e(Jt,[2,155]),e(Jt,[2,156]),{49:[1,220],67:Et,82:219,116:yt,117:Ue,118:fe},{30:221,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{51:[1,222],67:Et,82:219,116:yt,117:Ue,118:fe},{53:[1,223],67:Et,82:219,116:yt,117:Ue,118:fe},{55:[1,224],67:Et,82:219,116:yt,117:Ue,118:fe},{57:[1,225],67:Et,82:219,116:yt,117:Ue,118:fe},{60:[1,226]},{64:[1,227],67:Et,82:219,116:yt,117:Ue,118:fe},{66:[1,228],67:Et,82:219,116:yt,117:Ue,118:fe},{30:229,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{31:[1,230],67:Et,82:219,116:yt,117:Ue,118:fe},{67:Et,69:[1,231],71:[1,232],82:219,116:yt,117:Ue,118:fe},{67:Et,69:[1,234],71:[1,233],82:219,116:yt,117:Ue,118:fe},e(J,[2,45],{18:156,10:$,40:Ar}),e(J,[2,47],{44:Ot}),e(Re,[2,75]),e(Re,[2,74]),{62:[1,235],67:Et,82:219,116:yt,117:Ue,118:fe},e(Re,[2,77]),e(Qe,[2,80]),{77:[1,236],79:198,116:te,119:ie},{30:237,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},e(vt,a,{5:238}),e(Ye,[2,102]),e(W,[2,35]),{43:239,44:m,45:40,47:41,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},{10:$,18:240},{10:St,60:Kt,84:kr,92:241,105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{10:St,60:Kt,84:kr,92:252,104:[1,253],105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{10:St,60:Kt,84:kr,92:254,104:[1,255],105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{105:[1,256]},{10:St,60:Kt,84:kr,92:257,105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{44:m,47:258,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},e(xt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(xt,[2,116]),e(xt,[2,118],{10:[1,262]}),e(xt,[2,119]),e(Te,[2,56]),e(Jt,[2,87]),e(Te,[2,57]),{51:[1,263],67:Et,82:219,116:yt,117:Ue,118:fe},e(Te,[2,64]),e(Te,[2,59]),e(Te,[2,60]),e(Te,[2,61]),{109:[1,264]},e(Te,[2,63]),e(Te,[2,65]),{66:[1,265],67:Et,82:219,116:yt,117:Ue,118:fe},e(Te,[2,67]),e(Te,[2,68]),e(Te,[2,70]),e(Te,[2,69]),e(Te,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Re,[2,78]),{31:[1,266],67:Et,82:219,116:yt,117:Ue,118:fe},{6:11,7:12,8:o,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:f,36:p,38:g,42:28,43:39,44:m,45:40,47:41,60:y,84:x,85:T,86:C,87:k,88:E,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A,121:M,122:I,123:P,124:B,125:D},e(lt,[2,53]),{43:268,44:m,45:40,47:41,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},e(xt,[2,121],{106:pt}),e(nr,[2,130],{108:270,10:St,60:Kt,84:kr,105:Yt,109:wt,110:Vt,111:We,112:rt}),e(Wt,[2,132]),e(Wt,[2,134]),e(Wt,[2,135]),e(Wt,[2,136]),e(Wt,[2,137]),e(Wt,[2,138]),e(Wt,[2,139]),e(Wt,[2,140]),e(Wt,[2,141]),e(xt,[2,122],{106:pt}),{10:[1,271]},e(xt,[2,123],{106:pt}),{10:[1,272]},e(ct,[2,129]),e(xt,[2,105],{106:pt}),e(xt,[2,106],{113:113,44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,114:N,115:G,116:A}),e(xt,[2,110]),e(xt,[2,112],{10:[1,273]}),e(xt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:q,9:z,11:j,21:278},e(W,[2,34]),e(lt,[2,52]),{10:St,60:Kt,84:kr,105:Yt,107:279,108:243,109:wt,110:Vt,111:We,112:rt},e(Wt,[2,133]),{14:le,44:se,60:Ce,89:ce,101:280,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt,120:88},{14:le,44:se,60:Ce,89:ce,101:281,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt,120:88},{98:[1,282]},e(xt,[2,120]),e(Te,[2,58]),{30:283,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},e(Te,[2,66]),e(vt,a,{5:284}),e(nr,[2,131],{108:270,10:St,60:Kt,84:kr,105:Yt,109:wt,110:Vt,111:We,112:rt}),e(xt,[2,126],{120:168,10:[1,285],14:le,44:se,60:Ce,89:ce,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt}),e(xt,[2,127],{120:168,10:[1,286],14:le,44:se,60:Ce,89:ce,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt}),e(xt,[2,114]),{31:[1,287],67:Et,82:219,116:yt,117:Ue,118:fe},{6:11,7:12,8:o,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:f,36:p,38:g,42:28,43:39,44:m,45:40,47:41,60:y,84:x,85:T,86:C,87:k,88:E,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A,121:M,122:I,123:P,124:B,125:D},{10:St,60:Kt,84:kr,92:289,105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{10:St,60:Kt,84:kr,92:290,105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},e(Te,[2,62]),e(W,[2,33]),e(xt,[2,124],{106:pt}),e(xt,[2,125],{106:pt})],defaultActions:{},parseError:s(function(kt,Rt){if(Rt.recoverable)this.trace(kt);else{var Dt=new Error(kt);throw Dt.hash=Rt,Dt}},"parseError"),parse:s(function(kt){var Rt=this,Dt=[0],ht=[],Xt=[null],he=[],Fr=this.table,be="",ur=0,ei=0,_a=0,iu=2,Hl=1,wp=he.slice.call(arguments,1),Nn=Object.create(this.lexer),na={yy:{}};for(var Go in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Go)&&(na.yy[Go]=this.yy[Go]);Nn.setInput(kt,na.yy),na.yy.lexer=Nn,na.yy.parser=this,typeof Nn.yylloc>"u"&&(Nn.yylloc={});var Aa=Nn.yylloc;he.push(Aa);var gt=Nn.options&&Nn.options.ranges;typeof na.yy.parseError=="function"?this.parseError=na.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(ia){Dt.length=Dt.length-2*ia,Xt.length=Xt.length-ia,he.length=he.length-ia}s(pe,"popStack");function qe(){var ia;return ia=ht.pop()||Nn.lex()||Hl,typeof ia!="number"&&(ia instanceof Array&&(ht=ia,ia=ht.pop()),ia=Rt.symbols_[ia]||ia),ia}s(qe,"lex");for(var at,It,qt,zt,Pn,ti,Ti={},hi,Yn,Ci,bT;;){if(qt=Dt[Dt.length-1],this.defaultActions[qt]?zt=this.defaultActions[qt]:((at===null||typeof at>"u")&&(at=qe()),zt=Fr[qt]&&Fr[qt][at]),typeof zt>"u"||!zt.length||!zt[0]){var LA="";bT=[];for(hi in Fr[qt])this.terminals_[hi]&&hi>iu&&bT.push("'"+this.terminals_[hi]+"'");Nn.showPosition?LA="Parse error on line "+(ur+1)+`:
@@ -419,7 +419,7 @@ Expecting `+bT.join(", ")+", got '"+(this.terminals_[at]||at)+"'":LA="Parse erro
419
419
  fill: ${e.arrowheadColor};
420
420
  }
421
421
 
422
- .edgePath .path {
422
+ .edgePaths .path {
423
423
  stroke: ${e.lineColor};
424
424
  stroke-width: ${e.strokeWidth??2}px;
425
425
  }
@@ -1182,7 +1182,7 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[Ie]||Ie)+"'":ue="Parse erro
1182
1182
  fill: ${e.titleColor||e.textColor};
1183
1183
  font-family: ${e.fontFamily};
1184
1184
  }
1185
- `,"getStyles"),j2e=Hst});var U2e={};jt(U2e,{diagram:()=>Ust});var Ust,Y2e=_(()=>{"use strict";x2e();F2e();q2e();H2e();Ust={parser:y2e,db:$2e,renderer:W2e,styles:j2e}});var Q2e,Z2e=_(()=>{"use strict";os();ft();Q2e={parse:s(async e=>{let t=await Jn("info",e);Y.debug(t)},"parse")}});var Qst,Zst,J2e,eCe=_(()=>{"use strict";Qst={version:"11.17.1-tiny"},Zst=s(()=>Qst.version,"getVersion"),J2e={getVersion:Zst}});var nn,ls=_(()=>{"use strict";Sr();Nt();nn=s(e=>{let{securityLevel:t}=xe(),r=et("body");if(t==="sandbox"){let a=et(`#i${e}`).node()?.contentDocument??document;r=et(a.body)}return r.select(`#${e}`)},"selectSvgElement")});var Jst,tCe,rCe=_(()=>{"use strict";ft();ls();fn();Jst=s((e,t,r)=>{Y.debug(`rendering info diagram
1185
+ `,"getStyles"),j2e=Hst});var U2e={};jt(U2e,{diagram:()=>Ust});var Ust,Y2e=_(()=>{"use strict";x2e();F2e();q2e();H2e();Ust={parser:y2e,db:$2e,renderer:W2e,styles:j2e}});var Q2e,Z2e=_(()=>{"use strict";os();ft();Q2e={parse:s(async e=>{let t=await Jn("info",e);Y.debug(t)},"parse")}});var Qst,Zst,J2e,eCe=_(()=>{"use strict";Qst={version:"11.17.2-tiny"},Zst=s(()=>Qst.version,"getVersion"),J2e={getVersion:Zst}});var nn,ls=_(()=>{"use strict";Sr();Nt();nn=s(e=>{let{securityLevel:t}=xe(),r=et("body");if(t==="sandbox"){let a=et(`#i${e}`).node()?.contentDocument??document;r=et(a.body)}return r.select(`#${e}`)},"selectSvgElement")});var Jst,tCe,rCe=_(()=>{"use strict";ft();ls();fn();Jst=s((e,t,r)=>{Y.debug(`rendering info diagram
1186
1186
  `+e);let n=nn(t);Cr(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),tCe={draw:Jst}});var nCe={};jt(nCe,{diagram:()=>eat});var eat,iCe=_(()=>{"use strict";Z2e();eCe();rCe();eat={parser:Q2e,db:J2e,renderer:tCe}});var oCe,Y8,y_,K8,nat,iat,sat,aat,oat,lat,cat,x_,X8=_(()=>{"use strict";ft();un();Vi();oCe=ar.pie,Y8={sections:new Map,showData:!1,config:oCe},y_=Y8.sections,K8=Y8.showData,nat=structuredClone(oCe),iat=s(()=>structuredClone(nat),"getConfig"),sat=s(()=>{y_=new Map,K8=Y8.showData,er()},"clear"),aat=s(({label:e,value:t})=>{if(t<0)throw new Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);y_.has(e)||(y_.set(e,t),Y.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),oat=s(()=>y_,"getSections"),lat=s(e=>{K8=e},"setShowData"),cat=s(()=>K8,"getShowData"),x_={getConfig:iat,clear:sat,setDiagramTitle:xr,getDiagramTitle:yr,setAccTitle:hr,getAccTitle:pr,setAccDescription:mr,getAccDescription:gr,addSection:aat,getSections:oat,setShowData:lat,getShowData:cat}});var uat,lCe,cCe=_(()=>{"use strict";os();ft();Qs();X8();uat=s((e,t)=>{kn(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),lCe={parse:s(async e=>{let t=await Jn("pie",e);Y.debug(t),uat(t,x_)},"parse")}});var hat,uCe,hCe=_(()=>{"use strict";hat=s(e=>`
1187
1187
  .pieCircle{
1188
1188
  stroke: ${e.pieStrokeColor};
@@ -1967,7 +1967,7 @@ Expecting `+se.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ce="Parse error
1967
1967
  fill: ${e.arrowheadColor};
1968
1968
  }
1969
1969
 
1970
- .edgePath .path {
1970
+ .edgePaths .path {
1971
1971
  stroke: ${e.lineColor};
1972
1972
  stroke-width: 1.5px;
1973
1973
  }
@@ -2412,7 +2412,7 @@ Expecting `+Ie.join(", ")+", got '"+(this.terminals_[ee]||ee)+"'":nt="Parse erro
2412
2412
  fill: ${e.arrowheadColor};
2413
2413
  }
2414
2414
 
2415
- .edgePath .path {
2415
+ .edgePaths .path {
2416
2416
  stroke: ${e.lineColor};
2417
2417
  stroke-width: 2.0px;
2418
2418
  }
@@ -2877,7 +2877,7 @@ A`,o,o,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}functio
2877
2877
  `}else n+=`${e.themeCSS}
2878
2878
  `;return n+SR(r)},"createCssStyles"),Pgt=s((e,t)=>AA($Re(`${e}{${t}}`),FRe([s(function(n,i,a,o){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===gT)return;n.props=n.props.map(l=>l===e&&Array.isArray(n.children)&&n.children.every(h=>h.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(h.props))||(l.startsWith(`${e} `)||l.startsWith(`${e}>`))&&!l.startsWith(`${e} ||`)?l:`${e} ${l}`)}else n.type.startsWith("@")&&([...[TRe,kRe,TA,vRe,"@container","@starting-style"],gT].includes(n.type)||(Y.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=Py))},"addNamespace"),BRe])),"compileCSS"),Mgt=s((e,t,r,n)=>{let i=Ngt(e,r),a=Cz(t,i,{...e.themeVariables,theme:e.theme,look:e.look},n);return Pgt(n,a)},"createUserStyles"),Ogt=s((e="",t,r)=>{let n=e;return!r&&!t&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Ps(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),$gt=s((e="",t)=>{let r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":Egt,n=HRe(`<body style="${_gt}">${e}</body>`);return`<iframe style="width:${vgt};height:${r};${wgt}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${Agt}">
2879
2879
  ${Rgt}
2880
- </iframe>`},"putIntoIFrame"),YRe=s((e,t,r,n,i)=>{let a=e.append("div");a.attr("id",r),n&&a.attr("style",n);let o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",Cgt);return i&&o.attr("xmlns:xlink",i),o.append("g"),e},"appendDivSvgG");function KRe(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}s(KRe,"sandboxedIframe");var Bgt=s((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),Fgt=s(async function(e,t,r){Ny();let n=XRe(t);t=n.code;let i=mt();Y.debug(i),t.length>(i?.maxTextSize??ygt)&&(t=xgt);let a=`#${e}`,o="i"+e,l="#"+o,u="d"+e,h="#"+u,d=s(()=>{let M=et(p?l:h).node();M&&"remove"in M&&M.remove()},"removeTempElements"),f=et(document.body),p=i.securityLevel===bgt,g=i.securityLevel===Tgt,m=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),p){let A=KRe(et(r),o);f=et(A.nodes()[0].contentDocument.body),f.node().style.margin="0"}else f=et(r);YRe(f,e,u,`font-family: ${m}`,kgt)}else{if(Bgt(document,e,u,o),p){let A=KRe(et(document.body),o);f=et(A.nodes()[0].contentDocument.body),f.node().style.margin="0"}else f=et("body");YRe(f,e,u)}let y,x;try{y=await Gy.fromText(t,{title:n.title})}catch(A){if(i.suppressErrorRendering)throw d(),A;y=await Gy.fromText("error"),x=A}let T=f.select(h).node(),C=y.type,k=T.firstChild,E=k.firstChild,v=y.renderer.getClasses?.(t,y),S=Mgt(i,C,v,a),w=document.createElement("style");w.innerHTML=S,k.insertBefore(w,E);try{await y.renderer.draw(t,e,"11.17.1",y)}catch(A){throw i.suppressErrorRendering?d():USe.draw(t,e,"11.17.1"),A}let L=f.select(`${h} svg`),O=y.db.getAccTitle?.(),F=y.db.getAccDescription?.();zgt(C,L,O,F);let G=s(()=>{f.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",Sgt);let A=f.select(h).node().innerHTML;if(Y.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),A=Ogt(A,p,Ei(i.arrowMarkerAbsolute)),p){let M=f.select(h+" svg").node();A=$gt(A,M)}else g||(A=Ds.sanitize(A,{ADD_TAGS:Lgt,ADD_ATTR:Dgt,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return WRe(),A},"serializeSvg")();if(x)throw x;return d(),{diagramType:C,svg:G,bindFunctions:y.db.bindFunctions}},"render");function Ggt(e={}){let t=Sn({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),zG(t),t?.theme&&t.theme in Da?t.themeVariables=Da[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Da.default.getThemeVariables(t.themeVariables));let r=typeof t=="object"?oR(t):lR();Vy(r.logLevel),Ny()}s(Ggt,"initialize");var QRe=s((e,t={})=>{let{code:r}=b9(e);return Gy.fromText(r,t)},"getDiagramFromText");function zgt(e,t,r,n){GRe(t,e),zRe(t,r,n,t.attr("id"))}s(zgt,"addA11yInfo");var Hh=Object.freeze({render:Fgt,parse:Igt,getDiagramFromText:QRe,initialize:Ggt,getConfig:mt,setConfig:IT,getSiteConfig:lR,updateSiteConfig:VG,reset:s(()=>{Ky()},"reset"),globalReset:s(()=>{Ky(au)},"globalReset"),defaultConfig:au});Vy(mt().logLevel);Ky(mt());Qd();Pt();xS();var Vgt=s((e,t,r)=>{Y.warn(e),C4(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),ZRe=s(async function(e={querySelector:".mermaid"}){try{await Wgt(e)}catch(t){if(C4(t)&&Y.error(t.str),nu.parseError&&nu.parseError(t),!e.suppressErrors)throw Y.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Wgt=s(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){let n=Hh.getConfig();Y.debug(`${e?"":"No "}Callback function found`);let i;if(r)i=r;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");Y.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(Y.debug("Start On Load: "+n?.startOnLoad),Hh.updateSiteConfig({startOnLoad:n?.startOnLoad}));let a=new Bt.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed),o,l=[];for(let u of Array.from(i)){Y.info("Rendering diagram: "+u.id);if(u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");let h=`mermaid-${a.next()}`;o=u.innerHTML,o=MT(Bt.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");let d=Bt.detectInit(o);d&&Y.debug("Detected early reinit: ",d);try{let{svg:f,bindFunctions:p}=await r3e(h,o,u);u.innerHTML=f,e&&await e(h),p&&p(u)}catch(f){Vgt(f,l,nu.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),JRe=s(function(e){Hh.initialize(e)},"initialize"),qgt=s(async function(e,t,r){Y.warn("mermaid.init is deprecated. Please use run instead."),e&&JRe(e);let n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await ZRe(n)},"init"),jgt=s(async(e,{lazyLoad:t=!0}={})=>{Ny(),BT(...e),t===!1&&await bRe()},"registerExternalDiagrams"),e3e=s(function(){if(nu.startOnLoad){let{startOnLoad:e}=Hh.getConfig();e&&nu.run().catch(t=>Y.error("Mermaid failed to initialize",t))}},"contentLoaded");if(typeof document<"u"){window.addEventListener("load",e3e,!1)}var Hgt=s(function(e){nu.parseError=e},"setParseErrorHandler"),RA=[],T9=!1,t3e=s(async()=>{if(!T9){for(T9=!0;RA.length>0;){let e=RA.shift();if(e)try{await e()}catch(t){Y.error("Error executing queue",t)}}T9=!1}},"executeQueue"),Ugt=s(async(e,t)=>new Promise((r,n)=>{let i=s(()=>new Promise((a,o)=>{Hh.parse(e,t).then(l=>{a(l),r(l)},l=>{Y.error("Error parsing",l),nu.parseError?.(l),o(l),n(l)})}),"performCall");RA.push(i),t3e().catch(n)}),"parse"),r3e=s((e,t,r)=>new Promise((n,i)=>{let a=s(()=>new Promise((o,l)=>{Hh.render(e,t,r).then(u=>{o(u),n(u)},u=>{Y.error("Error parsing",u),nu.parseError?.(u),l(u),i(u)})}),"performCall");RA.push(a),t3e().catch(i)}),"render"),Ygt=s(()=>Object.keys(Zl).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),nu={startOnLoad:!0,mermaidAPI:Hh,parse:Ugt,render:r3e,init:qgt,run:ZRe,registerExternalDiagrams:jgt,registerLayoutLoaders:JN,initialize:JRe,parseError:void 0,contentLoaded:e3e,setParseErrorHandler:Hgt,detectType:Bp,registerIconPacks:PT,getRegisteredDiagramsMetadata:Ygt},Kgt=nu;return l3e(Xgt);})();
2880
+ </iframe>`},"putIntoIFrame"),YRe=s((e,t,r,n,i)=>{let a=e.append("div");a.attr("id",r),n&&a.attr("style",n);let o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",Cgt);return i&&o.attr("xmlns:xlink",i),o.append("g"),e},"appendDivSvgG");function KRe(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}s(KRe,"sandboxedIframe");var Bgt=s((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),Fgt=s(async function(e,t,r){Ny();let n=XRe(t);t=n.code;let i=mt();Y.debug(i),t.length>(i?.maxTextSize??ygt)&&(t=xgt);let a=`#${e}`,o="i"+e,l="#"+o,u="d"+e,h="#"+u,d=s(()=>{let M=et(p?l:h).node();M&&"remove"in M&&M.remove()},"removeTempElements"),f=et(document.body),p=i.securityLevel===bgt,g=i.securityLevel===Tgt,m=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),p){let A=KRe(et(r),o);f=et(A.nodes()[0].contentDocument.body),f.node().style.margin="0"}else f=et(r);YRe(f,e,u,`font-family: ${m}`,kgt)}else{if(Bgt(document,e,u,o),p){let A=KRe(et(document.body),o);f=et(A.nodes()[0].contentDocument.body),f.node().style.margin="0"}else f=et("body");YRe(f,e,u)}let y,x;try{y=await Gy.fromText(t,{title:n.title})}catch(A){if(i.suppressErrorRendering)throw d(),A;y=await Gy.fromText("error"),x=A}let T=f.select(h).node(),C=y.type,k=T.firstChild,E=k.firstChild,v=y.renderer.getClasses?.(t,y),S=Mgt(i,C,v,a),w=document.createElement("style");w.innerHTML=S,k.insertBefore(w,E);try{await y.renderer.draw(t,e,"11.17.2",y)}catch(A){throw i.suppressErrorRendering?d():USe.draw(t,e,"11.17.2"),A}let L=f.select(`${h} svg`),O=y.db.getAccTitle?.(),F=y.db.getAccDescription?.();zgt(C,L,O,F);let G=s(()=>{f.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",Sgt);let A=f.select(h).node().innerHTML;if(Y.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),A=Ogt(A,p,Ei(i.arrowMarkerAbsolute)),p){let M=f.select(h+" svg").node();A=$gt(A,M)}else g||(A=Ds.sanitize(A,{ADD_TAGS:Lgt,ADD_ATTR:Dgt,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return WRe(),A},"serializeSvg")();if(x)throw x;return d(),{diagramType:C,svg:G,bindFunctions:y.db.bindFunctions}},"render");function Ggt(e={}){let t=Sn({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),zG(t),t?.theme&&t.theme in Da?t.themeVariables=Da[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Da.default.getThemeVariables(t.themeVariables));let r=typeof t=="object"?oR(t):lR();Vy(r.logLevel),Ny()}s(Ggt,"initialize");var QRe=s((e,t={})=>{let{code:r}=b9(e);return Gy.fromText(r,t)},"getDiagramFromText");function zgt(e,t,r,n){GRe(t,e),zRe(t,r,n,t.attr("id"))}s(zgt,"addA11yInfo");var Hh=Object.freeze({render:Fgt,parse:Igt,getDiagramFromText:QRe,initialize:Ggt,getConfig:mt,setConfig:IT,getSiteConfig:lR,updateSiteConfig:VG,reset:s(()=>{Ky()},"reset"),globalReset:s(()=>{Ky(au)},"globalReset"),defaultConfig:au});Vy(mt().logLevel);Ky(mt());Qd();Pt();xS();var Vgt=s((e,t,r)=>{Y.warn(e),C4(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),ZRe=s(async function(e={querySelector:".mermaid"}){try{await Wgt(e)}catch(t){if(C4(t)&&Y.error(t.str),nu.parseError&&nu.parseError(t),!e.suppressErrors)throw Y.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Wgt=s(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){let n=Hh.getConfig();Y.debug(`${e?"":"No "}Callback function found`);let i;if(r)i=r;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");Y.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(Y.debug("Start On Load: "+n?.startOnLoad),Hh.updateSiteConfig({startOnLoad:n?.startOnLoad}));let a=new Bt.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed),o,l=[];for(let u of Array.from(i)){Y.info("Rendering diagram: "+u.id);if(u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");let h=`mermaid-${a.next()}`;o=u.innerHTML,o=MT(Bt.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");let d=Bt.detectInit(o);d&&Y.debug("Detected early reinit: ",d);try{let{svg:f,bindFunctions:p}=await r3e(h,o,u);u.innerHTML=f,e&&await e(h),p&&p(u)}catch(f){Vgt(f,l,nu.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),JRe=s(function(e){Hh.initialize(e)},"initialize"),qgt=s(async function(e,t,r){Y.warn("mermaid.init is deprecated. Please use run instead."),e&&JRe(e);let n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await ZRe(n)},"init"),jgt=s(async(e,{lazyLoad:t=!0}={})=>{Ny(),BT(...e),t===!1&&await bRe()},"registerExternalDiagrams"),e3e=s(function(){if(nu.startOnLoad){let{startOnLoad:e}=Hh.getConfig();e&&nu.run().catch(t=>Y.error("Mermaid failed to initialize",t))}},"contentLoaded");if(typeof document<"u"){window.addEventListener("load",e3e,!1)}var Hgt=s(function(e){nu.parseError=e},"setParseErrorHandler"),RA=[],T9=!1,t3e=s(async()=>{if(!T9){for(T9=!0;RA.length>0;){let e=RA.shift();if(e)try{await e()}catch(t){Y.error("Error executing queue",t)}}T9=!1}},"executeQueue"),Ugt=s(async(e,t)=>new Promise((r,n)=>{let i=s(()=>new Promise((a,o)=>{Hh.parse(e,t).then(l=>{a(l),r(l)},l=>{Y.error("Error parsing",l),nu.parseError?.(l),o(l),n(l)})}),"performCall");RA.push(i),t3e().catch(n)}),"parse"),r3e=s((e,t,r)=>new Promise((n,i)=>{let a=s(()=>new Promise((o,l)=>{Hh.render(e,t,r).then(u=>{o(u),n(u)},u=>{Y.error("Error parsing",u),nu.parseError?.(u),l(u),i(u)})}),"performCall");RA.push(a),t3e().catch(i)}),"render"),Ygt=s(()=>Object.keys(Zl).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),nu={startOnLoad:!0,mermaidAPI:Hh,parse:Ugt,render:r3e,init:qgt,run:ZRe,registerExternalDiagrams:jgt,registerLayoutLoaders:JN,initialize:JRe,parseError:void 0,contentLoaded:e3e,setParseErrorHandler:Hgt,detectType:Bp,registerIconPacks:PT,getRegisteredDiagramsMetadata:Ygt},Kgt=nu;return l3e(Xgt);})();
2881
2881
  /*! Bundled license information:
2882
2882
 
2883
2883
  lodash-es/lodash.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mermaid-js/tiny",
3
- "version": "11.17.1",
3
+ "version": "11.17.2",
4
4
  "description": "Tiny version of mermaid",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/mermaid.tiny.js",