Lines Matching defs:t1

789 see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof us?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}}});function _oe(t,e){let r=new pM(t,e);return r.resolveRefs(),r.errors}var pM,Doe=N(()=>{"use strict";Us();qt();fs();o(_oe,"resolveGrammar");pM=class extends hs{static{o(this,"GastRefResolverVisitor")}constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Ae(br(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Vi.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}});function Jk(t,e,r=[]){r=an(r);let n=[],i=0;function a(l){return l.concat(bi(t,i+1))}o(a,"remainingPathWith");function s(l){let u=Jk(a(l),e,r);return n.concat(u)}for(o(s,"getAlternativesForProd");r.length<e&&i<t.length;){let l=t[i];if(l instanceof Dn)return s(l.definition);if(l instanceof on)return s(l.definition);if(l instanceof ln)n=s(l.definition);else if(l instanceof Ln){let u=l.definition.concat([new Pr({definition:l.definition})]);return s(u)}else if(l instanceof Rn){let u=[new Dn({definition:l.definition}),new Pr({definition:[new Er({terminalType:l.separator})].concat(l.definition)})];return s(u)}else if(l instanceof Tn){let u=l.definition.concat([new Pr({definition:[new Er({terminalType:l.separator})].concat(l.definition)})]);n=s(u)}else if(l instanceof Pr){let u=l.definition.concat([new Pr({definition:l.definition})]);n=s(u)}else{if(l instanceof wn)return Ae(l.definition,u=>{hr(u.definition)===!1&&(n=s(u.definition))}),n;if(l instanceof Er)r.push(l.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:bi(t,i)}),n}function eE(t,e,r,n){let i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE",l=!1,u=e.length,h=u-n-1,f=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!hr(d);){let p=d.pop();if(p===s){l&&ma(d).idx<=h&&d.pop();continue}let m=p.def,g=p.idx,y=p.ruleStack,v=p.occurrenceStack;if(hr(m))continue;let x=m[0];if(x===i){let b={idx:g,def:bi(m),ruleStack:Fu(y),occurrenceStack:Fu(v)};d.push(b)}else if(x instanceof Er)if(g<u-1){let b=g+1,T=e[b];if(r(T,x.terminalType)){let S={idx:b,def:bi(m),ruleStack:y,occurrenceStack:v};d.push(S)}}else if(g===u-1)f.push({nextTokenType:x.terminalType,nextTokenOccurrence:x.idx,ruleStack:y,occurrenceStack:v}),l=!0;else throw Error("non exhaustive match");else if(x instanceof on){let b=an(y);b.push(x.nonTerminalName);let T=an(v);T.push(x.idx);let S={idx:g,def:x.definition.concat(a,bi(m)),ruleStack:b,occurrenceStack:T};d.push(S)}else if(x instanceof ln){let b={idx:g,def:bi(m),ruleStack:y,occurrenceStack:v};d.push(b),d.push(s);let T={idx:g,def:x.definition.concat(bi(m)),ruleStack:y,occurrenceStack:v};d.push(T)}else if(x instanceof Ln){let b=new Pr({definition:x.definition,idx:x.idx}),T=x.definition.concat([b],bi(m)),S={idx:g,def:T,ruleStack:y,occurrenceStack:v};d.push(S)}else if(x instanceof Rn){let b=new Er({terminalType:x.separator}),T=new Pr({definition:[b].concat(x.definition),idx:x.idx}),S=x.definition.concat([T],bi(m)),w={idx:g,def:S,ruleStack:y,occurrenceStack:v};d.push(w)}else if(x instanceof Tn){let b={idx:g,def:bi(m),ruleStack:y,occurrenceStack:v};d.push(b),d.push(s);let T=new Er({terminalType:x.separator}),S=new Pr({definition:[T].concat(x.definition),idx:x.idx}),w=x.definition.concat([S],bi(m)),E={idx:g,def:w,ruleStack:y,occurrenceStack:v};d.push(E)}else if(x instanceof Pr){let b={idx:g,def:bi(m),ruleStack:y,occurrenceStack:v};d.push(b),d.push(s);let T=new Pr({definition:x.definition,idx:x.idx}),S=x.definition.concat([T],bi(m)),w={idx:g,def:S,ruleStack:y,occurrenceStack:v};d.push(w)}else if(x instanceof wn)for(let b=x.definition.length-1;b>=0;b--){let T=x.definition[b],S={idx:g,def:T.definition.concat(bi(m)),ruleStack:y,occurrenceStack:v};d.push(S),d.push(s)}else if(x instanceof Dn)d.push({idx:g,def:x.definition.concat(bi(m)),ruleStack:y,occurrenceStack:v});else if(x instanceof us)d.push(kFe(x,g,y,v));else throw Error("non exhaustive match")}return f}function kFe(t,e,r,n){let i=an(r);i.push(t.name);let a=an(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var mM,Kk,Zg,Qk,yx,Zk,vx,xx=N(()=>{"use strict";qt();rM();Vk();fs();mM=class extends Gu{static{o(this,"AbstractNextPossibleTokensWalker")}constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=an(this.path.ruleStack).reverse(),this.occurrenceStack=an(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){hr(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},Kk=class extends mM{static{o(this,"NextAfterTokenWalker")}constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),a=new Dn({definition:i});this.possibleTokTypes=yp(a),this.found=!0}}},Zg=class extends Gu{static{o(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Qk=class extends Zg{static{o(this,"NextTerminalAfterManyWalker")}walkMany(e,r,n){if(e.idx===this.occurrence){let i=ia(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Er&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},yx=class extends Zg{static{o(this,"NextTerminalAfterManySepWalker")}walkManySep(e,r,n){if(e.idx===this.occurrence){let i=ia(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Er&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Zk=class extends Zg{static{o(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=ia(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Er&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},vx=class extends Zg{static{o(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=ia(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Er&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};o(Jk,"possiblePathsFrom");o(eE,"nextPossibleTokensAfter");o(kFe,"expandTopLevelRule")});function bx(t){if(t instanceof ln||t==="Option")return Qn.OPTION;if(t instanceof Pr||t==="Repetition")return Qn.REPETITION;if(t instanceof Ln||t==="RepetitionMandatory")return Qn.REPETITION_MANDATORY;if(t instanceof Rn||t==="RepetitionMandatoryWithSeparator")return Qn.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Tn||t==="RepetitionWithSeparator")return Qn.REPETITION_WITH_SEPARATOR;if(t instanceof wn||t==="Alternation")return Qn.ALTERNATION;throw Error("non exhaustive match")}function rE(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=bx(n);return a===Qn.ALTERNATION?Jg(e,r,i):e1(e,r,a,i)}function Roe(t,e,r,n,i,a){let s=Jg(t,e,r),l=Boe(s)?jg:Vu;return a(s,n,l,i)}function Noe(t,e,r,n,i,a){let s=e1(t,e,i,r),l=Boe(s)?jg:Vu;return a(s[0],l,n)}function Moe(t,e,r,n){let i=t.length,a=Pa(t,s=>Pa(s,l=>l.length===1));if(e)return function(s){let l=Je(s,u=>u.GATE);for(let u=0;u<i;u++){let h=t[u],f=h.length,d=l[u];if(!(d!==void 0&&d.call(this)===!1))e:for(let p=0;p<f;p++){let m=h[p],g=m.length;for(let y=0;y<g;y++){let v=this.LA(y+1);if(r(v,m[y])===!1)continue e}return u}}};if(a&&!n){let s=Je(t,u=>qr(u)),l=Xr(s,(u,h,f)=>(Ae(h,d=>{Bt(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=f),Ae(d.categoryMatches,p=>{Bt(u,p)||(u[p]=f)})}),u),{});return function(){let u=this.LA(1);return l[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let l=t[s],u=l.length;e:for(let h=0;h<u;h++){let f=l[h],d=f.length;for(let p=0;p<d;p++){let m=this.LA(p+1);if(r(m,f[p])===!1)continue e}return s}}}}function Ioe(t,e,r){let n=Pa(t,a=>a.length===1),i=t.length;if(n&&!r){let a=qr(t);if(a.length===1&&hr(a[0].categoryMatches)){let l=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{let s=Xr(a,(l,u,h)=>(l[u.tokenTypeIdx]=!0,Ae(u.categoryMatches,f=>{l[f]=!0}),l),[]);return function(){let l=this.LA(1);return s[l.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){let s=t[a],l=s.length;for(let u=0;u<l;u++){let h=this.LA(u+1);if(e(h,s[u])===!1)continue e}return!0}return!1}}function Loe(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function gM(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let a=0;a<e.length;a++){let s=e[a];i.push(s+"_"+n.tokenTypeIdx);for(let l=0;l<n.categoryMatches.length;l++){let u="_"+n.categoryMatches[l];i.push(s+u)}}e=i}return e}function EFe(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let a=0;a<e.length;a++){let s=e[a];if(i[s]===!0)return!1}}return!0}function Ooe(t,e){let r=Je(t,s=>Jk([s],1)),n=Loe(r.length),i=Je(r,s=>{let l={};return Ae(s,u=>{let h=gM(u.partialPath);Ae(h,f=>{l[f]=!0})}),l}),a=r;for(let s=1;s<=e;s++){let l=a;a=Loe(l.length);for(let u=0;u<l.length;u++){let h=l[u];for(let f=0;f<h.length;f++){let d=h[f].partialPath,p=h[f].suffixDef,m=gM(d);if(EFe(i,m,u)||hr(p)||d.length===e){let y=n[u];if(nE(y,d)===!1){y.push(d);for(let v=0;v<m.length;v++){let x=m[v];i[u][x]=!0}}}else{let y=Jk(p,s+1,d);a[u]=a[u].concat(y),Ae(y,v=>{let x=gM(v.partialPath);Ae(x,b=>{i[u][b]=!0})})}}}}return n}function Jg(t,e,r,n){let i=new tE(t,Qn.ALTERNATION,n);return e.accept(i),Ooe(i.result,r)}function e1(t,e,r,n){let i=new tE(t,r);e.accept(i);let a=i.result,l=new yM(e,t,r).startWalking(),u=new Dn({definition:a}),h=new Dn({definition:l});return Ooe([u,h],n)}function nE(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let a=e[i],s=n[i];if((a===s||s.categoryMatchesMap[a.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Poe(t,e){return t.length<e.length&&Pa(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function Boe(t){return Pa(t,e=>Pa(e,r=>Pa(r,n=>hr(n.categoryMatches))))}var Qn,yM,tE,t1=N(()=>{"use strict";qt();xx();Vk();xp();fs();(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Qn||(Qn={}));o(bx,"getProdType");o(rE,"getLookaheadPaths");o(Roe,"buildLookaheadFuncForOr");o(Noe,"buildLookaheadFuncForOptionalProd");o(Moe,"buildAlternativesLookAheadFunc");o(Ioe,"buildSingleAlternativeLookaheadFunction");yM=class extends Gu{static{o(this,"RestDefinitionFinderWalker")}constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Qn.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Qn.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Qn.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Qn.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Qn.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},tE=class extends hs{static{o(this,"InsideDefinitionFinderVisitor")}constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Qn.OPTION)}visitRepetition(e){this.checkIsTarget(e,Qn.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Qn.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Qn.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Qn.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Qn.ALTERNATION)}};o(Loe,"initializeArrayOfArrays");o(gM,"pathToHashKeys");o(EFe,"isUniquePrefixHash");o(Ooe,"lookAheadSequenceFromAlternatives");o(Jg,"getLookaheadPathsForOr");o(e1,"getLookaheadPathsForOptionalProd");o(nE,"containsPath");o(Poe,"isStrictPrefixOfPath");o(Boe,"areTokenCategoriesNotUsed")});function Foe(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Je(e,r=>Object.assign({type:Vi.CUSTOM_LOOKAHEAD_VALIDATION},r))}function $oe(t,e,r,n){let i=ga(t,u=>SFe(u,r)),a=RFe(t,e,r),s=ga(t,u=>_Fe(u,r)),l=ga(t,u=>AFe(u,t,n,r));return i.concat(a,s,l)}function SFe(t,e){let r=new vM;t.accept(r);let n=r.allProductions,i=yR(n,CFe),a=zs(i,l=>l.length>1);return Je(br(a),l=>{let u=ia(l),h=e.buildDuplicateFoundError(t,l),f=Vs(u),d={message:h,type:Vi.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:f,occurrence:u.idx},p=zoe(u);return p&&(d.parameter=p),d})}function CFe(t){return`${Vs(t)}_#_${t.idx}_#_${zoe(t)}`}function zoe(t){return t instanceof Er?t.terminalType.name:t instanceof on?t.nonTerminalName:""}function AFe(t,e,r,n){let i=[];if(Xr(e,(s,l)=>l.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:Vi.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Goe(t,e,r){let n=[],i;return Xn(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Vi.INVALID_RULE_OVERRIDE,ruleName:t})),n}function bM(t,e,r,n=[]){let i=[],a=iE(e.definition);if(hr(a))return[];{let s=t.name;Xn(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Vi.LEFT_RECURSION,ruleName:s});let u=af(a,n.concat([t])),h=ga(u,f=>{let d=an(n);return d.push(f),bM(t,f,r,d)});return i.concat(h)}}function iE(t){let e=[];if(hr(t))return e;let r=ia(t);if(r instanceof on)e.push(r.referencedRule);else if(r instanceof Dn||r instanceof ln||r instanceof Ln||r instanceof Rn||r instanceof Tn||r instanceof Pr)e=e.concat(iE(r.definition));else if(r instanceof wn)e=qr(Je(r.definition,a=>iE(a.definition)));else if(!(r instanceof Er))throw Error("non exhaustive match");let n=gp(r),i=t.length>1;if(n&&i){let a=bi(t);return e.concat(iE(a))}else return e}function Voe(t,e){let r=new Tx;t.accept(r);let n=r.alternations;return ga(n,a=>{let s=Fu(a.definition);return ga(s,(l,u)=>{let h=eE([l],[],Vu,1);return hr(h)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:u}),type:Vi.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:u+1}]:[]})})}function Uoe(t,e,r){let n=new Tx;t.accept(n);let i=n.alternations;return i=sf(i,s=>s.ignoreAmbiguities===!0),ga(i,s=>{let l=s.idx,u=s.maxLookahead||e,h=Jg(l,t,u,s),f=DFe(h,s,t,r),d=LFe(h,s,t,r);return f.concat(d)})}function _Fe(t,e){let r=new Tx;t.accept(r);let n=r.alternations;return ga(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:Vi.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function Hoe(t,e,r){let n=[];return Ae(t,i=>{let a=new xM;i.accept(a);let s=a.allProductions;Ae(s,l=>{let u=bx(l),h=l.maxLookahead||e,f=l.idx,p=e1(f,i,u,h)[0];if(hr(qr(p))){let m=r.buildEmptyRepetitionError({topLevelRule:i,repetition:l});n.push({message:m,type:Vi.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function DFe(t,e,r,n){let i=[],a=Xr(t,(l,u,h)=>(e.definition[h].ignoreAmbiguities===!0||Ae(u,f=>{let d=[h];Ae(t,(p,m)=>{h!==m&&nE(p,f)&&e.definition[m].ignoreAmbiguities!==!0&&d.push(m)}),d.length>1&&!nE(i,f)&&(i.push(f),l.push({alts:d,path:f}))}),l),[]);return Je(a,l=>{let u=Je(l.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:l.path}),type:Vi.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:l.alts}})}function LFe(t,e,r,n){let i=Xr(t,(s,l,u)=>{let h=Je(l,f=>({idx:u,path:f}));return s.concat(h)},[]);return Ac(ga(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let u=s.idx,h=s.path,f=Yr(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&Poe(p.path,h));return Je(f,p=>{let m=[p.idx+1,u+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:m,prefixPath:p.path}),type:Vi.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:m}})}))}function RFe(t,e,r){let n=[],i=Je(e,a=>a.name);return Ae(t,a=>{let s=a.name;if(Xn(i,s)){let l=r.buildNamespaceConflictError(a);n.push({message:l,type:Vi.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}var vM,Tx,xM,wx=N(()=>{"use strict";qt();Us();fs();t1();xx();xp();o(Foe,"validateLookahead");o($oe,"validateGrammar");o(SFe,"validateDuplicateProductions");o(CFe,"identifyProductionForDuplicates");o(zoe,"getExtraProductionArgument");vM=class extends hs{static{o(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};o(AFe,"validateRuleDoesNotAlreadyExist");o(Goe,"validateRuleIsOverridden");o(bM,"validateNoLeftRecursion");o(iE,"getFirstNoneTerminal");Tx=class extends hs{static{o(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};o(Voe,"validateEmptyOrAlternative");o(Uoe,"validateAmbiguousAlternationAlternatives");xM=class extends hs{static{o(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};o(_Fe,"validateTooManyAlts");o(Hoe,"validateSomeNonEmptyLookaheadPath");o(DFe,"checkAlternativesAmbiguities");o(LFe,"checkPrefixAlternativesAmbiguities");o(RFe,"checkTerminalAndNoneTerminalsNameSpace")});function Woe(t){let e=nf(t,{errMsgProvider:Aoe}),r={};return Ae(t.rules,n=>{r[n.name]=n}),_oe(r,e.errMsgProvider)}function qoe(t){return t=nf(t,{errMsgProvider:$l}),$oe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var Yoe=N(()=>{"use strict";qt();Doe();wx();Qg();o(Woe,"resolveGrammar");o(qoe,"validateGrammar")});function pf(t){return Xn(Zoe,t.name)}var Xoe,joe,Koe,Qoe,Zoe,r1,Tp,kx,Ex,Sx,n1=N(()=>{"use strict";qt();Xoe="MismatchedTokenException",joe="NoViableAltException",Koe="EarlyExitException",Qoe="NotAllInputParsedException",Zoe=[Xoe,joe,Koe,Qoe];Object.freeze(Zoe);o(pf,"isRecognitionException");r1=class extends Error{static{o(this,"RecognitionException")}constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Tp=class extends r1{static{o(this,"MismatchedTokenException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Xoe}},kx=class extends r1{static{o(this,"NoViableAltException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=joe}},Ex=class extends r1{static{o(this,"NotAllInputParsedException")}constructor(e,r){super(e,r),this.name=Qoe}},Sx=class extends r1{static{o(this,"EarlyExitException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Koe}}});function NFe(t,e,r,n,i,a,s){let l=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[l];if(u===void 0){let p=this.getCurrRuleFullName(),m=this.getGAstProductions()[p];u=new a(m,i).startWalking(),this.firstAfterRepMap[l]=u}let h=u.token,f=u.occurrence,d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&h===void 0&&(h=fo,f=1),!(h===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(h,f,s)&&this.tryInRepetitionRecovery(t,e,r,h)}var TM,kM,wM,aE,EM=N(()=>{"use strict";bp();qt();n1();nM();Us();TM={},kM="InRuleRecoveryException",wM=class extends Error{static{o(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=kM}},aE=class{static{o(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Bt(e,"recoveryEnabled")?e.recoveryEnabled:ds.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=NFe)}getTokenToInsert(e){let r=Wu(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let a=this.findReSyncTokenType(),s=this.exportLexerState(),l=[],u=!1,h=this.LA(1),f=this.LA(1),d=o(()=>{let p=this.LA(0),m=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:h,previous:p,ruleName:this.getCurrRuleFullName()}),g=new Tp(m,h,this.LA(0));g.resyncedTokens=Fu(l),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!u;)if(this.tokenMatcher(f,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(f,a)?u=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,l));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new wM("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||hr(r))return!1;let n=this.LA(1);return ls(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Xn(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=ls(e,a=>gx(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return TM;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Je(e,(n,i)=>i===0?TM:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=Je(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return qr(e)}getFollowSetFromFollowKey(e){if(e===TM)return[fo];let r=e.ruleName+e.idxInCallingRule+Uk+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,fo)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return Fu(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,l){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=an(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Je(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};o(NFe,"attemptInRepetitionRecovery")});function sE(t,e,r){return r|e|t}var oE=N(()=>{"use strict";o(sE,"getKeyForAutomaticLookahead")});var Yu,SM=N(()=>{"use strict";qt();Qg();Us();wx();t1();Yu=class{static{o(this,"LLkLookaheadStrategy")}constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:ds.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(hr(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return ga(e,r=>bM(r,r,$l))}validateEmptyOrAlternatives(e){return ga(e,r=>Voe(r,$l))}validateAmbiguousAlternationAlternatives(e,r){return ga(e,n=>Uoe(n,r,$l))}validateSomeNonEmptyLookaheadPath(e,r){return Hoe(e,r,$l)}buildLookaheadForAlternation(e){return Roe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Moe)}buildLookaheadForOptional(e){return Noe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,bx(e.prodType),Ioe)}}});function MFe(t){lE.reset(),t.accept(lE);let e=lE.dslMethods;return lE.reset(),e}var cE,CM,lE,Joe=N(()=>{"use strict";qt();Us();oE();fs();SM();cE=class{static{o(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=Bt(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:ds.dynamicTokensEnabled,this.maxLookahead=Bt(e,"maxLookahead")?e.maxLookahead:ds.maxLookahead,this.lookaheadStrategy=Bt(e,"lookaheadStrategy")?e.lookaheadStrategy:new Yu({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Ae(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:l,repetitionWithSeparator:u}=MFe(r);Ae(n,h=>{let f=h.idx===0?"":h.idx;this.TRACE_INIT(`${Vs(h)}${f}`,()=>{let d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:h.idx,rule:r,maxLookahead:h.maxLookahead||this.maxLookahead,hasPredicates:h.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=sE(this.fullRuleNameToShort[r.name],256,h.idx);this.setLaFuncCache(p,d)})}),Ae(i,h=>{this.computeLookaheadFunc(r,h.idx,768,"Repetition",h.maxLookahead,Vs(h))}),Ae(a,h=>{this.computeLookaheadFunc(r,h.idx,512,"Option",h.maxLookahead,Vs(h))}),Ae(s,h=>{this.computeLookaheadFunc(r,h.idx,1024,"RepetitionMandatory",h.maxLookahead,Vs(h))}),Ae(l,h=>{this.computeLookaheadFunc(r,h.idx,1536,"RepetitionMandatoryWithSeparator",h.maxLookahead,Vs(h))}),Ae(u,h=>{this.computeLookaheadFunc(r,h.idx,1280,"RepetitionWithSeparator",h.maxLookahead,Vs(h))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let l=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=sE(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,l)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return sE(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},CM=class extends hs{static{o(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},lE=new CM;o(MFe,"collectMethods")});function DM(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function LM(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function ele(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function tle(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var rle=N(()=>{"use strict";o(DM,"setNodeLocationOnlyOffset");o(LM,"setNodeLocationFull");o(ele,"addTerminalToCst");o(tle,"addNoneTerminalToCst")});function RM(t,e){Object.defineProperty(t,IFe,{enumerable:!1,configurable:!0,writable:!1,value:e})}var IFe,nle=N(()=>{"use strict";IFe="name";o(RM,"defineNameProp")});function OFe(t,e){let r=zr(t),n=r.length;for(let i=0;i<n;i++){let a=r[i],s=t[a],l=s.length;for(let u=0;u<l;u++){let h=s[u];h.tokenTypeIdx===void 0&&this[h.name](h.children,e)}}}function ile(t,e){let r=o(function(){},"derivedConstructor");RM(r,t+"BaseSemantics");let n={visit:o(function(i,a){if(Pt(i)&&(i=i[0]),!mr(i))return this[i.name](i.children,a)},"visit"),validateVisitor:o(function(){let i=PFe(this,e);if(!hr(i)){let a=Je(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
793 `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function ale(t,e,r){let n=o(function(){},"derivedConstructor");RM(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return Ae(e,a=>{i[a]=OFe}),n.prototype=i,n.prototype.constructor=n,n}function PFe(t,e){return BFe(t,e)}function BFe(t,e){let r=Yr(e,i=>Ai(t[i])===!1),n=Je(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:NM.MISSING_METHOD,methodName:i}));return Ac(n)}var NM,sle=N(()=>{"use strict";qt();nle();o(OFe,"defaultVisit");o(ile,"createBaseSemanticVisitorConstructor");o(ale,"createBaseVisitorConstructorWithDefaults");(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(NM||(NM={}));o(PFe,"validateVisitor");o(BFe,"validateMissingCstMethods")});var dE,ole=N(()=>{"use strict";rle();qt();sle();Us();dE=class{static{o(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Bt(e,"nodeLocationTracking")?e.nodeLocationTracking:ds.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ai,this.cstFinallyStateUpdate=ai,this.cstPostTerminal=ai,this.cstPostNonTerminal=ai,this.cstPostRule=ai;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=LM,this.setNodeLocationFromNode=LM,this.cstPostRule=ai,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ai,this.setNodeLocationFromNode=ai,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=DM,this.setNodeLocationFromNode=DM,this.cstPostRule=ai,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ai,this.setNodeLocationFromNode=ai,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ai,this.setNodeLocationFromNode=ai,this.cstPostRule=ai,this.setInitialNodeLocation=ai;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];ele(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];tle(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(mr(this.baseCstVisitorConstructor)){let e=ile(this.className,zr(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(mr(this.baseCstVisitorWithDefaultsConstructor)){let e=ale(this.className,zr(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}});var pE,lle=N(()=>{"use strict";Us();pE=class{static{o(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):i1}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?i1:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}});var mE,cle=N(()=>{"use strict";qt();n1();Us();Qg();wx();fs();mE=class{static{o(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=a1){if(Xn(this.definedRulesNames,e)){let s={message:$l.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Vi.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=a1){let i=Goe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(pf(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return zk(br(this.gastProductionsCache))}}});var gE,ule=N(()=>{"use strict";qt();oE();n1();t1();xx();Us();EM();bp();xp();gE=class{static{o(this,"RecognizerEngine")}initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=jg,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Bt(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
800 Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Bt(n,"resyncEnabled")?n.resyncEnabled:a1.resyncEnabled,a=Bt(n,"recoveryValueFunc")?n.recoveryValueFunc:a1.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let l;return this.outputCst===!0?l=o(function(...f){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):l=o(function(...f){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(l,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(pf(e)){let s=e;if(a){let l=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(l))if(s.resyncedTokens=this.reSyncTo(l),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof e!="function"){a=e.DEF;let s=e.GATE;if(s!==void 0){let l=i;i=o(()=>s.call(this)&&l.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;let s=r.GATE;if(s!==void 0){let l=i;i=o(()=>s.call(this)&&l.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Qn.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Zk)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=o(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,l,i,vx],l,1536,e,vx)}else throw this.raiseEarlyExitException(e,Qn.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;let l=r.GATE;if(l!==void 0){let u=i;i=o(()=>l.call(this)&&u.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,Qk,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=o(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,l,i,yx],l,1280,e,yx)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,1536,e,a)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=Pt(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Ex(r,e))}}subruleInternal(e,r,n){let i;try{let a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw pf(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Tp(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===kM?n:a}}else throw n}saveRecogState(){let e=this.errors,r=an(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),fo)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}});var yE,hle=N(()=>{"use strict";n1();qt();t1();Us();yE=class{static{o(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=Bt(e,"errorMessageProvider")?e.errorMessageProvider:ds.errorMessageProvider}SAVE_ERROR(e){if(pf(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:an(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return an(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],l=e1(e,a,r,this.maxLookahead)[0],u=[];for(let f=1;f<=this.maxLookahead;f++)u.push(this.LA(f));let h=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:l,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Sx(h,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Jg(e,i,this.maxLookahead),s=[];for(let h=1;h<=this.maxLookahead;h++)s.push(this.LA(h));let l=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:l,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new kx(u,this.LA(1),l))}}});var vE,fle=N(()=>{"use strict";xx();qt();vE=class{static{o(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(mr(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return eE([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=ia(e.ruleStack),i=this.getGAstProductions()[r];return new Kk(i,e).startWalking()}}});function Ax(t,e,r,n=!1){bE(r);let i=ma(this.recordingProdStack),a=Ai(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Bt(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),TE}function zFe(t,e){bE(e);let r=ma(this.recordingProdStack),n=Pt(t)===!1,i=n===!1?t:t.DEF,a=new wn({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Bt(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);let s=B2(i,l=>Ai(l.GATE));return a.hasPredicates=s,r.definition.push(a),Ae(i,l=>{let u=new Dn({definition:[]});a.definition.push(u),Bt(l,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:Bt(l,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),l.ALT.call(this),this.recordingProdStack.pop()}),TE}function mle(t){return t===0?"":`${t}`}function bE(t){if(t<0||t>ple){let e=new Error(`Invalid DSL Method idx value: <${t}>
813 For further details.`);this.skipValidations=Bt(r,"skipValidations")?r.skipValidations:ds.skipValidations}};_x.DEFER_DEFINITION_ERRORS_HANDLING=!1;ble(_x,[aE,cE,dE,pE,gE,mE,yE,vE,xE,wE]);Dx=class extends _x{static{o(this,"EmbeddedActionsParser")}constructor(e,r=ds){let n=an(r);n.outputCst=!1,super(e,n)}}});var wle=N(()=>{"use strict";fs()});var kle=N(()=>{"use strict"});var Ele=N(()=>{"use strict";wle();kle()});var Sle=N(()=>{"use strict";JN()});var mf=N(()=>{"use strict";JN();Us();px();bp();t1();SM();Qg();n1();fM();fs();fs();Ele();Sle()});function wp(t,e,r){return`${t.name}_${e}_${r}`}function Dle(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};YFe(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],a=kp(e,i,i);a!==void 0&&i$e(e,i,a)}return e}function YFe(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],a=aa(t,i,void 0,{type:VFe}),s=aa(t,i,void 0,{type:l1});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function Lle(t,e,r){return r instanceof Er?IM(t,e,r.terminalType,r):r instanceof on?n$e(t,e,r):r instanceof wn?ZFe(t,e,r):r instanceof ln?JFe(t,e,r):r instanceof Pr?XFe(t,e,r):r instanceof Tn?jFe(t,e,r):r instanceof Ln?KFe(t,e,r):r instanceof Rn?QFe(t,e,r):kp(t,e,r)}function XFe(t,e,r){let n=aa(t,e,r,{type:Ale});yf(t,n);let i=c1(t,e,n,r,kp(t,e,r));return Nle(t,e,r,i)}function jFe(t,e,r){let n=aa(t,e,r,{type:Ale});yf(t,n);let i=c1(t,e,n,r,kp(t,e,r)),a=IM(t,e,r.separator,r);return Nle(t,e,r,i,a)}function KFe(t,e,r){let n=aa(t,e,r,{type:Cle});yf(t,n);let i=c1(t,e,n,r,kp(t,e,r));return Rle(t,e,r,i)}function QFe(t,e,r){let n=aa(t,e,r,{type:Cle});yf(t,n);let i=c1(t,e,n,r,kp(t,e,r)),a=IM(t,e,r.separator,r);return Rle(t,e,r,i,a)}function ZFe(t,e,r){let n=aa(t,e,r,{type:gf});yf(t,n);let i=Je(r.definition,s=>Lle(t,e,s));return c1(t,e,n,r,...i)}function JFe(t,e,r){let n=aa(t,e,r,{type:gf});yf(t,n);let i=c1(t,e,n,r,kp(t,e,r));return e$e(t,e,r,i)}function kp(t,e,r){let n=Yr(Je(r.definition,i=>Lle(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:r$e(t,n)}function Rle(t,e,r,n,i){let a=n.left,s=n.right,l=aa(t,e,r,{type:qFe});yf(t,l);let u=aa(t,e,r,{type:_le});return a.loopback=l,u.loopback=l,t.decisionMap[wp(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=l,Di(s,l),i===void 0?(Di(l,a),Di(l,u)):(Di(l,u),Di(l,i.left),Di(i.right,a)),{left:a,right:u}}function Nle(t,e,r,n,i){let a=n.left,s=n.right,l=aa(t,e,r,{type:WFe});yf(t,l);let u=aa(t,e,r,{type:_le}),h=aa(t,e,r,{type:HFe});return l.loopback=h,u.loopback=h,Di(l,a),Di(l,u),Di(s,h),i!==void 0?(Di(h,u),Di(h,i.left),Di(i.right,a)):Di(h,l),t.decisionMap[wp(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=l,{left:l,right:u}}function e$e(t,e,r,n){let i=n.left,a=n.right;return Di(i,a),t.decisionMap[wp(e,"Option",r.idx)]=i,n}function yf(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function c1(t,e,r,n,...i){let a=aa(t,e,n,{type:UFe,start:r});r.end=a;for(let l of i)l!==void 0?(Di(r,l.left),Di(l.right,a)):Di(r,a);let s={left:r,right:a};return t.decisionMap[wp(e,t$e(n),n.idx)]=r,s}function t$e(t){if(t instanceof wn)return"Alternation";if(t instanceof ln)return"Option";if(t instanceof Pr)return"Repetition";if(t instanceof Tn)return"RepetitionWithSeparator";if(t instanceof Ln)return"RepetitionMandatory";if(t instanceof Rn)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function r$e(t,e){let r=e.length;for(let a=0;a<r-1;a++){let s=e[a],l;s.left.transitions.length===1&&(l=s.left.transitions[0]);let u=l instanceof o1,h=l,f=e[a+1].left;s.left.type===gf&&s.right.type===gf&&l!==void 0&&(u&&h.followState===s.right||l.target===s.right)?(u?h.followState=f:l.target=f,a$e(t,s.right)):Di(s.right,f)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function IM(t,e,r,n){let i=aa(t,e,n,{type:gf}),a=aa(t,e,n,{type:gf});return OM(i,new s1(a,r)),{left:i,right:a}}function n$e(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),a=aa(t,e,r,{type:gf}),s=aa(t,e,r,{type:gf}),l=new o1(i,n,s);return OM(a,l),{left:a,right:s}}function i$e(t,e,r){let n=t.ruleToStartState.get(e);Di(n,r.left);let i=t.ruleToStopState.get(e);return Di(r.right,i),{left:n,right:i}}function Di(t,e){let r=new Rx(e);OM(t,r)}function aa(t,e,r,n){let i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function OM(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function a$e(t,e){t.states.splice(t.states.indexOf(e),1)}var gf,VFe,Cle,Ale,l1,UFe,HFe,WFe,qFe,_le,Lx,s1,Rx,o1,Mle=N(()=>{"use strict";Um();fR();mf();o(wp,"buildATNKey");gf=1,VFe=2,Cle=4,Ale=5,l1=7,UFe=8,HFe=9,WFe=10,qFe=11,_le=12,Lx=class{static{o(this,"AbstractTransition")}constructor(e){this.target=e}isEpsilon(){return!1}},s1=class extends Lx{static{o(this,"AtomTransition")}constructor(e,r){super(e),this.tokenType=r}},Rx=class extends Lx{static{o(this,"EpsilonTransition")}constructor(e){super(e)}isEpsilon(){return!0}},o1=class extends Lx{static{o(this,"RuleTransition")}constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};o(Dle,"createATN");o(YFe,"createRuleStartAndStopATNStates");o(Lle,"atom");o(XFe,"repetition");o(jFe,"repetitionSep");o(KFe,"repetitionMandatory");o(QFe,"repetitionMandatorySep");o(ZFe,"alternation");o(JFe,"option");o(kp,"block");o(Rle,"plus");o(Nle,"star");o(e$e,"optional");o(yf,"defineDecisionState");o(c1,"makeAlts");o(t$e,"getProdType");o(r$e,"makeBlock");o(IM,"tokenRef");o(n$e,"ruleRef");o(i$e,"buildRuleHandle");o(Di,"epsilon");o(aa,"newState");o(OM,"addTransition");o(a$e,"removeState")});function PM(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}var Nx,u1,Ile=N(()=>{"use strict";Um();Nx={},u1=class{static{o(this,"ATNConfigSet")}constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=PM(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return Je(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};o(PM,"getATNConfigKey")});function s$e(t,e){let r={};return n=>{let i=n.toString(),a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}function Ple(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let a of n){if(a===void 0){if(e)break;return!1}let s=[a.tokenTypeIdx].concat(a.categoryMatches);for(let l of s)if(r.has(l)){if(!i.has(l))return!1}else r.add(l),i.add(l)}}return!0}function o$e(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=s$e(t.decisionStates[n],n);return r}function BM(t,e,r,n){let i=t[e](r),a=i.start;if(a===void 0){let l=v$e(i.atnStartState);a=$le(i,Fle(l)),i.start=a}return l$e.apply(this,[i,a,r,n])}function l$e(t,e,r,n){let i=e,a=1,s=[],l=this.LA(a++);for(;;){let u=p$e(i,l);if(u===void 0&&(u=c$e.apply(this,[t,i,l,a,r,n])),u===Nx)return d$e(s,i,l);if(u.isAcceptState===!0)return u.prediction;i=u,s.push(l),l=this.LA(a++)}}function c$e(t,e,r,n,i,a){let s=m$e(e.configs,r,i);if(s.size===0)return Ble(t,e,r,Nx),Nx;let l=Fle(s),u=y$e(s,i);if(u!==void 0)l.isAcceptState=!0,l.prediction=u,l.configs.uniqueAlt=u;else if(w$e(s)){let h=Nl(s.alts);l.isAcceptState=!0,l.prediction=h,l.configs.uniqueAlt=h,u$e.apply(this,[t,n,s.alts,a])}return l=Ble(t,e,r,l),l}function u$e(t,e,r,n){let i=[];for(let h=1;h<=e;h++)i.push(this.LA(h).tokenType);let a=t.atnStartState,s=a.rule,l=a.production,u=h$e({topLevelRule:s,ambiguityIndices:r,production:l,prefixPath:i});n(u)}function h$e(t){let e=Je(t.prefixPath,i=>Hu(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${f$e(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
1976 In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,l;return{s:o(function(){r=r.call(t)},"s"),n:o(function(){var u=r.next();return a=u.done,u},"n"),e:o(function(u){s=!0,l=u},"e"),f:o(function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw l}},"f")}}function Pqe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Bqe(t,e){return e={exports:{}},t(e,e.exports),e.exports}function Hqe(t){for(var e=t.length;e--&&Uqe.test(t.charAt(e)););return e}function Yqe(t){return t&&t.slice(0,Wqe(t)+1).replace(qqe,"")}function Zqe(t){var e=Kqe.call(t,Fb),r=t[Fb];try{t[Fb]=void 0;var n=!0}catch{}var i=Qqe.call(t);return n&&(e?t[Fb]=r:delete t[Fb]),i}function rYe(t){return tYe.call(t)}function sYe(t){return t==null?t===void 0?aYe:iYe:V0e&&V0e in Object(t)?Jqe(t):nYe(t)}function oYe(t){return t!=null&&typeof t=="object"}function uYe(t){return typeof t=="symbol"||lYe(t)&&mge(t)==cYe}function mYe(t){if(typeof t=="number")return t;if(d4(t))return U0e;if(Kp(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Kp(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Xqe(t);var r=fYe.test(t);return r||dYe.test(t)?pYe(t.slice(2),r?2:8):hYe.test(t)?U0e:+t}function xYe(t,e,r){var n,i,a,s,l,u,h=0,f=!1,d=!1,p=!0;if(typeof t!="function")throw new TypeError(gYe);e=H0e(e)||0,Kp(r)&&(f=!!r.leading,d="maxWait"in r,a=d?yYe(H0e(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p);function m(E){var _=n,C=i;return n=i=void 0,h=E,s=t.apply(C,_),s}o(m,"invokeFunc");function g(E){return h=E,l=setTimeout(x,e),f?m(E):s}o(g,"leadingEdge");function y(E){var _=E-u,C=E-h,D=e-_;return d?vYe(D,a-C):D}o(y,"remainingWait");function v(E){var _=E-u,C=E-h;return u===void 0||_>=e||_<0||d&&C>=a}o(v,"shouldInvoke");function x(){var E=nB();if(v(E))return b(E);l=setTimeout(x,y(E))}o(x,"timerExpired");function b(E){return l=void 0,p&&n?m(E):(n=i=void 0,s)}o(b,"trailingEdge");function T(){l!==void 0&&clearTimeout(l),h=0,n=u=i=l=void 0}o(T,"cancel");function S(){return l===void 0?s:b(nB())}o(S,"flush");function w(){var E=nB(),_=v(E);if(n=arguments,i=this,u=E,_){if(l===void 0)return g(u);if(d)return clearTimeout(l),l=setTimeout(x,e),m(u)}return l===void 0&&(l=setTimeout(x,e)),s}return o(w,"debounced"),w.cancel=T,w.flush=S,w}function eC(t,e,r,n,i,a){var s;return li(t)?s=t:s=ny[t]||ny.euclidean,e===0&&li(t)?s(i,a):s(e,r,n,i,a)}function hje(t,e){if(tC(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||d4(t)?!0:uje.test(t)||!cje.test(t)||e!=null&&t in Object(e)}function yje(t){if(!Kp(t))return!1;var e=mge(t);return e==pje||e==mje||e==dje||e==gje}function bje(t){return!!ume&&ume in t}function Eje(t){if(t!=null){try{return kje.call(t)}catch{}try{return t+""}catch{}}return""}function Mje(t){if(!Kp(t)||Tje(t))return!1;var e=vje(t)?Nje:Aje;return e.test(Sje(t))}function Oje(t,e){return t?.[e]}function Bje(t,e){var r=Pje(t,e);return Ije(r)?r:void 0}function $je(){this.__data__=s4?s4(null):{},this.size=0}function Gje(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function qje(t){var e=this.__data__;if(s4){var r=e[t];return r===Uje?void 0:r}return Wje.call(e,t)?e[t]:void 0}function Kje(t){var e=this.__data__;return s4?e[t]!==void 0:jje.call(e,t)}function Jje(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=s4&&e===void 0?Zje:e,this}function oy(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function tKe(){this.__data__=[],this.size=0}function nKe(t,e){return t===e||t!==t&&e!==e}function iKe(t,e){for(var r=t.length;r--;)if(zge(t[r][0],e))return r;return-1}function oKe(t){var e=this.__data__,r=rC(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():sKe.call(e,r,1),--this.size,!0}function cKe(t){var e=this.__data__,r=rC(e,t);return r<0?void 0:e[r][1]}function hKe(t){return rC(this.__data__,t)>-1}function dKe(t,e){var r=this.__data__,n=rC(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function ly(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function vKe(){this.size=0,this.__data__={hash:new hme,map:new(yKe||mKe),string:new hme}}function bKe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function wKe(t,e){var r=t.__data__;return TKe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function kKe(t){var e=nC(this,t).delete(t);return this.size-=e?1:0,e}function SKe(t){return nC(this,t).get(t)}function AKe(t){return nC(this,t).has(t)}function DKe(t,e){var r=nC(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function cy(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function YB(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(RKe);var r=o(function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s},"memoized");return r.cache=new(YB.Cache||Gge),r}function IKe(t){var e=NKe(t,function(n){return r.size===MKe&&r.clear(),n}),r=e.cache;return e}function $Ke(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function Hge(t){if(typeof t=="string")return t;if(tC(t))return Uge(t,Hge)+"";if(d4(t))return dme?dme.call(t):"";var e=t+"";return e=="0"&&1/t==-zKe?"-0":e}function VKe(t){return t==null?"":GKe(t)}function UKe(t,e){return tC(t)?t:fje(t,e)?[t]:Vge(Wge(t))}function WKe(t){if(typeof t=="string"||d4(t))return t;var e=t+"";return e=="0"&&1/t==-HKe?"-0":e}function qKe(t,e){e=qge(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[XB(e[r++])];return r&&r==n?t:void 0}function XKe(t,e,r){var n=t==null?void 0:YKe(t,e);return n===void 0?r:n}function QKe(t,e,r){e=="__proto__"&&pme?pme(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function tQe(t,e,r){var n=t[e];(!(eQe.call(t,e)&&zge(n,r))||r===void 0&&!(e in t))&&ZKe(t,e,r)}function aQe(t,e){var r=typeof t;return e=e??nQe,!!e&&(r=="number"||r!="symbol"&&iQe.test(t))&&t>-1&&t%1==0&&t<e}function oQe(t,e,r,n){if(!Kp(t))return t;e=qge(e,t);for(var i=-1,a=e.length,s=a-1,l=t;l!=null&&++i<a;){var u=XB(e[i]),h=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var f=l[u];h=n?n(f,u,l):void 0,h===void 0&&(h=Kp(f)?f:sQe(e[i+1])?[]:{})}rQe(l,u,h),l=l[u]}return t}function cQe(t,e,r){return t==null?t:lQe(t,e,r)}function hQe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function dQe(t){return tC(t)?Uge(t,XB):d4(t)?[t]:fQe(Vge(Wge(t)))}function KB(t,e,r,n){for(var i=[],a=new ay,s=t.cy(),l=s.hasCompoundNodes(),u=0;u<t.length;u++){var h=t[u];r?i.push(h):l&&n(i,a,h)}for(;i.length>0;){var f=i.shift();e(f),a.add(f.id()),l&&n(i,a,f)}return t}function Xge(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i<n.length;i++){var a=n[i];e.has(a.id())||t.push(a)}}function jge(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}function NQe(t,e,r){jge(t,e,r),Xge(t,e,r)}function cB(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;s<a.length;s++){var l=a[s];!e&&l.isLoop()||(n+=t(i,l))}return n}else return}}function H1(t,e){return function(r){for(var n,i=this.nodes(),a=0;a<i.length;a++){var s=i[a],l=s[t](r);l!==void 0&&(n===void 0||e(l,n))&&(n=l)}return n}}function Gb(){return!1}function w6(){return!0}function aC(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QQe,e=arguments.length>1?arguments[1]:void 0,r=0;r<bme.length;r++){var n=bme[r];this[n]=t[n]||i1e[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}function c1e(t,e,r){var n=r._private,i=n.styleCache=n.styleCache||[],a;return(a=i[t])!=null||(a=i[t]=e(r)),a}function sC(t,e){return t=Bf(t),o(function(n){return c1e(t,e,n)},"cachedStyleFunction")}function oC(t,e){t=Bf(t);var r=o(function(i){return e.call(i)},"selfFn");return o(function(){var i=this[0];if(i)return c1e(t,r,i)},"cachedPrototypeStyleFunction")}function hB(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var i=0;i<n.length;i++){var a=n[i];if(!e(a))return!1}return!0}function QB(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var i=this.cy();if(!i.styleEnabled())return!0;var a=this[0],s=i.hasCompoundNodes();if(a){var l=a._private;if(!e(a))return!1;if(a.isNode())return!s||hB(a,n);var u=l.source,h=l.target;return r(u)&&(!s||hB(u,r))&&(u===h||r(h)&&(!s||hB(h,r)))}}}function wme(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],i=e[1];this.on(t.event,n,i)}else if(e.length===1&&li(e[0])){var a=e[0];this.on(t.event,a)}else if(e.length===0||e.length===1&&En(e[0])){for(var s=e.length===1?e[0]:null,l=0;l<this.length;l++){var u=this[l],h=!t.ableField||u._private[t.ableField],f=u._private[t.field]!=t.value;if(t.overrideAble){var d=t.overrideAble(u);if(d!==void 0&&(h=d,!d))return this}h&&(u._private[t.field]=t.value,f&&r.push(u))}var p=this.spawn(r);p.updateStyle(),p.emit(t.event),s&&p.emit(s)}return this}}function hy(t){Of[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},Of[t.on]=wme({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Of[t.off]=wme({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}function Cme(t){return o(function(r){for(var n=[],i=0;i<this.length;i++){var a=this[i],s=a._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)},"sourceImpl")}function Ame(t){return o(function(r){var n=[],i=this._private.cy,a=t||{};Zt(r)&&(r=i.$(r));for(var s=0;s<r.length;s++)for(var l=r[s]._private.edges,u=0;u<l.length;u++){var h=l[u],f=h._private.data,d=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),p=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),m=d||p;m&&((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!d||a.thisIsTgt&&!p)||n.push(h))}return this.spawn(n,!0)},"edgesWithImpl")}function _me(t){var e={codirected:!1};return t=ir({},e,t),o(function(n){for(var i=[],a=this.edges(),s=t,l=0;l<a.length;l++)for(var u=a[l],h=u._private,f=h.source,d=f._private.data.id,p=h.data.target,m=f._private.edges,g=0;g<m.length;g++){var y=m[g],v=y._private.data,x=v.target,b=v.source,T=x===p&&b===d,S=d===x&&p===b;(s.codirected&&T||!s.codirected&&(T||S))&&i.push(y)}return this.spawn(i,!0).filter(n)},"parallelEdgesImpl")}function lZe(t,e,r,n){var i=4,a=.001,s=1e-7,l=10,u=11,h=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var p=f?new Float32Array(u):new Array(u);function m(O,R){return 1-3*R+3*O}o(m,"A");function g(O,R){return 3*R-6*O}o(g,"B");function y(O){return 3*O}o(y,"C");function v(O,R,k){return((m(R,k)*O+g(R,k))*O+y(R))*O}o(v,"calcBezier");function x(O,R,k){return 3*m(R,k)*O*O+2*g(R,k)*O+y(R)}o(x,"getSlope");function b(O,R){for(var k=0;k<i;++k){var L=x(R,t,r);if(L===0)return R;var A=v(R,t,r)-O;R-=A/L}return R}o(b,"newtonRaphsonIterate");function T(){for(var O=0;O<u;++O)p[O]=v(O*h,t,r)}o(T,"calcSampleValues");function S(O,R,k){var L,A,I=0;do A=R+(k-R)/2,L=v(A,t,r)-O,L>0?k=A:R=A;while(Math.abs(L)>s&&++I<l);return A}o(S,"binarySubdivide");function w(O){for(var R=0,k=1,L=u-1;k!==L&&p[k]<=O;++k)R+=h;--k;var A=(O-p[k])/(p[k+1]-p[k]),I=R+A*h,M=x(I,t,r);return M>=a?b(O,I):M===0?I:S(O,R,R+h)}o(w,"getTForX");var E=!1;function _(){E=!0,(t!==e||r!==n)&&T()}o(_,"precompute");var C=o(function(R){return E||_(),t===e&&r===n?R:R===0?0:R===1?1:v(w(R),e,n)},"f");C.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var D="generateBezier("+[t,e,r,n]+")";return C.toString=function(){return D},C}function Dme(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function Lme(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function W1(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=Lme(t,i),l=Lme(e,i);if(_t(s)&&_t(l))return Dme(a,s,l,r,n);if(En(s)&&En(l)){for(var u=[],h=0;h<l.length;h++){var f=s[h],d=l[h];if(f!=null&&d!=null){var p=Dme(a,f,d,r,n);u.push(p)}else u.push(d)}return u}}function uZe(t,e,r,n){var i=!n,a=t._private,s=e._private,l=s.easing,u=s.startTime,h=n?t:t.cy(),f=h.style();if(!s.easingImpl)if(l==null)s.easingImpl=M6.linear;else{var d;if(Zt(l)){var p=f.parse("transition-timing-function",l);d=p.value}else d=l;var m,g;Zt(d)?(m=d,g=[]):(m=d[1],g=d.slice(2).map(function(F){return+F})),g.length>0?(m==="spring"&&g.push(s.duration),s.easingImpl=M6[m].apply(null,g)):s.easingImpl=M6[m]}var y=s.easingImpl,v;if(s.duration===0?v=1:v=(r-u)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var x=s.startPosition,b=s.position;if(b&&i&&!t.locked()){var T={};Vb(x.x,b.x)&&(T.x=W1(x.x,b.x,v,y)),Vb(x.y,b.y)&&(T.y=W1(x.y,b.y,v,y)),t.position(T)}var S=s.startPan,w=s.pan,E=a.pan,_=w!=null&&n;_&&(Vb(S.x,w.x)&&(E.x=W1(S.x,w.x,v,y)),Vb(S.y,w.y)&&(E.y=W1(S.y,w.y,v,y)),t.emit("pan"));var C=s.startZoom,D=s.zoom,O=D!=null&&n;O&&(Vb(C,D)&&(a.zoom=i4(a.minZoom,W1(C,D,v,y),a.maxZoom)),t.emit("zoom")),(_||O)&&t.emit("viewport");var R=s.style;if(R&&R.length>0&&i){for(var k=0;k<R.length;k++){var L=R[k],A=L.name,I=L,M=s.startStyle[A],P=f.properties[M.name],B=W1(M,I,v,y,P);f.overrideBypass(t,A,B)}t.emit("style")}}return s.progress=v,v}function Vb(t,e){return t==null||e==null?!1:_t(t)&&_t(e)?!0:!!(t&&e)}function hZe(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function Rme(t,e){var r=e._private.aniEles,n=[];function i(f,d){var p=f._private,m=p.animation.current,g=p.animation.queue,y=!1;if(m.length===0){var v=g.shift();v&&m.push(v)}for(var x=o(function(E){for(var _=E.length-1;_>=0;_--){var C=E[_];C()}E.splice(0,E.length)},"callbacks"),b=m.length-1;b>=0;b--){var T=m[b],S=T._private;if(S.stopped){m.splice(b,1),S.hooked=!1,S.playing=!1,S.started=!1,x(S.frames);continue}!S.playing&&!S.applying||(S.playing&&S.applying&&(S.applying=!1),S.started||hZe(f,T,t),uZe(f,T,t,d),S.applying&&(S.applying=!1),x(S.frames),S.step!=null&&S.step(t),T.completed()&&(m.splice(b,1),S.hooked=!1,S.playing=!1,S.started=!1,x(S.completes)),y=!0)}return!d&&m.length===0&&g.length===0&&n.push(f),y}o(i,"stepOne");for(var a=!1,s=0;s<r.length;s++){var l=r[s],u=i(l);a=a||u}var h=i(e,!0);(a||h)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}function h1e(t){this.options=ir({},xZe,bZe,t)}function f1e(t){this.options=ir({},TZe,t)}function d1e(t){this.options=ir({},wZe,t)}function uC(t){this.options=ir({},kZe,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(i){var a=i.source().data("id"),s=i.target().data("id"),l=e.some(function(h){return h.data("id")===a}),u=e.some(function(h){return h.data("id")===s});return!l||!u});this.options.eles=this.options.eles.not(n)}function m1e(t){this.options=ir({},zZe,t)}function eF(t){this.options=ir({},GZe,t)}function g1e(t){this.options=ir({},VZe,t)}function y1e(t){this.options=ir({},UZe,t)}function v1e(t){this.options=t,this.notifications=0}function T1e(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function rF(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(qZe(t,e,r,n,i),{cx:_B,cy:DB,radius:Yp,startX:x1e,startY:b1e,stopX:LB,stopY:RB,startAngle:Kc.ang+Math.PI/2*Xp,endAngle:nl.ang-Math.PI/2*Xp,counterClockwise:P6})}function w1e(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];e.push({x:n,y:i})}return e}}function YZe(t,e,r){for(var n=o(function(h,f,d,p){return sa(h,f,d,p)},"qbezierAt$1"),i=e._private,a=i.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var l=t.bezierProjPcts[s];a.push({x:n(r[0],r[2],r[4],l),y:n(r[1],r[3],r[5],l)})}}function kJe(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function EJe(t,e,r){for(var n,i=0;i<e.length;i++){var a=e[i];i===0&&(n=a),t.lineTo(a.x,a.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function jme(t,e,r){t.beginPath&&t.beginPath();for(var n=e,i=0;i<n.length;i++){var a=n[i];t.lineTo(a.x,a.y)}var s=r,l=r[0];t.moveTo(l.x,l.y);for(var i=1;i<s.length;i++){var a=s[i];t.lineTo(a.x,a.y)}t.closePath&&t.closePath()}function SJe(t,e,r,n,i){t.beginPath&&t.beginPath(),t.arc(r,n,i,0,Math.PI*2,!1);var a=e,s=a[0];t.moveTo(s.x,s.y);for(var l=0;l<a.length;l++){var u=a[l];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function CJe(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}function mB(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+a,r),t.lineTo(e+n-a,r),t.quadraticCurveTo(e+n,r,e+n,r+a),t.lineTo(e+n,r+i-a),t.quadraticCurveTo(e+n,r+i,e+n-a,r+i),t.lineTo(e+a,r+i),t.quadraticCurveTo(e,r+i,e,r+i-a),t.lineTo(e,r+a),t.quadraticCurveTo(e,r,e+a,r),t.closePath(),s?t.stroke():t.fill()}function Kme(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function MJe(t,e,r){var n=Kme(t,t.VERTEX_SHADER,e),i=Kme(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function IJe(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function aF(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function gB(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function A6(t,e,r){var n=t[0]/255,i=t[1]/255,a=t[2]/255,s=e,l=r||new Array(4);return l[0]=n*s,l[1]=i*s,l[2]=a*s,l[3]=s,l}function _6(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function OJe(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function PJe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function O1e(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function P1e(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function BJe(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function FJe(t,e,r,n){var i=O1e(t,e),a=Ri(i,2),s=a[0],l=a[1],u=P1e(t,l,n),h=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,h),t.bufferData(t.ARRAY_BUFFER,u,t.STATIC_DRAW),l===t.FLOAT?t.vertexAttribPointer(r,s,l,!1,0,0):l===t.INT&&t.vertexAttribIPointer(r,s,l,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),h}function yo(t,e,r,n){var i=O1e(t,r),a=Ri(i,3),s=a[0],l=a[1],u=a[2],h=P1e(t,l,e*s),f=s*u,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*f,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),l===t.FLOAT?t.vertexAttribPointer(n,s,l,!1,f,0):l===t.INT&&t.vertexAttribIPointer(n,s,l,f,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var p=new Array(e),m=0;m<e;m++)p[m]=BJe(t,l,h,f,s,m);return d.dataArray=h,d.stride=f,d.size=s,d.getView=function(g){return p[g]},d.setPoint=function(g,y,v){var x=p[g];x[0]=y,x[1]=v},d.bufferSubData=function(g){t.bindBuffer(t.ARRAY_BUFFER,d),g?t.bufferSubData(t.ARRAY_BUFFER,0,h,0,g*s):t.bufferSubData(t.ARRAY_BUFFER,0,h)},d}function $Je(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,i){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}function Zb(){var t=new Qme(9);return Qme!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function B1e(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function zJe(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],l=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=r[0],m=r[1],g=r[2],y=r[3],v=r[4],x=r[5],b=r[6],T=r[7],S=r[8];return t[0]=p*n+m*s+g*h,t[1]=p*i+m*l+g*f,t[2]=p*a+m*u+g*d,t[3]=y*n+v*s+x*h,t[4]=y*i+v*l+x*f,t[5]=y*a+v*u+x*d,t[6]=b*n+T*s+S*h,t[7]=b*i+T*l+S*f,t[8]=b*a+T*u+S*d,t}function j6(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],l=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=r[0],m=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=s,t[4]=l,t[5]=u,t[6]=p*n+m*s+h,t[7]=p*i+m*l+f,t[8]=p*a+m*u+d,t}function F1e(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],l=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=Math.sin(r),m=Math.cos(r);return t[0]=m*n+p*s,t[1]=m*i+p*l,t[2]=m*a+p*u,t[3]=m*s-p*n,t[4]=m*l-p*i,t[5]=m*u-p*a,t[6]=h,t[7]=f,t[8]=d,t}function sF(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function GJe(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function HJe(t,e){return t.intersection?t.intersection(e):new Set(age(t).filter(function(r){return e.has(r)}))}function ege(t,e){return"rgba(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(e,")")}function XJe(t){var e=t&&t.style&&t.style.backgroundColor||"white";return hge(e)}function jJe(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>L1e?(KJe(t),e.call(t,a)):(QJe(t),G1e(t,a,Jb.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,l,u){return net(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.eleDrawing.invalidate(s,{type:"node-body"})}}}function KJe(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function QJe(t){var e=o(function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()},"clear");e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function ZJe(t){var e=t.canvasWidth,r=t.canvasHeight,n=aF(t),i=n.pan,a=n.zoom,s=Zb();j6(s,s,[i.x,i.y]),sF(s,s,[a,a]);var l=Zb();GJe(l,e,r);var u=Zb();return zJe(u,l,s),u}function z1e(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=aF(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function JJe(t,e){t.drawSelectionRectangle(e,function(r){return z1e(t,r)})}function eet(t){var e=t.data.contexts[t.NODE];e.save(),z1e(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function tet(t){var e=o(function(i,a,s){for(var l=i.atlasManager.getRenderTypeOpts(a),u=t.data.contexts[t.NODE],h=.125,f=l.atlasCollection.atlases,d=0;d<f.length;d++){var p=f[d],m=p.canvas,g=m.width,y=m.height,v=g*d,x=m.height*s;u.save(),u.scale(h,h),u.drawImage(m,v,x),u.strokeStyle="black",u.rect(v,x,g,y),u.stroke(),u.restore()}},"draw"),r=0;e(t.eleDrawing,"node-body",r++),e(t.eleDrawing,"node-label",r++)}function ret(t,e,r,n,i){var a,s,l,u,h=aF(t),f=h.pan,d=h.zoom;if(n===void 0||i===void 0){var p=gB(t,f,d,e,r),m=Ri(p,2),g=m[0],y=m[1],v=6;a=g-v/2,s=y-v/2,l=v,u=v}else{var x=gB(t,f,d,e,r),b=Ri(x,2),T=b[0],S=b[1],w=gB(t,f,d,n,i),E=Ri(w,2),_=E[0],C=E[1];a=T,s=C,l=Math.abs(_-T),u=Math.abs(C-S)}if(l===0||u===0)return[];var D=t.data.contexts[t.WEBGL];D.bindFramebuffer(D.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(D.viewport(0,0,D.canvas.width,D.canvas.height),G1e(t,null,Jb.PICKING),t.pickingFrameBuffer.needsDraw=!1);var O=l*u,R=new Uint8Array(O*4);D.readPixels(a,s,l,u,D.RGBA,D.UNSIGNED_BYTE,R),D.bindFramebuffer(D.FRAMEBUFFER,null);for(var k=new Set,L=0;L<O;L++){var A=R.slice(L*4,L*4+4),I=OJe(A)-1;I>=0&&k.add(I)}return k}function net(t,e,r){var n=ret(t,e,r),i=t.getCachedZSortedEles(),a,s,l=vo(n),u;try{for(l.s();!(u=l.n()).done;){var h=u.value,f=i[h];if(!a&&f.isNode()&&(a=f),!s&&f.isEdge()&&(s=f),a&&s)break}}catch(d){l.e(d)}finally{l.f()}return[a,s].filter(Boolean)}function G1e(t,e,r){var n,i;t.webglDebug&&(i=[],n=performance.now());var a=t.eleDrawing,s=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&JJe(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var l=o(function(k,L){L+=1,k.isNode()?(a.drawTexture(k,L,"node-underlay"),a.drawTexture(k,L,"node-body"),a.drawTexture(k,L,"node-label"),a.drawTexture(k,L,"node-overlay")):(a.drawEdgeLine(k,L),a.drawEdgeArrow(k,L,"source"),a.drawEdgeArrow(k,L,"target"),a.drawTexture(k,L,"edge-label"))},"draw"),u=t.data.contexts[t.WEBGL];r.screen?(u.clearColor(0,0,0,0),u.enable(u.BLEND),u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA)):u.disable(u.BLEND),u.clear(u.COLOR_BUFFER_BIT|u.DEPTH_BUFFER_BIT),u.viewport(0,0,u.canvas.width,u.canvas.height);var h=ZJe(t),f=t.getCachedZSortedEles();if(s=f.length,a.startFrame(h,i,r),r.screen){for(var d=0;d<f.nondrag.length;d++)l(f.nondrag[d],d);for(var p=0;p<f.drag.length;p++)l(f.drag[p],-1)}else if(r.picking)for(var m=0;m<f.length;m++)l(f[m],m);a.endFrame(),t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,a.gc()),r.screen&&t.webglDebugShowAtlases&&(eet(t),tet(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var g=performance.now(),y=!0,v=0,x=0,b=vo(i),T;try{for(b.s();!(T=b.n()).done;){var S=T.value;v++,x+=S.count}}catch(R){b.e(R)}finally{b.f()}var w=Math.ceil(g-n),E="".concat(s," elements, ").concat(x," rectangles, ").concat(v," batches");if(y)console.log("WebGL (".concat(r.name,") - ").concat(E));else{console.log("WebGL render (".concat(r.name,") - frame time ").concat(w,"ms")),console.log(" ".concat(E)),console.log("Texture Atlases Used:");var _=a.getAtlasDebugInfo(),C=vo(_),D;try{for(C.s();!(D=C.n()).done;){var O=D.value;console.log(" ".concat(O.type,": ").concat(O.keyCount," keys, ").concat(O.atlasCount," atlases"))}}catch(R){C.e(R)}finally{C.f()}console.log("")}}}function iet(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return new Blob([n],{type:e})}function nge(t){var e=t.indexOf(",");return t.substr(e+1)}function U1e(t,e,r){var n=o(function(){return e.toDataURL(r,t.quality)},"getB64Uri");switch(t.output){case"blob-promise":return new sy(function(i,a){try{e.toBlob(function(s){s!=null?i(s):a(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){a(s)}});case"blob":return iet(nge(n()),r);case"base64":return nge(n());case"base64uri":default:return n()}}function W1e(t){var e=this,r=e.cy.window(),n=r.document;t.webgl&&(Sr.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Sr.CANVAS_LAYERS),contexts:new Array(Sr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Sr.CANVAS_LAYERS),bufferCanvases:new Array(Sr.BUFFER_COUNT),bufferContexts:new Array(Sr.CANVAS_LAYERS)};var i="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[i]=a,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=t.cy.container();l.appendChild(e.data.canvasContainer),l.style[i]=a;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};kqe()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var h=0;h<Sr.CANVAS_LAYERS;h++){var f=e.data.canvases[h]=n.createElement("canvas"),d=Sr.CANVAS_TYPES[h];e.data.contexts[h]=f.getContext(d),e.data.contexts[h]||oi("Could not create canvas of type "+d),Object.keys(u).forEach(function(Q){f.style[Q]=u[Q]}),f.style.position="absolute",f.setAttribute("data-id","layer"+h),f.style.zIndex=String(Sr.CANVAS_LAYERS-h),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[h]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Sr.NODE].setAttribute("data-id","layer"+Sr.NODE+"-node"),e.data.canvases[Sr.SELECT_BOX].setAttribute("data-id","layer"+Sr.SELECT_BOX+"-selectbox"),e.data.canvases[Sr.DRAG].setAttribute("data-id","layer"+Sr.DRAG+"-drag"),e.data.canvases[Sr.WEBGL]&&e.data.canvases[Sr.WEBGL].setAttribute("data-id","layer"+Sr.WEBGL+"-webgl");for(var h=0;h<Sr.BUFFER_COUNT;h++)e.data.bufferCanvases[h]=n.createElement("canvas"),e.data.bufferContexts[h]=e.data.bufferCanvases[h].getContext("2d"),e.data.bufferCanvases[h].style.position="absolute",e.data.bufferCanvases[h].setAttribute("data-id","buffer"+h),e.data.bufferCanvases[h].style.zIndex=String(-h-1),e.data.bufferCanvases[h].style.visibility="hidden";e.pathsEnabled=!0;var p=Ys(),m=o(function(j){return{x:(j.x1+j.x2)/2,y:(j.y1+j.y2)/2}},"getBoxCenter"),g=o(function(j){return{x:-j.w/2,y:-j.h/2}},"getCenterOffset"),y=o(function(j){var ne=j[0]._private,te=ne.oldBackgroundTimestamp===ne.backgroundTimestamp;return!te},"backgroundTimestampHasChanged"),v=o(function(j){return j[0]._private.nodeKey},"getStyleKey"),x=o(function(j){return j[0]._private.labelStyleKey},"getLabelKey"),b=o(function(j){return j[0]._private.sourceLabelStyleKey},"getSourceLabelKey"),T=o(function(j){return j[0]._private.targetLabelStyleKey},"getTargetLabelKey"),S=o(function(j,ne,te,he,le){return e.drawElement(j,ne,te,!1,!1,le)},"drawElement"),w=o(function(j,ne,te,he,le){return e.drawElementText(j,ne,te,he,"main",le)},"drawLabel"),E=o(function(j,ne,te,he,le){return e.drawElementText(j,ne,te,he,"source",le)},"drawSourceLabel"),_=o(function(j,ne,te,he,le){return e.drawElementText(j,ne,te,he,"target",le)},"drawTargetLabel"),C=o(function(j){return j.boundingBox(),j[0]._private.bodyBounds},"getElementBox"),D=o(function(j){return j.boundingBox(),j[0]._private.labelBounds.main||p},"getLabelBox"),O=o(function(j){return j.boundingBox(),j[0]._private.labelBounds.source||p},"getSourceLabelBox"),R=o(function(j){return j.boundingBox(),j[0]._private.labelBounds.target||p},"getTargetLabelBox"),k=o(function(j,ne){return ne},"isLabelVisibleAtScale"),L=o(function(j){return m(C(j))},"getElementRotationPoint"),A=o(function(j,ne,te){var he=j?j+"-":"";return{x:ne.x+te.pstyle(he+"text-margin-x").pfValue,y:ne.y+te.pstyle(he+"text-margin-y").pfValue}},"addTextMargin"),I=o(function(j,ne,te){var he=j[0]._private.rscratch;return{x:he[ne],y:he[te]}},"getRsPt"),M=o(function(j){return A("",I(j,"labelX","labelY"),j)},"getLabelRotationPoint"),P=o(function(j){return A("source",I(j,"sourceLabelX","sourceLabelY"),j)},"getSourceLabelRotationPoint"),B=o(function(j){return A("target",I(j,"targetLabelX","targetLabelY"),j)},"getTargetLabelRotationPoint"),F=o(function(j){return g(C(j))},"getElementRotationOffset"),z=o(function(j){return g(O(j))},"getSourceLabelRotationOffset"),$=o(function(j){return g(R(j))},"getTargetLabelRotationOffset"),U=o(function(j){var ne=D(j),te=g(D(j));if(j.isNode()){switch(j.pstyle("text-halign").value){case"left":te.x=-ne.w-(ne.leftPad||0);break;case"right":te.x=-(ne.rightPad||0);break}switch(j.pstyle("text-valign").value){case"top":te.y=-ne.h-(ne.topPad||0);break;case"bottom":te.y=-(ne.botPad||0);break}}return te},"getLabelRotationOffset"),K=e.data.eleTxrCache=new jb(e,{getKey:v,doesEleInvalidateKey:y,drawElement:S,getBoundingBox:C,getRotationPoint:L,getRotationOffset:F,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),ee=e.data.lblTxrCache=new jb(e,{getKey:x,drawElement:w,getBoundingBox:D,getRotationPoint:M,getRotationOffset:U,isVisible:k}),Y=e.data.slbTxrCache=new jb(e,{getKey:b,drawElement:E,getBoundingBox:O,getRotationPoint:P,getRotationOffset:z,isVisible:k}),ce=e.data.tlbTxrCache=new jb(e,{getKey:T,drawElement:_,getBoundingBox:R,getRotationPoint:B,getRotationOffset:$,isVisible:k}),Z=e.data.lyrTxrCache=new R1e(e);e.onUpdateEleCalcs(o(function(j,ne){K.invalidateElements(ne),ee.invalidateElements(ne),Y.invalidateElements(ne),ce.invalidateElements(ne),Z.invalidateElements(ne);for(var te=0;te<ne.length;te++){var he=ne[te]._private;he.oldBackgroundTimestamp=he.backgroundTimestamp}},"invalidateTextureCaches"));var ue=o(function(j){for(var ne=0;ne<j.length;ne++)Z.enqueueElementRefinement(j[ne].ele)},"refineInLayers");K.onDequeue(ue),ee.onDequeue(ue),Y.onDequeue(ue),ce.onDequeue(ue),t.webgl&&e.initWebgl(t,{getStyleKey:v,getLabelKey:x,drawElement:S,drawLabel:w,getElementBox:C,getLabelBox:D,getElementRotationPoint:L,getElementRotationOffset:F,getLabelRotationPoint:M,getLabelRotationOffset:U})}function X1e(t,e,r){var n=r,i=o(function(C){hn("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")},"overrideErr");if(t==="core"){if(u4.prototype[e])return i(e);u4.prototype[e]=r}else if(t==="collection"){if(Sa.prototype[e])return i(e);Sa.prototype[e]=r}else if(t==="layout"){for(var a=o(function(C){this.options=C,r.call(this,C),Ur(this._private)||(this._private={}),this._private.cy=C.cy,this._private.listeners=[],this.createEmitter()},"Layout"),s=a.prototype=Object.create(r.prototype),l=[],u=0;u<l.length;u++){var h=l[u];s[h]=s[h]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var f=r.prototype.stop;s.stop=function(){var _=this.options;if(_&&_.animate){var C=this.animations;if(C)for(var D=0;D<C.length;D++)C[D].stop()}return f?f.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=o(function(C){return C._private.cy},"getCy"),p={addEventFields:o(function(C,D){D.layout=C,D.cy=d(C),D.target=C},"addEventFields"),bubble:o(function(){return!0},"bubble"),parent:o(function(C){return d(C)},"parent")};ir(s,{createEmitter:o(function(){return this._private.emitter=new aC(p,this),this},"createEmitter"),emitter:o(function(){return this._private.emitter},"emitter"),on:o(function(C,D){return this.emitter().on(C,D),this},"on"),one:o(function(C,D){return this.emitter().one(C,D),this},"one"),once:o(function(C,D){return this.emitter().one(C,D),this},"once"),removeListener:o(function(C,D){return this.emitter().removeListener(C,D),this},"removeListener"),removeAllListeners:o(function(){return this.emitter().removeAllListeners(),this},"removeAllListeners"),emit:o(function(C,D){return this.emitter().emit(C,D),this},"emit")}),un.eventAliasesOn(s),n=a}else if(t==="renderer"&&e!=="null"&&e!=="base"){var m=j1e("renderer","base"),g=m.prototype,y=r,v=r.prototype,x=o(function(){m.apply(this,arguments),y.apply(this,arguments)},"Renderer"),b=x.prototype;for(var T in g){var S=g[T],w=v[T]!=null;if(w)return i(T);b[T]=S}for(var E in v)b[E]=v[E];g.clientFunctions.forEach(function(_){b[_]=b[_]||function(){oi("Renderer does not implement `renderer."+_+"()` on its prototype")}}),n=x}else if(t==="__proto__"||t==="constructor"||t==="prototype")return oi(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return fge({map:q1e,keys:[t,e],value:n})}function j1e(t,e){return dge({map:q1e,keys:[t,e]})}function uet(t,e,r,n,i){return fge({map:Y1e,keys:[t,e,r,n],value:i})}function het(t,e,r,n){return dge({map:Y1e,keys:[t,e,r,n]})}var Hi,z0e,pqe,sge,mqe,gqe,h4,Zt,li,En,Ur,yqe,_t,vqe,F6,xo,f4,oge,BB,lge,xqe,Pf,bqe,Tqe,wqe,kqe,e4,FB,K6,cge,G0e,Wi,Eqe,Sqe,Cqe,Aqe,_qe,Dqe,uge,Lqe,ir,Rqe,Nqe,Mqe,Iqe,hge,Oqe,fge,dge,Kp,Wb,Fqe,$qe,zqe,Gqe,Q6,Vqe,nB,Uqe,Wqe,qqe,Xqe,jqe,ty,pge,Kqe,Qqe,Fb,Jqe,eYe,tYe,nYe,iYe,aYe,V0e,mge,lYe,cYe,d4,U0e,hYe,fYe,dYe,pYe,H0e,gYe,yYe,vYe,p4,iB,gge,bYe,$6,nh,X1,yge,qb,vge,t4,r4,TYe,Lf,m6,wYe,Bf,xge,kYe,W0e,EYe,SYe,$B,bge,z6,q0e,zB,oi,Tge,hn,CYe,Qc,AYe,wge,_Ye,kge,oa,Ff,GB,DYe,Wl,Nf,LYe,Zc,RYe,NYe,ay,Z6,Y0e,n4,MYe,m4,IYe,OYe,PYe,BYe,FYe,$Ye,zYe,GYe,VYe,UYe,HYe,aB,WYe,qYe,J6,Ege,j1,YYe,XYe,jYe,KYe,QYe,g6,VB,Sge,Qp,Wp,ZYe,sa,Q1,JYe,i4,Ys,eXe,tXe,rXe,Cge,nXe,D6,L6,X0e,UB,ry,iXe,Age,_ge,aXe,sXe,oXe,lXe,cXe,uXe,qs,ih,hXe,G6,V6,fXe,jp,Yb,sB,Mf,a4,dXe,y6,Ts,Dge,bB,Zp,Lge,HB,pXe,TB,mXe,gXe,j0e,Z1,K0e,J1,yXe,wB,vXe,xXe,bXe,TXe,Rge,wXe,kXe,EXe,SXe,CXe,AXe,_Xe,Q0e,DXe,LXe,Nge,Z0e,J0e,RXe,NXe,$b,ny,MXe,WB,U6,oB,Mge,Ige,IXe,OXe,PXe,eme,tme,BXe,FXe,$Xe,zXe,GXe,rme,VXe,UXe,HXe,WXe,nme,v6,qXe,YXe,ime,XXe,jXe,KXe,QXe,ZXe,JXe,ame,eje,sme,tje,rje,nje,x6,ije,b6,aje,Oge,Pge,Bge,Fge,ah,ome,$ge,lme,cme,sje,sy,kB,Jp,oje,lje,tC,cje,uje,fje,dje,pje,mje,gje,vje,xje,lB,ume,Tje,wje,kje,Sje,Cje,Aje,_je,Dje,Lje,Rje,Nje,Ije,Pje,qB,Fje,s4,zje,Vje,Uje,Hje,Wje,Yje,Xje,jje,Qje,Zje,eKe,hme,rKe,zge,rC,aKe,sKe,lKe,uKe,fKe,pKe,mKe,gKe,yKe,xKe,TKe,nC,EKe,CKe,_Ke,LKe,Gge,RKe,NKe,MKe,OKe,PKe,BKe,FKe,Vge,Uge,zKe,fme,dme,GKe,Wge,qge,HKe,XB,YKe,jKe,KKe,pme,ZKe,JKe,eQe,rQe,nQe,iQe,sQe,lQe,uQe,fQe,pQe,mQe,gQe,un,yQe,R6,Vr,gn,$t,EB,vQe,xQe,bQe,U1,Rf,SB,TQe,wQe,kQe,EQe,SQe,Yge,CQe,AQe,jB,_Qe,pi,Vn,DQe,LQe,RQe,$f,zf,If,al,iy,o4,Kge,MQe,iC,ql,Qge,Zge,mme,IQe,ey,Hf,il,Hl,qp,zb,T6,uB,OQe,PQe,Jge,e1e,gme,l4,yme,vme,BQe,Xb,g4,t1e,FQe,$Qe,zQe,GQe,VQe,UQe,HQe,WQe,qQe,xme,YQe,XQe,jQe,r1e,n1e,KQe,i1e,bme,QQe,Gf,a1e,Tme,ZQe,JQe,k6,s1e,o1e,Qr,eZe,l1e,H6,tZe,rZe,N6,Ea,uy,nZe,iZe,aZe,sZe,Of,Ha,kme,Eme,Sme,Sa,Mn,oZe,cZe,Nn,M6,fZe,dZe,E6,u1e,CB,I6,pZe,mZe,AB,O6,qa,Kb,gZe,y4,ZB,Jc,lC,JB,ka,cC,Ua,Wa,yZe,vZe,e0,c4,u4,W6,xZe,bZe,q1,Nme,TZe,wZe,fB,kZe,EZe,SZe,CZe,AZe,_Ze,p1e,DZe,LZe,RZe,Mme,NZe,MZe,q6,IZe,OZe,PZe,BZe,FZe,$Ze,Ime,zZe,GZe,VZe,UZe,HZe,Ome,Pme,tF,r0,Y6,_B,DB,Kc,nl,Bme,Fme,Xp,P6,rh,Up,Yp,jc,Y1,S6,x1e,b1e,LB,RB,$me,zme,WZe,qZe,Ya,v4,nF,eu,k1e,E1e,XZe,S1e,Gme,Vme,hC,fC,C1e,A1e,fy,sh,x4,Ume,jZe,_1e,dy,dB,D1e,KZe,Hme,C6,B6,NB,L1e,QZe,ZZe,JZe,eJe,tJe,rJe,nJe,iJe,aJe,sJe,oJe,lJe,cJe,K1,uJe,jb,Yi,hJe,Qb,X6,fJe,dJe,pJe,mJe,gJe,yJe,vJe,xJe,Wme,bJe,qme,TJe,R1e,Ca,Yme,wJe,N1e,Xme,tu,AJe,_Je,DJe,LJe,RJe,pB,oh,M1e,iF,n0,py,I1e,ws,NJe,Ub,Qme,Jb,Hb,VJe,UJe,WJe,yB,Zme,Jme,vB,qJe,YJe,$1e,Wf,tge,rge,MB,IB,V1e,Hp,b4,H1e,aet,Sr,set,oet,cet,q1e,Y1e,OB,K1e,t0,fet,sl,oF=N(()=>{"use strict";o(qi,"_typeof");o(Vf,"_classCallCheck");o($0e,"_defineProperties");o(Uf,"_createClass");o(ige,"_defineProperty$1");o(Ri,"_slicedToArray");o(age,"_toConsumableArray");o(lqe,"_arrayWithoutHoles");o(cqe,"_arrayWithHoles");o(uqe,"_iterableToArray");o(hqe,"_iterableToArrayLimit");o(PB,"_unsupportedIterableToArray");o(xB,"_arrayLikeToArray");o(fqe,"_nonIterableSpread");o(dqe,"_nonIterableRest");o(vo,"_createForOfIteratorHelper");Hi=typeof window>"u"?null:window,z0e=Hi?Hi.navigator:null;Hi&&Hi.document;pqe=qi(""),sge=qi({}),mqe=qi(function(){}),gqe=typeof HTMLElement>"u"?"undefined":qi(HTMLElement),h4=o(function(e){return e&&e.instanceString&&li(e.instanceString)?e.instanceString():null},"instanceStr"),Zt=o(function(e){return e!=null&&qi(e)==pqe},"string"),li=o(function(e){return e!=null&&qi(e)===mqe},"fn"),En=o(function(e){return!xo(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},"array"),Ur=o(function(e){return e!=null&&qi(e)===sge&&!En(e)&&e.constructor===Object},"plainObject"),yqe=o(function(e){return e!=null&&qi(e)===sge},"object"),_t=o(function(e){return e!=null&&qi(e)===qi(1)&&!isNaN(e)},"number"),vqe=o(function(e){return _t(e)&&Math.floor(e)===e},"integer"),F6=o(function(e){if(gqe!=="undefined")return e!=null&&e instanceof HTMLElement},"htmlElement"),xo=o(function(e){return f4(e)||oge(e)},"elementOrCollection"),f4=o(function(e){return h4(e)==="collection"&&e._private.single},"element"),oge=o(function(e){return h4(e)==="collection"&&!e._private.single},"collection"),BB=o(function(e){return h4(e)==="core"},"core"),lge=o(function(e){return h4(e)==="stylesheet"},"stylesheet"),xqe=o(function(e){return h4(e)==="event"},"event"),Pf=o(function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},"emptyString"),bqe=o(function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},"domElement"),Tqe=o(function(e){return Ur(e)&&_t(e.x1)&&_t(e.x2)&&_t(e.y1)&&_t(e.y2)},"boundingBox"),wqe=o(function(e){return yqe(e)&&li(e.then)},"promise"),kqe=o(function(){return z0e&&z0e.userAgent.match(/msie|trident|edge/i)},"ms"),e4=o(function(e,r){r||(r=o(function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);return a.join("$")},"keyFn"));var n=o(function i(){var a=this,s=arguments,l,u=r.apply(a,s),h=i.cache;return(l=h[u])||(l=h[u]=e.apply(a,s)),l},"memoizedFn");return n.cache={},n},"memoize"),FB=e4(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),K6=e4(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),cge=e4(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),G0e=o(function(e){return Pf(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},"capitalize"),Wi="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Eqe="rgb[a]?\\(("+Wi+"[%]?)\\s*,\\s*("+Wi+"[%]?)\\s*,\\s*("+Wi+"[%]?)(?:\\s*,\\s*("+Wi+"))?\\)",Sqe="rgb[a]?\\((?:"+Wi+"[%]?)\\s*,\\s*(?:"+Wi+"[%]?)\\s*,\\s*(?:"+Wi+"[%]?)(?:\\s*,\\s*(?:"+Wi+"))?\\)",Cqe="hsl[a]?\\(("+Wi+")\\s*,\\s*("+Wi+"[%])\\s*,\\s*("+Wi+"[%])(?:\\s*,\\s*("+Wi+"))?\\)",Aqe="hsl[a]?\\((?:"+Wi+")\\s*,\\s*(?:"+Wi+"[%])\\s*,\\s*(?:"+Wi+"[%])(?:\\s*,\\s*(?:"+Wi+"))?\\)",_qe="\\#[0-9a-fA-F]{3}",Dqe="\\#[0-9a-fA-F]{6}",uge=o(function(e,r){return e<r?-1:e>r?1:0},"ascending"),Lqe=o(function(e,r){return-1*uge(e,r)},"descending"),ir=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var i=Object.keys(n),a=0;a<i.length;a++){var s=i[a];t[s]=n[s]}}return t},Rqe=o(function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,i,a,s=16;return r?(n=parseInt(e[1]+e[1],s),i=parseInt(e[2]+e[2],s),a=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),i=parseInt(e[3]+e[4],s),a=parseInt(e[5]+e[6],s)),[n,i,a]}},"hex2tuple"),Nqe=o(function(e){var r,n,i,a,s,l,u,h;function f(g,y,v){return v<0&&(v+=1),v>1&&(v-=1),v<1/6?g+(y-g)*6*v:v<1/2?y:v<2/3?g+(y-g)*(2/3-v)*6:g}o(f,"hue2rgb");var d=new RegExp("^"+Cqe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)l=u=h=Math.round(a*255);else{var p=a<.5?a*(1+i):a+i-a*i,m=2*a-p;l=Math.round(255*f(m,p,n+1/3)),u=Math.round(255*f(m,p,n)),h=Math.round(255*f(m,p,n-1/3))}r=[l,u,h,s]}return r},"hsl2tuple"),Mqe=o(function(e){var r,n=new RegExp("^"+Eqe+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var l=i[1]||i[2]||i[3],u=i[1]&&i[2]&&i[3];if(l&&!u)return;var h=n[4];if(h!==void 0){if(h=parseFloat(h),h<0||h>1)return;r.push(h)}}return r},"rgb2tuple"),Iqe=o(function(e){return Oqe[e.toLowerCase()]},"colorname2tuple"),hge=o(function(e){return(En(e)?e:null)||Iqe(e)||Rqe(e)||Mqe(e)||Nqe(e)},"color2tuple"),Oqe={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},fge=o(function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a<i;a++){var s=n[a];if(Ur(s))throw Error("Tried to set map with object key");a<n.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},"setMap"),dge=o(function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a<i;a++){var s=n[a];if(Ur(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},"getMap");o(Pqe,"isObject");Kp=Pqe,Wb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};o(Bqe,"createCommonjsModule");Fqe=typeof Wb=="object"&&Wb&&Wb.Object===Object&&Wb,$qe=Fqe,zqe=typeof self=="object"&&self&&self.Object===Object&&self,Gqe=$qe||zqe||Function("return this")(),Q6=Gqe,Vqe=o(function(){return Q6.Date.now()},"now"),nB=Vqe,Uqe=/\s/;o(Hqe,"trimmedEndIndex");Wqe=Hqe,qqe=/^\s+/;o(Yqe,"baseTrim");Xqe=Yqe,jqe=Q6.Symbol,ty=jqe,pge=Object.prototype,Kqe=pge.hasOwnProperty,Qqe=pge.toString,Fb=ty?ty.toStringTag:void 0;o(Zqe,"getRawTag");Jqe=Zqe,eYe=Object.prototype,tYe=eYe.toString;o(rYe,"objectToString");nYe=rYe,iYe="[object Null]",aYe="[object Undefined]",V0e=ty?ty.toStringTag:void 0;o(sYe,"baseGetTag");mge=sYe;o(oYe,"isObjectLike");lYe=oYe,cYe="[object Symbol]";o(uYe,"isSymbol");d4=uYe,U0e=NaN,hYe=/^[-+]0x[0-9a-f]+$/i,fYe=/^0b[01]+$/i,dYe=/^0o[0-7]+$/i,pYe=parseInt;o(mYe,"toNumber");H0e=mYe,gYe="Expected a function",yYe=Math.max,vYe=Math.min;o(xYe,"debounce");p4=xYe,iB=Hi?Hi.performance:null,gge=iB&&iB.now?function(){return iB.now()}:function(){return Date.now()},bYe=function(){if(Hi){if(Hi.requestAnimationFrame)return function(t){Hi.requestAnimationFrame(t)};if(Hi.mozRequestAnimationFrame)return function(t){Hi.mozRequestAnimationFrame(t)};if(Hi.webkitRequestAnimationFrame)return function(t){Hi.webkitRequestAnimationFrame(t)};if(Hi.msRequestAnimationFrame)return function(t){Hi.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(gge())},1e3/60)}}(),$6=o(function(e){return bYe(e)},"requestAnimationFrame"),nh=gge,X1=9261,yge=65599,qb=5381,vge=o(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X1,n=r,i;i=e.next(),!i.done;)n=n*yge+i.value|0;return n},"hashIterableInts"),t4=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X1;return r*yge+e|0},"hashInt"),r4=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qb;return(r<<5)+r+e|0},"hashIntAlt"),TYe=o(function(e,r){return e*2097152+r},"combineHashes"),Lf=o(function(e){return e[0]*2097152+e[1]},"combineHashesArray"),m6=o(function(e,r){return[t4(e[0],r[0]),r4(e[1],r[1])]},"hashArrays"),wYe=o(function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:o(function(){return i<a?n.value=e[i++]:n.done=!0,n},"next")};return vge(s,r)},"hashIntsArray"),Bf=o(function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:o(function(){return i<a?n.value=e.charCodeAt(i++):n.done=!0,n},"next")};return vge(s,r)},"hashString"),xge=o(function(){return kYe(arguments)},"hashStrings"),kYe=o(function(e){for(var r,n=0;n<e.length;n++){var i=e[n];n===0?r=Bf(i):r=Bf(i,r)}return r},"hashStringsArray"),W0e=!0,EYe=console.warn!=null,SYe=console.trace!=null,$B=Number.MAX_SAFE_INTEGER||9007199254740991,bge=o(function(){return!0},"trueify"),z6=o(function(){return!1},"falsify"),q0e=o(function(){return 0},"zeroify"),zB=o(function(){},"noop"),oi=o(function(e){throw new Error(e)},"error"),Tge=o(function(e){if(e!==void 0)W0e=!!e;else return W0e},"warnings"),hn=o(function(e){Tge()&&(EYe?console.warn(e):(console.log(e),SYe&&console.trace()))},"warn"),CYe=o(function(e){return ir({},e)},"clone"),Qc=o(function(e){return e==null?e:En(e)?e.slice():Ur(e)?CYe(e):e},"copy"),AYe=o(function(e){return e.slice()},"copyArray"),wge=o(function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},"uuid"),_Ye={},kge=o(function(){return _Ye},"staticEmptyObject"),oa=o(function(e){var r=Object.keys(e);return function(n){for(var i={},a=0;a<r.length;a++){var s=r[a],l=n?.[s];i[s]=l===void 0?e[s]:l}return i}},"defaults"),Ff=o(function(e,r,n){for(var i=e.length-1;i>=0&&!(e[i]===r&&(e.splice(i,1),n));i--);},"removeFromArray"),GB=o(function(e){e.splice(0,e.length)},"clearArray"),DYe=o(function(e,r){for(var n=0;n<r.length;n++){var i=r[n];e.push(i)}},"push"),Wl=o(function(e,r,n){return n&&(r=cge(n,r)),e[r]},"getPrefixedProperty"),Nf=o(function(e,r,n,i){n&&(r=cge(n,r)),e[r]=i},"setPrefixedProperty"),LYe=function(){function t(){Vf(this,t),this._obj={}}return o(t,"ObjectMap"),Uf(t,[{key:"set",value:o(function(r,n){return this._obj[r]=n,this},"set")},{key:"delete",value:o(function(r){return this._obj[r]=void 0,this},"_delete")},{key:"clear",value:o(function(){this._obj={}},"clear")},{key:"has",value:o(function(r){return this._obj[r]!==void 0},"has")},{key:"get",value:o(function(r){return this._obj[r]},"get")}]),t}(),Zc=typeof Map<"u"?Map:LYe,RYe="undefined",NYe=function(){function t(e){if(Vf(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return o(t,"ObjectSet"),Uf(t,[{key:"instanceString",value:o(function(){return"set"},"instanceString")},{key:"add",value:o(function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)},"add")},{key:"delete",value:o(function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)},"_delete")},{key:"clear",value:o(function(){this._obj=Object.create(null)},"clear")},{key:"has",value:o(function(r){return this._obj[r]===1},"has")},{key:"toArray",value:o(function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})},"toArray")},{key:"forEach",value:o(function(r,n){return this.toArray().forEach(r,n)},"forEach")}]),t}(),ay=(typeof Set>"u"?"undefined":qi(Set))!==RYe?Set:NYe,Z6=o(function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!BB(e)){oi("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){oi("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new ay,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,l=e.pan(),u=e.zoom();a.position={x:(s.x-l.x)/u,y:(s.y-l.y)/u}}var h=[];En(r.classes)?h=r.classes:Zt(r.classes)&&(h=r.classes.split(/\s+/));for(var f=0,d=h.length;f<d;f++){var p=h[f];!p||p===""||a.classes.add(p)}this.createEmitter();var m=r.style||r.css;m&&(hn("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(m)),(n===void 0||n)&&this.restore()},"Element"),Y0e=o(function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},o(function(n,i,a){var s;Ur(n)&&!xo(n)&&(s=n,n=s.roots||s.root,i=s.visit,a=s.directed),a=arguments.length===2&&!li(i)?i:a,i=li(i)?i:function(){};for(var l=this._private.cy,u=n=Zt(n)?this.filter(n):n,h=[],f=[],d={},p={},m={},g=0,y,v=this.byGroup(),x=v.nodes,b=v.edges,T=0;T<u.length;T++){var S=u[T],w=S.id();S.isNode()&&(h.unshift(S),e.bfs&&(m[w]=!0,f.push(S)),p[w]=0)}for(var E=o(function(){var L=e.bfs?h.shift():h.pop(),A=L.id();if(e.dfs){if(m[A])return"continue";m[A]=!0,f.push(L)}var I=p[A],M=d[A],P=M!=null?M.source():null,B=M!=null?M.target():null,F=M==null?void 0:L.same(P)?B[0]:P[0],z=void 0;if(z=i(L,M,F,g++,I),z===!0)return y=L,"break";if(z===!1)return"break";for(var $=L.connectedEdges().filter(function(ce){return(!a||ce.source().same(L))&&b.has(ce)}),U=0;U<$.length;U++){var K=$[U],ee=K.connectedNodes().filter(function(ce){return!ce.same(L)&&x.has(ce)}),Y=ee.id();ee.length!==0&&!m[Y]&&(ee=ee[0],h.push(ee),e.bfs&&(m[Y]=!0,f.push(ee)),d[Y]=K,p[Y]=p[A]+1)}},"_loop");h.length!==0;){var _=E();if(_!=="continue"&&_==="break")break}for(var C=l.collection(),D=0;D<f.length;D++){var O=f[D],R=d[O.id()];R!=null&&C.push(R),C.push(O)}return{path:l.collection(C),found:l.collection(y)}},"searchFn")},"defineSearch"),n4={breadthFirstSearch:Y0e({bfs:!0}),depthFirstSearch:Y0e({dfs:!0})};n4.bfs=n4.breadthFirstSearch;n4.dfs=n4.depthFirstSearch;MYe=Bqe(function(t,e){(function(){var r,n,i,a,s,l,u,h,f,d,p,m,g,y,v;i=Math.floor,d=Math.min,n=o(function(x,b){return x<b?-1:x>b?1:0},"defaultCmp"),f=o(function(x,b,T,S,w){var E;if(T==null&&(T=0),w==null&&(w=n),T<0)throw new Error("lo must be non-negative");for(S==null&&(S=x.length);T<S;)E=i((T+S)/2),w(b,x[E])<0?S=E:T=E+1;return[].splice.apply(x,[T,T-T].concat(b)),b},"insort"),l=o(function(x,b,T){return T==null&&(T=n),x.push(b),y(x,0,x.length-1,T)},"heappush"),s=o(function(x,b){var T,S;return b==null&&(b=n),T=x.pop(),x.length?(S=x[0],x[0]=T,v(x,0,b)):S=T,S},"heappop"),h=o(function(x,b,T){var S;return T==null&&(T=n),S=x[0],x[0]=b,v(x,0,T),S},"heapreplace"),u=o(function(x,b,T){var S;return T==null&&(T=n),x.length&&T(x[0],b)<0&&(S=[x[0],b],b=S[0],x[0]=S[1],v(x,0,T)),b},"heappushpop"),a=o(function(x,b){var T,S,w,E,_,C;for(b==null&&(b=n),E=function(){C=[];for(var D=0,O=i(x.length/2);0<=O?D<O:D>O;0<=O?D++:D--)C.push(D);return C}.apply(this).reverse(),_=[],S=0,w=E.length;S<w;S++)T=E[S],_.push(v(x,T,b));return _},"heapify"),g=o(function(x,b,T){var S;if(T==null&&(T=n),S=x.indexOf(b),S!==-1)return y(x,0,S,T),v(x,S,T)},"updateItem"),p=o(function(x,b,T){var S,w,E,_,C;if(T==null&&(T=n),w=x.slice(0,b),!w.length)return w;for(a(w,T),C=x.slice(b),E=0,_=C.length;E<_;E++)S=C[E],u(w,S,T);return w.sort(T).reverse()},"nlargest"),m=o(function(x,b,T){var S,w,E,_,C,D,O,R,k;if(T==null&&(T=n),b*10<=x.length){if(E=x.slice(0,b).sort(T),!E.length)return E;for(w=E[E.length-1],O=x.slice(b),_=0,D=O.length;_<D;_++)S=O[_],T(S,w)<0&&(f(E,S,0,null,T),E.pop(),w=E[E.length-1]);return E}for(a(x,T),k=[],C=0,R=d(b,x.length);0<=R?C<R:C>R;0<=R?++C:--C)k.push(s(x,T));return k},"nsmallest"),y=o(function(x,b,T,S){var w,E,_;for(S==null&&(S=n),w=x[T];T>b;){if(_=T-1>>1,E=x[_],S(w,E)<0){x[T]=E,T=_;continue}break}return x[T]=w},"_siftdown"),v=o(function(x,b,T){var S,w,E,_,C;for(T==null&&(T=n),w=x.length,C=b,E=x[b],S=2*b+1;S<w;)_=S+1,_<w&&!(T(x[S],x[_])<0)&&(S=_),x[b]=x[S],b=S,S=2*b+1;return x[b]=E,y(x,C,b,T)},"_siftup"),r=function(){x.push=l,x.pop=s,x.replace=h,x.pushpop=u,x.heapify=a,x.updateItem=g,x.nlargest=p,x.nsmallest=m;function x(b){this.cmp=b??n,this.nodes=[]}return o(x,"Heap"),x.prototype.push=function(b){return l(this.nodes,b,this.cmp)},x.prototype.pop=function(){return s(this.nodes,this.cmp)},x.prototype.peek=function(){return this.nodes[0]},x.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},x.prototype.replace=function(b){return h(this.nodes,b,this.cmp)},x.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},x.prototype.heapify=function(){return a(this.nodes,this.cmp)},x.prototype.updateItem=function(b){return g(this.nodes,b,this.cmp)},x.prototype.clear=function(){return this.nodes=[]},x.prototype.empty=function(){return this.nodes.length===0},x.prototype.size=function(){return this.nodes.length},x.prototype.clone=function(){var b;return b=new x,b.nodes=this.nodes.slice(0),b},x.prototype.toArray=function(){return this.nodes.slice(0)},x.prototype.insert=x.prototype.push,x.prototype.top=x.prototype.peek,x.prototype.front=x.prototype.peek,x.prototype.has=x.prototype.contains,x.prototype.copy=x.prototype.clone,x}(),function(x,b){return t.exports=b()}(this,function(){return r})}).call(Wb)}),m4=MYe,IYe=oa({root:null,weight:o(function(e){return 1},"weight"),directed:!1}),OYe={dijkstra:o(function(e){if(!Ur(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=IYe(e),i=n.root,a=n.weight,s=n.directed,l=this,u=a,h=Zt(i)?this.filter(i)[0]:i[0],f={},d={},p={},m=this.byGroup(),g=m.nodes,y=m.edges;y.unmergeBy(function(I){return I.isLoop()});for(var v=o(function(M){return f[M.id()]},"getDist"),x=o(function(M,P){f[M.id()]=P,b.updateItem(M)},"setDist"),b=new m4(function(I,M){return v(I)-v(M)}),T=0;T<g.length;T++){var S=g[T];f[S.id()]=S.same(h)?0:1/0,b.push(S)}for(var w=o(function(M,P){for(var B=(s?M.edgesTo(P):M.edgesWith(P)).intersect(y),F=1/0,z,$=0;$<B.length;$++){var U=B[$],K=u(U);(K<F||!z)&&(F=K,z=U)}return{edge:z,dist:F}},"distBetween");b.size()>0;){var E=b.pop(),_=v(E),C=E.id();if(p[C]=_,_!==1/0)for(var D=E.neighborhood().intersect(g),O=0;O<D.length;O++){var R=D[O],k=R.id(),L=w(E,R),A=_+L.dist;A<v(R)&&(x(R,A),d[k]={node:E,edge:L.edge})}}return{distanceTo:o(function(M){var P=Zt(M)?g.filter(M)[0]:M[0];return p[P.id()]},"distanceTo"),pathTo:o(function(M){var P=Zt(M)?g.filter(M)[0]:M[0],B=[],F=P,z=F.id();if(P.length>0)for(B.unshift(P);d[z];){var $=d[z];B.unshift($.edge),B.unshift($.node),F=$.node,z=F.id()}return l.spawn(B)},"pathTo")}},"dijkstra")},PYe={kruskal:o(function(e){e=e||function(T){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),l=n,u=o(function(S){for(var w=0;w<s.length;w++){var E=s[w];if(E.has(S))return w}},"findSetIndex"),h=0;h<a;h++)s[h]=this.spawn(n[h]);for(var f=i.sort(function(T,S){return e(T)-e(S)}),d=0;d<f.length;d++){var p=f[d],m=p.source()[0],g=p.target()[0],y=u(m),v=u(g),x=s[y],b=s[v];y!==v&&(l.merge(p),x.merge(b),s.splice(v,1))}return l},"kruskal")},BYe=oa({root:null,goal:null,weight:o(function(e){return 1},"weight"),heuristic:o(function(e){return 0},"heuristic"),directed:!1}),FYe={aStar:o(function(e){var r=this.cy(),n=BYe(e),i=n.root,a=n.goal,s=n.heuristic,l=n.directed,u=n.weight;i=r.collection(i)[0],a=r.collection(a)[0];var h=i.id(),f=a.id(),d={},p={},m={},g=new m4(function(z,$){return p[z.id()]-p[$.id()]}),y=new ay,v={},x={},b=o(function($,U){g.push($),y.add(U)},"addToOpenSet"),T,S,w=o(function(){T=g.pop(),S=T.id(),y.delete(S)},"popFromOpenSet"),E=o(function($){return y.has($)},"isInOpenSet");b(i,h),d[h]=0,p[h]=s(i);for(var _=0;g.size()>0;){if(w(),_++,S===f){for(var C=[],D=a,O=f,R=x[O];C.unshift(D),R!=null&&C.unshift(R),D=v[O],D!=null;)O=D.id(),R=x[O];return{found:!0,distance:d[S],path:this.spawn(C),steps:_}}m[S]=!0;for(var k=T._private.edges,L=0;L<k.length;L++){var A=k[L];if(this.hasElementWithId(A.id())&&!(l&&A.data("source")!==S)){var I=A.source(),M=A.target(),P=I.id()!==S?I:M,B=P.id();if(this.hasElementWithId(B)&&!m[B]){var F=d[S]+u(A);if(!E(B)){d[B]=F,p[B]=F+s(P),b(P,B),v[B]=T,x[B]=A;continue}F<d[B]&&(d[B]=F,p[B]=F+s(P),v[B]=T,x[B]=A)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}},"aStar")},$Ye=oa({weight:o(function(e){return 1},"weight"),directed:!1}),zYe={floydWarshall:o(function(e){for(var r=this.cy(),n=$Ye(e),i=n.weight,a=n.directed,s=i,l=this.byGroup(),u=l.nodes,h=l.edges,f=u.length,d=f*f,p=o(function(K){return u.indexOf(K)},"indexOf"),m=o(function(K){return u[K]},"atIndex"),g=new Array(d),y=0;y<d;y++){var v=y%f,x=(y-v)/f;x===v?g[y]=0:g[y]=1/0}for(var b=new Array(d),T=new Array(d),S=0;S<h.length;S++){var w=h[S],E=w.source()[0],_=w.target()[0];if(E!==_){var C=p(E),D=p(_),O=C*f+D,R=s(w);if(g[O]>R&&(g[O]=R,b[O]=D,T[O]=w),!a){var k=D*f+C;!a&&g[k]>R&&(g[k]=R,b[k]=C,T[k]=w)}}}for(var L=0;L<f;L++)for(var A=0;A<f;A++)for(var I=A*f+L,M=0;M<f;M++){var P=A*f+M,B=L*f+M;g[I]+g[B]<g[P]&&(g[P]=g[I]+g[B],b[P]=b[I])}var F=o(function(K){return(Zt(K)?r.filter(K):K)[0]},"getArgEle"),z=o(function(K){return p(F(K))},"indexOfArgEle"),$={distance:o(function(K,ee){var Y=z(K),ce=z(ee);return g[Y*f+ce]},"distance"),path:o(function(K,ee){var Y=z(K),ce=z(ee),Z=m(Y);if(Y===ce)return Z.collection();if(b[Y*f+ce]==null)return r.collection();var ue=r.collection(),Q=Y,j;for(ue.merge(Z);Y!==ce;)Q=Y,Y=b[Y*f+ce],j=T[Q*f+Y],ue.merge(j),ue.merge(m(Y));return ue},"path")};return $},"floydWarshall")},GYe=oa({weight:o(function(e){return 1},"weight"),directed:!1,root:null}),VYe={bellmanFord:o(function(e){var r=this,n=GYe(e),i=n.weight,a=n.directed,s=n.root,l=i,u=this,h=this.cy(),f=this.byGroup(),d=f.edges,p=f.nodes,m=p.length,g=new Zc,y=!1,v=[];s=h.collection(s)[0],d.unmergeBy(function(se){return se.isLoop()});for(var x=d.length,b=o(function(ae){var Oe=g.get(ae.id());return Oe||(Oe={},g.set(ae.id(),Oe)),Oe},"getInfo"),T=o(function(ae){return(Zt(ae)?h.$(ae):ae)[0]},"getNodeFromTo"),S=o(function(ae){return b(T(ae)).dist},"distanceTo"),w=o(function(ae){for(var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,ye=T(ae),Be=[],He=ye;;){if(He==null)return r.spawn();var ze=b(He),Le=ze.edge,Ie=ze.pred;if(Be.unshift(He[0]),He.same(Oe)&&Be.length>0)break;Le!=null&&Be.unshift(Le),He=Ie}return u.spawn(Be)},"pathTo"),E=0;E<m;E++){var _=p[E],C=b(_);_.same(s)?C.dist=0:C.dist=1/0,C.pred=null,C.edge=null}for(var D=!1,O=o(function(ae,Oe,ye,Be,He,ze){var Le=Be.dist+ze;Le<He.dist&&!ye.same(Be.edge)&&(He.dist=Le,He.pred=ae,He.edge=ye,D=!0)},"checkForEdgeReplacement"),R=1;R<m;R++){D=!1;for(var k=0;k<x;k++){var L=d[k],A=L.source(),I=L.target(),M=l(L),P=b(A),B=b(I);O(A,I,L,P,B,M),a||O(I,A,L,B,P,M)}if(!D)break}if(D)for(var F=[],z=0;z<x;z++){var $=d[z],U=$.source(),K=$.target(),ee=l($),Y=b(U).dist,ce=b(K).dist;if(Y+ee<ce||!a&&ce+ee<Y)if(y||(hn("Graph contains a negative weight cycle for Bellman-Ford"),y=!0),e.findNegativeWeightCycles!==!1){var Z=[];Y+ee<ce&&Z.push(U),!a&&ce+ee<Y&&Z.push(K);for(var ue=Z.length,Q=0;Q<ue;Q++){var j=Z[Q],ne=[j];ne.push(b(j).edge);for(var te=b(j).pred;ne.indexOf(te)===-1;)ne.push(te),ne.push(b(te).edge),te=b(te).pred;ne=ne.slice(ne.indexOf(te));for(var he=ne[0].id(),le=0,J=2;J<ne.length;J+=2)ne[J].id()<he&&(he=ne[J].id(),le=J);ne=ne.slice(le).concat(ne.slice(0,le)),ne.push(ne[0]);var Se=ne.map(function(se){return se.id()}).join(",");F.indexOf(Se)===-1&&(v.push(u.spawn(ne)),F.push(Se))}}else break}return{distanceTo:S,pathTo:w,hasNegativeWeightCycle:y,negativeWeightCycles:v}},"bellmanFord")},UYe=Math.sqrt(2),HYe=o(function(e,r,n){n.length===0&&oi("Karger-Stein must be run on a connected (sub)graph");for(var i=n[e],a=i[1],s=i[2],l=r[a],u=r[s],h=n,f=h.length-1;f>=0;f--){var d=h[f],p=d[1],m=d[2];(r[p]===l&&r[m]===u||r[p]===u&&r[m]===l)&&h.splice(f,1)}for(var g=0;g<h.length;g++){var y=h[g];y[1]===u?(h[g]=y.slice(),h[g][1]=l):y[2]===u&&(h[g]=y.slice(),h[g][2]=l)}for(var v=0;v<r.length;v++)r[v]===u&&(r[v]=l);return h},"collapse"),aB=o(function(e,r,n,i){for(;n>i;){var a=Math.floor(Math.random()*r.length);r=HYe(a,e,r),n--}return r},"contractUntil"),WYe={kargerStein:o(function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(B){return B.isLoop()});var a=n.length,s=i.length,l=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),u=Math.floor(a/UYe);if(a<2){oi("At least 2 nodes are required for Karger-Stein algorithm");return}for(var h=[],f=0;f<s;f++){var d=i[f];h.push([f,n.indexOf(d.source()),n.indexOf(d.target())])}for(var p=1/0,m=[],g=new Array(a),y=new Array(a),v=new Array(a),x=o(function(F,z){for(var $=0;$<a;$++)z[$]=F[$]},"copyNodesMap"),b=0;b<=l;b++){for(var T=0;T<a;T++)y[T]=T;var S=aB(y,h.slice(),a,u),w=S.slice();x(y,v);var E=aB(y,S,u,2),_=aB(v,w,u,2);E.length<=_.length&&E.length<p?(p=E.length,m=E,x(y,g)):_.length<=E.length&&_.length<p&&(p=_.length,m=_,x(v,g))}for(var C=this.spawn(m.map(function(B){return i[B[0]]})),D=this.spawn(),O=this.spawn(),R=g[0],k=0;k<g.length;k++){var L=g[k],A=n[k];L===R?D.merge(A):O.merge(A)}var I=o(function(F){var z=e.spawn();return F.forEach(function($){z.merge($),$.connectedEdges().forEach(function(U){e.contains(U)&&!C.contains(U)&&z.merge(U)})}),z},"constructComponent"),M=[I(D),I(O)],P={cut:C,components:M,partition1:D,partition2:O};return P},"kargerStein")},qYe=o(function(e){return{x:e.x,y:e.y}},"copyPosition"),J6=o(function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},"modelToRenderedPosition"),Ege=o(function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},"renderedToModelPosition"),j1=o(function(e){return{x:e[0],y:e[1]}},"array2point"),YYe=o(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a<n;a++){var s=e[a];isFinite(s)&&(i=Math.min(s,i))}return i},"min"),XYe=o(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a<n;a++){var s=e[a];isFinite(s)&&(i=Math.max(s,i))}return i},"max"),jYe=o(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s<n;s++){var l=e[s];isFinite(l)&&(i+=l,a++)}return i/a},"mean"),KYe=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var l=0,u=e.length-1;u>=0;u--){var h=e[u];s?isFinite(h)||(e[u]=-1/0,l++):e.splice(u,1)}a&&e.sort(function(p,m){return p-m});var f=e.length,d=Math.floor(f/2);return f%2!==0?e[d+1+l]:(e[d-1+l]+e[d+l])/2},"median"),QYe=o(function(e){return Math.PI*e/180},"deg2rad"),g6=o(function(e,r){return Math.atan2(r,e)-Math.PI/2},"getAngleFromDisp"),VB=Math.log2||function(t){return Math.log(t)/Math.log(2)},Sge=o(function(e){return e>0?1:e<0?-1:0},"signum"),Qp=o(function(e,r){return Math.sqrt(Wp(e,r))},"dist"),Wp=o(function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},"sqdist"),ZYe=o(function(e){for(var r=e.length,n=0,i=0;i<r;i++)n+=e[i];for(var a=0;a<r;a++)e[a]=e[a]/n;return e},"inPlaceSumNormalize"),sa=o(function(e,r,n,i){return(1-i)*(1-i)*e+2*(1-i)*i*r+i*i*n},"qbezierAt"),Q1=o(function(e,r,n,i){return{x:sa(e.x,r.x,n.x,i),y:sa(e.y,r.y,n.y,i)}},"qbezierPtAt"),JYe=o(function(e,r,n,i){var a={x:r.x-e.x,y:r.y-e.y},s=Qp(e,r),l={x:a.x/s,y:a.y/s};return n=n??0,i=i??n*s,{x:e.x+l.x*i,y:e.y+l.y*i}},"lineAt"),i4=o(function(e,r,n){return Math.max(e,Math.min(n,r))},"bound"),Ys=o(function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},"makeBoundingBox"),eXe=o(function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},"copyBoundingBox"),tXe=o(function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},"clearBoundingBox"),rXe=o(function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},"shiftBoundingBox"),Cge=o(function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},"updateBoundingBox"),nXe=o(function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},"expandBoundingBoxByPoint"),D6=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},"expandBoundingBox"),L6=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var l=Ri(r,4);n=l[0],i=l[1],a=l[2],s=l[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},"expandBoundingBoxSides"),X0e=o(function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},"assignBoundingBox"),UB=o(function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},"boundingBoxesIntersect"),ry=o(function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},"inBoundingBox"),iXe=o(function(e,r){return ry(e,r.x,r.y)},"pointInBoundingBox"),Age=o(function(e,r){return ry(e,r.x1,r.y1)&&ry(e,r.x2,r.y2)},"boundingBoxInBoundingBox"),_ge=o(function(e,r,n,i,a,s,l){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",h=u==="auto"?Zp(a,s):u,f=a/2,d=s/2;h=Math.min(h,f,d);var p=h!==f,m=h!==d,g;if(p){var y=n-f+h-l,v=i-d-l,x=n+f-h+l,b=v;if(g=Mf(e,r,n,i,y,v,x,b,!1),g.length>0)return g}if(m){var T=n+f+l,S=i-d+h-l,w=T,E=i+d-h+l;if(g=Mf(e,r,n,i,T,S,w,E,!1),g.length>0)return g}if(p){var _=n-f+h-l,C=i+d+l,D=n+f-h+l,O=C;if(g=Mf(e,r,n,i,_,C,D,O,!1),g.length>0)return g}if(m){var R=n-f-l,k=i-d+h-l,L=R,A=i+d-h+l;if(g=Mf(e,r,n,i,R,k,L,A,!1),g.length>0)return g}var I;{var M=n-f+h,P=i-d+h;if(I=Yb(e,r,n,i,M,P,h+l),I.length>0&&I[0]<=M&&I[1]<=P)return[I[0],I[1]]}{var B=n+f-h,F=i-d+h;if(I=Yb(e,r,n,i,B,F,h+l),I.length>0&&I[0]>=B&&I[1]<=F)return[I[0],I[1]]}{var z=n+f-h,$=i+d-h;if(I=Yb(e,r,n,i,z,$,h+l),I.length>0&&I[0]>=z&&I[1]>=$)return[I[0],I[1]]}{var U=n-f+h,K=i+d-h;if(I=Yb(e,r,n,i,U,K,h+l),I.length>0&&I[0]<=U&&I[1]>=K)return[I[0],I[1]]}return[]},"roundRectangleIntersectLine"),aXe=o(function(e,r,n,i,a,s,l){var u=l,h=Math.min(n,a),f=Math.max(n,a),d=Math.min(i,s),p=Math.max(i,s);return h-u<=e&&e<=f+u&&d-u<=r&&r<=p+u},"inLineVicinity"),sXe=o(function(e,r,n,i,a,s,l,u,h){var f={x1:Math.min(n,l,a)-h,x2:Math.max(n,l,a)+h,y1:Math.min(i,u,s)-h,y2:Math.max(i,u,s)+h};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},"inBezierVicinity"),oXe=o(function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),l=2*e,u=(-r+s)/l,h=(-r-s)/l;return[u,h]},"solveQuadratic"),lXe=o(function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var l,u,h,f,d,p,m,g;if(u=(3*n-r*r)/9,h=-(27*i)+r*(9*n-2*(r*r)),h/=54,l=u*u*u+h*h,a[1]=0,m=r/3,l>0){d=h+Math.sqrt(l),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),p=h-Math.sqrt(l),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),a[0]=-m+d+p,m+=(d+p)/2,a[4]=a[2]=-m,m=Math.sqrt(3)*(-p+d)/2,a[3]=m,a[5]=-m;return}if(a[5]=a[3]=0,l===0){g=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),a[0]=-m+2*g,a[4]=a[2]=-(g+m);return}u=-u,f=u*u*u,f=Math.acos(h/Math.sqrt(f)),g=2*Math.sqrt(u),a[0]=-m+g*Math.cos(f/3),a[2]=-m+g*Math.cos((f+2*Math.PI)/3),a[4]=-m+g*Math.cos((f+4*Math.PI)/3)},"solveCubic"),cXe=o(function(e,r,n,i,a,s,l,u){var h=1*n*n-4*n*a+2*n*l+4*a*a-4*a*l+l*l+i*i-4*i*s+2*i*u+4*s*s-4*s*u+u*u,f=1*9*n*a-3*n*n-3*n*l-6*a*a+3*a*l+9*i*s-3*i*i-3*i*u-6*s*s+3*s*u,d=1*3*n*n-6*n*a+n*l-n*e+2*a*a+2*a*e-l*e+3*i*i-6*i*s+i*u-i*r+2*s*s+2*s*r-u*r,p=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,m=[];lXe(h,f,d,p,m);for(var g=1e-7,y=[],v=0;v<6;v+=2)Math.abs(m[v+1])<g&&m[v]>=0&&m[v]<=1&&y.push(m[v]);y.push(1),y.push(0);for(var x=-1,b,T,S,w=0;w<y.length;w++)b=Math.pow(1-y[w],2)*n+2*(1-y[w])*y[w]*a+y[w]*y[w]*l,T=Math.pow(1-y[w],2)*i+2*(1-y[w])*y[w]*s+y[w]*y[w]*u,S=Math.pow(b-e,2)+Math.pow(T-r,2),x>=0?S<x&&(x=S):x=S;return x},"sqdistToQuadraticBezier"),uXe=o(function(e,r,n,i,a,s){var l=[e-n,r-i],u=[a-n,s-i],h=u[0]*u[0]+u[1]*u[1],f=l[0]*l[0]+l[1]*l[1],d=l[0]*u[0]+l[1]*u[1],p=d*d/h;return d<0?f:p>h?(e-a)*(e-a)+(r-s)*(r-s):f-p},"sqdistToFiniteLine"),qs=o(function(e,r,n){for(var i,a,s,l,u,h=0,f=0;f<n.length/2;f++)if(i=n[f*2],a=n[f*2+1],f+1<n.length/2?(s=n[(f+1)*2],l=n[(f+1)*2+1]):(s=n[(f+1-n.length/2)*2],l=n[(f+1-n.length/2)*2+1]),!(i==e&&s==e))if(i>=e&&e>=s||i<=e&&e<=s)u=(e-i)/(s-i)*(l-a)+a,u>r&&h++;else continue;return h%2!==0},"pointInsidePolygonPoints"),ih=o(function(e,r,n,i,a,s,l,u,h){var f=new Array(n.length),d;u[0]!=null?(d=Math.atan(u[1]/u[0]),u[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=u;for(var p=Math.cos(-d),m=Math.sin(-d),g=0;g<f.length/2;g++)f[g*2]=s/2*(n[g*2]*p-n[g*2+1]*m),f[g*2+1]=l/2*(n[g*2+1]*p+n[g*2]*m),f[g*2]+=i,f[g*2+1]+=a;var y;if(h>0){var v=V6(f,-h);y=G6(v)}else y=f;return qs(e,r,y)},"pointInsidePolygon"),hXe=o(function(e,r,n,i,a,s,l,u){for(var h=new Array(n.length*2),f=0;f<u.length;f++){var d=u[f];h[f*4+0]=d.startX,h[f*4+1]=d.startY,h[f*4+2]=d.stopX,h[f*4+3]=d.stopY;var p=Math.pow(d.cx-e,2)+Math.pow(d.cy-r,2);if(p<=Math.pow(d.radius,2))return!0}return qs(e,r,h)},"pointInsideRoundPolygon"),G6=o(function(e){for(var r=new Array(e.length/2),n,i,a,s,l,u,h,f,d=0;d<e.length/4;d++){n=e[d*4],i=e[d*4+1],a=e[d*4+2],s=e[d*4+3],d<e.length/4-1?(l=e[(d+1)*4],u=e[(d+1)*4+1],h=e[(d+1)*4+2],f=e[(d+1)*4+3]):(l=e[0],u=e[1],h=e[2],f=e[3]);var p=Mf(n,i,a,s,l,u,h,f,!0);r[d*2]=p[0],r[d*2+1]=p[1]}return r},"joinLines"),V6=o(function(e,r){for(var n=new Array(e.length*2),i,a,s,l,u=0;u<e.length/2;u++){i=e[u*2],a=e[u*2+1],u<e.length/2-1?(s=e[(u+1)*2],l=e[(u+1)*2+1]):(s=e[0],l=e[1]);var h=l-a,f=-(s-i),d=Math.sqrt(h*h+f*f),p=h/d,m=f/d;n[u*4]=i+p*r,n[u*4+1]=a+m*r,n[u*4+2]=s+p*r,n[u*4+3]=l+m*r}return n},"expandPolygon"),fXe=o(function(e,r,n,i,a,s){var l=n-e,u=i-r;l/=a,u/=s;var h=Math.sqrt(l*l+u*u),f=h-1;if(f<0)return[];var d=f/h;return[(n-e)*d+e,(i-r)*d+r]},"intersectLineEllipse"),jp=o(function(e,r,n,i,a,s,l){return e-=a,r-=s,e/=n/2+l,r/=i/2+l,e*e+r*r<=1},"checkInEllipse"),Yb=o(function(e,r,n,i,a,s,l){var u=[n-e,i-r],h=[e-a,r-s],f=u[0]*u[0]+u[1]*u[1],d=2*(h[0]*u[0]+h[1]*u[1]),p=h[0]*h[0]+h[1]*h[1]-l*l,m=d*d-4*f*p;if(m<0)return[];var g=(-d+Math.sqrt(m))/(2*f),y=(-d-Math.sqrt(m))/(2*f),v=Math.min(g,y),x=Math.max(g,y),b=[];if(v>=0&&v<=1&&b.push(v),x>=0&&x<=1&&b.push(x),b.length===0)return[];var T=b[0]*u[0]+e,S=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[T,S];var w=b[1]*u[0]+e,E=b[1]*u[1]+r;return[T,S,w,E]}else return[T,S]},"intersectLineCircle"),sB=o(function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},"midOfThree"),Mf=o(function(e,r,n,i,a,s,l,u,h){var f=e-a,d=n-e,p=l-a,m=r-s,g=i-r,y=u-s,v=p*m-y*f,x=d*m-g*f,b=y*d-p*g;if(b!==0){var T=v/b,S=x/b,w=.001,E=0-w,_=1+w;return E<=T&&T<=_&&E<=S&&S<=_?[e+T*d,r+T*g]:h?[e+T*d,r+T*g]:[]}else return v===0||x===0?sB(e,n,l)===l?[l,u]:sB(e,n,a)===a?[a,s]:sB(a,l,n)===n?[n,i]:[]:[]},"finiteLinesIntersect"),a4=o(function(e,r,n,i,a,s,l,u){var h=[],f,d=new Array(n.length),p=!0;s==null&&(p=!1);var m;if(p){for(var g=0;g<d.length/2;g++)d[g*2]=n[g*2]*s+i,d[g*2+1]=n[g*2+1]*l+a;if(u>0){var y=V6(d,-u);m=G6(y)}else m=d}else m=n;for(var v,x,b,T,S=0;S<m.length/2;S++)v=m[S*2],x=m[S*2+1],S<m.length/2-1?(b=m[(S+1)*2],T=m[(S+1)*2+1]):(b=m[0],T=m[1]),f=Mf(e,r,i,a,v,x,b,T),f.length!==0&&h.push(f[0],f[1]);return h},"polygonIntersectLine"),dXe=o(function(e,r,n,i,a,s,l,u,h){var f=[],d,p=new Array(n.length*2);h.forEach(function(b,T){T===0?(p[p.length-2]=b.startX,p[p.length-1]=b.startY):(p[T*4-2]=b.startX,p[T*4-1]=b.startY),p[T*4]=b.stopX,p[T*4+1]=b.stopY,d=Yb(e,r,i,a,b.cx,b.cy,b.radius),d.length!==0&&f.push(d[0],d[1])});for(var m=0;m<p.length/4;m++)d=Mf(e,r,i,a,p[m*4],p[m*4+1],p[m*4+2],p[m*4+3],!1),d.length!==0&&f.push(d[0],d[1]);if(f.length>2){for(var g=[f[0],f[1]],y=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),v=1;v<f.length/2;v++){var x=Math.pow(f[v*2]-e,2)+Math.pow(f[v*2+1]-r,2);x<=y&&(g[0]=f[v*2],g[1]=f[v*2+1],y=x)}return g}return f},"roundPolygonIntersectLine"),y6=o(function(e,r,n){var i=[e[0]-r[0],e[1]-r[1]],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=(a-n)/a;return s<0&&(s=1e-5),[r[0]+s*i[0],r[1]+s*i[1]]},"shortenIntersection"),Ts=o(function(e,r){var n=bB(e,r);return n=Dge(n),n},"generateUnitNgonPointsFitToSquare"),Dge=o(function(e){for(var r,n,i=e.length/2,a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h<i;h++)r=e[2*h],n=e[2*h+1],a=Math.min(a,r),l=Math.max(l,r),s=Math.min(s,n),u=Math.max(u,n);for(var f=2/(l-a),d=2/(u-s),p=0;p<i;p++)r=e[2*p]=e[2*p]*f,n=e[2*p+1]=e[2*p+1]*d,a=Math.min(a,r),l=Math.max(l,r),s=Math.min(s,n),u=Math.max(u,n);if(s<-1)for(var m=0;m<i;m++)n=e[2*m+1]=e[2*m+1]+(-1-s);return e},"fitPolygonToSquare"),bB=o(function(e,r){var n=1/e*2*Math.PI,i=e%2===0?Math.PI/2+n/2:Math.PI/2;i+=r;for(var a=new Array(e*2),s,l=0;l<e;l++)s=l*n+i,a[2*l]=Math.cos(s),a[2*l+1]=Math.sin(-s);return a},"generateUnitNgonPoints"),Zp=o(function(e,r){return Math.min(e/4,r/4,8)},"getRoundRectangleRadius"),Lge=o(function(e,r){return Math.min(e/10,r/10,8)},"getRoundPolygonRadius"),HB=o(function(){return 8},"getCutRectangleCornerLength"),pXe=o(function(e,r,n){return[e-2*r+n,2*(r-e),e]},"bezierPtsToQuadCoeff"),TB=o(function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},"getBarrelCurveConstants"),mXe=oa({dampingFactor:.8,precision:1e-6,iterations:200,weight:o(function(e){return 1},"weight")}),gXe={pageRank:o(function(e){for(var r=mXe(e),n=r.dampingFactor,i=r.precision,a=r.iterations,s=r.weight,l=this._private.cy,u=this.byGroup(),h=u.nodes,f=u.edges,d=h.length,p=d*d,m=f.length,g=new Array(p),y=new Array(d),v=(1-n)/d,x=0;x<d;x++){for(var b=0;b<d;b++){var T=x*d+b;g[T]=0}y[x]=0}for(var S=0;S<m;S++){var w=f[S],E=w.data("source"),_=w.data("target");if(E!==_){var C=h.indexOfId(E),D=h.indexOfId(_),O=s(w),R=D*d+C;g[R]+=O,y[C]+=O}}for(var k=1/d+v,L=0;L<d;L++)if(y[L]===0)for(var A=0;A<d;A++){var I=A*d+L;g[I]=k}else for(var M=0;M<d;M++){var P=M*d+L;g[P]=g[P]/y[L]+v}for(var B=new Array(d),F=new Array(d),z,$=0;$<d;$++)B[$]=1;for(var U=0;U<a;U++){for(var K=0;K<d;K++)F[K]=0;for(var ee=0;ee<d;ee++)for(var Y=0;Y<d;Y++){var ce=ee*d+Y;F[ee]+=g[ce]*B[Y]}ZYe(F),z=B,B=F,F=z;for(var Z=0,ue=0;ue<d;ue++){var Q=z[ue]-B[ue];Z+=Q*Q}if(Z<i)break}var j={rank:o(function(te){return te=l.collection(te)[0],B[h.indexOf(te)]},"rank")};return j},"pageRank")},j0e=oa({root:null,weight:o(function(e){return 1},"weight"),directed:!1,alpha:0}),Z1={degreeCentralityNormalized:o(function(e){e=j0e(e);var r=this.cy(),n=this.nodes(),i=n.length;if(e.directed){for(var f={},d={},p=0,m=0,g=0;g<i;g++){var y=n[g],v=y.id();e.root=y;var x=this.degreeCentrality(e);p<x.indegree&&(p=x.indegree),m<x.outdegree&&(m=x.outdegree),f[v]=x.indegree,d[v]=x.outdegree}return{indegree:o(function(T){return p==0?0:(Zt(T)&&(T=r.filter(T)),f[T.id()]/p)},"indegree"),outdegree:o(function(T){return m===0?0:(Zt(T)&&(T=r.filter(T)),d[T.id()]/m)},"outdegree")}}else{for(var a={},s=0,l=0;l<i;l++){var u=n[l];e.root=u;var h=this.degreeCentrality(e);s<h.degree&&(s=h.degree),a[u.id()]=h.degree}return{degree:o(function(T){return s===0?0:(Zt(T)&&(T=r.filter(T)),a[T.id()]/s)},"degree")}}},"degreeCentralityNormalized"),degreeCentrality:o(function(e){e=j0e(e);var r=this.cy(),n=this,i=e,a=i.root,s=i.weight,l=i.directed,u=i.alpha;if(a=r.collection(a)[0],l){for(var m=a.connectedEdges(),g=m.filter(function(E){return E.target().same(a)&&n.has(E)}),y=m.filter(function(E){return E.source().same(a)&&n.has(E)}),v=g.length,x=y.length,b=0,T=0,S=0;S<g.length;S++)b+=s(g[S]);for(var w=0;w<y.length;w++)T+=s(y[w]);return{indegree:Math.pow(v,1-u)*Math.pow(b,u),outdegree:Math.pow(x,1-u)*Math.pow(T,u)}}else{for(var h=a.connectedEdges().intersection(n),f=h.length,d=0,p=0;p<h.length;p++)d+=s(h[p]);return{degree:Math.pow(f,1-u)*Math.pow(d,u)}}},"degreeCentrality")};Z1.dc=Z1.degreeCentrality;Z1.dcn=Z1.degreeCentralityNormalised=Z1.degreeCentralityNormalized;K0e=oa({harmonic:!0,weight:o(function(){return 1},"weight"),directed:!1,root:null}),J1={closenessCentralityNormalized:o(function(e){for(var r=K0e(e),n=r.harmonic,i=r.weight,a=r.directed,s=this.cy(),l={},u=0,h=this.nodes(),f=this.floydWarshall({weight:i,directed:a}),d=0;d<h.length;d++){for(var p=0,m=h[d],g=0;g<h.length;g++)if(d!==g){var y=f.distance(m,h[g]);n?p+=1/y:p+=y}n||(p=1/p),u<p&&(u=p),l[m.id()]=p}return{closeness:o(function(x){return u==0?0:(Zt(x)?x=s.filter(x)[0].id():x=x.id(),l[x]/u)},"closeness")}},"closenessCentralityNormalized"),closenessCentrality:o(function(e){var r=K0e(e),n=r.root,i=r.weight,a=r.directed,s=r.harmonic;n=this.filter(n)[0];for(var l=this.dijkstra({root:n,weight:i,directed:a}),u=0,h=this.nodes(),f=0;f<h.length;f++){var d=h[f];if(!d.same(n)){var p=l.distanceTo(d);s?u+=1/p:u+=p}}return s?u:1/u},"closenessCentrality")};J1.cc=J1.closenessCentrality;J1.ccn=J1.closenessCentralityNormalised=J1.closenessCentralityNormalized;yXe=oa({weight:null,directed:!1}),wB={betweennessCentrality:o(function(e){for(var r=yXe(e),n=r.directed,i=r.weight,a=i!=null,s=this.cy(),l=this.nodes(),u={},h={},f=0,d={set:o(function(T,S){h[T]=S,S>f&&(f=S)},"set"),get:o(function(T){return h[T]},"get")},p=0;p<l.length;p++){var m=l[p],g=m.id();n?u[g]=m.outgoers().nodes():u[g]=m.openNeighborhood().nodes(),d.set(g,0)}for(var y=o(function(T){for(var S=l[T].id(),w=[],E={},_={},C={},D=new m4(function(Y,ce){return C[Y]-C[ce]}),O=0;O<l.length;O++){var R=l[O].id();E[R]=[],_[R]=0,C[R]=1/0}for(_[S]=1,C[S]=0,D.push(S);!D.empty();){var k=D.pop();if(w.push(k),a)for(var L=0;L<u[k].length;L++){var A=u[k][L],I=s.getElementById(k),M=void 0;I.edgesTo(A).length>0?M=I.edgesTo(A)[0]:M=A.edgesTo(I)[0];var P=i(M);A=A.id(),C[A]>C[k]+P&&(C[A]=C[k]+P,D.nodes.indexOf(A)<0?D.push(A):D.updateItem(A),_[A]=0,E[A]=[]),C[A]==C[k]+P&&(_[A]=_[A]+_[k],E[A].push(k))}else for(var B=0;B<u[k].length;B++){var F=u[k][B].id();C[F]==1/0&&(D.push(F),C[F]=C[k]+1),C[F]==C[k]+1&&(_[F]=_[F]+_[k],E[F].push(k))}}for(var z={},$=0;$<l.length;$++)z[l[$].id()]=0;for(;w.length>0;){for(var U=w.pop(),K=0;K<E[U].length;K++){var ee=E[U][K];z[ee]=z[ee]+_[ee]/_[U]*(1+z[U])}U!=l[T].id()&&d.set(U,d.get(U)+z[U])}},"_loop"),v=0;v<l.length;v++)y(v);var x={betweenness:o(function(T){var S=s.collection(T).id();return d.get(S)},"betweenness"),betweennessNormalized:o(function(T){if(f==0)return 0;var S=s.collection(T).id();return d.get(S)/f},"betweennessNormalized")};return x.betweennessNormalised=x.betweennessNormalized,x},"betweennessCentrality")};wB.bc=wB.betweennessCentrality;vXe=oa({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),xXe=o(function(e){return vXe(e)},"setOptions"),bXe=o(function(e,r){for(var n=0,i=0;i<r.length;i++)n+=r[i](e);return n},"getSimilarity"),TXe=o(function(e,r,n){for(var i=0;i<r;i++)e[i*r+i]=n},"addLoops"),Rge=o(function(e,r){for(var n,i=0;i<r;i++){n=0;for(var a=0;a<r;a++)n+=e[a*r+i];for(var s=0;s<r;s++)e[s*r+i]=e[s*r+i]/n}},"normalize"),wXe=o(function(e,r,n){for(var i=new Array(n*n),a=0;a<n;a++){for(var s=0;s<n;s++)i[a*n+s]=0;for(var l=0;l<n;l++)for(var u=0;u<n;u++)i[a*n+u]+=e[a*n+l]*r[l*n+u]}return i},"mmult"),kXe=o(function(e,r,n){for(var i=e.slice(0),a=1;a<n;a++)e=wXe(e,i,r);return e},"expand"),EXe=o(function(e,r,n){for(var i=new Array(r*r),a=0;a<r*r;a++)i[a]=Math.pow(e[a],n);return Rge(i,r),i},"inflate"),SXe=o(function(e,r,n,i){for(var a=0;a<n;a++){var s=Math.round(e[a]*Math.pow(10,i))/Math.pow(10,i),l=Math.round(r[a]*Math.pow(10,i))/Math.pow(10,i);if(s!==l)return!1}return!0},"hasConverged"),CXe=o(function(e,r,n,i){for(var a=[],s=0;s<r;s++){for(var l=[],u=0;u<r;u++)Math.round(e[s*r+u]*1e3)/1e3>0&&l.push(n[u]);l.length!==0&&a.push(i.collection(l))}return a},"assign"),AXe=o(function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},"isDuplicate"),_Xe=o(function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&AXe(e[r],e[n])&&e.splice(n,1);return e},"removeDuplicates"),Q0e=o(function(e){for(var r=this.nodes(),n=this.edges(),i=this.cy(),a=xXe(e),s={},l=0;l<r.length;l++)s[r[l].id()]=l;for(var u=r.length,h=u*u,f=new Array(h),d,p=0;p<h;p++)f[p]=0;for(var m=0;m<n.length;m++){var g=n[m],y=s[g.source().id()],v=s[g.target().id()],x=bXe(g,a.attributes);f[y*u+v]+=x,f[v*u+y]+=x}TXe(f,u,a.multFactor),Rge(f,u);for(var b=!0,T=0;b&&T<a.maxIterations;)b=!1,d=kXe(f,u,a.expandFactor),f=EXe(d,u,a.inflateFactor),SXe(f,d,h,4)||(b=!0),T++;var S=CXe(f,u,r,i);return S=_Xe(S),S},"markovClustering"),DXe={markovClustering:Q0e,mcl:Q0e},LXe=o(function(e){return e},"identity"),Nge=o(function(e,r){return Math.abs(r-e)},"absDiff"),Z0e=o(function(e,r,n){return e+Nge(r,n)},"addAbsDiff"),J0e=o(function(e,r,n){return e+Math.pow(n-r,2)},"addSquaredDiff"),RXe=o(function(e){return Math.sqrt(e)},"sqrt"),NXe=o(function(e,r,n){return Math.max(e,Nge(r,n))},"maxAbsDiff"),$b=o(function(e,r,n,i,a){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:LXe,l=i,u,h,f=0;f<e;f++)u=r(f),h=n(f),l=a(l,u,h);return s(l)},"getDistance"),ny={euclidean:o(function(e,r,n){return e>=2?$b(e,r,n,0,J0e,RXe):$b(e,r,n,0,Z0e)},"euclidean"),squaredEuclidean:o(function(e,r,n){return $b(e,r,n,0,J0e)},"squaredEuclidean"),manhattan:o(function(e,r,n){return $b(e,r,n,0,Z0e)},"manhattan"),max:o(function(e,r,n){return $b(e,r,n,-1/0,NXe)},"max")};ny["squared-euclidean"]=ny.squaredEuclidean;ny.squaredeuclidean=ny.squaredEuclidean;o(eC,"clusteringDistance");MXe=oa({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),WB=o(function(e){return MXe(e)},"setOptions"),U6=o(function(e,r,n,i,a){var s=a!=="kMedoids",l=s?function(d){return n[d]}:function(d){return i[d](n)},u=o(function(p){return i[p](r)},"getQ"),h=n,f=r;return eC(e,i.length,l,u,h,f)},"getDist"),oB=o(function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),l=new Array(r),u=null,h=0;h<i;h++)a[h]=e.min(n[h]).value,s[h]=e.max(n[h]).value;for(var f=0;f<r;f++){u=[];for(var d=0;d<i;d++)u[d]=Math.random()*(s[d]-a[d])+a[d];l[f]=u}return l},"randomCentroids"),Mge=o(function(e,r,n,i,a){for(var s=1/0,l=0,u=0;u<r.length;u++){var h=U6(n,e,r[u],i,a);h<s&&(s=h,l=u)}return l},"classify"),Ige=o(function(e,r,n){for(var i=[],a=null,s=0;s<r.length;s++)a=r[s],n[a.id()]===e&&i.push(a);return i},"buildCluster"),IXe=o(function(e,r,n){return Math.abs(r-e)<=n},"haveValuesConverged"),OXe=o(function(e,r,n){for(var i=0;i<e.length;i++)for(var a=0;a<e[i].length;a++){var s=Math.abs(e[i][a]-r[i][a]);if(s>n)return!1}return!0},"haveMatricesConverged"),PXe=o(function(e,r,n){for(var i=0;i<n;i++)if(e===r[i])return!0;return!1},"seenBefore"),eme=o(function(e,r){var n=new Array(r);if(e.length<50)for(var i=0;i<r;i++){for(var a=e[Math.floor(Math.random()*e.length)];PXe(a,n,i);)a=e[Math.floor(Math.random()*e.length)];n[i]=a}else for(var s=0;s<r;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},"randomMedoids"),tme=o(function(e,r,n){for(var i=0,a=0;a<r.length;a++)i+=U6("manhattan",r[a],e,n,"kMedoids");return i},"findCost"),BXe=o(function(e){var r=this.cy(),n=this.nodes(),i=null,a=WB(e),s=new Array(a.k),l={},u;a.testMode?typeof a.testCentroids=="number"?(a.testCentroids,u=oB(n,a.k,a.attributes)):qi(a.testCentroids)==="object"?u=a.testCentroids:u=oB(n,a.k,a.attributes):u=oB(n,a.k,a.attributes);for(var h=!0,f=0;h&&f<a.maxIterations;){for(var d=0;d<n.length;d++)i=n[d],l[i.id()]=Mge(i,u,a.distance,a.attributes,"kMeans");h=!1;for(var p=0;p<a.k;p++){var m=Ige(p,n,l);if(m.length!==0){for(var g=a.attributes.length,y=u[p],v=new Array(g),x=new Array(g),b=0;b<g;b++){x[b]=0;for(var T=0;T<m.length;T++)i=m[T],x[b]+=a.attributes[b](i);v[b]=x[b]/m.length,IXe(v[b],y[b],a.sensitivityThreshold)||(h=!0)}u[p]=v,s[p]=r.collection(m)}}f++}return s},"kMeans"),FXe=o(function(e){var r=this.cy(),n=this.nodes(),i=null,a=WB(e),s=new Array(a.k),l,u={},h,f=new Array(a.k);a.testMode?typeof a.testCentroids=="number"||(qi(a.testCentroids)==="object"?l=a.testCentroids:l=eme(n,a.k)):l=eme(n,a.k);for(var d=!0,p=0;d&&p<a.maxIterations;){for(var m=0;m<n.length;m++)i=n[m],u[i.id()]=Mge(i,l,a.distance,a.attributes,"kMedoids");d=!1;for(var g=0;g<l.length;g++){var y=Ige(g,n,u);if(y.length!==0){f[g]=tme(l[g],y,a.attributes);for(var v=0;v<y.length;v++)h=tme(y[v],y,a.attributes),h<f[g]&&(f[g]=h,l[g]=y[v],d=!0);s[g]=r.collection(y)}}p++}return s},"kMedoids"),$Xe=o(function(e,r,n,i,a){for(var s,l,u=0;u<r.length;u++)for(var h=0;h<e.length;h++)i[u][h]=Math.pow(n[u][h],a.m);for(var f=0;f<e.length;f++)for(var d=0;d<a.attributes.length;d++){s=0,l=0;for(var p=0;p<r.length;p++)s+=i[p][f]*a.attributes[d](r[p]),l+=i[p][f];e[f][d]=s/l}},"updateCentroids"),zXe=o(function(e,r,n,i,a){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var l,u,h,f=2/(a.m-1),d=0;d<n.length;d++)for(var p=0;p<i.length;p++){l=0;for(var m=0;m<n.length;m++)u=U6(a.distance,i[p],n[d],a.attributes,"cmeans"),h=U6(a.distance,i[p],n[m],a.attributes,"cmeans"),l+=Math.pow(u/h,f);e[p][d]=1/l}},"updateMembership"),GXe=o(function(e,r,n,i){for(var a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var l,u,h=0;h<r.length;h++){l=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[h][f]>l&&(l=r[h][f],u=f);a[u].push(e[h])}for(var d=0;d<a.length;d++)a[d]=i.collection(a[d]);return a},"assign"),rme=o(function(e){var r=this.cy(),n=this.nodes(),i=WB(e),a,s,l,u,h;u=new Array(n.length);for(var f=0;f<n.length;f++)u[f]=new Array(i.k);l=new Array(n.length);for(var d=0;d<n.length;d++)l[d]=new Array(i.k);for(var p=0;p<n.length;p++){for(var m=0,g=0;g<i.k;g++)l[p][g]=Math.random(),m+=l[p][g];for(var y=0;y<i.k;y++)l[p][y]=l[p][y]/m}s=new Array(i.k);for(var v=0;v<i.k;v++)s[v]=new Array(i.attributes.length);h=new Array(n.length);for(var x=0;x<n.length;x++)h[x]=new Array(i.k);for(var b=!0,T=0;b&&T<i.maxIterations;)b=!1,$Xe(s,n,l,h,i),zXe(l,u,s,n,i),OXe(l,u,i.sensitivityThreshold)||(b=!0),T++;return a=GXe(n,l,i,r),{clusters:a,degreeOfMembership:l}},"fuzzyCMeans"),VXe={kMeans:BXe,kMedoids:FXe,fuzzyCMeans:rme,fcm:rme},UXe=oa({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),HXe={single:"min",complete:"max"},WXe=o(function(e){var r=UXe(e),n=HXe[r.linkage];return n!=null&&(r.linkage=n),r},"setOptions"),nme=o(function(e,r,n,i,a){for(var s=0,l=1/0,u,h=a.attributes,f=o(function(D,O){return eC(a.distance,h.length,function(R){return h[R](D)},function(R){return h[R](O)},D,O)},"getDist"),d=0;d<e.length;d++){var p=e[d].key,m=n[p][i[p]];m<l&&(s=p,l=m)}if(a.mode==="threshold"&&l>=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],y=r[i[s]],v;a.mode==="dendrogram"?v={left:g,right:y,key:g.key}:v={value:g.value.concat(y.value),key:g.key},e[g.index]=v,e.splice(y.index,1),r[g.key]=v;for(var x=0;x<e.length;x++){var b=e[x];g.key===b.key?u=1/0:a.linkage==="min"?(u=n[g.key][b.key],n[g.key][b.key]>n[y.key][b.key]&&(u=n[y.key][b.key])):a.linkage==="max"?(u=n[g.key][b.key],n[g.key][b.key]<n[y.key][b.key]&&(u=n[y.key][b.key])):a.linkage==="mean"?u=(n[g.key][b.key]*g.size+n[y.key][b.key]*y.size)/(g.size+y.size):a.mode==="dendrogram"?u=f(b.value,g.value):u=f(b.value[0],g.value[0]),n[g.key][b.key]=n[b.key][g.key]=u}for(var T=0;T<e.length;T++){var S=e[T].key;if(i[S]===g.key||i[S]===y.key){for(var w=S,E=0;E<e.length;E++){var _=e[E].key;n[S][_]<n[S][w]&&(w=_)}i[S]=w}e[T].index=T}return g.key=y.key=g.index=y.index=null,!0},"mergeClosest"),v6=o(function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},"getAllChildren"),qXe=o(function t(e,r){if(!e)return"";if(e.left&&e.right){var n=t(e.left,r),i=t(e.right,r),a=r.add({group:"nodes",data:{id:n+","+i}});return r.add({group:"edges",data:{source:n,target:a.id()}}),r.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}else if(e.value)return e.value.id()},"buildDendrogram"),YXe=o(function t(e,r,n){if(!e)return[];var i=[],a=[],s=[];return r===0?(e.left&&v6(e.left,i),e.right&&v6(e.right,a),s=i.concat(a),[n.collection(s)]):r===1?e.value?[n.collection(e.value)]:(e.left&&v6(e.left,i),e.right&&v6(e.right,a),[n.collection(i),n.collection(a)]):e.value?[n.collection(e.value)]:(e.left&&(i=t(e.left,r-1,n)),e.right&&(a=t(e.right,r-1,n)),i.concat(a))},"buildClustersFromTree"),ime=o(function(e){for(var r=this.cy(),n=this.nodes(),i=WXe(e),a=i.attributes,s=o(function(T,S){return eC(i.distance,a.length,function(w){return a[w](T)},function(w){return a[w](S)},T,S)},"getDist"),l=[],u=[],h=[],f=[],d=0;d<n.length;d++){var p={value:i.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};l[d]=p,f[d]=p,u[d]=[],h[d]=0}for(var m=0;m<l.length;m++)for(var g=0;g<=m;g++){var y=void 0;i.mode==="dendrogram"?y=m===g?1/0:s(l[m].value,l[g].value):y=m===g?1/0:s(l[m].value[0],l[g].value[0]),u[m][g]=y,u[g][m]=y,y<u[m][h[m]]&&(h[m]=g)}for(var v=nme(l,f,u,h,i);v;)v=nme(l,f,u,h,i);var x;return i.mode==="dendrogram"?(x=YXe(l[0],i.dendrogramDepth,r),i.addDendrogram&&qXe(l[0],r)):(x=new Array(l.length),l.forEach(function(b,T){b.key=b.index=null,x[T]=r.collection(b.value)})),x},"hierarchicalClustering"),XXe={hierarchicalClustering:ime,hca:ime},jXe=oa({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),KXe=o(function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||oi("Damping must range on [0.5, 1). Got: ".concat(r));var i=["median","mean","min","max"];return i.some(function(a){return a===n})||_t(n)||oi("Preference must be one of [".concat(i.map(function(a){return"'".concat(a,"'")}).join(", "),"] or a number. Got: ").concat(n)),jXe(e)},"setOptions"),QXe=o(function(e,r,n,i){var a=o(function(l,u){return i[u](l)},"attr");return-eC(e,i.length,function(s){return a(r,s)},function(s){return a(n,s)},r,n)},"getSimilarity"),ZXe=o(function(e,r){var n=null;return r==="median"?n=KYe(e):r==="mean"?n=jYe(e):r==="min"?n=YYe(e):r==="max"?n=XYe(e):n=r,n},"getPreference"),JXe=o(function(e,r,n){for(var i=[],a=0;a<e;a++)r[a*e+a]+n[a*e+a]>0&&i.push(a);return i},"findExemplars"),ame=o(function(e,r,n){for(var i=[],a=0;a<e;a++){for(var s=-1,l=-1/0,u=0;u<n.length;u++){var h=n[u];r[a*e+h]>l&&(s=h,l=r[a*e+h])}s>0&&i.push(s)}for(var f=0;f<n.length;f++)i[n[f]]=n[f];return i},"assignClusters"),eje=o(function(e,r,n){for(var i=ame(e,r,n),a=0;a<n.length;a++){for(var s=[],l=0;l<i.length;l++)i[l]===n[a]&&s.push(l);for(var u=-1,h=-1/0,f=0;f<s.length;f++){for(var d=0,p=0;p<s.length;p++)d+=r[s[p]*e+s[f]];d>h&&(u=f,h=d)}n[a]=s[u]}return i=ame(e,r,n),i},"assign"),sme=o(function(e){for(var r=this.cy(),n=this.nodes(),i=KXe(e),a={},s=0;s<n.length;s++)a[n[s].id()]=s;var l,u,h,f,d,p;l=n.length,u=l*l,h=new Array(u);for(var m=0;m<u;m++)h[m]=-1/0;for(var g=0;g<l;g++)for(var y=0;y<l;y++)g!==y&&(h[g*l+y]=QXe(i.distance,n[g],n[y],i.attributes));f=ZXe(h,i.preference);for(var v=0;v<l;v++)h[v*l+v]=f;d=new Array(u);for(var x=0;x<u;x++)d[x]=0;p=new Array(u);for(var b=0;b<u;b++)p[b]=0;for(var T=new Array(l),S=new Array(l),w=new Array(l),E=0;E<l;E++)T[E]=0,S[E]=0,w[E]=0;for(var _=new Array(l*i.minIterations),C=0;C<_.length;C++)_[C]=0;var D;for(D=0;D<i.maxIterations;D++){for(var O=0;O<l;O++){for(var R=-1/0,k=-1/0,L=-1,A=0,I=0;I<l;I++)T[I]=d[O*l+I],A=p[O*l+I]+h[O*l+I],A>=R?(k=R,R=A,L=I):A>k&&(k=A);for(var M=0;M<l;M++)d[O*l+M]=(1-i.damping)*(h[O*l+M]-R)+i.damping*T[M];d[O*l+L]=(1-i.damping)*(h[O*l+L]-k)+i.damping*T[L]}for(var P=0;P<l;P++){for(var B=0,F=0;F<l;F++)T[F]=p[F*l+P],S[F]=Math.max(0,d[F*l+P]),B+=S[F];B-=S[P],S[P]=d[P*l+P],B+=S[P];for(var z=0;z<l;z++)p[z*l+P]=(1-i.damping)*Math.min(0,B-S[z])+i.damping*T[z];p[P*l+P]=(1-i.damping)*(B-S[P])+i.damping*T[P]}for(var $=0,U=0;U<l;U++){var K=p[U*l+U]+d[U*l+U]>0?1:0;_[D%i.minIterations*l+U]=K,$+=K}if($>0&&(D>=i.minIterations-1||D==i.maxIterations-1)){for(var ee=0,Y=0;Y<l;Y++){w[Y]=0;for(var ce=0;ce<i.minIterations;ce++)w[Y]+=_[ce*l+Y];(w[Y]===0||w[Y]===i.minIterations)&&ee++}if(ee===l)break}}for(var Z=JXe(l,d,p),ue=eje(l,h,Z),Q={},j=0;j<Z.length;j++)Q[Z[j]]=[];for(var ne=0;ne<n.length;ne++){var te=a[n[ne].id()],he=ue[te];he!=null&&Q[he].push(n[ne])}for(var le=new Array(Z.length),J=0;J<Z.length;J++)le[J]=r.collection(Q[Z[J]]);return le},"affinityPropagation"),tje={affinityPropagation:sme,ap:sme},rje=oa({root:void 0,directed:!1}),nje={hierholzer:o(function(e){if(!Ur(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=rje(e),i=n.root,a=n.directed,s=this,l=!1,u,h,f;i&&(f=Zt(i)?this.filter(i)[0].id():i[0].id());var d={},p={};a?s.forEach(function(b){var T=b.id();if(b.isNode()){var S=b.indegree(!0),w=b.outdegree(!0),E=S-w,_=w-S;E==1?u?l=!0:u=T:_==1?h?l=!0:h=T:(_>1||E>1)&&(l=!0),d[T]=[],b.outgoers().forEach(function(C){C.isEdge()&&d[T].push(C.id())})}else p[T]=[void 0,b.target().id()]}):s.forEach(function(b){var T=b.id();if(b.isNode()){var S=b.degree(!0);S%2&&(u?h?l=!0:h=T:u=T),d[T]=[],b.connectedEdges().forEach(function(w){return d[T].push(w.id())})}else p[T]=[b.source().id(),b.target().id()]});var m={found:!1,trail:void 0};if(l)return m;if(h&&u)if(a){if(f&&h!=f)return m;f=h}else{if(f&&h!=f&&u!=f)return m;f||(f=h)}else f||(f=s[0].id());var g=o(function(T){for(var S=T,w=[T],E,_,C;d[S].length;)E=d[S].shift(),_=p[E][0],C=p[E][1],S!=C?(d[C]=d[C].filter(function(D){return D!=E}),S=C):!a&&S!=_&&(d[_]=d[_].filter(function(D){return D!=E}),S=_),w.unshift(E),w.unshift(S);return w},"walk"),y=[],v=[];for(v=g(f);v.length!=1;)d[v[0]].length==0?(y.unshift(s.getElementById(v.shift())),y.unshift(s.getElementById(v.shift()))):v=g(v.shift()).concat(v);y.unshift(s.getElementById(v.shift()));for(var x in d)if(d[x].length)return m;return m.found=!0,m.trail=this.spawn(y,!0),m},"hierholzer")},x6=o(function(){var e=this,r={},n=0,i=0,a=[],s=[],l={},u=o(function(p,m){for(var g=s.length-1,y=[],v=e.spawn();s[g].x!=p||s[g].y!=m;)y.push(s.pop().edge),g--;y.push(s.pop().edge),y.forEach(function(x){var b=x.connectedNodes().intersection(e);v.merge(x),b.forEach(function(T){var S=T.id(),w=T.connectedEdges().intersection(e);v.merge(T),r[S].cutVertex?v.merge(w.filter(function(E){return E.isLoop()})):v.merge(w)})}),a.push(v)},"buildComponent"),h=o(function d(p,m,g){p===g&&(i+=1),r[m]={id:n,low:n++,cutVertex:!1};var y=e.getElementById(m).connectedEdges().intersection(e);if(y.size()===0)a.push(e.spawn(e.getElementById(m)));else{var v,x,b,T;y.forEach(function(S){v=S.source().id(),x=S.target().id(),b=v===m?x:v,b!==g&&(T=S.id(),l[T]||(l[T]=!0,s.push({x:m,y:b,edge:S})),b in r?r[m].low=Math.min(r[m].low,r[b].id):(d(p,b,m),r[m].low=Math.min(r[m].low,r[b].low),r[m].id<=r[b].low&&(r[m].cutVertex=!0,u(m,b))))})}},"biconnectedSearch");e.forEach(function(d){if(d.isNode()){var p=d.id();p in r||(i=0,h(p,p),r[p].cutVertex=i>1)}});var f=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(f),components:a}},"hopcroftTarjanBiconnected"),ije={hopcroftTarjanBiconnected:x6,htbc:x6,htb:x6,hopcroftTarjanBiconnectedComponents:x6},b6=o(function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),l=o(function u(h){a.push(h),r[h]={index:n,low:n++,explored:!1};var f=e.getElementById(h).connectedEdges().intersection(e);if(f.forEach(function(y){var v=y.target().id();v!==h&&(v in r||u(v),r[v].explored||(r[h].low=Math.min(r[h].low,r[v].low)))}),r[h].index===r[h].low){for(var d=e.spawn();;){var p=a.pop();if(d.merge(e.getElementById(p)),r[p].low=r[h].index,r[p].explored=!0,p===h)break}var m=d.edgesWith(d),g=d.merge(m);i.push(g),s=s.difference(g)}},"stronglyConnectedSearch");return e.forEach(function(u){if(u.isNode()){var h=u.id();h in r||l(h)}}),{cut:s,components:i}},"tarjanStronglyConnected"),aje={tarjanStronglyConnected:b6,tsc:b6,tscc:b6,tarjanStronglyConnectedComponents:b6},Oge={};[n4,OYe,PYe,FYe,zYe,VYe,WYe,gXe,Z1,J1,wB,DXe,VXe,XXe,tje,nje,ije,aje].forEach(function(t){ir(Oge,t)});Pge=0,Bge=1,Fge=2,ah=o(function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=Pge,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))},"api");ah.prototype={fulfill:o(function(e){return ome(this,Bge,"fulfillValue",e)},"fulfill"),reject:o(function(e){return ome(this,Fge,"rejectReason",e)},"reject"),then:o(function(e,r){var n=this,i=new ah;return n.onFulfilled.push(cme(e,i,"fulfill")),n.onRejected.push(cme(r,i,"reject")),$ge(n),i.proxy},"then")};ome=o(function(e,r,n,i){return e.state===Pge&&(e.state=r,e[n]=i,$ge(e)),e},"deliver"),$ge=o(function(e){e.state===Bge?lme(e,"onFulfilled",e.fulfillValue):e.state===Fge&&lme(e,"onRejected",e.rejectReason)},"execute"),lme=o(function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=o(function(){for(var l=0;l<i.length;l++)i[l](n)},"func");typeof setImmediate=="function"?setImmediate(a):setTimeout(a,0)}},"execute_handlers"),cme=o(function(e,r,n){return function(i){if(typeof e!="function")r[n].call(r,i);else{var a;try{a=e(i)}catch(s){r.reject(s);return}sje(r,a)}}},"resolver"),sje=o(function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(qi(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(a){e.reject(a);return}if(typeof n=="function"){var i=!1;try{n.call(r,function(a){i||(i=!0,a===r?e.reject(new TypeError("circular thenable chain")):t(e,a))},function(a){i||(i=!0,e.reject(a))})}catch(a){i||e.reject(a)}return}e.fulfill(r)},"resolve");ah.all=function(t){return new ah(function(e,r){for(var n=new Array(t.length),i=0,a=o(function(u,h){n[u]=h,i++,i===t.length&&e(n)},"fulfill"),s=0;s<t.length;s++)(function(l){var u=t[l],h=u!=null&&u.then!=null;if(h)u.then(function(d){a(l,d)},function(d){r(d)});else{var f=u;a(l,f)}})(s)})};ah.resolve=function(t){return new ah(function(e,r){e(t)})};ah.reject=function(t){return new ah(function(e,r){r(t)})};sy=typeof Promise<"u"?Promise:ah,kB=o(function(e,r,n){var i=BB(e),a=!i,s=this._private=ir({duration:1e3},r,n);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&li(s.complete)&&s.completes.push(s.complete),a){var l=e.position();s.startPosition=s.startPosition||{x:l.x,y:l.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(i){var u=e.pan();s.startPan={x:u.x,y:u.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},"Animation"),Jp=kB.prototype;ir(Jp,{instanceString:o(function(){return"animation"},"instanceString"),hook:o(function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),xo(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},"hook"),play:o(function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},"play"),playing:o(function(){return this._private.playing},"playing"),apply:o(function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},"apply"),applying:o(function(){return this._private.applying},"applying"),pause:o(function(){var e=this._private;return e.playing=!1,e.started=!1,this},"pause"),stop:o(function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},"stop"),rewind:o(function(){return this.progress(0)},"rewind"),fastforward:o(function(){return this.progress(1)},"fastforward"),time:o(function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},"time"),progress:o(function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},"progress"),completed:o(function(){return this._private.progress===1},"completed"),reverse:o(function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=o(function(h,f){var d=e[h];d!=null&&(e[h]=e[f],e[f]=d)},"swap");if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var i=0;i<e.style.length;i++){var a=e.style[i],s=a.name,l=e.startStyle[s];e.startStyle[s]=a,e.style[i]=l}return r&&this.play(),this},"reverse"),promise:o(function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new sy(function(i,a){n.push(function(){i()})})},"promise")});Jp.complete=Jp.completed;Jp.run=Jp.play;Jp.running=Jp.playing;oje={animated:o(function(){return o(function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return!1;var s=i[0];if(s)return s._private.animation.current.length>0},"animatedImpl")},"animated"),clearQueue:o(function(){return o(function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s<i.length;s++){var l=i[s];l._private.animation.queue=[]}return this},"clearQueueImpl")},"clearQueue"),delay:o(function(){return o(function(r,n){var i=this._private.cy||this;return i.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this},"delayImpl")},"delay"),delayAnimation:o(function(){return o(function(r,n){var i=this._private.cy||this;return i.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this},"delayAnimationImpl")},"delayAnimation"),animation:o(function(){return o(function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],l=this._private.cy||this,u=!a,h=!u;if(!l.styleEnabled())return this;var f=l.style();r=ir({},r,n);var d=Object.keys(r).length===0;if(d)return new kB(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(h&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),h&&r.renderedPosition!=null){var p=r.renderedPosition,m=l.pan(),g=l.zoom();r.position=Ege(p,g,m)}if(u&&r.panBy!=null){var y=r.panBy,v=l.pan();r.pan={x:v.x+y.x,y:v.y+y.y}}var x=r.center||r.centre;if(u&&x!=null){var b=l.getCenterPan(x.eles,r.zoom);b!=null&&(r.pan=b)}if(u&&r.fit!=null){var T=r.fit,S=l.getFitViewport(T.eles||T.boundingBox,T.padding);S!=null&&(r.pan=S.pan,r.zoom=S.zoom)}if(u&&Ur(r.zoom)){var w=l.getZoomedViewport(r.zoom);w!=null?(w.zoomed&&(r.zoom=w.zoom),w.panned&&(r.pan=w.pan)):r.zoom=null}return new kB(s[0],r)},"animationImpl")},"animation"),animate:o(function(){return o(function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],l=this._private.cy||this;if(!l.styleEnabled())return this;n&&(r=ir({},r,n));for(var u=0;u<s.length;u++){var h=s[u],f=h.animated()&&(r.queue===void 0||r.queue),d=h.animation(r,f?{queue:!0}:void 0);d.play()}return this},"animateImpl")},"animate"),stop:o(function(){return o(function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var u=0;u<s.length;u++){for(var h=s[u],f=h._private,d=f.animation.current,p=0;p<d.length;p++){var m=d[p],g=m._private;n&&(g.duration=0)}r&&(f.animation.queue=[]),n||(f.animation.current=[])}return l.notify("draw"),this},"stopImpl")},"stop")},lje=Array.isArray,tC=lje,cje=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uje=/^\w*$/;o(hje,"isKey");fje=hje,dje="[object AsyncFunction]",pje="[object Function]",mje="[object GeneratorFunction]",gje="[object Proxy]";o(yje,"isFunction");vje=yje,xje=Q6["__core-js_shared__"],lB=xje,ume=function(){var t=/[^.]+$/.exec(lB&&lB.keys&&lB.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();o(bje,"isMasked");Tje=bje,wje=Function.prototype,kje=wje.toString;o(Eje,"toSource");Sje=Eje,Cje=/[\\^$.*+?()[\]{}|]/g,Aje=/^\[object .+?Constructor\]$/,_je=Function.prototype,Dje=Object.prototype,Lje=_je.toString,Rje=Dje.hasOwnProperty,Nje=RegExp("^"+Lje.call(Rje).replace(Cje,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");o(Mje,"baseIsNative");Ije=Mje;o(Oje,"getValue$1");Pje=Oje;o(Bje,"getNative");qB=Bje,Fje=qB(Object,"create"),s4=Fje;o($je,"hashClear");zje=$je;o(Gje,"hashDelete");Vje=Gje,Uje="__lodash_hash_undefined__",Hje=Object.prototype,Wje=Hje.hasOwnProperty;o(qje,"hashGet");Yje=qje,Xje=Object.prototype,jje=Xje.hasOwnProperty;o(Kje,"hashHas");Qje=Kje,Zje="__lodash_hash_undefined__";o(Jje,"hashSet");eKe=Jje;o(oy,"Hash");oy.prototype.clear=zje;oy.prototype.delete=Vje;oy.prototype.get=Yje;oy.prototype.has=Qje;oy.prototype.set=eKe;hme=oy;o(tKe,"listCacheClear");rKe=tKe;o(nKe,"eq");zge=nKe;o(iKe,"assocIndexOf");rC=iKe,aKe=Array.prototype,sKe=aKe.splice;o(oKe,"listCacheDelete");lKe=oKe;o(cKe,"listCacheGet");uKe=cKe;o(hKe,"listCacheHas");fKe=hKe;o(dKe,"listCacheSet");pKe=dKe;o(ly,"ListCache");ly.prototype.clear=rKe;ly.prototype.delete=lKe;ly.prototype.get=uKe;ly.prototype.has=fKe;ly.prototype.set=pKe;mKe=ly,gKe=qB(Q6,"Map"),yKe=gKe;o(vKe,"mapCacheClear");xKe=vKe;o(bKe,"isKeyable");TKe=bKe;o(wKe,"getMapData");nC=wKe;o(kKe,"mapCacheDelete");EKe=kKe;o(SKe,"mapCacheGet");CKe=SKe;o(AKe,"mapCacheHas");_Ke=AKe;o(DKe,"mapCacheSet");LKe=DKe;o(cy,"MapCache");cy.prototype.clear=xKe;cy.prototype.delete=EKe;cy.prototype.get=CKe;cy.prototype.has=_Ke;cy.prototype.set=LKe;Gge=cy,RKe="Expected a function";o(YB,"memoize");YB.Cache=Gge;NKe=YB,MKe=500;o(IKe,"memoizeCapped");OKe=IKe,PKe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,BKe=/\\(\\)?/g,FKe=OKe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(PKe,function(r,n,i,a){e.push(i?a.replace(BKe,"$1"):n||r)}),e}),Vge=FKe;o($Ke,"arrayMap");Uge=$Ke,zKe=1/0,fme=ty?ty.prototype:void 0,dme=fme?fme.toString:void 0;o(Hge,"baseToString");GKe=Hge;o(VKe,"toString$1");Wge=VKe;o(UKe,"castPath");qge=UKe,HKe=1/0;o(WKe,"toKey");XB=WKe;o(qKe,"baseGet");YKe=qKe;o(XKe,"get");jKe=XKe,KKe=function(){try{var t=qB(Object,"defineProperty");return t({},"",{}),t}catch{}}(),pme=KKe;o(QKe,"baseAssignValue");ZKe=QKe,JKe=Object.prototype,eQe=JKe.hasOwnProperty;o(tQe,"assignValue");rQe=tQe,nQe=9007199254740991,iQe=/^(?:0|[1-9]\d*)$/;o(aQe,"isIndex");sQe=aQe;o(oQe,"baseSet");lQe=oQe;o(cQe,"set");uQe=cQe;o(hQe,"copyArray");fQe=hQe;o(dQe,"toPath");pQe=dQe,mQe={data:o(function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:o(function(i){},"beforeGet"),beforeSet:o(function(i,a){},"beforeSet"),onSet:o(function(i){},"onSet"),canSet:o(function(i){return!0},"canSet")};return e=ir({},r,e),o(function(i,a){var s=e,l=this,u=l.length!==void 0,h=u?l:[l],f=u?l[0]:l;if(Zt(i)){var d=i.indexOf(".")!==-1,p=d&&pQe(i);if(s.allowGetting&&a===void 0){var m;return f&&(s.beforeGet(f),p&&f._private[s.field][i]===void 0?m=jKe(f._private[s.field],p):m=f._private[s.field][i]),m}else if(s.allowSetting&&a!==void 0){var g=!s.immutableKeys[i];if(g){var y=ige({},i,a);s.beforeSet(l,y);for(var v=0,x=h.length;v<x;v++){var b=h[v];s.canSet(b)&&(p&&f._private[s.field][i]===void 0?uQe(b._private[s.field],p,a):b._private[s.field][i]=a)}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Ur(i)){var T=i,S,w,E=Object.keys(T);s.beforeSet(l,T);for(var _=0;_<E.length;_++){S=E[_],w=T[S];var C=!s.immutableKeys[S];if(C)for(var D=0;D<h.length;D++){var O=h[D];s.canSet(O)&&(O._private[s.field][S]=w)}}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&li(i)){var R=i;l.on(s.bindingEvent,R)}else if(s.allowGetting&&i===void 0){var k;return f&&(s.beforeGet(f),k=f._private[s.field]),k}return l},"dataImpl")},"data"),removeData:o(function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=ir({},r,e),o(function(i){var a=e,s=this,l=s.length!==void 0,u=l?s:[s];if(Zt(i)){for(var h=i.split(/\s+/),f=h.length,d=0;d<f;d++){var p=h[d];if(!Pf(p)){var m=!a.immutableKeys[p];if(m)for(var g=0,y=u.length;g<y;g++)u[g]._private[a.field][p]=void 0}}a.triggerEvent&&s[a.triggerFnName](a.event)}else if(i===void 0){for(var v=0,x=u.length;v<x;v++)for(var b=u[v]._private[a.field],T=Object.keys(b),S=0;S<T.length;S++){var w=T[S],E=!a.immutableKeys[w];E&&(b[w]=void 0)}a.triggerEvent&&s[a.triggerFnName](a.event)}return s},"removeDataImpl")},"removeData")},gQe={eventAliasesOn:o(function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,i){var a=this,s=Array.prototype.slice.call(arguments,0);return new sy(function(l,u){var h=o(function(m){a.off.apply(a,d),l(m)},"callback"),f=s.concat([h]),d=f.concat([]);a.on.apply(a,f)})}},"eventAliasesOn")},un={};[oje,mQe,gQe].forEach(function(t){ir(un,t)});yQe={animate:un.animate(),animation:un.animation(),animated:un.animated(),clearQueue:un.clearQueue(),delay:un.delay(),delayAnimation:un.delayAnimation(),stop:un.stop()},R6={classes:o(function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(g){return n.push(g)}),n}else En(e)||(e=(e||"").match(/\S+/g)||[]);for(var i=[],a=new ay(e),s=0;s<r.length;s++){for(var l=r[s],u=l._private,h=u.classes,f=!1,d=0;d<e.length;d++){var p=e[d],m=h.has(p);if(!m){f=!0;break}}f||(f=h.size!==e.length),f&&(u.classes=a,i.push(l))}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},"classes"),addClass:o(function(e){return this.toggleClass(e,!0)},"addClass"),hasClass:o(function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},"hasClass"),toggleClass:o(function(e,r){En(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,l=n.length;s<l;s++)for(var u=n[s],h=u._private.classes,f=!1,d=0;d<e.length;d++){var p=e[d],m=h.has(p),g=!1;r||i&&!m?(h.add(p),g=!0):(!r||i&&m)&&(h.delete(p),g=!0),!f&&g&&(a.push(u),f=!0)}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},"toggleClass"),removeClass:o(function(e){return this.toggleClass(e,!1)},"removeClass"),flashClass:o(function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n},"flashClass")};R6.className=R6.classNames=R6.classes;Vr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Wi,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Vr.variable="(?:[\\w-.]|(?:\\\\"+Vr.metaChar+"))+";Vr.className="(?:[\\w-]|(?:\\\\"+Vr.metaChar+"))+";Vr.value=Vr.string+"|"+Vr.number;Vr.id=Vr.variable;(function(){var t,e,r;for(t=Vr.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Vr.comparatorOp+="|@"+e;for(t=Vr.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Vr.comparatorOp+="|\\!"+e)})();gn=o(function(){return{checks:[]}},"newQuery"),$t={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},EB=[{selector:":selected",matches:o(function(e){return e.selected()},"matches")},{selector:":unselected",matches:o(function(e){return!e.selected()},"matches")},{selector:":selectable",matches:o(function(e){return e.selectable()},"matches")},{selector:":unselectable",matches:o(function(e){return!e.selectable()},"matches")},{selector:":locked",matches:o(function(e){return e.locked()},"matches")},{selector:":unlocked",matches:o(function(e){return!e.locked()},"matches")},{selector:":visible",matches:o(function(e){return e.visible()},"matches")},{selector:":hidden",matches:o(function(e){return!e.visible()},"matches")},{selector:":transparent",matches:o(function(e){return e.transparent()},"matches")},{selector:":grabbed",matches:o(function(e){return e.grabbed()},"matches")},{selector:":free",matches:o(function(e){return!e.grabbed()},"matches")},{selector:":removed",matches:o(function(e){return e.removed()},"matches")},{selector:":inside",matches:o(function(e){return!e.removed()},"matches")},{selector:":grabbable",matches:o(function(e){return e.grabbable()},"matches")},{selector:":ungrabbable",matches:o(function(e){return!e.grabbable()},"matches")},{selector:":animated",matches:o(function(e){return e.animated()},"matches")},{selector:":unanimated",matches:o(function(e){return!e.animated()},"matches")},{selector:":parent",matches:o(function(e){return e.isParent()},"matches")},{selector:":childless",matches:o(function(e){return e.isChildless()},"matches")},{selector:":child",matches:o(function(e){return e.isChild()},"matches")},{selector:":orphan",matches:o(function(e){return e.isOrphan()},"matches")},{selector:":nonorphan",matches:o(function(e){return e.isChild()},"matches")},{selector:":compound",matches:o(function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()},"matches")},{selector:":loop",matches:o(function(e){return e.isLoop()},"matches")},{selector:":simple",matches:o(function(e){return e.isSimple()},"matches")},{selector:":active",matches:o(function(e){return e.active()},"matches")},{selector:":inactive",matches:o(function(e){return!e.active()},"matches")},{selector:":backgrounding",matches:o(function(e){return e.backgrounding()},"matches")},{selector:":nonbackgrounding",matches:o(function(e){return!e.backgrounding()},"matches")}].sort(function(t,e){return Lqe(t.selector,e.selector)}),vQe=function(){for(var t={},e,r=0;r<EB.length;r++)e=EB[r],t[e.selector]=e.matches;return t}(),xQe=o(function(e,r){return vQe[e](r)},"stateSelectorMatches"),bQe="("+EB.map(function(t){return t.selector}).join("|")+")",U1=o(function(e){return e.replace(new RegExp("\\\\("+Vr.metaChar+")","g"),function(r,n){return n})},"cleanMetaChars"),Rf=o(function(e,r,n){e[e.length-1]=n},"replaceLastQuery"),SB=[{name:"group",query:!0,regex:"("+Vr.group+")",populate:o(function(e,r,n){var i=Ri(n,1),a=i[0];r.checks.push({type:$t.GROUP,value:a==="*"?a:a+"s"})},"populate")},{name:"state",query:!0,regex:bQe,populate:o(function(e,r,n){var i=Ri(n,1),a=i[0];r.checks.push({type:$t.STATE,value:a})},"populate")},{name:"id",query:!0,regex:"\\#("+Vr.id+")",populate:o(function(e,r,n){var i=Ri(n,1),a=i[0];r.checks.push({type:$t.ID,value:U1(a)})},"populate")},{name:"className",query:!0,regex:"\\.("+Vr.className+")",populate:o(function(e,r,n){var i=Ri(n,1),a=i[0];r.checks.push({type:$t.CLASS,value:U1(a)})},"populate")},{name:"dataExists",query:!0,regex:"\\[\\s*("+Vr.variable+")\\s*\\]",populate:o(function(e,r,n){var i=Ri(n,1),a=i[0];r.checks.push({type:$t.DATA_EXIST,field:U1(a)})},"populate")},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Vr.variable+")\\s*("+Vr.comparatorOp+")\\s*("+Vr.value+")\\s*\\]",populate:o(function(e,r,n){var i=Ri(n,3),a=i[0],s=i[1],l=i[2],u=new RegExp("^"+Vr.string+"$").exec(l)!=null;u?l=l.substring(1,l.length-1):l=parseFloat(l),r.checks.push({type:$t.DATA_COMPARE,field:U1(a),operator:s,value:l})},"populate")},{name:"dataBool",query:!0,regex:"\\[\\s*("+Vr.boolOp+")\\s*("+Vr.variable+")\\s*\\]",populate:o(function(e,r,n){var i=Ri(n,2),a=i[0],s=i[1];r.checks.push({type:$t.DATA_BOOL,field:U1(s),operator:a})},"populate")},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Vr.meta+")\\s*("+Vr.comparatorOp+")\\s*("+Vr.number+")\\s*\\]\\]",populate:o(function(e,r,n){var i=Ri(n,3),a=i[0],s=i[1],l=i[2];r.checks.push({type:$t.META_COMPARE,field:U1(a),operator:s,value:parseFloat(l)})},"populate")},{name:"nextQuery",separator:!0,regex:Vr.separator,populate:o(function(e,r){var n=e.currentSubject,i=e.edgeCount,a=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,e.currentSubject=null),s.edgeCount=i,s.compoundCount=a,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=gn();return l},"populate")},{name:"directedEdge",separator:!0,regex:Vr.directedEdge,populate:o(function(e,r){if(e.currentSubject==null){var n=gn(),i=r,a=gn();return n.checks.push({type:$t.DIRECTED_EDGE,source:i,target:a}),Rf(e,r,n),e.edgeCount++,a}else{var s=gn(),l=r,u=gn();return s.checks.push({type:$t.NODE_SOURCE,source:l,target:u}),Rf(e,r,s),e.edgeCount++,u}},"populate")},{name:"undirectedEdge",separator:!0,regex:Vr.undirectedEdge,populate:o(function(e,r){if(e.currentSubject==null){var n=gn(),i=r,a=gn();return n.checks.push({type:$t.UNDIRECTED_EDGE,nodes:[i,a]}),Rf(e,r,n),e.edgeCount++,a}else{var s=gn(),l=r,u=gn();return s.checks.push({type:$t.NODE_NEIGHBOR,node:l,neighbor:u}),Rf(e,r,s),u}},"populate")},{name:"child",separator:!0,regex:Vr.child,populate:o(function(e,r){if(e.currentSubject==null){var n=gn(),i=gn(),a=e[e.length-1];return n.checks.push({type:$t.CHILD,parent:a,child:i}),Rf(e,r,n),e.compoundCount++,i}else if(e.currentSubject===r){var s=gn(),l=e[e.length-1],u=gn(),h=gn(),f=gn(),d=gn();return s.checks.push({type:$t.COMPOUND_SPLIT,left:l,right:u,subject:h}),h.checks=r.checks,r.checks=[{type:$t.TRUE}],d.checks.push({type:$t.TRUE}),u.checks.push({type:$t.PARENT,parent:d,child:f}),Rf(e,l,s),e.currentSubject=h,e.compoundCount++,f}else{var p=gn(),m=gn(),g=[{type:$t.PARENT,parent:p,child:m}];return p.checks=r.checks,r.checks=g,e.compoundCount++,m}},"populate")},{name:"descendant",separator:!0,regex:Vr.descendant,populate:o(function(e,r){if(e.currentSubject==null){var n=gn(),i=gn(),a=e[e.length-1];return n.checks.push({type:$t.DESCENDANT,ancestor:a,descendant:i}),Rf(e,r,n),e.compoundCount++,i}else if(e.currentSubject===r){var s=gn(),l=e[e.length-1],u=gn(),h=gn(),f=gn(),d=gn();return s.checks.push({type:$t.COMPOUND_SPLIT,left:l,right:u,subject:h}),h.checks=r.checks,r.checks=[{type:$t.TRUE}],d.checks.push({type:$t.TRUE}),u.checks.push({type:$t.ANCESTOR,ancestor:d,descendant:f}),Rf(e,l,s),e.currentSubject=h,e.compoundCount++,f}else{var p=gn(),m=gn(),g=[{type:$t.ANCESTOR,ancestor:p,descendant:m}];return p.checks=r.checks,r.checks=g,e.compoundCount++,m}},"populate")},{name:"subject",modifier:!0,regex:Vr.subject,populate:o(function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return hn("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],i=n.checks[0],a=i==null?null:i.type;a===$t.DIRECTED_EDGE?i.type=$t.NODE_TARGET:a===$t.UNDIRECTED_EDGE&&(i.type=$t.NODE_NEIGHBOR,i.node=i.nodes[1],i.neighbor=i.nodes[0],i.nodes=null)},"populate")}];SB.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});TQe=o(function(e){for(var r,n,i,a=0;a<SB.length;a++){var s=SB[a],l=s.name,u=e.match(s.regexObj);if(u!=null){n=u,r=s,i=l;var h=u[0];e=e.substring(h.length);break}}return{expr:r,match:n,name:i,remaining:e}},"consumeExpr"),wQe=o(function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},"consumeWhitespace"),kQe=o(function(e){var r=this,n=r.inputText=e,i=r[0]=gn();for(r.length=1,n=wQe(n);;){var a=TQe(n);if(a.expr==null)return hn("The selector `"+e+"`is invalid"),!1;var s=a.match.slice(1),l=a.expr.populate(r,i,s);if(l===!1)return!1;if(l!=null&&(i=l),n=a.remaining,n.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var h=0;h<r.length;h++){var f=r[h];if(f.compoundCount>0&&f.edgeCount>0)return hn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return hn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&hn("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},"parse"),EQe=o(function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=o(function(f){return f??""},"clean"),r=o(function(f){return Zt(f)?'"'+f+'"':e(f)},"cleanVal"),n=o(function(f){return" "+f+" "},"space"),i=o(function(f,d){var p=f.type,m=f.value;switch(p){case $t.GROUP:{var g=e(m);return g.substring(0,g.length-1)}case $t.DATA_COMPARE:{var y=f.field,v=f.operator;return"["+y+n(e(v))+r(m)+"]"}case $t.DATA_BOOL:{var x=f.operator,b=f.field;return"["+e(x)+b+"]"}case $t.DATA_EXIST:{var T=f.field;return"["+T+"]"}case $t.META_COMPARE:{var S=f.operator,w=f.field;return"[["+w+n(e(S))+r(m)+"]]"}case $t.STATE:return m;case $t.ID:return"#"+m;case $t.CLASS:return"."+m;case $t.PARENT:case $t.CHILD:return a(f.parent,d)+n(">")+a(f.child,d);case $t.ANCESTOR:case $t.DESCENDANT:return a(f.ancestor,d)+" "+a(f.descendant,d);case $t.COMPOUND_SPLIT:{var E=a(f.left,d),_=a(f.subject,d),C=a(f.right,d);return E+(E.length>0?" ":"")+_+C}case $t.TRUE:return""}},"checkToString"),a=o(function(f,d){return f.checks.reduce(function(p,m,g){return p+(d===f&&g===0?"$":"")+i(m,d)},"")},"queryToString"),s="",l=0;l<this.length;l++){var u=this[l];s+=a(u,u.subject),this.length>1&&l<this.length-1&&(s+=", ")}return this.toStringCache=s,s},"toString"),SQe={parse:kQe,toString:EQe},Yge=o(function(e,r,n){var i,a=Zt(e),s=_t(e),l=Zt(n),u,h,f=!1,d=!1,p=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(a||l||f)&&(u=!a&&!s?"":""+e,h=""+n),f&&(e=u=u.toLowerCase(),n=h=h.toLowerCase()),r){case"*=":i=u.indexOf(h)>=0;break;case"$=":i=u.indexOf(h,u.length-h.length)>=0;break;case"^=":i=u.indexOf(h)===0;break;case"=":i=e===n;break;case">":p=!0,i=e>n;break;case">=":p=!0,i=e>=n;break;case"<":p=!0,i=e<n;break;case"<=":p=!0,i=e<=n;break;default:i=!1;break}return d&&(e!=null||!p)&&(i=!i),i},"valCmp"),CQe=o(function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},"boolCmp"),AQe=o(function(e){return e!==void 0},"existCmp"),jB=o(function(e,r){return e.data(r)},"data"),_Qe=o(function(e,r){return e[r]()},"meta"),pi=[],Vn=o(function(e,r){return e.checks.every(function(n){return pi[n.type](n,r)})},"matches");pi[$t.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};pi[$t.STATE]=function(t,e){var r=t.value;return xQe(r,e)};pi[$t.ID]=function(t,e){var r=t.value;return e.id()===r};pi[$t.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};pi[$t.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,i=t.value;return Yge(_Qe(e,r),n,i)};pi[$t.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,i=t.value;return Yge(jB(e,r),n,i)};pi[$t.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return CQe(jB(e,r),n)};pi[$t.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,AQe(jB(e,r))};pi[$t.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],i=e.source(),a=e.target();return Vn(r,i)&&Vn(n,a)||Vn(n,i)&&Vn(r,a)};pi[$t.NODE_NEIGHBOR]=function(t,e){return Vn(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Vn(t.neighbor,r)})};pi[$t.DIRECTED_EDGE]=function(t,e){return Vn(t.source,e.source())&&Vn(t.target,e.target())};pi[$t.NODE_SOURCE]=function(t,e){return Vn(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Vn(t.target,r)})};pi[$t.NODE_TARGET]=function(t,e){return Vn(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Vn(t.source,r)})};pi[$t.CHILD]=function(t,e){return Vn(t.child,e)&&Vn(t.parent,e.parent())};pi[$t.PARENT]=function(t,e){return Vn(t.parent,e)&&e.children().some(function(r){return Vn(t.child,r)})};pi[$t.DESCENDANT]=function(t,e){return Vn(t.descendant,e)&&e.ancestors().some(function(r){return Vn(t.ancestor,r)})};pi[$t.ANCESTOR]=function(t,e){return Vn(t.ancestor,e)&&e.descendants().some(function(r){return Vn(t.descendant,r)})};pi[$t.COMPOUND_SPLIT]=function(t,e){return Vn(t.subject,e)&&Vn(t.left,e)&&Vn(t.right,e)};pi[$t.TRUE]=function(){return!0};pi[$t.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};pi[$t.FILTER]=function(t,e){var r=t.value;return r(e)};DQe=o(function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===$t.ID)return e.getElementById(r[0].checks[0].value).collection();var n=o(function(a){for(var s=0;s<r.length;s++){var l=r[s];if(Vn(l,a))return!0}return!1},"selectorFunction");return r.text()==null&&(n=o(function(){return!0},"selectorFunction")),e.filter(n)},"filter"),LQe=o(function(e){for(var r=this,n=0;n<r.length;n++){var i=r[n];if(Vn(i,e))return!0}return!1},"matches"),RQe={matches:LQe,filter:DQe},$f=o(function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Zt(e)&&e.match(/^\s*$/)||(xo(e)?this.addQuery({checks:[{type:$t.COLLECTION,value:e.collection()}]}):li(e)?this.addQuery({checks:[{type:$t.FILTER,value:e}]}):Zt(e)?this.parse(e)||(this.invalid=!0):oi("A selector must be created from a string; found "))},"Selector"),zf=$f.prototype;[SQe,RQe].forEach(function(t){return ir(zf,t)});zf.text=function(){return this.inputText};zf.size=function(){return this.length};zf.eq=function(t){return this[t]};zf.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};zf.addQuery=function(t){this[this.length++]=t};zf.selector=zf.toString;If={allAre:o(function(e){var r=new $f(e);return this.every(function(n){return r.matches(n)})},"allAre"),is:o(function(e){var r=new $f(e);return this.some(function(n){return r.matches(n)})},"is"),some:o(function(e,r){for(var n=0;n<this.length;n++){var i=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(i)return!0}return!1},"some"),every:o(function(e,r){for(var n=0;n<this.length;n++){var i=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!i)return!1}return!0},"every"),same:o(function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(i){return e.hasElementWithId(i.id())})},"same"),anySame:o(function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},"anySame"),allAreNeighbors:o(function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},"allAreNeighbors"),contains:o(function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})},"contains")};If.allAreNeighbours=If.allAreNeighbors;If.has=If.contains;If.equal=If.equals=If.same;al=o(function(e,r){return o(function(i,a,s,l){var u=i,h=this,f;if(u==null?f="":xo(u)&&u.length===1&&(f=u.id()),h.length===1&&f){var d=h[0]._private,p=d.traversalCache=d.traversalCache||{},m=p[r]=p[r]||[],g=Bf(f),y=m[g];return y||(m[g]=e.call(h,i,a,s,l))}else return e.call(h,i,a,s,l)},"traversalCache")},"cache"),iy={parent:o(function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var i=0;i<this.length;i++){var a=this[i],s=a._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},"parent"),parents:o(function(e){for(var r=[],n=this.parent();n.nonempty();){for(var i=0;i<n.length;i++){var a=n[i];r.push(a)}n=n.parent()}return this.spawn(r,!0).filter(e)},"parents"),commonAncestors:o(function(e){for(var r,n=0;n<this.length;n++){var i=this[n],a=i.parents();r=r||a,r=r.intersect(a)}return r.filter(e)},"commonAncestors"),orphans:o(function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},"orphans"),nonorphans:o(function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},"nonorphans"),children:al(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],i=n._private.children,a=0;a<i.length;a++)e.push(i[a]);return this.spawn(e,!0).filter(t)},"children"),siblings:o(function(e){return this.parent().children().not(this).filter(e)},"siblings"),isParent:o(function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},"isParent"),isChildless:o(function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},"isChildless"),isChild:o(function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},"isChild"),isOrphan:o(function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},"isOrphan"),descendants:o(function(e){var r=[];function n(i){for(var a=0;a<i.length;a++){var s=i[a];r.push(s),s.children().nonempty()&&n(s.children())}}return o(n,"add"),n(this.children()),this.spawn(r,!0).filter(e)},"descendants")};o(KB,"forEachCompound");o(Xge,"addChildren");iy.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return KB(this,t,e,Xge)};o(jge,"addParent");iy.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return KB(this,t,e,jge)};o(NQe,"addParentAndChildren");iy.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return KB(this,t,e,NQe)};iy.ancestors=iy.parents;o4=Kge={data:un.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:un.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:un.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:un.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:un.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:un.removeData({field:"rscratch",triggerEvent:!1}),id:o(function(){var e=this[0];if(e)return e._private.data.id},"id")};o4.attr=o4.data;o4.removeAttr=o4.removeData;MQe=Kge,iC={};o(cB,"defineDegreeFunction");ir(iC,{degree:cB(function(t,e){return e.source().same(e.target())?2:1}),indegree:cB(function(t,e){return e.target().same(t)?1:0}),outdegree:cB(function(t,e){return e.source().same(t)?1:0})});o(H1,"defineDegreeBoundsFunction");ir(iC,{minDegree:H1("degree",function(t,e){return t<e}),maxDegree:H1("degree",function(t,e){return t>e}),minIndegree:H1("indegree",function(t,e){return t<e}),maxIndegree:H1("indegree",function(t,e){return t>e}),minOutdegree:H1("outdegree",function(t,e){return t<e}),maxOutdegree:H1("outdegree",function(t,e){return t>e})});ir(iC,{totalDegree:o(function(e){for(var r=0,n=this.nodes(),i=0;i<n.length;i++)r+=n[i].degree(e);return r},"totalDegree")});Zge=o(function(e,r,n){for(var i=0;i<e.length;i++){var a=e[i];if(!a.locked()){var s=a._private.position,l={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};a.isParent()&&!(l.x===0&&l.y===0)&&a.children().shift(l,n),a.dirtyBoundingBoxCache()}}},"beforePositionSet"),mme={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:o(function(e){e.updateCompoundBounds()},"beforeGet"),beforeSet:o(function(e,r){Zge(e,r,!1)},"beforeSet"),onSet:o(function(e){e.dirtyCompoundBoundsCache()},"onSet"),canSet:o(function(e){return!e.locked()},"canSet")};ql=Qge={position:un.data(mme),silentPosition:un.data(ir({},mme,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:o(function(e,r){Zge(e,r,!0)},"beforeSet"),onSet:o(function(e){e.dirtyCompoundBoundsCache()},"onSet")})),positions:o(function(e,r){if(Ur(e))r?this.silentPosition(e):this.position(e);else if(li(e)){var n=e,i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var s=this[a],l=void 0;(l=n(s,a))&&(r?s.silentPosition(l):s.position(l))}i.endBatch()}return this},"positions"),silentPositions:o(function(e){return this.positions(e,!0)},"silentPositions"),shift:o(function(e,r,n){var i;if(Ur(e)?(i={x:_t(e.x)?e.x:0,y:_t(e.y)?e.y:0},n=r):Zt(e)&&_t(r)&&(i={x:0,y:0},i[e]=r),i!=null){var a=this.cy();a.startBatch();for(var s=0;s<this.length;s++){var l=this[s];if(!(a.hasCompoundNodes()&&l.isChild()&&l.ancestors().anySame(this))){var u=l.position(),h={x:u.x+i.x,y:u.y+i.y};n?l.silentPosition(h):l.position(h)}}a.endBatch()}return this},"shift"),silentShift:o(function(e,r){return Ur(e)?this.shift(e,!0):Zt(e)&&_t(r)&&this.shift(e,r,!0),this},"silentShift"),renderedPosition:o(function(e,r){var n=this[0],i=this.cy(),a=i.zoom(),s=i.pan(),l=Ur(e)?e:void 0,u=l!==void 0||r!==void 0&&Zt(e);if(n&&n.isNode())if(u)for(var h=0;h<this.length;h++){var f=this[h];r!==void 0?f.position(e,(r-s[e])/a):l!==void 0&&f.position(Ege(l,a,s))}else{var d=n.position();return l=J6(d,a,s),e===void 0?l:l[e]}else if(!u)return;return this},"renderedPosition"),relativePosition:o(function(e,r){var n=this[0],i=this.cy(),a=Ur(e)?e:void 0,s=a!==void 0||r!==void 0&&Zt(e),l=i.hasCompoundNodes();if(n&&n.isNode())if(s)for(var u=0;u<this.length;u++){var h=this[u],f=l?h.parent():null,d=f&&f.length>0,p=d;d&&(f=f[0]);var m=p?f.position():{x:0,y:0};r!==void 0?h.position(e,r+m[e]):a!==void 0&&h.position({x:a.x+m.x,y:a.y+m.y})}else{var g=n.position(),y=l?n.parent():null,v=y&&y.length>0,x=v;v&&(y=y[0]);var b=x?y.position():{x:0,y:0};return a={x:g.x-b.x,y:g.y-b.y},e===void 0?a:a[e]}else if(!s)return;return this},"relativePosition")};ql.modelPosition=ql.point=ql.position;ql.modelPositions=ql.points=ql.positions;ql.renderedPoint=ql.renderedPosition;ql.relativePoint=ql.relativePosition;IQe=Qge;ey=Hf={};Hf.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,l=e.y1*n+i.y,u=e.y2*n+i.y;return{x1:a,x2:s,y1:l,y2:u,w:s-a,h:u-l}};Hf.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};Hf.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var l=s._private,u=s.children(),h=s.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=u.boundingBox({includeLabels:h,includeOverlays:!1,useCache:!1}),p=l.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=p.x-d.w/2,d.x2=p.x+d.w/2,d.y1=p.y-d.h/2,d.y2=p.y+d.h/2);function m(D,O,R){var k=0,L=0,A=O+R;return D>0&&A>0&&(k=O/A*D,L=R/A*D),{biasDiff:k,biasComplementDiff:L}}o(m,"computeBiasValues");function g(D,O,R,k){if(R.units==="%")switch(k){case"width":return D>0?R.pfValue*D:0;case"height":return O>0?R.pfValue*O:0;case"average":return D>0&&O>0?R.pfValue*(D+O)/2:0;case"min":return D>0&&O>0?D>O?R.pfValue*O:R.pfValue*D:0;case"max":return D>0&&O>0?D>O?R.pfValue*D:R.pfValue*O:0;default:return 0}else return R.units==="px"?R.pfValue:0}o(g,"computePaddingValues");var y=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(y=y*100/f.width.val);var v=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(v=v*100/f.width.val);var x=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(x=x*100/f.height.val);var b=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(b=b*100/f.height.val);var T=m(f.width.val-d.w,y,v),S=T.biasDiff,w=T.biasComplementDiff,E=m(f.height.val-d.h,x,b),_=E.biasDiff,C=E.biasComplementDiff;l.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(d.w,f.width.val),p.x=(-S+d.x1+d.x2+w)/2,l.autoHeight=Math.max(d.h,f.height.val),p.y=(-_+d.y1+d.y2+C)/2}o(r,"update");for(var n=0;n<this.length;n++){var i=this[n],a=i._private;(!a.compoundBoundsClean||t)&&(r(i),e.batching()||(a.compoundBoundsClean=!0))}return this};il=o(function(e){return e===1/0||e===-1/0?0:e},"noninf"),Hl=o(function(e,r,n,i,a){i-r===0||a-n===0||r==null||n==null||i==null||a==null||(e.x1=r<e.x1?r:e.x1,e.x2=i>e.x2?i:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=a>e.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},"updateBounds"),qp=o(function(e,r){return r==null?e:Hl(e,r.x1,r.y1,r.x2,r.y2)},"updateBoundsFromBox"),zb=o(function(e,r,n){return Wl(e,r,n)},"prefixedProperty"),T6=o(function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,l=r.pstyle(n+"-arrow-shape").value,u,h;if(l!=="none"){n==="source"?(u=a.srcX,h=a.srcY):n==="target"?(u=a.tgtX,h=a.tgtY):(u=a.midX,h=a.midY);var f=i.arrowBounds=i.arrowBounds||{},d=f[n]=f[n]||{};d.x1=u-s,d.y1=h-s,d.x2=u+s,d.y2=h+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,D6(d,1),Hl(e,d.x1,d.y1,d.x2,d.y2)}}},"updateBoundsFromArrow"),uB=o(function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,l=r.pstyle(i+"label").strValue;if(l){var u=r.pstyle("text-halign"),h=r.pstyle("text-valign"),f=zb(s,"labelWidth",n),d=zb(s,"labelHeight",n),p=zb(s,"labelX",n),m=zb(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,y=r.pstyle(i+"text-margin-y").pfValue,v=r.isEdge(),x=r.pstyle(i+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,T=r.pstyle("text-border-width").pfValue,S=T/2,w=r.pstyle("text-background-padding").pfValue,E=2,_=d,C=f,D=C/2,O=_/2,R,k,L,A;if(v)R=p-D,k=p+D,L=m-O,A=m+O;else{switch(u.value){case"left":R=p-C,k=p;break;case"center":R=p-D,k=p+D;break;case"right":R=p,k=p+C;break}switch(h.value){case"top":L=m-_,A=m;break;case"center":L=m-O,A=m+O;break;case"bottom":L=m,A=m+_;break}}var I=g-Math.max(b,S)-w-E,M=g+Math.max(b,S)+w+E,P=y-Math.max(b,S)-w-E,B=y+Math.max(b,S)+w+E;R+=I,k+=M,L+=P,A+=B;var F=n||"main",z=a.labelBounds,$=z[F]=z[F]||{};$.x1=R,$.y1=L,$.x2=k,$.y2=A,$.w=k-R,$.h=A-L,$.leftPad=I,$.rightPad=M,$.topPad=P,$.botPad=B;var U=v&&x.strValue==="autorotate",K=x.pfValue!=null&&x.pfValue!==0;if(U||K){var ee=U?zb(a.rstyle,"labelAngle",n):x.pfValue,Y=Math.cos(ee),ce=Math.sin(ee),Z=(R+k)/2,ue=(L+A)/2;if(!v){switch(u.value){case"left":Z=k;break;case"right":Z=R;break}switch(h.value){case"top":ue=A;break;case"bottom":ue=L;break}}var Q=o(function(se,ae){return se=se-Z,ae=ae-ue,{x:se*Y-ae*ce+Z,y:se*ce+ae*Y+ue}},"rotate"),j=Q(R,L),ne=Q(R,A),te=Q(k,L),he=Q(k,A);R=Math.min(j.x,ne.x,te.x,he.x),k=Math.max(j.x,ne.x,te.x,he.x),L=Math.min(j.y,ne.y,te.y,he.y),A=Math.max(j.y,ne.y,te.y,he.y)}var le=F+"Rot",J=z[le]=z[le]||{};J.x1=R,J.y1=L,J.x2=k,J.y2=A,J.w=k-R,J.h=A-L,Hl(e,R,L,k,A),Hl(a.labelBounds.all,R,L,k,A)}return e}},"updateBoundsFromLabel"),OQe=o(function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value;if(n>0&&i>0){var a=r.pstyle("outline-offset").value,s=r.pstyle("shape").value,l=i+a,u=(e.w+l*2)/e.w,h=(e.h+l*2)/e.h,f=0,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+l*2.4)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+l*2.4)/e.w:s==="star"?(u=(e.w+l*2.8)/e.w,h=(e.h+l*2.6)/e.h,d=-l/3.8):s==="triangle"?(u=(e.w+l*2.8)/e.w,h=(e.h+l*2.4)/e.h,d=-l/1.4):s==="vee"&&(u=(e.w+l*4.4)/e.w,h=(e.h+l*3.8)/e.h,d=-l*.5);var p=e.h*h-e.h,m=e.w*u-e.w;if(L6(e,[Math.ceil(p/2),Math.ceil(m/2)]),f!=0||d!==0){var g=rXe(e,f,d);Cge(e,g)}}}},"updateBoundsFromOutline"),PQe=o(function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Ys(),l=e._private,u=e.isNode(),h=e.isEdge(),f,d,p,m,g,y,v=l.rstyle,x=u&&i?e.pstyle("bounds-expansion").pfValue:[0],b=o(function(Se){return Se.pstyle("display").value!=="none"},"isDisplayed"),T=!i||b(e)&&(!h||b(e.source())&&b(e.target()));if(T){var S=0,w=0;i&&r.includeOverlays&&(S=e.pstyle("overlay-opacity").value,S!==0&&(w=e.pstyle("overlay-padding").value));var E=0,_=0;i&&r.includeUnderlays&&(E=e.pstyle("underlay-opacity").value,E!==0&&(_=e.pstyle("underlay-padding").value));var C=Math.max(w,_),D=0,O=0;if(i&&(D=e.pstyle("width").pfValue,O=D/2),u&&r.includeNodes){var R=e.position();g=R.x,y=R.y;var k=e.outerWidth(),L=k/2,A=e.outerHeight(),I=A/2;f=g-L,d=g+L,p=y-I,m=y+I,Hl(s,f,p,d,m),i&&r.includeOutlines&&OQe(s,e)}else if(h&&r.includeEdges)if(i&&!a){var M=e.pstyle("curve-style").strValue;if(f=Math.min(v.srcX,v.midX,v.tgtX),d=Math.max(v.srcX,v.midX,v.tgtX),p=Math.min(v.srcY,v.midY,v.tgtY),m=Math.max(v.srcY,v.midY,v.tgtY),f-=O,d+=O,p-=O,m+=O,Hl(s,f,p,d,m),M==="haystack"){var P=v.haystackPts;if(P&&P.length===2){if(f=P[0].x,p=P[0].y,d=P[1].x,m=P[1].y,f>d){var B=f;f=d,d=B}if(p>m){var F=p;p=m,m=F}Hl(s,f-O,p-O,d+O,m+O)}}else if(M==="bezier"||M==="unbundled-bezier"||M.endsWith("segments")||M.endsWith("taxi")){var z;switch(M){case"bezier":case"unbundled-bezier":z=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=v.linePts;break}if(z!=null)for(var $=0;$<z.length;$++){var U=z[$];f=U.x-O,d=U.x+O,p=U.y-O,m=U.y+O,Hl(s,f,p,d,m)}}}else{var K=e.source(),ee=K.position(),Y=e.target(),ce=Y.position();if(f=ee.x,d=ce.x,p=ee.y,m=ce.y,f>d){var Z=f;f=d,d=Z}if(p>m){var ue=p;p=m,m=ue}f-=O,d+=O,p-=O,m+=O,Hl(s,f,p,d,m)}if(i&&r.includeEdges&&h&&(T6(s,e,"mid-source"),T6(s,e,"mid-target"),T6(s,e,"source"),T6(s,e,"target")),i){var Q=e.pstyle("ghost").value==="yes";if(Q){var j=e.pstyle("ghost-offset-x").pfValue,ne=e.pstyle("ghost-offset-y").pfValue;Hl(s,s.x1+j,s.y1+ne,s.x2+j,s.y2+ne)}}var te=l.bodyBounds=l.bodyBounds||{};X0e(te,s),L6(te,x),D6(te,1),i&&(f=s.x1,d=s.x2,p=s.y1,m=s.y2,Hl(s,f-C,p-C,d+C,m+C));var he=l.overlayBounds=l.overlayBounds||{};X0e(he,s),L6(he,x),D6(he,1);var le=l.labelBounds=l.labelBounds||{};le.all!=null?tXe(le.all):le.all=Ys(),i&&r.includeLabels&&(r.includeMainLabels&&uB(s,e,null),h&&(r.includeSourceLabels&&uB(s,e,"source"),r.includeTargetLabels&&uB(s,e,"target")))}return s.x1=il(s.x1),s.y1=il(s.y1),s.x2=il(s.x2),s.y2=il(s.y2),s.w=il(s.x2-s.x1),s.h=il(s.y2-s.y1),s.w>0&&s.h>0&&T&&(L6(s,x),D6(s,1)),s},"boundingBoxImpl"),Jge=o(function(e){var r=0,n=o(function(s){return(s?1:0)<<r++},"tf"),i=0;return i+=n(e.incudeNodes),i+=n(e.includeEdges),i+=n(e.includeLabels),i+=n(e.includeMainLabels),i+=n(e.includeSourceLabels),i+=n(e.includeTargetLabels),i+=n(e.includeOverlays),i+=n(e.includeOutlines),i},"getKey"),e1e=o(function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),i=o(function(s){return Math.round(s)},"r");return wYe([i(r.x),i(r.y),i(n.x),i(n.y)])}else return 0},"getBoundingBoxPosKey"),gme=o(function(e,r){var n=e._private,i,a=e.isEdge(),s=r==null?yme:Jge(r),l=s===yme,u=e1e(e),h=n.bbCachePosKey===u,f=r.useCache&&h,d=o(function(y){return y._private.bbCache==null||y._private.styleDirty},"isDirty"),p=!f||d(e)||a&&(d(e.source())||d(e.target()));if(p?(h||e.recalculateRenderedStyle(f),i=PQe(e,l4),n.bbCache=i,n.bbCachePosKey=u):i=n.bbCache,!l){var m=e.isNode();i=Ys(),(r.includeNodes&&m||r.includeEdges&&!m)&&(r.includeOverlays?qp(i,n.overlayBounds):qp(i,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!a||r.includeSourceLabels&&r.includeTargetLabels)?qp(i,n.labelBounds.all):(r.includeMainLabels&&qp(i,n.labelBounds.mainRot),r.includeSourceLabels&&qp(i,n.labelBounds.sourceRot),r.includeTargetLabels&&qp(i,n.labelBounds.targetRot))),i.w=i.x2-i.x1,i.h=i.y2-i.y1}return i},"cachedBoundingBoxImpl"),l4={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},yme=Jge(l4),vme=oa(l4);Hf.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=l4:t=vme(t),e=gme(this[0],t);else{e=Ys(),t=t||l4;var r=vme(t),n=this,i=n.cy(),a=i.styleEnabled();if(a)for(var s=0;s<n.length;s++){var l=n[s],u=l._private,h=e1e(l),f=u.bbCachePosKey===h,d=r.useCache&&f&&!u.styleDirty;l.recalculateRenderedStyle(d)}this.updateCompoundBounds(!t.useCache);for(var p=0;p<n.length;p++){var m=n[p];qp(e,gme(m,r))}}return e.x1=il(e.x1),e.y1=il(e.y1),e.x2=il(e.x2),e.y2=il(e.y2),e.w=il(e.x2-e.x1),e.h=il(e.y2-e.y1),e};Hf.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Hf.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),i=r.collection();if(n&&(i=e.filter(function(h){return h.isParent()}),e=e.not(i)),Ur(t)){var a=t;t=o(function(){return a},"fn")}var s=o(function(f,d){return f._private.bbAtOldPos=t(f,d)},"storeOldPos"),l=o(function(f){return f._private.bbAtOldPos},"getOldPos");r.startBatch(),e.forEach(s).silentPositions(t),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var u=eXe(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),r.endBatch(),u};ey.boundingbox=ey.bb=ey.boundingBox;ey.renderedBoundingbox=ey.renderedBoundingBox;BQe=Hf;Xb=g4={};t1e=o(function(e){e.uppercaseName=G0e(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=G0e(e.outerName),Xb[e.name]=o(function(){var n=this[0],i=n._private,a=i.cy,s=a._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),i[e.autoName]||0;var l=n.pstyle(e.name);switch(l.strValue){case"label":return n.recalculateRenderedStyle(),i.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},"dimImpl"),Xb["outer"+e.uppercaseName]=o(function(){var n=this[0],i=n._private,a=i.cy,s=a._private.styleEnabled;if(n)if(s){var l=n[e.name](),u=n.pstyle("border-width").pfValue,h=2*n.padding();return l+u+h}else return 1},"outerDimImpl"),Xb["rendered"+e.uppercaseName]=o(function(){var n=this[0];if(n){var i=n[e.name]();return i*this.cy().zoom()}},"renderedDimImpl"),Xb["rendered"+e.uppercaseOuterName]=o(function(){var n=this[0];if(n){var i=n[e.outerName]();return i*this.cy().zoom()}},"renderedOuterDimImpl")},"defineDimFns");t1e({name:"width"});t1e({name:"height"});g4.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};g4.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};g4.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};FQe=g4,$Qe=o(function(e,r){if(e.isEdge())return r(e)},"ifEdge"),zQe=o(function(e,r){if(e.isEdge()){var n=e.cy();return J6(r(e),n.zoom(),n.pan())}},"ifEdgeRenderedPosition"),GQe=o(function(e,r){if(e.isEdge()){var n=e.cy(),i=n.pan(),a=n.zoom();return r(e).map(function(s){return J6(s,a,i)})}},"ifEdgeRenderedPositions"),VQe=o(function(e){return e.renderer().getControlPoints(e)},"controlPoints"),UQe=o(function(e){return e.renderer().getSegmentPoints(e)},"segmentPoints"),HQe=o(function(e){return e.renderer().getSourceEndpoint(e)},"sourceEndpoint"),WQe=o(function(e){return e.renderer().getTargetEndpoint(e)},"targetEndpoint"),qQe=o(function(e){return e.renderer().getEdgeMidpoint(e)},"midpoint"),xme={controlPoints:{get:VQe,mult:!0},segmentPoints:{get:UQe,mult:!0},sourceEndpoint:{get:HQe},targetEndpoint:{get:WQe},midpoint:{get:qQe}},YQe=o(function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},"renderedName"),XQe=Object.keys(xme).reduce(function(t,e){var r=xme[e],n=YQe(e);return t[e]=function(){return $Qe(this,r.get)},r.mult?t[n]=function(){return GQe(this,r.get)}:t[n]=function(){return zQe(this,r.get)},t},{}),jQe=ir({},IQe,BQe,FQe,XQe);r1e=o(function(e,r){this.recycle(e,r)},"Event");o(Gb,"returnFalse");o(w6,"returnTrue");r1e.prototype={instanceString:o(function(){return"event"},"instanceString"),recycle:o(function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Gb,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?w6:Gb):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},"recycle"),preventDefault:o(function(){this.isDefaultPrevented=w6;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},"preventDefault"),stopPropagation:o(function(){this.isPropagationStopped=w6;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},"stopPropagation"),stopImmediatePropagation:o(function(){this.isImmediatePropagationStopped=w6,this.stopPropagation()},"stopImmediatePropagation"),isDefaultPrevented:Gb,isPropagationStopped:Gb,isImmediatePropagationStopped:Gb};n1e=/^([^.]+)(\.(?:[^.]+))?$/,KQe=".*",i1e={qualifierCompare:o(function(e,r){return e===r},"qualifierCompare"),eventMatches:o(function(){return!0},"eventMatches"),addEventFields:o(function(){},"addEventFields"),callbackContext:o(function(e){return e},"callbackContext"),beforeEmit:o(function(){},"beforeEmit"),afterEmit:o(function(){},"afterEmit"),bubble:o(function(){return!1},"bubble"),parent:o(function(){return null},"parent"),context:null},bme=Object.keys(i1e),QQe={};o(aC,"Emitter");Gf=aC.prototype,a1e=o(function(e,r,n,i,a,s,l){li(i)&&(a=i,i=null),l&&(s==null?s=l:s=ir({},s,l));for(var u=En(n)?n:n.split(/\s+/),h=0;h<u.length;h++){var f=u[h];if(!Pf(f)){var d=f.match(n1e);if(d){var p=d[1],m=d[2]?d[2]:null,g=r(e,f,p,m,i,a,s);if(g===!1)break}}}},"forEachEvent"),Tme=o(function(e,r){return e.addEventFields(e.context,r),new r1e(r.type,r)},"makeEventObj"),ZQe=o(function(e,r,n){if(xqe(n)){r(e,n);return}else if(Ur(n)){r(e,Tme(e,n));return}for(var i=En(n)?n:n.split(/\s+/),a=0;a<i.length;a++){var s=i[a];if(!Pf(s)){var l=s.match(n1e);if(l){var u=l[1],h=l[2]?l[2]:null,f=Tme(e,{type:u,namespace:h,target:e.context});r(e,f)}}}},"forEachEventObj");Gf.on=Gf.addListener=function(t,e,r,n,i){return a1e(this,function(a,s,l,u,h,f,d){li(f)&&a.listeners.push({event:s,callback:f,type:l,namespace:u,qualifier:h,conf:d})},t,e,r,n,i),this};Gf.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})};Gf.removeListener=Gf.off=function(t,e,r,n){var i=this;this.emitting!==0&&(this.listeners=AYe(this.listeners));for(var a=this.listeners,s=o(function(h){var f=a[h];a1e(i,function(d,p,m,g,y,v){if((f.type===m||t==="*")&&(!g&&f.namespace!==".*"||f.namespace===g)&&(!y||d.qualifierCompare(f.qualifier,y))&&(!v||f.callback===v))return a.splice(h,1),!1},t,e,r,n)},"_loop"),l=a.length-1;l>=0;l--)s(l);return this};Gf.removeAllListeners=function(){return this.removeListener("*")};Gf.emit=Gf.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,En(e)||(e=[e]),ZQe(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var l=o(function(f){var d=n[f];if(d.type===s.type&&(!d.namespace||d.namespace===s.namespace||d.namespace===KQe)&&a.eventMatches(a.context,d,s)){var p=[s];e!=null&&DYe(p,e),a.beforeEmit(a.context,d,s),d.conf&&d.conf.one&&(a.listeners=a.listeners.filter(function(y){return y!==d}));var m=a.callbackContext(a.context,d,s),g=d.callback.apply(m,p);a.afterEmit(a.context,d,s),g===!1&&(s.stopPropagation(),s.preventDefault())}},"_loop2"),u=0;u<i;u++)l(u);a.bubble(a.context)&&!s.isPropagationStopped()&&a.parent(a.context).emit(s,e)},t),this.emitting--,this};JQe={qualifierCompare:o(function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},"qualifierCompare"),eventMatches:o(function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&f4(n.target)&&i.matches(n.target):!0},"eventMatches"),addEventFields:o(function(e,r){r.cy=e.cy(),r.target=e},"addEventFields"),callbackContext:o(function(e,r,n){return r.qualifier!=null?n.target:e},"callbackContext"),beforeEmit:o(function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},"beforeEmit"),bubble:o(function(){return!0},"bubble"),parent:o(function(e){return e.isChild()?e.parent():e.cy()},"parent")},k6=o(function(e){return Zt(e)?new $f(e):e},"argSelector"),s1e={createEmitter:o(function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new aC(JQe,r))}return this},"createEmitter"),emitter:o(function(){return this._private.emitter},"emitter"),on:o(function(e,r,n){for(var i=k6(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n)}return this},"on"),removeListener:o(function(e,r,n){for(var i=k6(r),a=0;a<this.length;a++){var s=this[a];s.emitter().removeListener(e,i,n)}return this},"removeListener"),removeAllListeners:o(function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},"removeAllListeners"),one:o(function(e,r,n){for(var i=k6(r),a=0;a<this.length;a++){var s=this[a];s.emitter().one(e,i,n)}return this},"one"),once:o(function(e,r,n){for(var i=k6(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n,{once:!0,onceCollection:this})}},"once"),emit:o(function(e,r){for(var n=0;n<this.length;n++){var i=this[n];i.emitter().emit(e,r)}return this},"emit"),emitAndNotify:o(function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this},"emitAndNotify")};un.eventAliasesOn(s1e);o1e={nodes:o(function(e){return this.filter(function(r){return r.isNode()}).filter(e)},"nodes"),edges:o(function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},"edges"),byGroup:o(function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var i=this[n];i.isNode()?e.push(i):r.push(i)}return{nodes:e,edges:r}},"byGroup"),filter:o(function(e,r){if(e===void 0)return this;if(Zt(e)||xo(e))return new $f(e).filter(this);if(li(e)){for(var n=this.spawn(),i=this,a=0;a<i.length;a++){var s=i[a],l=r?e.apply(r,[s,a,i]):e(s,a,i);l&&n.push(s)}return n}return this.spawn()},"filter"),not:o(function(e){if(e){Zt(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var i=this[n],a=e.has(i);a||r.push(i)}return r}else return this},"not"),absoluteComplement:o(function(){var e=this.cy();return e.mutableElements().not(this)},"absoluteComplement"),intersect:o(function(e){if(Zt(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),i=this,a=e,s=this.length<e.length,l=s?i:a,u=s?a:i,h=0;h<l.length;h++){var f=l[h];u.has(f)&&n.push(f)}return n},"intersect"),xor:o(function(e){var r=this._private.cy;Zt(e)&&(e=r.$(e));var n=this.spawn(),i=this,a=e,s=o(function(u,h){for(var f=0;f<u.length;f++){var d=u[f],p=d._private.data.id,m=h.hasElementWithId(p);m||n.push(d)}},"add");return s(i,a),s(a,i),n},"xor"),diff:o(function(e){var r=this._private.cy;Zt(e)&&(e=r.$(e));var n=this.spawn(),i=this.spawn(),a=this.spawn(),s=this,l=e,u=o(function(f,d,p){for(var m=0;m<f.length;m++){var g=f[m],y=g._private.data.id,v=d.hasElementWithId(y);v?a.merge(g):p.push(g)}},"add");return u(s,l,n),u(l,s,i),{left:n,right:i,both:a}},"diff"),add:o(function(e){var r=this._private.cy;if(!e)return this;if(Zt(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=this.spawnSelf(),a=0;a<e.length;a++){var s=e[a],l=!this.has(s);l&&i.push(s)}return i},"add"),merge:o(function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Zt(e)){var i=e;e=n.mutableElements().filter(i)}for(var a=r.map,s=0;s<e.length;s++){var l=e[s],u=l._private.data.id,h=!a.has(u);if(h){var f=this.length++;this[f]=l,a.set(u,{ele:l,index:f})}}return this},"merge"),unmergeAt:o(function(e){var r=this[e],n=r.id(),i=this._private,a=i.map;this[e]=void 0,a.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var l=this.length-1,u=this[l],h=u._private.data.id;this[l]=void 0,this[e]=u,a.set(h,{ele:u,index:e})}return this.length--,this},"unmergeAt"),unmergeOne:o(function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},"unmergeOne"),unmerge:o(function(e){var r=this._private.cy;if(!e)return this;if(e&&Zt(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},"unmerge"),unmergeBy:o(function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},"unmergeBy"),map:o(function(e,r){for(var n=[],i=this,a=0;a<i.length;a++){var s=i[a],l=r?e.apply(r,[s,a,i]):e(s,a,i);n.push(l)}return n},"map"),reduce:o(function(e,r){for(var n=r,i=this,a=0;a<i.length;a++)n=e(n,i[a],a,i);return n},"reduce"),max:o(function(e,r){for(var n=-1/0,i,a=this,s=0;s<a.length;s++){var l=a[s],u=r?e.apply(r,[l,s,a]):e(l,s,a);u>n&&(n=u,i=l)}return{value:n,ele:i}},"max"),min:o(function(e,r){for(var n=1/0,i,a=this,s=0;s<a.length;s++){var l=a[s],u=r?e.apply(r,[l,s,a]):e(l,s,a);u<n&&(n=u,i=l)}return{value:n,ele:i}},"min")},Qr=o1e;Qr.u=Qr["|"]=Qr["+"]=Qr.union=Qr.or=Qr.add;Qr["\\"]=Qr["!"]=Qr["-"]=Qr.difference=Qr.relativeComplement=Qr.subtract=Qr.not;Qr.n=Qr["&"]=Qr["."]=Qr.and=Qr.intersection=Qr.intersect;Qr["^"]=Qr["(+)"]=Qr["(-)"]=Qr.symmetricDifference=Qr.symdiff=Qr.xor;Qr.fnFilter=Qr.filterFn=Qr.stdFilter=Qr.filter;Qr.complement=Qr.abscomp=Qr.absoluteComplement;eZe={isNode:o(function(){return this.group()==="nodes"},"isNode"),isEdge:o(function(){return this.group()==="edges"},"isEdge"),isLoop:o(function(){return this.isEdge()&&this.source()[0]===this.target()[0]},"isLoop"),isSimple:o(function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},"isSimple"),group:o(function(){var e=this[0];if(e)return e._private.group},"group")},l1e=o(function(e,r){var n=e.cy(),i=n.hasCompoundNodes();function a(f){var d=f.pstyle("z-compound-depth");return d.value==="auto"?i?f.zDepth():0:d.value==="bottom"?-1:d.value==="top"?$B:0}o(a,"getDepth");var s=a(e)-a(r);if(s!==0)return s;function l(f){var d=f.pstyle("z-index-compare");return d.value==="auto"&&f.isNode()?1:0}o(l,"getEleDepth");var u=l(e)-l(r);if(u!==0)return u;var h=e.pstyle("z-index").value-r.pstyle("z-index").value;return h!==0?h:e.poolIndex()-r.poolIndex()},"zIndexSort"),H6={forEach:o(function(e,r){if(li(e))for(var n=this.length,i=0;i<n;i++){var a=this[i],s=r?e.apply(r,[a,i,this]):e(a,i,this);if(s===!1)break}return this},"forEach"),toArray:o(function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},"toArray"),slice:o(function(e,r){var n=[],i=this.length;r==null&&(r=i),e==null&&(e=0),e<0&&(e=i+e),r<0&&(r=i+r);for(var a=e;a>=0&&a<r&&a<i;a++)n.push(this[a]);return this.spawn(n)},"slice"),size:o(function(){return this.length},"size"),eq:o(function(e){return this[e]||this.spawn()},"eq"),first:o(function(){return this[0]||this.spawn()},"first"),last:o(function(){return this[this.length-1]||this.spawn()},"last"),empty:o(function(){return this.length===0},"empty"),nonempty:o(function(){return!this.empty()},"nonempty"),sort:o(function(e){if(!li(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},"sort"),sortByZIndex:o(function(){return this.sort(l1e)},"sortByZIndex"),zDepth:o(function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var i=r.data.parent?e.parents().size():0;return e.isParent()?i:$B-1}else{var a=r.source,s=r.target,l=a.zDepth(),u=s.zDepth();return Math.max(l,u,0)}}},"zDepth")};H6.each=H6.forEach;tZe=o(function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":qi(Symbol))!=e&&qi(Symbol.iterator)!=e;r&&(H6[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return ige({next:o(function(){return a<s?i.value=n[a++]:(i.value=void 0,i.done=!0),i},"next")},Symbol.iterator,function(){return this})})},"defineSymbolIterator");tZe();rZe=oa({nodeDimensionsIncludeLabels:!1}),N6={layoutDimensions:o(function(e){e=rZe(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},"layoutDimensions"),layoutPositions:o(function(e,r,n){var i=this.nodes().filter(function(w){return!w.isParent()}),a=this.cy(),s=r.eles,l=o(function(E){return E.id()},"getMemoizeKey"),u=e4(n,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var h=o(function(E,_,C){var D={x:_.x1+_.w/2,y:_.y1+_.h/2},O={x:(C.x-D.x)*E,y:(C.y-D.y)*E};return{x:D.x+O.x,y:D.y+O.y}},"calculateSpacing"),f=r.spacingFactor&&r.spacingFactor!==1,d=o(function(){if(!f)return null;for(var E=Ys(),_=0;_<i.length;_++){var C=i[_],D=u(C,_);nXe(E,D.x,D.y)}return E},"spacingBb"),p=d(),m=e4(function(w,E){var _=u(w,E);if(f){var C=Math.abs(r.spacingFactor);_=h(C,p,_)}return r.transform!=null&&(_=r.transform(w,_)),_},l);if(r.animate){for(var g=0;g<i.length;g++){var y=i[g],v=m(y,g),x=r.animateFilter==null||r.animateFilter(y,g);if(x){var b=y.animation({position:v,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else y.position(v)}if(r.fit){var T=a.animation({fit:{boundingBox:s.boundingBoxAt(m),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(T)}else if(r.zoom!==void 0&&r.pan!==void 0){var S=a.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(S)}e.animations.forEach(function(w){return w.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),sy.all(e.animations.map(function(w){return w.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else i.positions(m),r.fit&&a.fit(r.eles,r.padding),r.zoom!=null&&a.zoom(r.zoom),r.pan&&a.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},"layoutPositions"),layout:o(function(e){var r=this.cy();return r.makeLayout(ir({},e,{eles:this}))},"layout")};N6.createLayout=N6.makeLayout=N6.layout;o(c1e,"styleCache");o(sC,"cacheStyleFunction");o(oC,"cachePrototypeStyleFunction");Ea={recalculateRenderedStyle:o(function(e){var r=this.cy(),n=r.renderer(),i=r.styleEnabled();return n&&i&&n.recalculateRenderedStyle(this,e),this},"recalculateRenderedStyle"),dirtyStyleCache:o(function(){var e=this.cy(),r=o(function(a){return a._private.styleCache=null},"dirty");if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(i){r(i),i.connectedEdges().forEach(r)});return this},"dirtyStyleCache"),updateStyle:o(function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var i=r.hasCompoundNodes(),a=this;e=!!(e||e===void 0),i&&(a=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=a;return e?s.emitAndNotify("style"):s.emit("style"),a.forEach(function(l){return l._private.styleDirty=!0}),this},"updateStyle"),cleanStyle:o(function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},"cleanStyle"),parsedStyle:o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},"parsedStyle"),numericStyle:o(function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},"numericStyle"),numericStyleUnits:o(function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},"numericStyleUnits"),renderedStyle:o(function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},"renderedStyle"),style:o(function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Ur(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(Zt(e))if(r===void 0){var l=this[0];return l?a.getStylePropertyValue(l,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?a.getRawStyle(u):void 0}return this},"style"),removeStyle:o(function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s<a.length;s++){var l=a[s];i.removeAllBypasses(l,n)}else{e=e.split(/\s+/);for(var u=0;u<a.length;u++){var h=a[u];i.removeBypasses(h,e,n)}}return this.emitAndNotify("style"),this},"removeStyle"),show:o(function(){return this.css("display","element"),this},"show"),hide:o(function(){return this.css("display","none"),this},"hide"),effectiveOpacity:o(function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),n=this[0];if(n){var i=n._private,a=n.pstyle("opacity").value;if(!r)return a;var s=i.data.parent?n.parents():null;if(s)for(var l=0;l<s.length;l++){var u=s[l],h=u.pstyle("opacity").value;a=h*a}return a}},"effectiveOpacity"),transparent:o(function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},"transparent"),backgrounding:o(function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding},"backgrounding")};o(hB,"checkCompound");o(QB,"defineDerivedStateFunction");uy=sC("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ea.takesUpSpace=oC("takesUpSpace",QB({ok:uy}));nZe=sC("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&uy(t)}),iZe=sC("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&uy(t)});Ea.interactive=oC("interactive",QB({ok:nZe,parentOk:iZe,edgeOkViaNode:uy}));Ea.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};aZe=sC("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&uy(t)}),sZe=uy;Ea.visible=oC("visible",QB({ok:aZe,edgeOkViaNode:sZe}));Ea.hidden=function(){var t=this[0];if(t)return!t.visible()};Ea.isBundledBezier=oC("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Ea.bypass=Ea.css=Ea.style;Ea.renderedCss=Ea.renderedStyle;Ea.removeBypass=Ea.removeCss=Ea.removeStyle;Ea.pstyle=Ea.parsedStyle;Of={};o(wme,"defineSwitchFunction");o(hy,"defineSwitchSet");hy({field:"locked",overrideField:o(function(e){return e.cy().autolock()?!0:void 0},"overrideField"),on:"lock",off:"unlock"});hy({field:"grabbable",overrideField:o(function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},"overrideField"),on:"grabify",off:"ungrabify"});hy({field:"selected",ableField:"selectable",overrideAble:o(function(e){return e.cy().autounselectify()?!1:void 0},"overrideAble"),on:"select",off:"unselect"});hy({field:"selectable",overrideField:o(function(e){return e.cy().autounselectify()?!1:void 0},"overrideField"),on:"selectify",off:"unselectify"});Of.deselect=Of.unselect;Of.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};hy({field:"active",on:"activate",off:"unactivate"});hy({field:"pannable",on:"panify",off:"unpanify"});Of.inactive=function(){var t=this[0];if(t)return!t._private.active};Ha={},kme=o(function(e){return o(function(n){for(var i=this,a=[],s=0;s<i.length;s++){var l=i[s];if(l.isNode()){for(var u=!1,h=l.connectedEdges(),f=0;f<h.length;f++){var d=h[f],p=d.source(),m=d.target();if(e.noIncomingEdges&&m===l&&p!==l||e.noOutgoingEdges&&p===l&&m!==l){u=!0;break}}u||a.push(l)}}return this.spawn(a,!0).filter(n)},"dagExtremityImpl")},"defineDagExtremity"),Eme=o(function(e){return function(r){for(var n=this,i=[],a=0;a<n.length;a++){var s=n[a];if(s.isNode())for(var l=s.connectedEdges(),u=0;u<l.length;u++){var h=l[u],f=h.source(),d=h.target();e.outgoing&&f===s?(i.push(h),i.push(d)):e.incoming&&d===s&&(i.push(h),i.push(f))}}return this.spawn(i,!0).filter(r)}},"defineDagOneHop"),Sme=o(function(e){return function(r){for(var n=this,i=[],a={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var l=!1,u=0;u<s.length;u++){var h=s[u],f=h.id();a[f]||(a[f]=!0,i.push(h),l=!0)}if(!l)break;n=s}return this.spawn(i,!0).filter(r)}},"defineDagAllHops");Ha.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};ir(Ha,{roots:kme({noIncomingEdges:!0}),leaves:kme({noOutgoingEdges:!0}),outgoers:al(Eme({outgoing:!0}),"outgoers"),successors:Sme({outgoing:!0}),incomers:al(Eme({incoming:!0}),"incomers"),predecessors:Sme({incoming:!0})});ir(Ha,{neighborhood:al(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var i=r[n],a=i.connectedEdges(),s=0;s<a.length;s++){var l=a[s],u=l.source(),h=l.target(),f=i===u?h:u;f.length>0&&e.push(f[0]),e.push(l[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:o(function(e){return this.neighborhood().add(this).filter(e)},"closedNeighborhood"),openNeighborhood:o(function(e){return this.neighborhood(e)},"openNeighborhood")});Ha.neighbourhood=Ha.neighborhood;Ha.closedNeighbourhood=Ha.closedNeighborhood;Ha.openNeighbourhood=Ha.openNeighborhood;ir(Ha,{source:al(o(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"sourceImpl"),"source"),target:al(o(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"targetImpl"),"target"),sources:Cme({attr:"source"}),targets:Cme({attr:"target"})});o(Cme,"defineSourceFunction");ir(Ha,{edgesWith:al(Ame(),"edgesWith"),edgesTo:al(Ame({thisIsSrc:!0}),"edgesTo")});o(Ame,"defineEdgesWithFunction");ir(Ha,{connectedEdges:al(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var i=r[n];if(i.isNode())for(var a=i._private.edges,s=0;s<a.length;s++){var l=a[s];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:al(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var i=r[n];i.isEdge()&&(e.push(i.source()[0]),e.push(i.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:al(_me(),"parallelEdges"),codirectedEdges:al(_me({codirected:!0}),"codirectedEdges")});o(_me,"defineParallelEdgesFunction");ir(Ha,{components:o(function(e){var r=this,n=r.cy(),i=n.collection(),a=e==null?r.nodes():e.nodes(),s=[];e!=null&&a.empty()&&(a=e.sources());var l=o(function(f,d){i.merge(f),a.unmerge(f),d.merge(f)},"visitInComponent");if(a.empty())return r.spawn();var u=o(function(){var f=n.collection();s.push(f);var d=a[0];l(d,f),r.bfs({directed:!1,roots:d,visit:o(function(m){return l(m,f)},"visit")}),f.forEach(function(p){p.connectedEdges().forEach(function(m){r.has(m)&&f.has(m.source())&&f.has(m.target())&&f.merge(m)})})},"_loop");do u();while(a.length>0);return s},"components"),component:o(function(){var e=this[0];return e.cy().mutableElements().components(e)[0]},"component")});Ha.componentsOf=Ha.components;Sa=o(function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){oi("A collection must have a reference to the core");return}var a=new Zc,s=!1;if(!r)r=[];else if(r.length>0&&Ur(r[0])&&!f4(r[0])){s=!0;for(var l=[],u=new ay,h=0,f=r.length;h<f;h++){var d=r[h];d.data==null&&(d.data={});var p=d.data;if(p.id==null)p.id=wge();else if(e.hasElementWithId(p.id)||u.has(p.id))continue;var m=new Z6(e,d,!1);l.push(m),u.add(p.id)}r=l}this.length=0;for(var g=0,y=r.length;g<y;g++){var v=r[g][0];if(v!=null){var x=v._private.data.id;(!n||!a.has(x))&&(n&&a.set(x,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:o(function(){for(var T=this.lazyMap=new Zc,S=this.eles,w=0;w<S.length;w++){var E=S[w];T.set(E.id(),{index:w,ele:E})}},"rebuildMap")},n&&(this._private.map=a),s&&!i&&this.restore()},"Collection"),Mn=Z6.prototype=Sa.prototype=Object.create(Array.prototype);Mn.instanceString=function(){return"collection"};Mn.spawn=function(t,e){return new Sa(this.cy(),t,e)};Mn.spawnSelf=function(){return this.spawn(this)};Mn.cy=function(){return this._private.cy};Mn.renderer=function(){return this._private.cy.renderer()};Mn.element=function(){return this[0]};Mn.collection=function(){return oge(this)?this:new Sa(this._private.cy,[this])};Mn.unique=function(){return new Sa(this._private.cy,this,!0)};Mn.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};Mn.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Sa(e)};Mn.$id=Mn.getElementById;Mn.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};Mn.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};Mn.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};Mn.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Ur(t)){if(r.startBatch(),t.data){e.data(t.data);var i=n.data;if(e.isEdge()){var a=!1,s={},l=t.data.source,u=t.data.target;l!=null&&l!=i.source&&(s.source=""+l,a=!0),u!=null&&u!=i.target&&(s.target=""+u,a=!0),a&&(e=e.move(s))}else{var h="parent"in t.data,f=t.data.parent;h&&(f!=null||i.parent!=null)&&f!=i.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var d=o(function(y,v,x){var b=t[y];b!=null&&b!==n[y]&&(b?e[v]():e[x]())},"checkSwitch");return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var p={data:Qc(n.data),position:Qc(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};p.classes="";var m=0;return n.classes.forEach(function(g){return p.classes+=m++===0?g:" "+g}),p}}};Mn.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t};Mn.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],i=n.json(),a=new Z6(t,i,!1);e.push(a)}return new Sa(t,e)};Mn.copy=Mn.clone;Mn.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],l,u=0,h=r.length;u<h;u++){var f=r[u];e&&!f.removed()||(f.isNode()?a.push(f):s.push(f))}l=a.concat(s);var d,p=o(function(){l.splice(d,1),d--},"removeFromElements");for(d=0;d<l.length;d++){var m=l[d],g=m._private,y=g.data;if(m.clearTraversalCache(),!(!e&&!g.removed)){if(y.id===void 0)y.id=wge();else if(_t(y.id))y.id=""+y.id;else if(Pf(y.id)||!Zt(y.id)){oi("Can not create element with invalid string ID `"+y.id+"`"),p();continue}else if(n.hasElementWithId(y.id)){oi("Can not create second element with ID `"+y.id+"`"),p();continue}}var v=y.id;if(m.isNode()){var x=g.position;x.x==null&&(x.x=0),x.y==null&&(x.y=0)}if(m.isEdge()){for(var b=m,T=["source","target"],S=T.length,w=!1,E=0;E<S;E++){var _=T[E],C=y[_];_t(C)&&(C=y[_]=""+y[_]),C==null||C===""?(oi("Can not create edge `"+v+"` with unspecified "+_),w=!0):n.hasElementWithId(C)||(oi("Can not create edge `"+v+"` with nonexistant "+_+" `"+C+"`"),w=!0)}if(w){p();continue}var D=n.getElementById(y.source),O=n.getElementById(y.target);D.same(O)?D._private.edges.push(b):(D._private.edges.push(b),O._private.edges.push(b)),b._private.source=D,b._private.target=O}g.map=new Zc,g.map.set(v,{ele:m,index:0}),g.removed=!1,e&&n.addToPool(m)}for(var R=0;R<a.length;R++){var k=a[R],L=k._private.data;_t(L.parent)&&(L.parent=""+L.parent);var A=L.parent,I=A!=null;if(I||k._private.parent){var M=k._private.parent?n.collection().merge(k._private.parent):n.getElementById(A);if(M.empty())L.parent=void 0;else if(M[0].removed())hn("Node added with missing parent, reference to parent removed"),L.parent=void 0,k._private.parent=null;else{for(var P=!1,B=M;!B.empty();){if(k.same(B)){P=!0,L.parent=void 0;break}B=B.parent()}P||(M[0]._private.children.push(k),k._private.parent=M[0],i.hasCompoundNodes=!0)}}}if(l.length>0){for(var F=l.length===r.length?r:new Sa(n,l),z=0;z<F.length;z++){var $=F[z];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}var U;i.hasCompoundNodes?U=n.collection().merge(F).merge(F.connectedNodes()).merge(F.parent()):U=F,U.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?F.emitAndNotify("add"):e&&F.emit("add")}return r};Mn.removed=function(){var t=this[0];return t&&t._private.removed};Mn.inside=function(){var t=this[0];return t&&!t._private.removed};Mn.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(A){for(var I=A._private.edges,M=0;M<I.length;M++)u(I[M])}o(s,"addConnectedEdges");function l(A){for(var I=A._private.children,M=0;M<I.length;M++)u(I[M])}o(l,"addChildren");function u(A){var I=i[A.id()];e&&A.removed()||I||(i[A.id()]=!0,A.isNode()?(n.push(A),s(A),l(A)):n.unshift(A))}o(u,"add");for(var h=0,f=r.length;h<f;h++){var d=r[h];u(d)}function p(A,I){var M=A._private.edges;Ff(M,I),A.clearTraversalCache()}o(p,"removeEdgeRef");function m(A){A.clearTraversalCache()}o(m,"removeParallelRef");var g=[];g.ids={};function y(A,I){I=I[0],A=A[0];var M=A._private.children,P=A.id();Ff(M,I),I._private.parent=null,g.ids[P]||(g.ids[P]=!0,g.push(A))}o(y,"removeChildRef"),r.dirtyCompoundBoundsCache(),e&&a.removeFromPool(n);for(var v=0;v<n.length;v++){var x=n[v];if(x.isEdge()){var b=x.source()[0],T=x.target()[0];p(b,x),p(T,x);for(var S=x.parallelEdges(),w=0;w<S.length;w++){var E=S[w];m(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var _=x.parent();_.length!==0&&y(_,x)}e&&(x._private.removed=!0)}var C=a._private.elements;a._private.hasCompoundNodes=!1;for(var D=0;D<C.length;D++){var O=C[D];if(O.isParent()){a._private.hasCompoundNodes=!0;break}}var R=new Sa(this.cy(),n);R.size()>0&&(t?R.emitAndNotify("remove"):e&&R.emit("remove"));for(var k=0;k<g.length;k++){var L=g[k];(!e||!L.removed())&&L.updateStyle()}return R};Mn.move=function(t){var e=this._private.cy,r=this,n=!1,i=!1,a=o(function(g){return g==null?g:""+g},"toString");if(t.source!==void 0||t.target!==void 0){var s=a(t.source),l=a(t.target),u=s!=null&&e.hasElementWithId(s),h=l!=null&&e.hasElementWithId(l);(u||h)&&(e.batch(function(){r.remove(n,i),r.emitAndNotify("moveout");for(var m=0;m<r.length;m++){var g=r[m],y=g._private.data;g.isEdge()&&(u&&(y.source=s),h&&(y.target=l))}r.restore(n,i)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=a(t.parent),d=f===null||e.hasElementWithId(f);if(d){var p=f===null?void 0:f;e.batch(function(){var m=r.remove(n,i);m.emitAndNotify("moveout");for(var g=0;g<r.length;g++){var y=r[g],v=y._private.data;y.isNode()&&(v.parent=p)}m.restore(n,i)}),r.emitAndNotify("move")}}return this};[Oge,yQe,R6,If,iy,MQe,iC,jQe,s1e,o1e,eZe,H6,N6,Ea,Of,Ha].forEach(function(t){ir(Mn,t)});oZe={add:o(function(e){var r,n=this;if(xo(e)){var i=e;if(i._private.cy===n)r=i.restore();else{for(var a=[],s=0;s<i.length;s++){var l=i[s];a.push(l.json())}r=new Sa(n,a)}}else if(En(e)){var u=e;r=new Sa(n,u)}else if(Ur(e)&&(En(e.nodes)||En(e.edges))){for(var h=e,f=[],d=["nodes","edges"],p=0,m=d.length;p<m;p++){var g=d[p],y=h[g];if(En(y))for(var v=0,x=y.length;v<x;v++){var b=ir({group:g},y[v]);f.push(b)}}r=new Sa(n,f)}else{var T=e;r=new Z6(n,T).collection()}return r},"add"),remove:o(function(e){if(!xo(e)){if(Zt(e)){var r=e;e=this.$(r)}}return e.remove()},"remove")};o(lZe,"generateCubicBezier");cZe=function(){function t(n){return-n.tension*n.x-n.friction*n.v}o(t,"springAccelerationForState");function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}o(e,"springEvaluateStateWithDerivative");function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),l=e(n,i*.5,s),u=e(n,i,l),h=1/6*(a.dx+2*(s.dx+l.dx)+u.dx),f=1/6*(a.dv+2*(s.dv+l.dv)+u.dv);return n.x=n.x+h*i,n.v=n.v+f*i,n}return o(r,"springIntegrateState"),o(function n(i,a,s){var l={x:-1,v:0,tension:null,friction:null},u=[0],h=0,f=1/1e4,d=16/1e3,p,m,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,l.tension=i,l.friction=a,p=s!==null,p?(h=n(i,a),m=h/s*d):m=d;g=r(g||l,m),u.push(1+g.x),h+=16,Math.abs(g.x)>f&&Math.abs(g.v)>f;);return p?function(y){return u[y*(u.length-1)|0]}:h},"springRK4Factory")}(),Nn=o(function(e,r,n,i){var a=lZe(e,r,n,i);return function(s,l,u){return s+(l-s)*a(u)}},"cubicBezier"),M6={linear:o(function(e,r,n){return e+(r-e)*n},"linear"),ease:Nn(.25,.1,.25,1),"ease-in":Nn(.42,0,1,1),"ease-out":Nn(0,0,.58,1),"ease-in-out":Nn(.42,0,.58,1),"ease-in-sine":Nn(.47,0,.745,.715),"ease-out-sine":Nn(.39,.575,.565,1),"ease-in-out-sine":Nn(.445,.05,.55,.95),"ease-in-quad":Nn(.55,.085,.68,.53),"ease-out-quad":Nn(.25,.46,.45,.94),"ease-in-out-quad":Nn(.455,.03,.515,.955),"ease-in-cubic":Nn(.55,.055,.675,.19),"ease-out-cubic":Nn(.215,.61,.355,1),"ease-in-out-cubic":Nn(.645,.045,.355,1),"ease-in-quart":Nn(.895,.03,.685,.22),"ease-out-quart":Nn(.165,.84,.44,1),"ease-in-out-quart":Nn(.77,0,.175,1),"ease-in-quint":Nn(.755,.05,.855,.06),"ease-out-quint":Nn(.23,1,.32,1),"ease-in-out-quint":Nn(.86,0,.07,1),"ease-in-expo":Nn(.95,.05,.795,.035),"ease-out-expo":Nn(.19,1,.22,1),"ease-in-out-expo":Nn(1,0,0,1),"ease-in-circ":Nn(.6,.04,.98,.335),"ease-out-circ":Nn(.075,.82,.165,1),"ease-in-out-circ":Nn(.785,.135,.15,.86),spring:o(function(e,r,n){if(n===0)return M6.linear;var i=cZe(e,r,n);return function(a,s,l){return a+(s-a)*i(l)}},"spring"),"cubic-bezier":Nn};o(Dme,"getEasedValue");o(Lme,"getValue");o(W1,"ease");o(uZe,"step$1");o(Vb,"valid");o(hZe,"startAnimation");o(Rme,"stepAll");fZe={animate:un.animate(),animation:un.animation(),animated:un.animated(),clearQueue:un.clearQueue(),delay:un.delay(),delayAnimation:un.delayAnimation(),stop:un.stop(),addToAnimationPool:o(function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},"addToAnimationPool"),stopAnimationLoop:o(function(){this._private.animationsRunning=!1},"stopAnimationLoop"),startAnimationLoop:o(function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&$6(o(function(a){Rme(a,e),r()},"animationStep"))}o(r,"headlessStep");var n=e.renderer();n&&n.beforeRender?n.beforeRender(o(function(a,s){Rme(s,e)},"rendererAnimationStep"),n.beforeRenderPriorities.animations):r()},"startAnimationLoop")},dZe={qualifierCompare:o(function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},"qualifierCompare"),eventMatches:o(function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&f4(n.target)&&i.matches(n.target):!0},"eventMatches"),addEventFields:o(function(e,r){r.cy=e,r.target=e},"addEventFields"),callbackContext:o(function(e,r,n){return r.qualifier!=null?n.target:e},"callbackContext")},E6=o(function(e){return Zt(e)?new $f(e):e},"argSelector"),u1e={createEmitter:o(function(){var e=this._private;return e.emitter||(e.emitter=new aC(dZe,this)),this},"createEmitter"),emitter:o(function(){return this._private.emitter},"emitter"),on:o(function(e,r,n){return this.emitter().on(e,E6(r),n),this},"on"),removeListener:o(function(e,r,n){return this.emitter().removeListener(e,E6(r),n),this},"removeListener"),removeAllListeners:o(function(){return this.emitter().removeAllListeners(),this},"removeAllListeners"),one:o(function(e,r,n){return this.emitter().one(e,E6(r),n),this},"one"),once:o(function(e,r,n){return this.emitter().one(e,E6(r),n),this},"once"),emit:o(function(e,r){return this.emitter().emit(e,r),this},"emit"),emitAndNotify:o(function(e,r){return this.emit(e),this.notify(e,r),this},"emitAndNotify")};un.eventAliasesOn(u1e);CB={png:o(function(e){var r=this._private.renderer;return e=e||{},r.png(e)},"png"),jpg:o(function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)},"jpg")};CB.jpeg=CB.jpg;I6={layout:o(function(e){var r=this;if(e==null){oi("Layout options must be specified to make a layout");return}if(e.name==null){oi("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){oi("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Zt(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(ir({},e,{cy:r,eles:a}));return s},"layout")};I6.createLayout=I6.makeLayout=I6.layout;pZe={notify:o(function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},"notify"),notifications:o(function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},"notifications"),noNotifications:o(function(e){this.notifications(!1),e(),this.notifications(!0)},"noNotifications"),batching:o(function(){return this._private.batchCount>0},"batching"),startBatch:o(function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},"startBatch"),endBatch:o(function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},"endBatch"),batch:o(function(e){return this.startBatch(),e(),this.endBatch(),this},"batch"),batchData:o(function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i<n.length;i++){var a=n[i],s=e[a],l=r.getElementById(a);l.data(s)}})},"batchData")},mZe=oa({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:12,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),AB={renderTo:o(function(e,r,n,i){var a=this._private.renderer;return a.renderTo(e,r,n,i),this},"renderTo"),renderer:o(function(){return this._private.renderer},"renderer"),forceRender:o(function(){return this.notify("draw"),this},"forceRender"),resize:o(function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},"resize"),initRenderer:o(function(e){var r=this,n=r.extension("renderer",e.name);if(n==null){oi("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&hn("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var i=mZe(e);i.cy=r,r._private.renderer=new n(i),this.notify("init")},"initRenderer"),destroyRenderer:o(function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},"destroyRenderer"),onRender:o(function(e){return this.on("render",e)},"onRender"),offRender:o(function(e){return this.off("render",e)},"offRender")};AB.invalidateDimensions=AB.resize;O6={collection:o(function(e,r){return Zt(e)?this.$(e):xo(e)?e.collection():En(e)?(r||(r={}),new Sa(this,e,r.unique,r.removed)):new Sa(this)},"collection"),nodes:o(function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},"nodes"),edges:o(function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},"edges"),$:o(function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},"$"),mutableElements:o(function(){return this._private.elements},"mutableElements")};O6.elements=O6.filter=O6.$;qa={},Kb="t",gZe="f";qa.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a<t.length;a++){var s=t[a],l=e.getContextMeta(s);if(!l.empty){var u=e.getContextStyle(l),h=e.applyContextStyle(l,u,s);s._private.appliedInitStyle?e.updateTransitions(s,h.diffProps):s._private.appliedInitStyle=!0;var f=e.updateStyleHints(s);f&&i.push(s)}}return i};qa.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},i=t+"-"+e,a=n[i];if(a)return a;for(var s=[],l={},u=0;u<r.length;u++){var h=r[u],f=t[u]===Kb,d=e[u]===Kb,p=f!==d,m=h.mappedProperties.length>0;if(p||d&&m){var g=void 0;p&&m||p?g=h.properties:m&&(g=h.mappedProperties);for(var y=0;y<g.length;y++){for(var v=g[y],x=v.name,b=!1,T=u+1;T<r.length;T++){var S=r[T],w=e[T]===Kb;if(w&&(b=S.properties[v.name]!=null,b))break}!l[x]&&!b&&(l[x]=!0,s.push(x))}}}return n[i]=s,s};qa.getContextMeta=function(t){for(var e=this,r="",n,i=t._private.styleCxtKey||"",a=0;a<e.length;a++){var s=e[a],l=s.selector&&s.selector.matches(t);l?r+=Kb:r+=gZe}return n=e.getPropertiesDiff(i,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}};qa.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var i={_private:{key:e}},a=0;a<r.length;a++){var s=r[a],l=e[a]===Kb;if(l)for(var u=0;u<s.properties.length;u++){var h=s.properties[u];i[h.name]=h}}return n[e]=i,i};qa.applyContextStyle=function(t,e,r){for(var n=this,i=t.diffPropNames,a={},s=n.types,l=0;l<i.length;l++){var u=i[l],h=e[u],f=r.pstyle(u);if(!h)if(f)f.bypass?h={name:u,deleteBypassed:!0}:h={name:u,delete:!0};else continue;if(f!==h){if(h.mapped===s.fn&&f!=null&&f.mapping!=null&&f.mapping.value===h.value){var d=f.mapping,p=d.fnValue=h.value(r);if(p===d.prevFnValue)continue}var m=a[u]={prev:f};n.applyParsedProperty(r,h),m.next=r.pstyle(u),m.next&&m.next.bypass&&(m.next=m.next.bypassed)}}return{diffProps:a}};qa.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,i=r.propertyGroupKeys,a=o(function(ne,te,he){return r.getPropertiesHash(ne,te,he)},"propHash"),s=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",u=t._private.style;n=Object.keys(u);for(var h=0;h<i.length;h++){var f=i[h];e.styleKeys[f]=[X1,qb]}for(var d=o(function(ne,te){return e.styleKeys[te][0]=t4(ne,e.styleKeys[te][0])},"updateGrKey1"),p=o(function(ne,te){return e.styleKeys[te][1]=r4(ne,e.styleKeys[te][1])},"updateGrKey2"),m=o(function(ne,te){d(ne,te),p(ne,te)},"updateGrKey"),g=o(function(ne,te){for(var he=0;he<ne.length;he++){var le=ne.charCodeAt(he);d(le,te),p(le,te)}},"updateGrKeyWStr"),y=2e9,v=o(function(ne){return-128<ne&&ne<128&&Math.floor(ne)!==ne?y-(ne*1024|0):ne},"cleanNum"),x=0;x<n.length;x++){var b=n[x],T=u[b];if(T!=null){var S=this.properties[b],w=S.type,E=S.groupKey,_=void 0;S.hashOverride!=null?_=S.hashOverride(t,T):T.pfValue!=null&&(_=T.pfValue);var C=S.enums==null?T.value:null,D=_!=null,O=C!=null,R=D||O,k=T.units;if(w.number&&R&&!w.multiple){var L=D?_:C;m(v(L),E),!D&&k!=null&&g(k,E)}else g(T.strValue,E)}}for(var A=[X1,qb],I=0;I<i.length;I++){var M=i[I],P=e.styleKeys[M];A[0]=t4(P[0],A[0]),A[1]=r4(P[1],A[1])}e.styleKey=TYe(A[0],A[1]);var B=e.styleKeys;e.labelDimsKey=Lf(B.labelDimensions);var F=a(t,["label"],B.labelDimensions);if(e.labelKey=Lf(F),e.labelStyleKey=Lf(m6(B.commonLabel,F)),!l){var z=a(t,["source-label"],B.labelDimensions);e.sourceLabelKey=Lf(z),e.sourceLabelStyleKey=Lf(m6(B.commonLabel,z));var $=a(t,["target-label"],B.labelDimensions);e.targetLabelKey=Lf($),e.targetLabelStyleKey=Lf(m6(B.commonLabel,$))}if(l){var U=e.styleKeys,K=U.nodeBody,ee=U.nodeBorder,Y=U.nodeOutline,ce=U.backgroundImage,Z=U.compound,ue=U.pie,Q=[K,ee,Y,ce,Z,ue].filter(function(j){return j!=null}).reduce(m6,[X1,qb]);e.nodeKey=Lf(Q),e.hasPie=ue!=null&&ue[0]!==X1&&ue[1]!==qb}return s!==e.styleKey};qa.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null};qa.applyParsedProperty=function(t,e){var r=this,n=e,i=t._private.style,a,s=r.types,l=r.properties[n.name].type,u=n.bypass,h=i[n.name],f=h&&h.bypass,d=t._private,p="mapping",m=o(function(K){return K==null?null:K.pfValue!=null?K.pfValue:K.value},"getVal"),g=o(function(){var K=m(h),ee=m(n);r.checkTriggers(t,n.name,K,ee)},"checkTriggers");if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",u)),n.delete)return i[n.name]=void 0,g(),!0;if(n.deleteBypassed)return h?h.bypass?(h.bypassed=void 0,g(),!0):!1:(g(),!0);if(n.deleteBypass)return h?h.bypass?(i[n.name]=h.bypassed,g(),!0):!1:(g(),!0);var y=o(function(){hn("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")},"printMappingErr");switch(n.mapped){case s.mapData:{for(var v=n.field.split("."),x=d.data,b=0;b<v.length&&x;b++){var T=v[b];x=x[T]}if(x==null)return y(),!1;var S;if(_t(x)){var w=n.fieldMax-n.fieldMin;w===0?S=0:S=(x-n.fieldMin)/w}else return hn("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+x+"` for `"+t.id()+"` is non-numeric)"),!1;if(S<0?S=0:S>1&&(S=1),l.color){var E=n.valueMin[0],_=n.valueMax[0],C=n.valueMin[1],D=n.valueMax[1],O=n.valueMin[2],R=n.valueMax[2],k=n.valueMin[3]==null?1:n.valueMin[3],L=n.valueMax[3]==null?1:n.valueMax[3],A=[Math.round(E+(_-E)*S),Math.round(C+(D-C)*S),Math.round(O+(R-O)*S),Math.round(k+(L-k)*S)];a={bypass:n.bypass,name:n.name,value:A,strValue:"rgb("+A[0]+", "+A[1]+", "+A[2]+")"}}else if(l.number){var I=n.valueMin+(n.valueMax-n.valueMin)*S;a=this.parse(n.name,I,n.bypass,p)}else return!1;if(!a)return y(),!1;a.mapping=n,n=a;break}case s.data:{for(var M=n.field.split("."),P=d.data,B=0;B<M.length&&P;B++){var F=M[B];P=P[F]}if(P!=null&&(a=this.parse(n.name,P,n.bypass,p)),!a)return y(),!1;a.mapping=n,n=a;break}case s.fn:{var z=n.value,$=n.fnValue!=null?n.fnValue:z(t);if(n.prevFnValue=$,$==null)return hn("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(a=this.parse(n.name,$,n.bypass,p),!a)return hn("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;a.mapping=Qc(n),n=a;break}case void 0:break;default:return!1}return u?(f?n.bypassed=h.bypassed:n.bypassed=h,i[n.name]=n):f?h.bypassed=n:i[n.name]=n,g(),!0};qa.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var i=n._private.style,a=Object.keys(i),s=0;s<a.length;s++){var l=a[s],u=i[l];u!=null&&(u.bypass?u.bypassed=null:i[l]=null)}}};qa.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};qa.updateTransitions=function(t,e){var r=this,n=t._private,i=t.pstyle("transition-property").value,a=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(i.length>0&&a>0){for(var l={},u=!1,h=0;h<i.length;h++){var f=i[h],d=t.pstyle(f),p=e[f];if(p){var m=p.prev,g=m,y=p.next!=null?p.next:d,v=!1,x=void 0,b=1e-6;g&&(_t(g.pfValue)&&_t(y.pfValue)?(v=y.pfValue-g.pfValue,x=g.pfValue+b*v):_t(g.value)&&_t(y.value)?(v=y.value-g.value,x=g.value+b*v):En(g.value)&&En(y.value)&&(v=g.value[0]!==y.value[0]||g.value[1]!==y.value[1]||g.value[2]!==y.value[2],x=g.strValue),v&&(l[f]=y.strValue,this.applyBypass(t,f,x),u=!0))}}if(!u)return;n.transitioning=!0,new sy(function(T){s>0?t.delayAnimation(s).play().promise().then(T):T()}).then(function(){return t.animation({style:l,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)};qa.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],l=i(s);l!=null&&l(r,n)&&a(s)};qa.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};qa.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),i.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||n==="bezier")&&t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()}),i.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||n==="none")&&t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};qa.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};y4={};y4.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var l=0;l<i.properties.length;l++){var u=i.properties[l],h=u.name,f=this.parse(h,r,!0);f&&a.push(f)}}else if(Zt(e)){var d=this.parse(e,r,!0);d&&a.push(d)}else if(Ur(e)){var p=e;n=r;for(var m=Object.keys(p),g=0;g<m.length;g++){var y=m[g],v=p[y];if(v===void 0&&(v=p[K6(y)]),v!==void 0){var x=this.parse(y,v,!0);x&&a.push(x)}}}else return!1;if(a.length===0)return!1;for(var b=!1,T=0;T<t.length;T++){for(var S=t[T],w={},E=void 0,_=0;_<a.length;_++){var C=a[_];if(n){var D=S.pstyle(C.name);E=w[C.name]={prev:D}}b=this.applyParsedProperty(S,Qc(C))||b,n&&(E.next=S.pstyle(C.name))}b&&this.updateStyleHints(S),n&&this.updateTransitions(S,w,s)}return b};y4.overrideBypass=function(t,e,r){e=FB(e);for(var n=0;n<t.length;n++){var i=t[n],a=i._private.style[e],s=this.properties[e].type,l=s.color,u=s.mutiple,h=a?a.pfValue!=null?a.pfValue:a.value:null;!a||!a.bypass?this.applyBypass(i,e,r):(a.value=r,a.pfValue!=null&&(a.pfValue=r),l?a.strValue="rgb("+r.join(",")+")":u?a.strValue=r.join(" "):a.strValue=""+r,this.updateStyleHints(i)),this.checkTriggers(i,e,h,r)}};y4.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};y4.removeBypasses=function(t,e,r){for(var n=!0,i=0;i<t.length;i++){for(var a=t[i],s={},l=0;l<e.length;l++){var u=e[l],h=this.properties[u],f=a.pstyle(h.name);if(!(!f||!f.bypass)){var d="",p=this.parse(u,d,!0),m=s[h.name]={prev:f};this.applyParsedProperty(a,p),m.next=a.pstyle(h.name)}}this.updateStyleHints(a),r&&this.updateTransitions(a,s,n)}};ZB={};ZB.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};ZB.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};Jc={};Jc.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Jc.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},i=0;i<r.properties.length;i++){var a=r.properties[i],s=r.getStylePropertyValue(t,a.name,e);s!=null&&(n[a.name]=s,n[K6(a.name)]=s)}return n}};Jc.getIndexedStyle=function(t,e,r,n){var i=t.pstyle(e)[r][n];return i??t.cy().style().getDefaultProperty(e)[r][0]};Jc.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var i=n.properties[e];i.alias&&(i=i.pointsTo);var a=i.type,s=t.pstyle(i.name);if(s){var l=s.value,u=s.units,h=s.strValue;if(r&&a.number&&l!=null&&_t(l)){var f=t.cy().zoom(),d=o(function(v){return v*f},"getRenderedValue"),p=o(function(v,x){return d(v)+x},"getValueStringWithUnits"),m=En(l),g=m?u.every(function(y){return y!=null}):u!=null;return g?m?l.map(function(y,v){return p(y,u[v])}).join(" "):p(l,u):m?l.map(function(y){return Zt(y)?y:""+d(y)}).join(" "):""+d(l)}else if(h!=null)return h}return null}};Jc.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n],a=i.name,s=t.pstyle(a);s!==void 0&&(Ur(s)?s=this.parse(a,s.strValue):s=this.parse(a,s)),s&&(r[a]=s)}return r};Jc.getPropsList=function(t){var e=this,r=[],n=t,i=e.properties;if(n)for(var a=Object.keys(n),s=0;s<a.length;s++){var l=a[s],u=n[l],h=i[l]||i[FB(l)],f=this.parse(h.name,u);f&&r.push(f)}return r};Jc.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),i,a,s,l,u,h;for(u=0;u<e.length;u++)if(i=e[u],a=t.pstyle(i,!1),a!=null)if(a.pfValue!=null)n[0]=t4(l,n[0]),n[1]=r4(l,n[1]);else for(s=a.strValue,h=0;h<s.length;h++)l=s.charCodeAt(h),n[0]=t4(l,n[0]),n[1]=r4(l,n[1]);return n};Jc.getPropertiesHash=Jc.getNonDefaultPropertiesHash;lC={};lC.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],i=n.selector,a=n.style||n.css,s=Object.keys(a);e.selector(i);for(var l=0;l<s.length;l++){var u=s[l],h=a[u];e.css(u,h)}}return e};lC.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};lC.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,i=r.properties,a={},s=0;s<i.length;s++){var l=i[s];a[l.name]=l.strValue}t.push({selector:n?n.toString():"core",style:a})}return t};JB={};JB.appendFromString=function(t){var e=this,r=this,n=""+t,i,a,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){n.length>i.length?n=n.substr(i.length):n=""}o(l,"removeSelAndBlockFromRemaining");function u(){a.length>s.length?a=a.substr(s.length):a=""}for(o(u,"removePropAndValFromRem");;){var h=n.match(/^\s*$/);if(h)break;var f=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){hn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=f[0];var d=f[1];if(d!=="core"){var p=new $f(d);if(p.invalid){hn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),l();continue}}var m=f[2],g=!1;a=m;for(var y=[];;){var v=a.match(/^\s*$/);if(v)break;var x=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!x){hn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),g=!0;break}s=x[0];var b=x[1],T=x[2],S=e.properties[b];if(!S){hn("Skipping property: Invalid property name in: "+s),u();continue}var w=r.parse(b,T);if(!w){hn("Skipping property: Invalid property definition in: "+s),u();continue}y.push({name:b,val:T}),u()}if(g){l();break}r.selector(d);for(var E=0;E<y.length;E++){var _=y[E];r.css(_.name,_.val)}l()}return r};JB.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};ka={};(function(){var t=Wi,e=Sqe,r=Aqe,n=_qe,i=Dqe,a=o(function(Q){return"^"+Q+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},"data"),s=o(function(Q){var j=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+i;return"^"+Q+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+j+")\\s*\\,\\s*("+j+")\\)$"},"mapData"),l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];ka.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:a("data")},layoutData:{mapping:!0,regex:a("layoutData")},scratch:{mapping:!0,regex:a("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:l,singleRegexMatchValue:!0},urls:{regexes:l,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:o(function(Q,j){switch(Q.length){case 2:return j[0]!=="deg"&&j[0]!=="rad"&&j[1]!=="deg"&&j[1]!=="rad";case 1:return Zt(Q[0])||j[0]==="deg"||j[0]==="rad";default:return!1}},"validate")},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:o(function(Q){var j=Q.length;return j===1||j===2||j===4},"validate")}};var u={zeroNonZero:o(function(Q,j){return(Q==null||j==null)&&Q!==j||Q==0&&j!=0?!0:Q!=0&&j==0},"zeroNonZero"),any:o(function(Q,j){return Q!=j},"any"),emptyNonEmpty:o(function(Q,j){var ne=Pf(Q),te=Pf(j);return ne&&!te||!ne&&te},"emptyNonEmpty")},h=ka.types,f=[{name:"label",type:h.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:h.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:h.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:h.bidirectionalSize,triggersBounds:u.any}],d=[{name:"source-label",type:h.text,triggersBounds:u.any},{name:"source-text-rotation",type:h.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:h.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:h.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:h.size,triggersBounds:u.any}],p=[{name:"target-label",type:h.text,triggersBounds:u.any},{name:"target-text-rotation",type:h.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:h.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:h.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:h.size,triggersBounds:u.any}],m=[{name:"font-family",type:h.fontFamily,triggersBounds:u.any},{name:"font-style",type:h.fontStyle,triggersBounds:u.any},{name:"font-weight",type:h.fontWeight,triggersBounds:u.any},{name:"font-size",type:h.size,triggersBounds:u.any},{name:"text-transform",type:h.textTransform,triggersBounds:u.any},{name:"text-wrap",type:h.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:h.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:h.size,triggersBounds:u.any},{name:"text-outline-width",type:h.size,triggersBounds:u.any},{name:"line-height",type:h.positiveNumber,triggersBounds:u.any}],g=[{name:"text-valign",type:h.valign,triggersBounds:u.any},{name:"text-halign",type:h.halign,triggersBounds:u.any},{name:"color",type:h.color},{name:"text-outline-color",type:h.color},{name:"text-outline-opacity",type:h.zeroOneNumber},{name:"text-background-color",type:h.color},{name:"text-background-opacity",type:h.zeroOneNumber},{name:"text-background-padding",type:h.size,triggersBounds:u.any},{name:"text-border-opacity",type:h.zeroOneNumber},{name:"text-border-color",type:h.color},{name:"text-border-width",type:h.size,triggersBounds:u.any},{name:"text-border-style",type:h.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:h.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:h.justification}],y=[{name:"events",type:h.bool,triggersZOrder:u.any},{name:"text-events",type:h.bool,triggersZOrder:u.any}],v=[{name:"display",type:h.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:h.visibility,triggersZOrder:u.any},{name:"opacity",type:h.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:h.zeroOneNumber},{name:"min-zoomed-font-size",type:h.size},{name:"z-compound-depth",type:h.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:h.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:h.number,triggersZOrder:u.any}],x=[{name:"overlay-padding",type:h.size,triggersBounds:u.any},{name:"overlay-color",type:h.color},{name:"overlay-opacity",type:h.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:h.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:h.cornerRadius}],b=[{name:"underlay-padding",type:h.size,triggersBounds:u.any},{name:"underlay-color",type:h.color},{name:"underlay-opacity",type:h.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:h.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:h.cornerRadius}],T=[{name:"transition-property",type:h.propList},{name:"transition-duration",type:h.time},{name:"transition-delay",type:h.time},{name:"transition-timing-function",type:h.easing}],S=o(function(Q,j){return j.value==="label"?-Q.poolIndex():j.pfValue},"nodeSizeHashOverride"),w=[{name:"height",type:h.nodeSize,triggersBounds:u.any,hashOverride:S},{name:"width",type:h.nodeSize,triggersBounds:u.any,hashOverride:S},{name:"shape",type:h.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:h.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:h.cornerRadius},{name:"background-color",type:h.color},{name:"background-fill",type:h.fill},{name:"background-opacity",type:h.zeroOneNumber},{name:"background-blacken",type:h.nOneOneNumber},{name:"background-gradient-stop-colors",type:h.colors},{name:"background-gradient-stop-positions",type:h.percentages},{name:"background-gradient-direction",type:h.gradientDirection},{name:"padding",type:h.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:h.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:h.boundsExpansion,triggersBounds:u.any}],E=[{name:"border-color",type:h.color},{name:"border-opacity",type:h.zeroOneNumber},{name:"border-width",type:h.size,triggersBounds:u.any},{name:"border-style",type:h.borderStyle},{name:"border-cap",type:h.lineCap},{name:"border-join",type:h.lineJoin},{name:"border-dash-pattern",type:h.numbers},{name:"border-dash-offset",type:h.number},{name:"border-position",type:h.linePosition}],_=[{name:"outline-color",type:h.color},{name:"outline-opacity",type:h.zeroOneNumber},{name:"outline-width",type:h.size,triggersBounds:u.any},{name:"outline-style",type:h.borderStyle},{name:"outline-offset",type:h.size,triggersBounds:u.any}],C=[{name:"background-image",type:h.urls},{name:"background-image-crossorigin",type:h.bgCrossOrigin},{name:"background-image-opacity",type:h.zeroOneNumbers},{name:"background-image-containment",type:h.bgContainment},{name:"background-image-smoothing",type:h.bools},{name:"background-position-x",type:h.bgPos},{name:"background-position-y",type:h.bgPos},{name:"background-width-relative-to",type:h.bgRelativeTo},{name:"background-height-relative-to",type:h.bgRelativeTo},{name:"background-repeat",type:h.bgRepeat},{name:"background-fit",type:h.bgFit},{name:"background-clip",type:h.bgClip},{name:"background-width",type:h.bgWH},{name:"background-height",type:h.bgWH},{name:"background-offset-x",type:h.bgPos},{name:"background-offset-y",type:h.bgPos}],D=[{name:"position",type:h.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:h.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:h.size,triggersBounds:u.any},{name:"min-width-bias-left",type:h.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:h.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:h.size,triggersBounds:u.any},{name:"min-height-bias-top",type:h.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:h.sizeMaybePercent,triggersBounds:u.any}],O=[{name:"line-style",type:h.lineStyle},{name:"line-color",type:h.color},{name:"line-fill",type:h.fill},{name:"line-cap",type:h.lineCap},{name:"line-opacity",type:h.zeroOneNumber},{name:"line-dash-pattern",type:h.numbers},{name:"line-dash-offset",type:h.number},{name:"line-outline-width",type:h.size},{name:"line-outline-color",type:h.color},{name:"line-gradient-stop-colors",type:h.colors},{name:"line-gradient-stop-positions",type:h.percentages},{name:"curve-style",type:h.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:h.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:h.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:h.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:h.size,triggersBounds:u.any},{name:"control-point-distances",type:h.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:h.numbers,triggersBounds:u.any},{name:"segment-distances",type:h.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:h.numbers,triggersBounds:u.any},{name:"segment-radii",type:h.numbers,triggersBounds:u.any},{name:"radius-type",type:h.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:h.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:h.size,triggersBounds:u.any},{name:"taxi-direction",type:h.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:h.number,triggersBounds:u.any},{name:"edge-distances",type:h.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:h.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:h.angle,triggersBounds:u.any},{name:"loop-sweep",type:h.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:h.size,triggersBounds:u.any},{name:"target-distance-from-node",type:h.size,triggersBounds:u.any}],R=[{name:"ghost",type:h.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:h.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:h.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:h.zeroOneNumber}],k=[{name:"selection-box-color",type:h.color},{name:"selection-box-opacity",type:h.zeroOneNumber},{name:"selection-box-border-color",type:h.color},{name:"selection-box-border-width",type:h.size},{name:"active-bg-color",type:h.color},{name:"active-bg-opacity",type:h.zeroOneNumber},{name:"active-bg-size",type:h.size},{name:"outside-texture-bg-color",type:h.color},{name:"outside-texture-bg-opacity",type:h.zeroOneNumber}],L=[];ka.pieBackgroundN=16,L.push({name:"pie-size",type:h.sizeMaybePercent});for(var A=1;A<=ka.pieBackgroundN;A++)L.push({name:"pie-"+A+"-background-color",type:h.color}),L.push({name:"pie-"+A+"-background-size",type:h.percent}),L.push({name:"pie-"+A+"-background-opacity",type:h.zeroOneNumber});var I=[],M=ka.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:h.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:h.color},{name:"arrow-fill",type:h.arrowFill},{name:"arrow-width",type:h.arrowWidth}].forEach(function(ue){M.forEach(function(Q){var j=Q+"-"+ue.name,ne=ue.type,te=ue.triggersBounds;I.push({name:j,type:ne,triggersBounds:te})})},{});var P=ka.properties=[].concat(y,T,v,x,b,R,g,m,f,d,p,w,E,_,C,L,D,O,I,k),B=ka.propertyGroups={behavior:y,transition:T,visibility:v,overlay:x,underlay:b,ghost:R,commonLabel:g,labelDimensions:m,mainLabel:f,sourceLabel:d,targetLabel:p,nodeBody:w,nodeBorder:E,nodeOutline:_,backgroundImage:C,pie:L,compound:D,edgeLine:O,edgeArrow:I,core:k},F=ka.propertyGroupNames={},z=ka.propertyGroupKeys=Object.keys(B);z.forEach(function(ue){F[ue]=B[ue].map(function(Q){return Q.name}),B[ue].forEach(function(Q){return Q.groupKey=ue})});var $=ka.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];ka.propertyNames=P.map(function(ue){return ue.name});for(var U=0;U<P.length;U++){var K=P[U];P[K.name]=K}for(var ee=0;ee<$.length;ee++){var Y=$[ee],ce=P[Y.pointsTo],Z={name:Y.name,alias:!0,pointsTo:ce};P.push(Z),P[Y.name]=Z}})();ka.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};ka.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=ir({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,h){for(var f=1;f<=ka.pieBackgroundN;f++){var d=h.name.replace("{{i}}",f),p=h.value;u[d]=p}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,h){return ka.arrowPrefixes.forEach(function(f){var d=f+"-"+h.name,p=h.value;u[d]=p}),u},{})),r={},n=0;n<this.properties.length;n++){var i=this.properties[n];if(!i.pointsTo){var a=i.name,s=e[a],l=this.parse(a,s);r[a]=l}}return t.defaultProperties=r,t.defaultProperties};ka.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};cC={};cC.parse=function(t,e,r,n){var i=this;if(li(e))return i.parseImplWarn(t,e,r,n);var a=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",l=""+e,u=xge(t,l,s,a),h=i.propCache=i.propCache||[],f;return(f=h[u])||(f=h[u]=i.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(f=Qc(f),f&&(f.value=Qc(f.value))),f};cC.parseImplWarn=function(t,e,r,n){var i=this.parseImpl(t,e,r,n);return!i&&e!=null&&hn("The style property `".concat(t,": ").concat(e,"` is invalid")),i&&(i.name==="width"||i.name==="height")&&e==="label"&&hn("The style value of `label` is deprecated for `"+i.name+"`"),i};cC.parseImpl=function(t,e,r,n){var i=this;t=FB(t);var a=i.properties[t],s=e,l=i.types;if(!a||e===void 0)return null;a.alias&&(a=a.pointsTo,t=a.name);var u=Zt(e);u&&(e=e.trim());var h=a.type;if(!h)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(li(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:r};var f,d;if(!(!u||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(l.data.regex).exec(e))){if(r)return!1;var p=l.data;return{name:t,value:f,strValue:""+e,mapped:p,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(l.mapData.regex).exec(e))){if(r||h.multiple)return!1;var m=l.mapData;if(!(h.color||h.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var y=this.parse(t,d[5]);if(!y||y.mapped)return!1;if(g.pfValue===y.pfValue||g.strValue===y.strValue)return hn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(h.color){var v=g.value,x=y.value,b=v[0]===x[0]&&v[1]===x[1]&&v[2]===x[2]&&(v[3]===x[3]||(v[3]==null||v[3]===1)&&(x[3]==null||x[3]===1));if(b)return!1}return{name:t,value:d,strValue:""+e,mapped:m,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:y.value,bypass:r}}}if(h.multiple&&n!=="multiple"){var T;if(u?T=e.split(/\s+/):En(e)?T=e:T=[e],h.evenMultiple&&T.length%2!==0)return null;for(var S=[],w=[],E=[],_="",C=!1,D=0;D<T.length;D++){var O=i.parse(t,T[D],r,"multiple");C=C||Zt(O.value),S.push(O.value),E.push(O.pfValue!=null?O.pfValue:O.value),w.push(O.units),_+=(D>0?" ":"")+O.strValue}return h.validate&&!h.validate(S,w)?null:h.singleEnum&&C?S.length===1&&Zt(S[0])?{name:t,value:S[0],strValue:S[0],bypass:r}:null:{name:t,value:S,pfValue:E,strValue:_,bypass:r,units:w}}var R=o(function(){for(var Q=0;Q<h.enums.length;Q++){var j=h.enums[Q];if(j===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null},"checkEnums");if(h.number){var k,L="px";if(h.units&&(k=h.units),h.implicitUnits&&(L=h.implicitUnits),!h.unitless)if(u){var A="px|em"+(h.allowPercent?"|\\%":"");k&&(A=k);var I=e.match("^("+Wi+")("+A+")?$");I&&(e=I[1],k=I[2]||L)}else(!k||h.implicitUnits)&&(k=L);if(e=parseFloat(e),isNaN(e)&&h.enums===void 0)return null;if(isNaN(e)&&h.enums!==void 0)return e=s,R();if(h.integer&&!vqe(e)||h.min!==void 0&&(e<h.min||h.strictMin&&e===h.min)||h.max!==void 0&&(e>h.max||h.strictMax&&e===h.max))return null;var M={name:t,value:e,strValue:""+e+(k||""),units:k,bypass:r};return h.unitless||k!=="px"&&k!=="em"?M.pfValue=e:M.pfValue=k==="px"||!k?e:this.getEmSizeInPixels()*e,(k==="ms"||k==="s")&&(M.pfValue=k==="ms"?e:1e3*e),(k==="deg"||k==="rad")&&(M.pfValue=k==="rad"?e:QYe(e)),k==="%"&&(M.pfValue=e/100),M}else if(h.propList){var P=[],B=""+e;if(B!=="none"){for(var F=B.split(/\s*,\s*|\s+/),z=0;z<F.length;z++){var $=F[z].trim();i.properties[$]?P.push($):hn("`"+$+"` is not a valid property name")}if(P.length===0)return null}return{name:t,value:P,strValue:P.length===0?"none":P.join(" "),bypass:r}}else if(h.color){var U=hge(e);return U?{name:t,value:U,pfValue:U,strValue:"rgb("+U[0]+","+U[1]+","+U[2]+")",bypass:r}:null}else if(h.regex||h.regexes){if(h.enums){var K=R();if(K)return K}for(var ee=h.regexes?h.regexes:[h.regex],Y=0;Y<ee.length;Y++){var ce=new RegExp(ee[Y]),Z=ce.exec(e);if(Z)return{name:t,value:h.singleRegexMatchValue?Z[1]:Z,strValue:""+e,bypass:r}}return null}else return h.string?{name:t,value:""+e,strValue:""+e,bypass:r}:h.enums?R():null};Ua=o(function t(e){if(!(this instanceof t))return new t(e);if(!BB(e)){oi("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},"Style"),Wa=Ua.prototype;Wa.instanceString=function(){return"style"};Wa.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(i){var a=i[0]._private;a.styleDirty=!0,a.appliedInitStyle=!1}),this};Wa.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Wa.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Wa.selector=function(t){var e=t==="core"?null:new $f(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Wa.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var i=t.properties[n],a=r[i.name];a===void 0&&(a=r[K6(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Wa.style=Wa.css;Wa.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[n].mappedProperties.push(r);var i=!this[n].selector;i&&(this._private.coreStyle[r.name]=r)}return this};Wa.append=function(t){return lge(t)?t.appendToStyle(this):En(t)?this.appendFromJson(t):Zt(t)&&this.appendFromString(t),this};Ua.fromJson=function(t,e){var r=new Ua(t);return r.fromJson(e),r};Ua.fromString=function(t,e){return new Ua(t).fromString(e)};[qa,y4,ZB,Jc,lC,JB,ka,cC].forEach(function(t){ir(Wa,t)});Ua.types=Wa.types;Ua.properties=Wa.properties;Ua.propertyGroups=Wa.propertyGroups;Ua.propertyGroupNames=Wa.propertyGroupNames;Ua.propertyGroupKeys=Wa.propertyGroupKeys;yZe={style:o(function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},"style"),setStyle:o(function(e){var r=this._private;return lge(e)?r.style=e.generateStyle(this):En(e)?r.style=Ua.fromJson(this,e):Zt(e)?r.style=Ua.fromString(this,e):r.style=Ua(this),r.style},"setStyle"),updateStyle:o(function(){this.mutableElements().updateStyle()},"updateStyle")},vZe="single",e0={autolock:o(function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},"autolock"),autoungrabify:o(function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},"autoungrabify"),autounselectify:o(function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},"autounselectify"),selectionType:o(function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=vZe),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},"selectionType"),panningEnabled:o(function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},"panningEnabled"),userPanningEnabled:o(function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},"userPanningEnabled"),zoomingEnabled:o(function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},"zoomingEnabled"),userZoomingEnabled:o(function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},"userZoomingEnabled"),boxSelectionEnabled:o(function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},"boxSelectionEnabled"),pan:o(function(){var e=arguments,r=this._private.pan,n,i,a,s,l;switch(e.length){case 0:return r;case 1:if(Zt(e[0]))return n=e[0],r[n];if(Ur(e[0])){if(!this._private.panningEnabled)return this;a=e[0],s=a.x,l=a.y,_t(s)&&(r.x=s),_t(l)&&(r.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],i=e[1],(n==="x"||n==="y")&&_t(i)&&(r[n]=i),this.emit("pan viewport");break}return this.notify("viewport"),this},"pan"),panBy:o(function(e,r){var n=arguments,i=this._private.pan,a,s,l,u,h;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Ur(e)&&(l=n[0],u=l.x,h=l.y,_t(u)&&(i.x+=u),_t(h)&&(i.y+=h),this.emit("pan viewport"));break;case 2:a=e,s=r,(a==="x"||a==="y")&&_t(s)&&(i[a]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},"panBy"),gc:o(function(){this.notify("gc")},"gc"),fit:o(function(e,r){var n=this.getFitViewport(e,r);if(n){var i=this._private;i.zoom=n.zoom,i.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},"fit"),getFitViewport:o(function(e,r){if(_t(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Zt(e)){var i=e;e=this.$(i)}else if(Tqe(e)){var a=e;n={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else xo(e)||(e=this.mutableElements());if(!(xo(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),l=this.height(),u;if(r=_t(r)?r:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){u=Math.min((s-2*r)/n.w,(l-2*r)/n.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var h={x:(s-u*(n.x1+n.x2))/2,y:(l-u*(n.y1+n.y2))/2};return{zoom:u,pan:h}}}}},"getFitViewport"),zoomRange:o(function(e,r){var n=this._private;if(r==null){var i=e;e=i.min,r=i.max}return _t(e)&&_t(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):_t(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:_t(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},"zoomRange"),minZoom:o(function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},"minZoom"),maxZoom:o(function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},"maxZoom"),getZoomedViewport:o(function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,l=!1;if(r.zoomingEnabled||(l=!0),_t(e)?s=e:Ur(e)&&(s=e.level,e.position!=null?a=J6(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(l=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,l||!_t(s)||s===i||a!=null&&(!_t(a.x)||!_t(a.y)))return null;if(a!=null){var u=n,h=i,f=s,d={x:-f/h*(a.x-u.x)+a.x,y:-f/h*(a.y-u.y)+a.y};return{zoomed:!0,panned:!0,zoom:f,pan:d}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},"getZoomedViewport"),zoom:o(function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},"zoom"),viewport:o(function(e){var r=this._private,n=!0,i=!0,a=[],s=!1,l=!1;if(!e)return this;if(_t(e.zoom)||(n=!1),Ur(e.pan)||(i=!1),!n&&!i)return this;if(n){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=u,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var h=e.pan;_t(h.x)&&(r.pan.x=h.x,l=!1),_t(h.y)&&(r.pan.y=h.y,l=!1),l||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},"viewport"),center:o(function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},"center"),getCenterPan:o(function(e,r){if(this._private.panningEnabled){if(Zt(e)){var n=e;e=this.mutableElements().filter(n)}else xo(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var l={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return l}}},"getCenterPan"),reset:o(function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},"reset"),invalidateSize:o(function(){this._private.sizeCache=null},"invalidateSize"),size:o(function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var i=n.window().getComputedStyle(r),a=o(function(l){return parseFloat(i.getPropertyValue(l))},"val");return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}}():{width:1,height:1})},"size"),width:o(function(){return this.size().width},"width"),height:o(function(){return this.size().height},"height"),extent:o(function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},"extent"),renderedExtent:o(function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},"renderedExtent"),multiClickDebounceTime:o(function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this},"multiClickDebounceTime")};e0.centre=e0.center;e0.autolockNodes=e0.autolock;e0.autoungrabifyNodes=e0.autoungrabify;c4={data:un.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:un.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:un.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:un.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};c4.attr=c4.data;c4.removeAttr=c4.removeData;u4=o(function(e){var r=this;e=ir({},e);var n=e.container;n&&!F6(n)&&F6(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=Hi!==void 0&&n!==void 0&&!e.headless,l=e;l.layout=ir({name:s?"grid":"null"},l.layout),l.renderer=ir({name:s?"canvas":"null"},l.renderer);var u=o(function(g,y,v){return y!==void 0?y:v!==void 0?v:g},"defVal"),h=this._private={container:n,ready:!1,options:l,elements:new Sa(this),listeners:[],aniEles:new Sa(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,l.zoomingEnabled),userZoomingEnabled:u(!0,l.userZoomingEnabled),panningEnabled:u(!0,l.panningEnabled),userPanningEnabled:u(!0,l.userPanningEnabled),boxSelectionEnabled:u(!0,l.boxSelectionEnabled),autolock:u(!1,l.autolock,l.autolockNodes),autoungrabify:u(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:u(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?s:l.styleEnabled,zoom:_t(l.zoom)?l.zoom:1,pan:{x:Ur(l.pan)&&_t(l.pan.x)?l.pan.x:0,y:Ur(l.pan)&&_t(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var f=o(function(g,y){var v=g.some(wqe);if(v)return sy.all(g).then(y);y(g)},"loadExtData");h.styleEnabled&&r.setStyle([]);var d=ir({},l,l.renderer);r.initRenderer(d);var p=o(function(g,y,v){r.notifications(!1);var x=r.mutableElements();x.length>0&&x.remove(),g!=null&&(Ur(g)||En(g))&&r.add(g),r.one("layoutready",function(T){r.notifications(!0),r.emit(T),r.one("load",y),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",v),r.emit("done")});var b=ir({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()},"setElesAndLayout");f([l.style,l.elements],function(m){var g=m[0],y=m[1];h.styleEnabled&&r.style().append(g),p(y,function(){r.startAnimationLoop(),h.ready=!0,li(l.ready)&&r.on("ready",l.ready);for(var v=0;v<a.length;v++){var x=a[v];r.on("ready",x)}i&&(i.readies=[]),r.emit("ready")},l.done)})},"Core"),W6=u4.prototype;ir(W6,{instanceString:o(function(){return"core"},"instanceString"),isReady:o(function(){return this._private.ready},"isReady"),destroyed:o(function(){return this._private.destroyed},"destroyed"),ready:o(function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},"ready"),destroy:o(function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},"destroy"),hasElementWithId:o(function(e){return this._private.elements.hasElementWithId(e)},"hasElementWithId"),getElementById:o(function(e){return this._private.elements.getElementById(e)},"getElementById"),hasCompoundNodes:o(function(){return this._private.hasCompoundNodes},"hasCompoundNodes"),headless:o(function(){return this._private.renderer.isHeadless()},"headless"),styleEnabled:o(function(){return this._private.styleEnabled},"styleEnabled"),addToPool:o(function(e){return this._private.elements.merge(e),this},"addToPool"),removeFromPool:o(function(e){return this._private.elements.unmerge(e),this},"removeFromPool"),container:o(function(){return this._private.container||null},"container"),window:o(function(){var e=this._private.container;if(e==null)return Hi;var r=this._private.container.ownerDocument;return r===void 0||r==null?Hi:r.defaultView||Hi},"window"),mount:o(function(e){if(e!=null){var r=this,n=r._private,i=n.options;return!F6(e)&&F6(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(ir({},i,i.renderer,{name:i.renderer.name==="null"?"canvas":i.renderer.name})),r.startAnimationLoop(),r.style(i.style),r.emit("mount"),r}},"mount"),unmount:o(function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},"unmount"),options:o(function(){return Qc(this._private.options)},"options"),json:o(function(e){var r=this,n=r._private,i=r.mutableElements(),a=o(function(S){return r.getElementById(S.id())},"getFreshRef");if(Ur(e)){if(r.startBatch(),e.elements){var s={},l=o(function(S,w){for(var E=[],_=[],C=0;C<S.length;C++){var D=S[C];if(!D.data.id){hn("cy.json() cannot handle elements without an ID attribute");continue}var O=""+D.data.id,R=r.getElementById(O);s[O]=!0,R.length!==0?_.push({ele:R,json:D}):(w&&(D.group=w),E.push(D))}r.add(E);for(var k=0;k<_.length;k++){var L=_[k],A=L.ele,I=L.json;A.json(I)}},"updateEles");if(En(e.elements))l(e.elements);else for(var u=["nodes","edges"],h=0;h<u.length;h++){var f=u[h],d=e.elements[f];En(d)&&l(d,f)}var p=r.collection();i.filter(function(T){return!s[T.id()]}).forEach(function(T){T.isParent()?p.merge(T):T.remove()}),p.forEach(function(T){return T.children().move({parent:null})}),p.forEach(function(T){return a(T).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var m=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],g=0;g<m.length;g++){var y=m[g];e[y]!=null&&r[y](e[y])}return r.endBatch(),this}else{var v=!!e,x={};v?x.elements=this.elements().map(function(T){return T.json()}):(x.elements={},i.forEach(function(T){var S=T.group();x.elements[S]||(x.elements[S]=[]),x.elements[S].push(T.json())})),this._private.styleEnabled&&(x.style=r.style().json()),x.data=Qc(r.data());var b=n.options;return x.zoomingEnabled=n.zoomingEnabled,x.userZoomingEnabled=n.userZoomingEnabled,x.zoom=n.zoom,x.minZoom=n.minZoom,x.maxZoom=n.maxZoom,x.panningEnabled=n.panningEnabled,x.userPanningEnabled=n.userPanningEnabled,x.pan=Qc(n.pan),x.boxSelectionEnabled=n.boxSelectionEnabled,x.renderer=Qc(b.renderer),x.hideEdgesOnViewport=b.hideEdgesOnViewport,x.textureOnViewport=b.textureOnViewport,x.wheelSensitivity=b.wheelSensitivity,x.motionBlur=b.motionBlur,x.multiClickDebounceTime=b.multiClickDebounceTime,x}},"json")});W6.$id=W6.getElementById;[oZe,fZe,u1e,CB,I6,pZe,AB,O6,yZe,e0,c4].forEach(function(t){ir(W6,t)});xZe={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")},bZe={maximal:!1,acyclic:!1},q1=o(function(e){return e.scratch("breadthfirst")},"getInfo"),Nme=o(function(e,r){return e.scratch("breadthfirst",r)},"setInfo");o(h1e,"BreadthFirstLayout");h1e.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=r.nodes().filter(function(ae){return ae.isChildless()}),i=r,a=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,l=!!t.boundingBox,u=e.extent(),h=Ys(l?t.boundingBox:{x1:u.x1,y1:u.y1,w:u.w,h:u.h}),f;if(xo(t.roots))f=t.roots;else if(En(t.roots)){for(var d=[],p=0;p<t.roots.length;p++){var m=t.roots[p],g=e.getElementById(m);d.push(g)}f=e.collection(d)}else if(Zt(t.roots))f=e.$(t.roots);else if(a)f=n.roots();else{var y=r.components();f=e.collection();for(var v=o(function(Oe){var ye=y[Oe],Be=ye.maxDegree(!1),He=ye.filter(function(ze){return ze.degree(!1)===Be});f=f.add(He)},"_loop"),x=0;x<y.length;x++)v(x)}var b=[],T={},S=o(function(Oe,ye){b[ye]==null&&(b[ye]=[]);var Be=b[ye].length;b[ye].push(Oe),Nme(Oe,{index:Be,depth:ye})},"addToDepth"),w=o(function(Oe,ye){var Be=q1(Oe),He=Be.depth,ze=Be.index;b[He][ze]=null,Oe.isChildless()&&S(Oe,ye)},"changeDepth");i.bfs({roots:f,directed:t.directed,visit:o(function(Oe,ye,Be,He,ze){var Le=Oe[0],Ie=Le.id();Le.isChildless()&&S(Le,ze),T[Ie]=!0},"visit")});for(var E=[],_=0;_<n.length;_++){var C=n[_];T[C.id()]||E.push(C)}var D=o(function(Oe){for(var ye=b[Oe],Be=0;Be<ye.length;Be++){var He=ye[Be];if(He==null){ye.splice(Be,1),Be--;continue}Nme(He,{depth:Oe,index:Be})}},"assignDepthsAt"),O=o(function(Oe,ye){for(var Be=q1(Oe),He=Oe.incomers().filter(function(ie){return ie.isNode()&&r.has(ie)}),ze=-1,Le=Oe.id(),Ie=0;Ie<He.length;Ie++){var xe=He[Ie],q=q1(xe);ze=Math.max(ze,q.depth)}if(Be.depth<=ze){if(!t.acyclic&&ye[Le])return null;var de=ze+1;return w(Oe,de),ye[Le]=de,!0}return!1},"adjustMaximally");if(a&&s){var R=[],k={},L=o(function(Oe){return R.push(Oe)},"enqueue"),A=o(function(){return R.shift()},"dequeue");for(n.forEach(function(ae){return R.push(ae)});R.length>0;){var I=A(),M=O(I,k);if(M)I.outgoers().filter(function(ae){return ae.isNode()&&r.has(ae)}).forEach(L);else if(M===null){hn("Detected double maximal shift for node `"+I.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var P=0;if(t.avoidOverlap)for(var B=0;B<n.length;B++){var F=n[B],z=F.layoutDimensions(t),$=z.w,U=z.h;P=Math.max(P,$,U)}var K={},ee=o(function(Oe){if(K[Oe.id()])return K[Oe.id()];for(var ye=q1(Oe).depth,Be=Oe.neighborhood(),He=0,ze=0,Le=0;Le<Be.length;Le++){var Ie=Be[Le];if(!(Ie.isEdge()||Ie.isParent()||!n.has(Ie))){var xe=q1(Ie);if(xe!=null){var q=xe.index,de=xe.depth;if(!(q==null||de==null)){var ie=b[de].length;de<ye&&(He+=q/ie,ze++)}}}}return ze=Math.max(1,ze),He=He/ze,ze===0&&(He=0),K[Oe.id()]=He,He},"getWeightedPercent"),Y=o(function(Oe,ye){var Be=ee(Oe),He=ee(ye),ze=Be-He;return ze===0?uge(Oe.id(),ye.id()):ze},"sortFn");t.depthSort!==void 0&&(Y=t.depthSort);for(var ce=b.length,Z=0;Z<ce;Z++)b[Z].sort(Y),D(Z);for(var ue=[],Q=0;Q<E.length;Q++)ue.push(E[Q]);var j=o(function(){for(var Oe=0;Oe<ce;Oe++)D(Oe)},"assignDepths");ue.length&&(b.unshift(ue),ce=b.length,j());for(var ne=0,te=0;te<ce;te++)ne=Math.max(b[te].length,ne);var he={x:h.x1+h.w/2,y:h.y1+h.h/2},le=n.reduce(function(ae,Oe){return function(ye){return{w:ae.w===-1?ye.w:(ae.w+ye.w)/2,h:ae.h===-1?ye.h:(ae.h+ye.h)/2}}(Oe.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),J=Math.max(ce===1?0:l?(h.h-t.padding*2-le.h)/(ce-1):(h.h-t.padding*2-le.h)/(ce+1),P),Se=b.reduce(function(ae,Oe){return Math.max(ae,Oe.length)},0),se=o(function(Oe){var ye=q1(Oe),Be=ye.depth,He=ye.index;if(t.circle){var ze=Math.min(h.w/2/ce,h.h/2/ce);ze=Math.max(ze,P);var Le=ze*Be+ze-(ce>0&&b[0].length<=3?ze/2:0),Ie=2*Math.PI/b[Be].length*He;return Be===0&&b[0].length===1&&(Le=1),{x:he.x+Le*Math.cos(Ie),y:he.y+Le*Math.sin(Ie)}}else{var xe=b[Be].length,q=Math.max(xe===1?0:l?(h.w-t.padding*2-le.w)/((t.grid?Se:xe)-1):(h.w-t.padding*2-le.w)/((t.grid?Se:xe)+1),P),de={x:he.x+(He+1-(xe+1)/2)*q,y:he.y+(Be+1-(ce+1)/2)*J};return de}},"getPosition");return r.nodes().layoutPositions(this,t,se),this};TZe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")};o(f1e,"CircleLayout");f1e.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=Ys(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,h=u/Math.max(1,a.length-1),f,d=0,p=0;p<a.length;p++){var m=a[p],g=m.layoutDimensions(e),y=g.w,v=g.h;d=Math.max(d,y,v)}if(_t(e.radius)?f=e.radius:a.length<=1?f=0:f=Math.min(s.h,s.w)/2-d,a.length>1&&e.avoidOverlap){d*=1.75;var x=Math.cos(h)-Math.cos(0),b=Math.sin(h)-Math.sin(0),T=Math.sqrt(d*d/(x*x+b*b));f=Math.max(T,f)}var S=o(function(E,_){var C=e.startAngle+_*h*(i?1:-1),D=f*Math.cos(C),O=f*Math.sin(C),R={x:l.x+D,y:l.y+O};return R},"getPos");return n.nodes().layoutPositions(this,e,S),this};wZe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:o(function(e){return e.degree()},"concentric"),levelWidth:o(function(e){return e.maxDegree()/4},"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")};o(d1e,"ConcentricLayout");d1e.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Ys(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],h=0,f=0;f<a.length;f++){var d=a[f],p=void 0;p=e.concentric(d),u.push({value:p,node:d}),d._private.scratch.concentric=p}a.updateStyle();for(var m=0;m<a.length;m++){var g=a[m],y=g.layoutDimensions(e);h=Math.max(h,y.w,y.h)}u.sort(function(le,J){return J.value-le.value});for(var v=e.levelWidth(a),x=[[]],b=x[0],T=0;T<u.length;T++){var S=u[T];if(b.length>0){var w=Math.abs(b[0].value-S.value);w>=v&&(b=[],x.push(b))}b.push(S)}var E=h+e.minNodeSpacing;if(!e.avoidOverlap){var _=x.length>0&&x[0].length>1,C=Math.min(s.w,s.h)/2-E,D=C/(x.length+_?1:0);E=Math.min(E,D)}for(var O=0,R=0;R<x.length;R++){var k=x[R],L=e.sweep===void 0?2*Math.PI-2*Math.PI/k.length:e.sweep,A=k.dTheta=L/Math.max(1,k.length-1);if(k.length>1&&e.avoidOverlap){var I=Math.cos(A)-Math.cos(0),M=Math.sin(A)-Math.sin(0),P=Math.sqrt(E*E/(I*I+M*M));O=Math.max(P,O)}k.r=O,O+=E}if(e.equidistant){for(var B=0,F=0,z=0;z<x.length;z++){var $=x[z],U=$.r-F;B=Math.max(B,U)}F=0;for(var K=0;K<x.length;K++){var ee=x[K];K===0&&(F=ee.r),ee.r=F,F+=B}}for(var Y={},ce=0;ce<x.length;ce++)for(var Z=x[ce],ue=Z.dTheta,Q=Z.r,j=0;j<Z.length;j++){var ne=Z[j],te=e.startAngle+(r?1:-1)*ue*j,he={x:l.x+Q*Math.cos(te),y:l.y+Q*Math.sin(te)};Y[ne.node.id()]=he}return i.nodes().layoutPositions(this,e,function(le){var J=le.id();return Y[J]}),this};kZe={ready:o(function(){},"ready"),stop:o(function(){},"stop"),animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:o(function(e){return 2048},"nodeRepulsion"),nodeOverlap:4,idealEdgeLength:o(function(e){return 32},"idealEdgeLength"),edgeElasticity:o(function(e){return 32},"edgeElasticity"),nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};o(uC,"CoseLayout");uC.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?fB=!0:fB=!1;var n=EZe(e,r,t);fB&&AZe(n),t.randomize&&_Ze(n);var i=nh(),a=o(function(){DZe(n,e,t),t.fit===!0&&e.fit(t.padding)},"refresh"),s=o(function(p){return!(r.stopped||p>=t.numIter||(LZe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},"mainLoop"),l=o(function(){if(t.animate===!0||t.animate===!1)a(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var p=t.eles.nodes(),m=p1e(n,t,p);p.layoutPositions(r,t,m)}},"done"),u=0,h=!0;if(t.animate===!0){var f=o(function d(){for(var p=0;h&&p<t.refresh;)h=s(u),u++,p++;if(!h)Ime(n,t),l();else{var m=nh();m-i>=t.animationThreshold&&a(),$6(d)}},"frame");f()}else{for(;h;)h=s(u),u++;Ime(n,t),l()}return this};uC.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};uC.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};EZe=o(function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Ys(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=n.eles.components(),h={},f=0;f<u.length;f++)for(var d=u[f],p=0;p<d.length;p++){var m=d[p];h[m.id()]=f}for(var f=0;f<l.nodeSize;f++){var g=a[f],y=g.layoutDimensions(n),v={};v.isLocked=g.locked(),v.id=g.data("id"),v.parentId=g.data("parent"),v.cmptId=h[g.id()],v.children=[],v.positionX=g.position("x"),v.positionY=g.position("y"),v.offsetX=0,v.offsetY=0,v.height=y.w,v.width=y.h,v.maxX=v.positionX+v.width/2,v.minX=v.positionX-v.width/2,v.maxY=v.positionY+v.height/2,v.minY=v.positionY-v.height/2,v.padLeft=parseFloat(g.style("padding")),v.padRight=parseFloat(g.style("padding")),v.padTop=parseFloat(g.style("padding")),v.padBottom=parseFloat(g.style("padding")),v.nodeRepulsion=li(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,l.layoutNodes.push(v),l.idToIndex[v.id]=f}for(var x=[],b=0,T=-1,S=[],f=0;f<l.nodeSize;f++){var g=l.layoutNodes[f],w=g.parentId;w!=null?l.layoutNodes[l.idToIndex[w]].children.push(g.id):(x[++T]=g.id,S.push(g.id))}for(l.graphSet.push(S);b<=T;){var E=x[b++],_=l.idToIndex[E],m=l.layoutNodes[_],C=m.children;if(C.length>0){l.graphSet.push(C);for(var f=0;f<C.length;f++)x[++T]=C[f]}}for(var f=0;f<l.graphSet.length;f++)for(var D=l.graphSet[f],p=0;p<D.length;p++){var O=l.idToIndex[D[p]];l.indexToGraph[O]=f}for(var f=0;f<l.edgeSize;f++){var R=i[f],k={};k.id=R.data("id"),k.sourceId=R.data("source"),k.targetId=R.data("target");var L=li(n.idealEdgeLength)?n.idealEdgeLength(R):n.idealEdgeLength,A=li(n.edgeElasticity)?n.edgeElasticity(R):n.edgeElasticity,I=l.idToIndex[k.sourceId],M=l.idToIndex[k.targetId],P=l.indexToGraph[I],B=l.indexToGraph[M];if(P!=B){for(var F=SZe(k.sourceId,k.targetId,l),z=l.graphSet[F],$=0,v=l.layoutNodes[I];z.indexOf(v.id)===-1;)v=l.layoutNodes[l.idToIndex[v.parentId]],$++;for(v=l.layoutNodes[M];z.indexOf(v.id)===-1;)v=l.layoutNodes[l.idToIndex[v.parentId]],$++;L*=$*n.nestingFactor}k.idealLength=L,k.elasticity=A,l.layoutEdges.push(k)}return l},"createLayoutInfo"),SZe=o(function(e,r,n){var i=CZe(e,r,0,n);return 2>i.count?0:i.graph},"findLCA"),CZe=o(function t(e,r,n,i){var a=i.graphSet[n];if(-1<a.indexOf(e)&&-1<a.indexOf(r))return{count:2,graph:n};for(var s=0,l=0;l<a.length;l++){var u=a[l],h=i.idToIndex[u],f=i.layoutNodes[h].children;if(f.length!==0){var d=i.indexToGraph[i.idToIndex[f[0]]],p=t(e,r,d,i);if(p.count!==0)if(p.count===1){if(s++,s===2)break}else return p}}return{count:s,graph:n}},"findLCA_aux"),_Ze=o(function(e,r){for(var n=e.clientWidth,i=e.clientHeight,a=0;a<e.nodeSize;a++){var s=e.layoutNodes[a];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*i)}},"randomizePositions"),p1e=o(function(e,r,n){var i=e.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(s){var l=e.layoutNodes[e.idToIndex[s.data("id")]];a.x1=Math.min(a.x1,l.positionX),a.x2=Math.max(a.x2,l.positionX),a.y1=Math.min(a.y1,l.positionY),a.y2=Math.max(a.y2,l.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(s,l){var u=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var h=(u.positionX-a.x1)/a.w,f=(u.positionY-a.y1)/a.h;return{x:i.x1+h*i.w,y:i.y1+f*i.h}}else return{x:u.positionX,y:u.positionY}}},"getScaleInBoundsFn"),DZe=o(function(e,r,n){var i=n.layout,a=n.eles.nodes(),s=p1e(e,n,a);a.positions(s),e.ready!==!0&&(e.ready=!0,i.one("layoutready",n.ready),i.emit({type:"layoutready",layout:this}))},"refreshPositions"),LZe=o(function(e,r,n){RZe(e,r),IZe(e),OZe(e,r),PZe(e),BZe(e)},"step"),RZe=o(function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var i=e.graphSet[n],a=i.length,s=0;s<a;s++)for(var l=e.layoutNodes[e.idToIndex[i[s]]],u=s+1;u<a;u++){var h=e.layoutNodes[e.idToIndex[i[u]]];NZe(l,h,e,r)}},"calculateNodeForces"),Mme=o(function(e){return-e+2*e*Math.random()},"randomDistance"),NZe=o(function(e,r,n,i){var a=e.cmptId,s=r.cmptId;if(!(a!==s&&!n.isCompound)){var l=r.positionX-e.positionX,u=r.positionY-e.positionY,h=1;l===0&&u===0&&(l=Mme(h),u=Mme(h));var f=MZe(e,r,l,u);if(f>0)var d=i.nodeOverlap*f,p=Math.sqrt(l*l+u*u),m=d*l/p,g=d*u/p;else var y=q6(e,l,u),v=q6(r,-1*l,-1*u),x=v.x-y.x,b=v.y-y.y,T=x*x+b*b,p=Math.sqrt(T),d=(e.nodeRepulsion+r.nodeRepulsion)/T,m=d*x/p,g=d*b/p;e.isLocked||(e.offsetX-=m,e.offsetY-=g),r.isLocked||(r.offsetX+=m,r.offsetY+=g)}},"nodeRepulsion"),MZe=o(function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},"nodesOverlap"),q6=o(function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,l=e.width||1,u=n/r,h=s/l,f={};return r===0&&0<n||r===0&&0>n?(f.x=i,f.y=a+s/2,f):0<r&&-1*h<=u&&u<=h?(f.x=i+l/2,f.y=a+l*n/2/r,f):0>r&&-1*h<=u&&u<=h?(f.x=i-l/2,f.y=a-l*n/2/r,f):0<n&&(u<=-1*h||u>=h)?(f.x=i+s*r/2/n,f.y=a+s/2,f):(0>n&&(u<=-1*h||u>=h)&&(f.x=i-s*r/2/n,f.y=a-s/2),f)},"findClippingPoint"),IZe=o(function(e,r){for(var n=0;n<e.edgeSize;n++){var i=e.layoutEdges[n],a=e.idToIndex[i.sourceId],s=e.layoutNodes[a],l=e.idToIndex[i.targetId],u=e.layoutNodes[l],h=u.positionX-s.positionX,f=u.positionY-s.positionY;if(!(h===0&&f===0)){var d=q6(s,h,f),p=q6(u,-1*h,-1*f),m=p.x-d.x,g=p.y-d.y,y=Math.sqrt(m*m+g*g),v=Math.pow(i.idealLength-y,2)/i.elasticity;if(y!==0)var x=v*m/y,b=v*g/y;else var x=0,b=0;s.isLocked||(s.offsetX+=x,s.offsetY+=b),u.isLocked||(u.offsetX-=x,u.offsetY-=b)}}},"calculateEdgeForces"),OZe=o(function(e,r){if(r.gravity!==0)for(var n=1,i=0;i<e.graphSet.length;i++){var a=e.graphSet[i],s=a.length;if(i===0)var l=e.clientHeight/2,u=e.clientWidth/2;else var h=e.layoutNodes[e.idToIndex[a[0]]],f=e.layoutNodes[e.idToIndex[h.parentId]],l=f.positionX,u=f.positionY;for(var d=0;d<s;d++){var p=e.layoutNodes[e.idToIndex[a[d]]];if(!p.isLocked){var m=l-p.positionX,g=u-p.positionY,y=Math.sqrt(m*m+g*g);if(y>n){var v=r.gravity*m/y,x=r.gravity*g/y;p.offsetX+=v,p.offsetY+=x}}}}},"calculateGravityForces"),PZe=o(function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],l=e.idToIndex[s],u=e.layoutNodes[l],h=u.children;if(0<h.length&&!u.isLocked){for(var f=u.offsetX,d=u.offsetY,p=0;p<h.length;p++){var m=e.layoutNodes[e.idToIndex[h[p]]];m.offsetX+=f,m.offsetY+=d,n[++a]=h[p]}u.offsetX=0,u.offsetY=0}}},"propagateForces"),BZe=o(function(e,r){for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];if(!(0<i.children.length||i.isLocked)){var a=FZe(i.offsetX,i.offsetY,e.temperature);i.positionX+=a.x,i.positionY+=a.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,$Ze(i,e)}}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},"updatePositions"),FZe=o(function(e,r,n){var i=Math.sqrt(e*e+r*r);if(i>n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},"limitForce"),$Ze=o(function t(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,a=!0),(i.maxY==null||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,a=!0),a)return t(i,r)}},"updateAncestryBoundaries"),Ime=o(function(e,r){for(var n=e.layoutNodes,i=[],a=0;a<n.length;a++){var s=n[a],l=s.cmptId,u=i[l]=i[l]||[];u.push(s)}for(var h=0,a=0;a<i.length;a++){var f=i[a];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var d=0;d<f.length;d++){var p=f[d];f.x1=Math.min(f.x1,p.positionX-p.width/2),f.x2=Math.max(f.x2,p.positionX+p.width/2),f.y1=Math.min(f.y1,p.positionY-p.height/2),f.y2=Math.max(f.y2,p.positionY+p.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,h+=f.w*f.h}}i.sort(function(b,T){return T.w*T.h-b.w*b.h});for(var m=0,g=0,y=0,v=0,x=Math.sqrt(h)*e.clientWidth/e.clientHeight,a=0;a<i.length;a++){var f=i[a];if(f){for(var d=0;d<f.length;d++){var p=f[d];p.isLocked||(p.positionX+=m-f.x1,p.positionY+=g-f.y1)}m+=f.w+r.componentSpacing,y+=f.w+r.componentSpacing,v=Math.max(v,f.h),y>x&&(g+=v+r.componentSpacing,m=0,y=0,v=0)}}},"separateComponents"),zZe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:o(function(e){},"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")};o(m1e,"GridLayout");m1e.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Ys(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(K){return{x:a.x1,y:a.y1}});else{var s=i.size(),l=Math.sqrt(s*a.h/a.w),u=Math.round(l),h=Math.round(a.w/a.h*l),f=o(function(ee){if(ee==null)return Math.min(u,h);var Y=Math.min(u,h);Y==u?u=ee:h=ee},"small"),d=o(function(ee){if(ee==null)return Math.max(u,h);var Y=Math.max(u,h);Y==u?u=ee:h=ee},"large"),p=e.rows,m=e.cols!=null?e.cols:e.columns;if(p!=null&&m!=null)u=p,h=m;else if(p!=null&&m==null)u=p,h=Math.ceil(s/u);else if(p==null&&m!=null)h=m,u=Math.ceil(s/h);else if(h*u>s){var g=f(),y=d();(g-1)*y>=s?f(g-1):(y-1)*g>=s&&d(y-1)}else for(;h*u<s;){var v=f(),x=d();(x+1)*v>=s?d(x+1):f(v+1)}var b=a.w/h,T=a.h/u;if(e.condense&&(b=0,T=0),e.avoidOverlap)for(var S=0;S<i.length;S++){var w=i[S],E=w._private.position;(E.x==null||E.y==null)&&(E.x=0,E.y=0);var _=w.layoutDimensions(e),C=e.avoidOverlapPadding,D=_.w+C,O=_.h+C;b=Math.max(b,D),T=Math.max(T,O)}for(var R={},k=o(function(ee,Y){return!!R["c-"+ee+"-"+Y]},"used"),L=o(function(ee,Y){R["c-"+ee+"-"+Y]=!0},"use"),A=0,I=0,M=o(function(){I++,I>=h&&(I=0,A++)},"moveToNextCell"),P={},B=0;B<i.length;B++){var F=i[B],z=e.position(F);if(z&&(z.row!==void 0||z.col!==void 0)){var $={row:z.row,col:z.col};if($.col===void 0)for($.col=0;k($.row,$.col);)$.col++;else if($.row===void 0)for($.row=0;k($.row,$.col);)$.row++;P[F.id()]=$,L($.row,$.col)}}var U=o(function(ee,Y){var ce,Z;if(ee.locked()||ee.isParent())return!1;var ue=P[ee.id()];if(ue)ce=ue.col*b+b/2+a.x1,Z=ue.row*T+T/2+a.y1;else{for(;k(A,I);)M();ce=I*b+b/2+a.x1,Z=A*T+T/2+a.y1,L(A,I),M()}return{x:ce,y:Z}},"getPos");i.layoutPositions(this,e,U)}return this};GZe={ready:o(function(){},"ready"),stop:o(function(){},"stop")};o(eF,"NullLayout");eF.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};eF.prototype.stop=function(){return this};VZe={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")};o(g1e,"PresetLayout");g1e.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=li(t.positions);function i(a){if(t.positions==null)return qYe(a.position());if(n)return t.positions(a);var s=t.positions[a._private.data.id];return s??null}return o(i,"getPosition"),r.layoutPositions(this,t,function(a,s){var l=i(a);return a.locked()||l==null?!1:l}),this};UZe={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")};o(y1e,"RandomLayout");y1e.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=Ys(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=o(function(s,l){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}},"getPos");return r.nodes().layoutPositions(this,t,i),this};HZe=[{name:"breadthfirst",impl:h1e},{name:"circle",impl:f1e},{name:"concentric",impl:d1e},{name:"cose",impl:uC},{name:"grid",impl:m1e},{name:"null",impl:eF},{name:"preset",impl:g1e},{name:"random",impl:y1e}];o(v1e,"NullRenderer");Ome=o(function(){},"noop"),Pme=o(function(){throw new Error("A headless instance can not render images")},"throwImgErr");v1e.prototype={recalculateRenderedStyle:Ome,notify:o(function(){this.notifications++},"notify"),init:Ome,isHeadless:o(function(){return!0},"isHeadless"),png:Pme,jpg:Pme};tF={};tF.arrowShapeWidth=.3;tF.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=o(function(h,f,d,p,m,g,y){var v=m.x-d/2-y,x=m.x+d/2+y,b=m.y-d/2-y,T=m.y+d/2+y,S=v<=h&&h<=x&&b<=f&&f<=T;return S},"bbCollide"),n=o(function(h,f,d,p,m){var g=h*Math.cos(p)-f*Math.sin(p),y=h*Math.sin(p)+f*Math.cos(p),v=g*d,x=y*d,b=v+m.x,T=x+m.y;return{x:b,y:T}},"transform"),i=o(function(h,f,d,p){for(var m=[],g=0;g<h.length;g+=2){var y=h[g],v=h[g+1];m.push(n(y,v,f,d,p))}return m},"transformPoints"),a=o(function(h){for(var f=[],d=0;d<h.length;d++){var p=h[d];f.push(p.x,p.y)}return f},"pointsToArr"),s=o(function(h){return h.pstyle("width").pfValue*h.pstyle("arrow-scale").pfValue*2},"standardGap"),l=o(function(h,f){Zt(f)&&(f=t[f]),t[h]=ir({name:h,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:o(function(p,m,g,y,v,x){var b=a(i(this.points,g+2*x,y,v)),T=qs(p,m,b);return T},"collide"),roughCollide:r,draw:o(function(p,m,g,y){var v=i(this.points,m,g,y);e.arrowShapeImpl("polygon")(p,v)},"draw"),spacing:o(function(p){return 0},"spacing"),gap:s},f)},"defineArrowShape");l("none",{collide:z6,roughCollide:z6,draw:zB,spacing:q0e,gap:q0e}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:o(function(h,f,d,p,m){var g=i(this.points,f,d,p),y=this.controlPoint,v=n(y[0],y[1],f,d,p);e.arrowShapeImpl(this.name)(h,g,v)},"draw"),gap:o(function(h){return s(h)*.8},"gap")}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:o(function(h,f,d,p,m,g,y){var v=a(i(this.points,d+2*y,p,m)),x=a(i(this.pointsTee,d+2*y,p,m)),b=qs(h,f,v)||qs(h,f,x);return b},"collide"),draw:o(function(h,f,d,p,m){var g=i(this.points,f,d,p),y=i(this.pointsTee,f,d,p);e.arrowShapeImpl(this.name)(h,g,y)},"draw")}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:o(function(h,f,d,p,m,g,y){var v=m,x=Math.pow(v.x-h,2)+Math.pow(v.y-f,2)<=Math.pow((d+2*y)*this.radius,2),b=a(i(this.points,d+2*y,p,m));return qs(h,f,b)||x},"collide"),draw:o(function(h,f,d,p,m){var g=i(this.pointsTr,f,d,p);e.arrowShapeImpl(this.name)(h,g,p.x,p.y,this.radius*f)},"draw"),spacing:o(function(h){return e.getArrowWidth(h.pstyle("width").pfValue,h.pstyle("arrow-scale").value)*this.radius},"spacing")}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:o(function(h,f){var d=this.baseCrossLinePts.slice(),p=f/h,m=3,g=5;return d[m]=d[m]-p,d[g]=d[g]-p,d},"crossLinePts"),collide:o(function(h,f,d,p,m,g,y){var v=a(i(this.points,d+2*y,p,m)),x=a(i(this.crossLinePts(d,g),d+2*y,p,m)),b=qs(h,f,v)||qs(h,f,x);return b},"collide"),draw:o(function(h,f,d,p,m){var g=i(this.points,f,d,p),y=i(this.crossLinePts(f,m),f,d,p);e.arrowShapeImpl(this.name)(h,g,y)},"draw")}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:o(function(h){return s(h)*.525},"gap")}),l("circle",{radius:.15,collide:o(function(h,f,d,p,m,g,y){var v=m,x=Math.pow(v.x-h,2)+Math.pow(v.y-f,2)<=Math.pow((d+2*y)*this.radius,2);return x},"collide"),draw:o(function(h,f,d,p,m){e.arrowShapeImpl(this.name)(h,p.x,p.y,this.radius*f)},"draw"),spacing:o(function(h){return e.getArrowWidth(h.pstyle("width").pfValue,h.pstyle("arrow-scale").value)*this.radius},"spacing")}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:o(function(h){return 1},"spacing"),gap:o(function(h){return 1},"gap")}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:o(function(h){return h.pstyle("width").pfValue*h.pstyle("arrow-scale").value},"gap")}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:o(function(h){return .95*h.pstyle("width").pfValue*h.pstyle("arrow-scale").value},"gap")})};r0={};r0.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),i=n[0],a=n[1],s=n[4],l=r.pan(),u=r.zoom(),h=((t-i)/s-l.x)/u,f=((e-a)/s-l.y)/u;return[h,f]};r0.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=o(function(x){return parseFloat(r.getPropertyValue(x))},"styleValue"),i={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},a={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,l=t.clientHeight,u=i.left+i.right,h=i.top+i.bottom,f=a.left+a.right,d=e.width/(s+f),p=s-u,m=l-h,g=e.left+i.left+a.left,y=e.top+i.top+a.top;return this.containerBB=[g,y,p,m,d]};r0.invalidateContainerClientCoordsCache=function(){this.containerBB=null};r0.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]};r0.findNearestElements=function(t,e,r,n){var i=this,a=this,s=a.getCachedZSortedEles(),l=[],u=a.cy.zoom(),h=a.cy.hasCompoundNodes(),f=(n?24:8)/u,d=(n?8:2)/u,p=(n?8:2)/u,m=1/0,g,y;r&&(s=s.interactive);function v(_,C){if(_.isNode()){if(y)return;y=_,l.push(_)}if(_.isEdge()&&(C==null||C<m))if(g){if(g.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value&&g.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value){for(var D=0;D<l.length;D++)if(l[D].isEdge()){l[D]=_,g=_,m=C??m;break}}}else l.push(_),g=_,m=C??m}o(v,"addEle");function x(_){var C=_.outerWidth()+2*d,D=_.outerHeight()+2*d,O=C/2,R=D/2,k=_.position(),L=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,A=_._private.rscratch;if(k.x-O<=t&&t<=k.x+O&&k.y-R<=e&&e<=k.y+R){var I=a.nodeShapes[i.getNodeShape(_)];if(I.checkPoint(t,e,0,C,D,k.x,k.y,L,A))return v(_,0),!0}}o(x,"checkNode");function b(_){var C=_._private,D=C.rscratch,O=_.pstyle("width").pfValue,R=_.pstyle("arrow-scale").value,k=O/2+f,L=k*k,A=k*2,B=C.source,F=C.target,I;if(D.edgeType==="segments"||D.edgeType==="straight"||D.edgeType==="haystack"){for(var M=D.allpts,P=0;P+3<M.length;P+=2)if(aXe(t,e,M[P],M[P+1],M[P+2],M[P+3],A)&&L>(I=uXe(t,e,M[P],M[P+1],M[P+2],M[P+3])))return v(_,I),!0}else if(D.edgeType==="bezier"||D.edgeType==="multibezier"||D.edgeType==="self"||D.edgeType==="compound"){for(var M=D.allpts,P=0;P+5<D.allpts.length;P+=4)if(sXe(t,e,M[P],M[P+1],M[P+2],M[P+3],M[P+4],M[P+5],A)&&L>(I=cXe(t,e,M[P],M[P+1],M[P+2],M[P+3],M[P+4],M[P+5])))return v(_,I),!0}for(var B=B||C.source,F=F||C.target,z=i.getArrowWidth(O,R),$=[{name:"source",x:D.arrowStartX,y:D.arrowStartY,angle:D.srcArrowAngle},{name:"target",x:D.arrowEndX,y:D.arrowEndY,angle:D.tgtArrowAngle},{name:"mid-source",x:D.midX,y:D.midY,angle:D.midsrcArrowAngle},{name:"mid-target",x:D.midX,y:D.midY,angle:D.midtgtArrowAngle}],P=0;P<$.length;P++){var U=$[P],K=a.arrowShapes[_.pstyle(U.name+"-arrow-shape").value],ee=_.pstyle("width").pfValue;if(K.roughCollide(t,e,z,U.angle,{x:U.x,y:U.y},ee,f)&&K.collide(t,e,z,U.angle,{x:U.x,y:U.y},ee,f))return v(_),!0}h&&l.length>0&&(x(B),x(F))}o(b,"checkEdge");function T(_,C,D){return Wl(_,C,D)}o(T,"preprop");function S(_,C){var D=_._private,O=p,R;C?R=C+"-":R="",_.boundingBox();var k=D.labelBounds[C||"main"],L=_.pstyle(R+"label").value,A=_.pstyle("text-events").strValue==="yes";if(!(!A||!L)){var I=T(D.rscratch,"labelX",C),M=T(D.rscratch,"labelY",C),P=T(D.rscratch,"labelAngle",C),B=_.pstyle(R+"text-margin-x").pfValue,F=_.pstyle(R+"text-margin-y").pfValue,z=k.x1-O-B,$=k.x2+O-B,U=k.y1-O-F,K=k.y2+O-F;if(P){var ee=Math.cos(P),Y=Math.sin(P),ce=o(function(he,le){return he=he-I,le=le-M,{x:he*ee-le*Y+I,y:he*Y+le*ee+M}},"rotate"),Z=ce(z,U),ue=ce(z,K),Q=ce($,U),j=ce($,K),ne=[Z.x+B,Z.y+F,Q.x+B,Q.y+F,j.x+B,j.y+F,ue.x+B,ue.y+F];if(qs(t,e,ne))return v(_),!0}else if(ry(k,t,e))return v(_),!0}}o(S,"checkLabel");for(var w=s.length-1;w>=0;w--){var E=s[w];E.isNode()?x(E)||S(E):b(E)||S(E)||S(E,"source")||S(E,"target")}return l};r0.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=[],s=Math.min(t,r),l=Math.max(t,r),u=Math.min(e,n),h=Math.max(e,n);t=s,r=l,e=u,n=h;for(var f=Ys({x1:t,y1:e,x2:r,y2:n}),d=0;d<i.length;d++){var p=i[d];if(p.isNode()){var m=p,g=m.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});UB(f,g)&&!Age(g,f)&&a.push(m)}else{var y=p,v=y._private,x=v.rscratch;if(x.startX!=null&&x.startY!=null&&!ry(f,x.startX,x.startY)||x.endX!=null&&x.endY!=null&&!ry(f,x.endX,x.endY))continue;if(x.edgeType==="bezier"||x.edgeType==="multibezier"||x.edgeType==="self"||x.edgeType==="compound"||x.edgeType==="segments"||x.edgeType==="haystack"){for(var b=v.rstyle.bezierPts||v.rstyle.linePts||v.rstyle.haystackPts,T=!0,S=0;S<b.length;S++)if(!iXe(f,b[S])){T=!1;break}T&&a.push(y)}else(x.edgeType==="haystack"||x.edgeType==="straight")&&a.push(y)}}return a};Y6={};Y6.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",i=e.edgeType==="multibezier",a=e.edgeType==="segments",s=e.edgeType==="compound",l=e.edgeType==="self",u,h,f,d,p,m,x,b;if(r?(f=e.haystackPts[0],d=e.haystackPts[1],p=e.haystackPts[2],m=e.haystackPts[3]):(f=e.arrowStartX,d=e.arrowStartY,p=e.arrowEndX,m=e.arrowEndY),x=e.midX,b=e.midY,a)u=f-e.segpts[0],h=d-e.segpts[1];else if(i||s||l||n){var g=e.allpts,y=sa(g[0],g[2],g[4],.1),v=sa(g[1],g[3],g[5],.1);u=f-y,h=d-v}else u=f-x,h=d-b;e.srcArrowAngle=g6(u,h);var x=e.midX,b=e.midY;if(r&&(x=(f+p)/2,b=(d+m)/2),u=p-f,h=m-d,a){var g=e.allpts;if(g.length/2%2===0){var T=g.length/2,S=T-2;u=g[T]-g[S],h=g[T+1]-g[S+1]}else if(e.isRound)u=e.midVector[1],h=-e.midVector[0];else{var T=g.length/2-1,S=T-2;u=g[T]-g[S],h=g[T+1]-g[S+1]}}else if(i||s||l){var g=e.allpts,w=e.ctrlpts,E,_,C,D;if(w.length/2%2===0){var O=g.length/2-1,R=O+2,k=R+2;E=sa(g[O],g[R],g[k],0),_=sa(g[O+1],g[R+1],g[k+1],0),C=sa(g[O],g[R],g[k],1e-4),D=sa(g[O+1],g[R+1],g[k+1],1e-4)}else{var R=g.length/2-1,O=R-2,k=R+2;E=sa(g[O],g[R],g[k],.4999),_=sa(g[O+1],g[R+1],g[k+1],.4999),C=sa(g[O],g[R],g[k],.5),D=sa(g[O+1],g[R+1],g[k+1],.5)}u=C-E,h=D-_}if(e.midtgtArrowAngle=g6(u,h),e.midDispX=u,e.midDispY=h,u*=-1,h*=-1,a){var g=e.allpts;if(g.length/2%2!==0){if(!e.isRound){var T=g.length/2-1,L=T+2;u=-(g[L]-g[T]),h=-(g[L+1]-g[T+1])}}}if(e.midsrcArrowAngle=g6(u,h),a)u=p-e.segpts[e.segpts.length-2],h=m-e.segpts[e.segpts.length-1];else if(i||s||l||n){var g=e.allpts,A=g.length,y=sa(g[A-6],g[A-4],g[A-2],.9),v=sa(g[A-5],g[A-3],g[A-1],.9);u=p-y,h=m-v}else u=p-x,h=m-b;e.tgtArrowAngle=g6(u,h)};Y6.getArrowWidth=Y6.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};Kc={},nl={},zme=o(function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},"asVec"),WZe=o(function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},"invertVec"),qZe=o(function(e,r,n,i,a){if(e!==$me?zme(r,e,Kc):WZe(nl,Kc),zme(r,n,nl),Bme=Kc.nx*nl.ny-Kc.ny*nl.nx,Fme=Kc.nx*nl.nx-Kc.ny*-nl.ny,rh=Math.asin(Math.max(-1,Math.min(1,Bme))),Math.abs(rh)<1e-6){_B=r.x,DB=r.y,Yp=Y1=0;return}Xp=1,P6=!1,Fme<0?rh<0?rh=Math.PI+rh:(rh=Math.PI-rh,Xp=-1,P6=!0):rh>0&&(Xp=-1,P6=!0),r.radius!==void 0?Y1=r.radius:Y1=i,Up=rh/2,S6=Math.min(Kc.len/2,nl.len/2),a?(jc=Math.abs(Math.cos(Up)*Y1/Math.sin(Up)),jc>S6?(jc=S6,Yp=Math.abs(jc*Math.sin(Up)/Math.cos(Up))):Yp=Y1):(jc=Math.min(S6,Y1),Yp=Math.abs(jc*Math.sin(Up)/Math.cos(Up))),LB=r.x+nl.nx*jc,RB=r.y+nl.ny*jc,_B=LB-nl.ny*Yp*Xp,DB=RB+nl.nx*Yp*Xp,x1e=r.x+Kc.nx*jc,b1e=r.y+Kc.ny*jc,$me=r},"calcCornerArc");o(T1e,"drawPreparedRoundCorner");o(rF,"getRoundCorner");Ya={};Ya.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),u=s.units!=null&&l.units!=null,h=o(function(w,E,_,C){var D=C-E,O=_-w,R=Math.sqrt(O*O+D*D);return{x:-D/R,y:O/R}},"recalcVectorNormInverse"),f=t.pstyle("edge-distances").value;switch(f){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(u){var d=this.manualEndptToPx(t.source()[0],s),p=Ri(d,2),m=p[0],g=p[1],y=this.manualEndptToPx(t.target()[0],l),v=Ri(y,2),x=v[0],b=v[1],T={x1:m,y1:g,x2:x,y2:b};i=h(m,g,x,b),a=T}else hn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};Ya.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,i=n.rscratch;if(!i.haystack){var a=Math.random()*2*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var s=n.source,l=n.target,u=s.position(),h=l.position(),f=s.width(),d=l.width(),p=s.height(),m=l.height(),g=r.pstyle("haystack-radius").value,y=g/2;i.haystackPts=i.allpts=[i.source.x*f*y+u.x,i.source.y*p*y+u.y,i.target.x*d*y+h.x,i.target.y*m*y+h.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};Ya.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),i=t.pstyle("segment-distances"),a=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),l=Math.min(n.pfValue.length,i.pfValue.length),u=a.pfValue[a.pfValue.length-1],h=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<l;f++){var d=n.pfValue[f],p=i.pfValue[f],m=1-d,g=d,y=this.findMidptPtsEtc(t,e),v=y.midptPts,x=y.vectorNormInverse,b={x:v.x1*m+v.x2*g,y:v.y1*m+v.y2*g};r.segpts.push(b.x+x.x*p,b.y+x.y*p),r.radii.push(a.pfValue[f]!==void 0?a.pfValue[f]:u),r.isArcRadius.push((s.pfValue[f]!==void 0?s.pfValue[f]:h)==="arc-radius")}};Ya.findLoopPoints=function(t,e,r,n){var i=t._private.rscratch,a=e.dirCounts,s=e.srcPos,l=t.pstyle("control-point-distances"),u=l?l.pfValue[0]:void 0,h=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,d=t.pstyle("control-point-step-size").pfValue;i.edgeType="self";var p=r,m=d;n&&(p=0,m=u);var g=h-Math.PI/2,y=g-f/2,v=g+f/2,x=h+"_"+f;p=a[x]===void 0?a[x]=0:++a[x],i.ctrlpts=[s.x+Math.cos(y)*1.4*m*(p/3+1),s.y+Math.sin(y)*1.4*m*(p/3+1),s.x+Math.cos(v)*1.4*m*(p/3+1),s.y+Math.sin(v)*1.4*m*(p/3+1)]};Ya.findCompoundLoopPoints=function(t,e,r,n){var i=t._private.rscratch;i.edgeType="compound";var a=e.srcPos,s=e.tgtPos,l=e.srcW,u=e.srcH,h=e.tgtW,f=e.tgtH,d=t.pstyle("control-point-step-size").pfValue,p=t.pstyle("control-point-distances"),m=p?p.pfValue[0]:void 0,g=r,y=d;n&&(g=0,y=m);var v=50,x={x:a.x-l/2,y:a.y-u/2},b={x:s.x-h/2,y:s.y-f/2},T={x:Math.min(x.x,b.x),y:Math.min(x.y,b.y)},S=.5,w=Math.max(S,Math.log(l*.01)),E=Math.max(S,Math.log(h*.01));i.ctrlpts=[T.x,T.y-(1+Math.pow(v,1.12)/100)*y*(g/3+1)*w,T.x-(1+Math.pow(v,1.12)/100)*y*(g/3+1)*E,T.y]};Ya.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Ya.findBezierPoints=function(t,e,r,n,i){var a=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),h=l&&u?Math.min(l.value.length,u.value.length):1,f=l?l.pfValue[0]:void 0,d=u.value[0],p=n;a.edgeType=p?"multibezier":"bezier",a.ctrlpts=[];for(var m=0;m<h;m++){var g=(.5-e.eles.length/2+r)*s*(i?-1:1),y=void 0,v=Sge(g);p&&(f=l?l.pfValue[m]:s,d=u.value[m]),n?y=f:y=f!==void 0?v*f:void 0;var x=y!==void 0?y:g,b=1-d,T=d,S=this.findMidptPtsEtc(t,e),w=S.midptPts,E=S.vectorNormInverse,_={x:w.x1*b+w.x2*T,y:w.y1*b+w.y2*T};a.ctrlpts.push(_.x+E.x*x,_.y+E.y*x)}};Ya.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",i="horizontal",a="leftward",s="rightward",l="downward",u="upward",h="auto",f=e.posPts,d=e.srcW,p=e.srcH,m=e.tgtW,g=e.tgtH,y=t.pstyle("edge-distances").value,v=y!=="node-position",x=t.pstyle("taxi-direction").value,b=x,T=t.pstyle("taxi-turn"),S=T.units==="%",w=T.pfValue,E=w<0,_=t.pstyle("taxi-turn-min-distance").pfValue,C=v?(d+m)/2:0,D=v?(p+g)/2:0,O=f.x2-f.x1,R=f.y2-f.y1,k=o(function(W,pe){return W>0?Math.max(W-pe,0):Math.min(W+pe,0)},"subDWH"),L=k(O,C),A=k(R,D),I=!1;b===h?x=Math.abs(L)>Math.abs(A)?i:n:b===u||b===l?(x=n,I=!0):(b===a||b===s)&&(x=i,I=!0);var M=x===n,P=M?A:L,B=M?R:O,F=Sge(B),z=!1;!(I&&(S||E))&&(b===l&&B<0||b===u&&B>0||b===a&&B>0||b===s&&B<0)&&(F*=-1,P=F*Math.abs(P),z=!0);var $;if(S){var U=w<0?1+w:w;$=U*P}else{var K=w<0?P:0;$=K+w*F}var ee=o(function(W){return Math.abs(W)<_||Math.abs(W)>=Math.abs(P)},"getIsTooClose"),Y=ee($),ce=ee(Math.abs(P)-Math.abs($)),Z=Y||ce;if(Z&&!z)if(M){var ue=Math.abs(B)<=p/2,Q=Math.abs(O)<=m/2;if(ue){var j=(f.x1+f.x2)/2,ne=f.y1,te=f.y2;r.segpts=[j,ne,j,te]}else if(Q){var he=(f.y1+f.y2)/2,le=f.x1,J=f.x2;r.segpts=[le,he,J,he]}else r.segpts=[f.x1,f.y2]}else{var Se=Math.abs(B)<=d/2,se=Math.abs(R)<=g/2;if(Se){var ae=(f.y1+f.y2)/2,Oe=f.x1,ye=f.x2;r.segpts=[Oe,ae,ye,ae]}else if(se){var Be=(f.x1+f.x2)/2,He=f.y1,ze=f.y2;r.segpts=[Be,He,Be,ze]}else r.segpts=[f.x2,f.y1]}else if(M){var Le=f.y1+$+(v?p/2*F:0),Ie=f.x1,xe=f.x2;r.segpts=[Ie,Le,xe,Le]}else{var q=f.x1+$+(v?d/2*F:0),de=f.y1,ie=f.y2;r.segpts=[q,de,q,ie]}if(r.isRound){var oe=t.pstyle("taxi-radius").value,V=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(oe),r.isArcRadius=new Array(r.segpts.length/2).fill(V)}};Ya.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,l=e.tgtW,u=e.tgtH,h=e.srcShape,f=e.tgtShape,d=e.srcCornerRadius,p=e.tgtCornerRadius,m=e.srcRs,g=e.tgtRs,y=!_t(r.startX)||!_t(r.startY),v=!_t(r.arrowStartX)||!_t(r.arrowStartY),x=!_t(r.endX)||!_t(r.endY),b=!_t(r.arrowEndX)||!_t(r.arrowEndY),T=3,S=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,w=T*S,E=Qp({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),_=E<w,C=Qp({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),D=C<w,O=!1;if(y||v||_){O=!0;var R={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},k=Math.sqrt(R.x*R.x+R.y*R.y),L={x:R.x/k,y:R.y/k},A=Math.max(a,s),I={x:r.ctrlpts[0]+L.x*2*A,y:r.ctrlpts[1]+L.y*2*A},M=h.intersectLine(n.x,n.y,a,s,I.x,I.y,0,d,m);_?(r.ctrlpts[0]=r.ctrlpts[0]+L.x*(w-E),r.ctrlpts[1]=r.ctrlpts[1]+L.y*(w-E)):(r.ctrlpts[0]=M[0]+L.x*w,r.ctrlpts[1]=M[1]+L.y*w)}if(x||b||D){O=!0;var P={x:r.ctrlpts[0]-i.x,y:r.ctrlpts[1]-i.y},B=Math.sqrt(P.x*P.x+P.y*P.y),F={x:P.x/B,y:P.y/B},z=Math.max(a,s),$={x:r.ctrlpts[0]+F.x*2*z,y:r.ctrlpts[1]+F.y*2*z},U=f.intersectLine(i.x,i.y,l,u,$.x,$.y,0,p,g);D?(r.ctrlpts[0]=r.ctrlpts[0]+F.x*(w-C),r.ctrlpts[1]=r.ctrlpts[1]+F.y*(w-C)):(r.ctrlpts[0]=U[0]+F.x*w,r.ctrlpts[1]=U[1]+F.y*w)}O&&this.findEndpoints(t)}};Ya.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,i;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,i=.5,e.midX=sa(e.allpts[n],e.allpts[n+2],e.allpts[n+4],i),e.midY=sa(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],i))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var a=2;a+3<e.allpts.length;a+=2){var s=e.radii[a/2-1],l=e.isArcRadius[a/2-1];e.roundCorners.push(rF({x:e.allpts[a-2],y:e.allpts[a-1]},{x:e.allpts[a],y:e.allpts[a+1],radius:s},{x:e.allpts[a+2],y:e.allpts[a+3]},s,l))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,h=u-2;e.midX=(e.segpts[h]+e.segpts[u])/2,e.midY=(e.segpts[h+1]+e.segpts[u+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var d={x:e.segpts[f],y:e.segpts[f+1]},p=e.roundCorners[f/2],m=[d.x-p.cx,d.y-p.cy],g=p.radius/Math.sqrt(Math.pow(m[0],2)+Math.pow(m[1],2));m=m.map(function(y){return y*g}),e.midX=p.cx+m[0],e.midY=p.cy+m[1],e.midVector=m}}}};Ya.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||_t(e.startX)&&_t(e.startY)&&_t(e.endX)&&_t(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,hn("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};Ya.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,i=n.hasCompoundNodes(),a={map:new Zc,get:o(function(_){var C=this.map.get(_[0]);return C!=null?C.get(_[1]):null},"get"),set:o(function(_,C){var D=this.map.get(_[0]);D==null&&(D=new Zc,this.map.set(_[0],D)),D.set(_[1],C)},"set")},s=[],l=[],u=0;u<t.length;u++){var h=t[u],f=h._private,d=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(d==="haystack"){l.push(h);continue}var p=d==="unbundled-bezier"||d.endsWith("segments")||d==="straight"||d==="straight-triangle"||d.endsWith("taxi"),m=d==="unbundled-bezier"||d==="bezier",g=f.source,y=f.target,v=g.poolIndex(),x=y.poolIndex(),b=[v,x].sort(),T=a.get(b);T==null&&(T={eles:[]},a.set(b,T),s.push(b)),T.eles.push(h),p&&(T.hasUnbundled=!0),m&&(T.hasBezier=!0)}}for(var S=o(function(_){var C=s[_],D=a.get(C),O=void 0;if(!D.hasUnbundled){var R=D.eles[0].parallelEdges().filter(function(q){return q.isBundledBezier()});GB(D.eles),R.forEach(function(q){return D.eles.push(q)}),D.eles.sort(function(q,de){return q.poolIndex()-de.poolIndex()})}var k=D.eles[0],L=k.source(),A=k.target();if(L.poolIndex()>A.poolIndex()){var I=L;L=A,A=I}var M=D.srcPos=L.position(),P=D.tgtPos=A.position(),B=D.srcW=L.outerWidth(),F=D.srcH=L.outerHeight(),z=D.tgtW=A.outerWidth(),$=D.tgtH=A.outerHeight(),U=D.srcShape=r.nodeShapes[e.getNodeShape(L)],K=D.tgtShape=r.nodeShapes[e.getNodeShape(A)],ee=D.srcCornerRadius=L.pstyle("corner-radius").value==="auto"?"auto":L.pstyle("corner-radius").pfValue,Y=D.tgtCornerRadius=A.pstyle("corner-radius").value==="auto"?"auto":A.pstyle("corner-radius").pfValue,ce=D.tgtRs=A._private.rscratch,Z=D.srcRs=L._private.rscratch;D.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ue=0;ue<D.eles.length;ue++){var Q=D.eles[ue],j=Q[0]._private.rscratch,ne=Q.pstyle("curve-style").value,te=ne==="unbundled-bezier"||ne.endsWith("segments")||ne.endsWith("taxi"),he=!L.same(Q.source());if(!D.calculatedIntersection&&L!==A&&(D.hasBezier||D.hasUnbundled)){D.calculatedIntersection=!0;var le=U.intersectLine(M.x,M.y,B,F,P.x,P.y,0,ee,Z),J=D.srcIntn=le,Se=K.intersectLine(P.x,P.y,z,$,M.x,M.y,0,Y,ce),se=D.tgtIntn=Se,ae=D.intersectionPts={x1:le[0],x2:Se[0],y1:le[1],y2:Se[1]},Oe=D.posPts={x1:M.x,x2:P.x,y1:M.y,y2:P.y},ye=Se[1]-le[1],Be=Se[0]-le[0],He=Math.sqrt(Be*Be+ye*ye),ze=D.vector={x:Be,y:ye},Le=D.vectorNorm={x:ze.x/He,y:ze.y/He},Ie={x:-Le.y,y:Le.x};D.nodesOverlap=!_t(He)||K.checkPoint(le[0],le[1],0,z,$,P.x,P.y,Y,ce)||U.checkPoint(Se[0],Se[1],0,B,F,M.x,M.y,ee,Z),D.vectorNormInverse=Ie,O={nodesOverlap:D.nodesOverlap,dirCounts:D.dirCounts,calculatedIntersection:!0,hasBezier:D.hasBezier,hasUnbundled:D.hasUnbundled,eles:D.eles,srcPos:P,srcRs:ce,tgtPos:M,tgtRs:Z,srcW:z,srcH:$,tgtW:B,tgtH:F,srcIntn:se,tgtIntn:J,srcShape:K,tgtShape:U,posPts:{x1:Oe.x2,y1:Oe.y2,x2:Oe.x1,y2:Oe.y1},intersectionPts:{x1:ae.x2,y1:ae.y2,x2:ae.x1,y2:ae.y1},vector:{x:-ze.x,y:-ze.y},vectorNorm:{x:-Le.x,y:-Le.y},vectorNormInverse:{x:-Ie.x,y:-Ie.y}}}var xe=he?O:D;j.nodesOverlap=xe.nodesOverlap,j.srcIntn=xe.srcIntn,j.tgtIntn=xe.tgtIntn,j.isRound=ne.startsWith("round"),i&&(L.isParent()||L.isChild()||A.isParent()||A.isChild())&&(L.parents().anySame(A)||A.parents().anySame(L)||L.same(A)&&L.isParent())?e.findCompoundLoopPoints(Q,xe,ue,te):L===A?e.findLoopPoints(Q,xe,ue,te):ne.endsWith("segments")?e.findSegmentsPoints(Q,xe):ne.endsWith("taxi")?e.findTaxiPoints(Q,xe):ne==="straight"||!te&&D.eles.length%2===1&&ue===Math.floor(D.eles.length/2)?e.findStraightEdgePoints(Q):e.findBezierPoints(Q,xe,ue,te,he),e.findEndpoints(Q),e.tryToCorrectInvalidPoints(Q,xe),e.checkForInvalidEdgeWarning(Q),e.storeAllpts(Q),e.storeEdgeProjections(Q),e.calculateArrowAngles(Q),e.recalculateEdgeLabelProjections(Q),e.calculateLabelAngles(Q)}},"_loop"),w=0;w<s.length;w++)S(w);this.findHaystackPoints(l)}};o(w1e,"getPts");Ya.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return w1e(e.segpts)};Ya.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return w1e(e.ctrlpts)};Ya.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};v4={};v4.manualEndptToPx=function(t,e){var r=this,n=t.position(),i=t.outerWidth(),a=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var l=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(l[0]=l[0]*i),e.units[1]==="%"&&(l[1]=l[1]*a),l[0]+=n.x,l[1]+=n.y,l}else{var u=e.pfValue[0];u=-Math.PI/2+u;var h=2*Math.max(i,a),f=[n.x+Math.cos(u)*h,n.y+Math.sin(u)*h];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,i,a,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};v4.findEndpoints=function(t){var e=this,r,n=t.source()[0],i=t.target()[0],a=n.position(),s=i.position(),l=t.pstyle("target-arrow-shape").value,u=t.pstyle("source-arrow-shape").value,h=t.pstyle("target-distance-from-node").pfValue,f=t.pstyle("source-distance-from-node").pfValue,d=n._private.rscratch,p=i._private.rscratch,m=t.pstyle("curve-style").value,g=t._private.rscratch,y=g.edgeType,v=m==="taxi",x=y==="self"||y==="compound",b=y==="bezier"||y==="multibezier"||x,T=y!=="bezier",S=y==="straight"||y==="segments",w=y==="segments",E=b||T||S,_=x||v,C=t.pstyle("source-endpoint"),D=_?"outside-to-node":C.value,O=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,R=t.pstyle("target-endpoint"),k=_?"outside-to-node":R.value,L=i.pstyle("corner-radius").value==="auto"?"auto":i.pstyle("corner-radius").pfValue;g.srcManEndpt=C,g.tgtManEndpt=R;var A,I,M,P;if(b){var B=[g.ctrlpts[0],g.ctrlpts[1]],F=T?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:B;A=F,I=B}else if(S){var z=w?g.segpts.slice(0,2):[s.x,s.y],$=w?g.segpts.slice(g.segpts.length-2):[a.x,a.y];A=$,I=z}if(k==="inside-to-node")r=[s.x,s.y];else if(R.units)r=this.manualEndptToPx(i,R);else if(k==="outside-to-line")r=g.tgtIntn;else if(k==="outside-to-node"||k==="outside-to-node-or-label"?M=A:(k==="outside-to-line"||k==="outside-to-line-or-label")&&(M=[a.x,a.y]),r=e.nodeShapes[this.getNodeShape(i)].intersectLine(s.x,s.y,i.outerWidth(),i.outerHeight(),M[0],M[1],0,L,p),k==="outside-to-node-or-label"||k==="outside-to-line-or-label"){var U=i._private.rscratch,K=U.labelWidth,ee=U.labelHeight,Y=U.labelX,ce=U.labelY,Z=K/2,ue=ee/2,Q=i.pstyle("text-valign").value;Q==="top"?ce-=ue:Q==="bottom"&&(ce+=ue);var j=i.pstyle("text-halign").value;j==="left"?Y-=Z:j==="right"&&(Y+=Z);var ne=a4(M[0],M[1],[Y-Z,ce-ue,Y+Z,ce-ue,Y+Z,ce+ue,Y-Z,ce+ue],s.x,s.y);if(ne.length>0){var te=a,he=Wp(te,j1(r)),le=Wp(te,j1(ne)),J=he;if(le<he&&(r=ne,J=le),ne.length>2){var Se=Wp(te,{x:ne[2],y:ne[3]});Se<J&&(r=[ne[2],ne[3]])}}}var se=y6(r,A,e.arrowShapes[l].spacing(t)+h),ae=y6(r,A,e.arrowShapes[l].gap(t)+h);if(g.endX=ae[0],g.endY=ae[1],g.arrowEndX=se[0],g.arrowEndY=se[1],D==="inside-to-node")r=[a.x,a.y];else if(C.units)r=this.manualEndptToPx(n,C);else if(D==="outside-to-line")r=g.srcIntn;else if(D==="outside-to-node"||D==="outside-to-node-or-label"?P=I:(D==="outside-to-line"||D==="outside-to-line-or-label")&&(P=[s.x,s.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(a.x,a.y,n.outerWidth(),n.outerHeight(),P[0],P[1],0,O,d),D==="outside-to-node-or-label"||D==="outside-to-line-or-label"){var Oe=n._private.rscratch,ye=Oe.labelWidth,Be=Oe.labelHeight,He=Oe.labelX,ze=Oe.labelY,Le=ye/2,Ie=Be/2,xe=n.pstyle("text-valign").value;xe==="top"?ze-=Ie:xe==="bottom"&&(ze+=Ie);var q=n.pstyle("text-halign").value;q==="left"?He-=Le:q==="right"&&(He+=Le);var de=a4(P[0],P[1],[He-Le,ze-Ie,He+Le,ze-Ie,He+Le,ze+Ie,He-Le,ze+Ie],a.x,a.y);if(de.length>0){var ie=s,oe=Wp(ie,j1(r)),V=Wp(ie,j1(de)),Te=oe;if(V<oe&&(r=[de[0],de[1]],Te=V),de.length>2){var W=Wp(ie,{x:de[2],y:de[3]});W<Te&&(r=[de[2],de[3]])}}}var pe=y6(r,I,e.arrowShapes[u].spacing(t)+f),ve=y6(r,I,e.arrowShapes[u].gap(t)+f);g.startX=ve[0],g.startY=ve[1],g.arrowStartX=pe[0],g.arrowStartY=pe[1],E&&(!_t(g.startX)||!_t(g.startY)||!_t(g.endX)||!_t(g.endY)?g.badLine=!0:g.badLine=!1)};v4.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};v4.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};nF={};o(YZe,"pushBezierPts");nF.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var i=0;i+5<r.allpts.length;i+=4)YZe(this,t,r.allpts.slice(i,i+6))}else if(n==="segments")for(var a=e.rstyle.linePts=[],i=0;i+1<r.allpts.length;i+=2)a.push({x:r.allpts[i],y:r.allpts[i+1]});else if(n==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};nF.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};eu={};eu.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Pf(e)){var r,n,i=t._private,a=t.width(),s=t.height(),l=t.padding(),u=t.position(),h=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,d=i.rscratch,p=i.rstyle;switch(h){case"left":r=u.x-a/2-l;break;case"right":r=u.x+a/2+l;break;default:r=u.x}switch(f){case"top":n=u.y-s/2-l;break;case"bottom":n=u.y+s/2+l;break;default:n=u.y}d.labelX=r,d.labelY=n,p.labelX=r,p.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};k1e=o(function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},"lineAngleFromDelta"),E1e=o(function(e,r){var n=r.x-e.x,i=r.y-e.y;return k1e(n,i)},"lineAngle"),XZe=o(function(e,r,n,i){var a=i4(0,i-.001,1),s=i4(0,i+.001,1),l=Q1(e,r,n,a),u=Q1(e,r,n,s);return E1e(l,u)},"bezierAngle");eu.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,i=this,a={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(a.mid||a.source||a.target){e={x:n.midX,y:n.midY};var s=o(function(d,p,m){Nf(r.rscratch,d,p,m),Nf(r.rstyle,d,p,m)},"setRs");s("labelX",null,e.x),s("labelY",null,e.y);var l=k1e(n.midDispX,n.midDispY);s("labelAutoAngle",null,l);var u=o(function f(){if(f.cache)return f.cache;for(var d=[],p=0;p+5<n.allpts.length;p+=4){var m={x:n.allpts[p],y:n.allpts[p+1]},g={x:n.allpts[p+2],y:n.allpts[p+3]},y={x:n.allpts[p+4],y:n.allpts[p+5]};d.push({p0:m,p1:g,p2:y,startDist:0,length:0,segments:[]})}var v=r.rstyle.bezierPts,x=i.bezierProjPcts.length;function b(_,C,D,O,R){var k=Qp(C,D),L=_.segments[_.segments.length-1],A={p0:C,p1:D,t0:O,t1:R,startDist:L?L.startDist+L.length:0,length:k};_.segments.push(A),_.length+=k}o(b,"addSegment");for(var T=0;T<d.length;T++){var S=d[T],w=d[T-1];w&&(S.startDist=w.startDist+w.length),b(S,S.p0,v[T*x],0,i.bezierProjPcts[0]);for(var E=0;E<x-1;E++)b(S,v[T*x+E],v[T*x+E+1],i.bezierProjPcts[E],i.bezierProjPcts[E+1]);b(S,v[T*x+x-1],S.p2,i.bezierProjPcts[x-1],1)}return f.cache=d},"createControlPointInfo"),h=o(function(d){var p,m=d==="source";if(a[d]){var g=t.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var y=u(),v,x=0,b=0,T=0;T<y.length;T++){for(var S=y[m?T:y.length-1-T],w=0;w<S.segments.length;w++){var E=S.segments[m?w:S.segments.length-1-w],_=T===y.length-1&&w===S.segments.length-1;if(x=b,b+=E.length,b>=g||_){v={cp:S,segment:E};break}}if(v)break}var C=v.cp,D=v.segment,O=(g-x)/D.length,R=D.t1-D.t0,k=m?D.t0+R*O:D.t1-R*O;k=i4(0,k,1),e=Q1(C.p0,C.p1,C.p2,k),p=XZe(C.p0,C.p1,C.p2,k);break}case"straight":case"segments":case"haystack":{for(var L=0,A,I,M,P,B=n.allpts.length,F=0;F+3<B&&(m?(M={x:n.allpts[F],y:n.allpts[F+1]},P={x:n.allpts[F+2],y:n.allpts[F+3]}):(M={x:n.allpts[B-2-F],y:n.allpts[B-1-F]},P={x:n.allpts[B-4-F],y:n.allpts[B-3-F]}),A=Qp(M,P),I=L,L+=A,!(L>=g));F+=2);var z=g-I,$=z/A;$=i4(0,$,1),e=JYe(M,P,$),p=E1e(M,P);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,p)}},"calculateEndProjection");h("source"),h("target"),this.applyLabelDimensions(t)}};eu.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};eu.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=this.calculateLabelDimensions(t,n),a=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,l=Wl(r.rscratch,"labelWrapCachedLines",e)||[],u=s!=="wrap"?1:Math.max(l.length,1),h=i.height/u,f=h*a,d=i.width,p=i.height+(u-1)*(a-1)*h;Nf(r.rstyle,"labelWidth",e,d),Nf(r.rscratch,"labelWidth",e,d),Nf(r.rstyle,"labelHeight",e,p),Nf(r.rscratch,"labelHeight",e,p),Nf(r.rscratch,"labelLineHeight",e,f)};eu.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=o(function(K,ee){return ee?(Nf(r.rscratch,K,e,ee),ee):Wl(r.rscratch,K,e)},"rscratch");if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var l=t.pstyle("text-wrap").value;if(l==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var h="\u200B",f=i.split(`